Bash: How to Insert One White Space before and after English Words in Japanese

Submitted by admin on Wed, 09/28/2016 - 13:38

Consider to insert one white space before and after English word in Japanese. Run the following script by changing a string 'YOUR_FILENAME'. The script copy the original file as YOUR_FILENAME.org and overwrite and replace the original file by inserting one white space before and after an English word. It is useful multi-byte language such as CJK (Chinese, Japanese and Korean).
export FILENAME='index.rst'; \
cp ${FILENAME} ${FILENAME}.org; \
cat ${FILENAME}.org | sed y/0123456789/0123456789/ | \

Tags

Drupal 8: How to Handle Errors After Updating Core or Modules

Submitted by admin on Wed, 09/21/2016 - 14:08

I think we should doubt cache since Drupal 8 aggressively uses cache-backend mechanism. If you encounter a fatal error or WSOD (White Screen of Death), check the following items.

Check error logs at /var/log/apache2/error.log

sudo tail -f /var/log/apache2/error.log

Configuration | Performance - Check off Aggregate CSS files and Aggregate JavaScript files

Configuration | Performance - Clear all caches

Rebuild cache from Drush

# Move to the directory where Drupal 8 is installed by using cd command,
sudo drush -l <YOUR_SITE_URL> cr

Tags

DevOps: What You Should Know

Submitted by admin on Mon, 09/19/2016 - 14:00

1. Adjust the time amongst the server in your system
ntpdate time.apple.com

2. Check and monitor your disk space

Your service may stop after one year from the beginning of your service release date because the log files occupies a server disk space.
Use logrotate to truncate the log files (even if you are practicing that, the logs will overflow at the server).
Monitor the remaining disk space by using df command.

df -h

Docker: How to Change Image Name

Submitted by admin on Sat, 09/17/2016 - 15:54

Use a 'tag' command on docker.
docker tag <image_id> <repository_name>:<tag>

Note: You can omit the part '<tag>' and only write '<repository_name>'. The meaning of the <tag> string after colon (:) of the repository name is that you can put a different version image by changing the date or versions.
docker tag <image_id> <repository_name>

How to Run Linux cron Job at the End of Every Month

Submitted by admin on Thu, 09/15/2016 - 20:32

Edit /etc/crontab
vi /etc/crontab

Every end of the month
H 23 28-31 * * /usr/bin/test $( date -d '+1 day' +%d ) -eq 1 && <COMMAND>

Every last Friday of the month
0 0 * * 5 /usr/bin/test $( date +%m ) -ne $( date --date '7 day' +%m ) && <COMMAND>

These will be useful in Jenkins.
/usr/bin/test $( date -d '+1 day' +%d ) -eq 1

or
/usr/bin/test $( date +%m ) -ne $( date --date '7 day' +%m )

Tags