Monday, July 22, 2019

curl to disable/stop AEM component from under /system/console/components

Disable:
curl -d "action=disable" -u admin:"pass" -X POST http://IP:Port/system/console/components/component-name


Enable:
curl -d "action=enable" -u admin:"pass+" -X POST http://IP:Port/system/console/components/component-name

Sunday, June 30, 2019

AWS CLI - Show snapshots for volume

1. List all snapshots for specific volume:
aws ec2 describe-snapshots --filters "Name=volume-id, Values=vol-xxxxxx"


2. If in progress, you can check following for status after getting snapshot-id at step 1:
aws ec2 describe-snapshots --snapshot-id snap-xxxx


You shall get something like the below:

...


            "VolumeId": "vol-xxxxx",
            "State": "pending",
            "VolumeSize": 900,
            "StartTime": "2019-06-30T21:26:16.662Z",
            "Progress": "46%",
            "OwnerId": "xxxx",
            "SnapshotId": "snap-xxxxx"

...


Friday, February 15, 2019

Check AEM Run Mode

Navigate to the below:

/system/console/status-slingsettings

and get proper values under 

Run Modes = [crx3tar-nofds, stage, crx3, nosamplecontent, author]

Sunday, February 10, 2019

Remove Keystore from AEM User

For example, if needed to remove Dynamic Media Replication user keystore, just delete from CRX/DE the keystore from /home/users/system/dam/dynamic-media-replication.

Saturday, December 22, 2018

Automatic Restart of OSGI bundle

1. Following script can be used

pswd=`pass OSGI-admin`
echo -e `date`
echo -e "start script"
echo -e "stop bundle"
curl -u admin:"$pswd" http://OSGI-IP:Port/system/console/bundles/bundle.jsp -F action=stop
echo -e ""
echo -e "Waiting for 3 seconds"
sleep 3
echo -e "start bundle"
curl -u admin:"$pswd" http://
OSGI-IP:Port/system/console/bundles/bundle.jsp -F action=start
echo -e ""
echo -e `date`
echo -e ""
echo -e ""
echo -e ""


2. Add above script to crontab

crontab -e

Add following line to run every 4 hours:
0 */4 * * * /home/user/bundle-script.sh >> /home/user/history-bundle-script.log

In history-bundle-script.log you shall get logged all events.

Friday, November 23, 2018

Fix ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'%' when using MySQL 8


1. Connet to MySQL DB:
mysql -u user -pPASSWORD
 
2. Just Run the following command:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD';

Fix mysqli_real_connect(): (HY000/2002): No such file or directory

1. When trying to access http://localhost/phpmyadmin, following messafe is displayed:
mysqli_real_connect(): (HY000/2002): No such file or directory

2. In order to fix, edit config.inc.php
vi config.inc.php

3. Replace
$cfg['Servers'][$i]['host'] = 'localhost';
with
$cfg['Servers'][$i]['host'] = '127.0.0.1';


After this change, it works!