pre-pend log timestamp

Adds a timestamp before alog from a script

awk -v sec=$(date -u +%s) '{print strftime("%Y-%m-%d %H:%M:%S",sec), $0; fflush();}'

in cron :

awk -v sec=$(date -u +\%s) '{print strftime("\%Y-\%m-\%d \%H:\%M:\%S",sec), $0; fflush();}'

So :

# echo hello world | awk -v sec=$(date -u +%s) '{print strftime("%Y-%m-%d %H:%M:%S",sec), $0; fflush();}'

 

2014-10-30 08:40:26 test

nJoy 🙂

Invalidate Varnish cache

1)   netstat -plnt

2)   varnishadm -T 127.0.0.1:6082 ban.url /wp-content/themes/catch-box -S /etc/varnish/secret

 

Will invalidate all content under  /wp-content/themes/catch-box.

 

nJoy  😛