Monday, August 14, 2017

Red Hat Linux - Disk File System Read Ahead


If there are issues with disk I/O or CPU wait time, you might consider fine tunning read ahead disk parameters:

1. Check current values and volumes:
blockdev --report

2. Set up proper parameters:
sudo blockdev --setra 256 /dev/xvda


If you want to read more, good documentation is here:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/main-fs.html

Linux Red Hat - change timezone

Set Date&Time as needed:
 

1. List all available timezones:
timedatectl list-timezones

2. Update timezone and check:

echo 'ZONE="Europe/Madrid"' > /etc/sysconfig/clock && ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime && date

Saturday, July 8, 2017

Start Adobe Experience Manager AEM in command line

1. Get license jar (e.g. cq-quickstart-6.3.0.jar) and license.properties file from Adobe.
Please make sure you have a valid licensed product.

2. Move the above two files in the same folder

3. Rename jar file to desired run modes and port  (e.g. aem-author-4502.jar)

4. Start jar using Java 8.
Example of run command:
java -XX:MaxMetaspaceSize=1024m -Xmx1024M -jar aem-author-4502.jar

5, It takes few minutes to start - once started you can get login screen with admin/admin user.

Wednesday, June 21, 2017

Use crontab on AWS RedHat

1. Get your script defined and get it into a proper location on the machine:

touch script.sh
chmod +x script.sh

vi script.sh

Example of script copying files to a user home folders:

#!/bin/bash
cd /folder/test-pckg/
chown dest_user:dest_user filename*
mv filename* /home/dest_user/prod-pckg/


2. Add your script to crontab

crontab -e 
30 21 * * * /folder/test-pckg/script.sh

The above runs each day at 21:30 local machine time.

3. Verify if it runs under cron tab logs:
cat /var/log/cron

You should grep for a line like the below:
Jun 20 21:30:01 instance-name CROND[12092]: (root) CMD (/folder/script.sh)

Sunday, May 28, 2017

Get cURL to not show progress bar

It's very simple, just add -s parameter:

curl -s http://domain.com

AEM curl command to get JMX status of replication queue - pending items

Syntax is the following:

curl -u admin:admin -X GET http://IP:PORT/system/console/jmx/com.adobe.granite.replication%3Aid%3D%22publishagentname%22%2Ctype%3Dagent

It gets all fields, to parse it, you can use the bellow

curl -u admin:admin -X GET http://IP:PORT/system/console/jmx/com.adobe.granite.replication%3Aid%3D%22publishagentname%22%2Ctype%3Dagent | grep "QueueNumEntries" | cut -d ">" -f5 | cut -d "<" -f1'

Saturday, May 27, 2017

Linux - check every few seconds if file size grows using Watch command

Complete syntax:

watch -n 5 ls -lh filename

Output (error.log is the filename):