Skip navigation

Tag Archives: terminal


Putting this here too (I’m in habit for putting scripts into blog).

Iklan

Just drop this again..

at first I’m using awk, but turns out there is pr command.

Source: Stackoverflow.


Just dropping by here


So I some times need to run a monthly cron job. And I want to set a parameter for duration spanned from first day and last day in the current month.

This is how I do it.

if [ -z “$STARTTIME” ] || [-z “$ENDTIME”]; then
STARTTIME=`date -d “-$(($(date +%d)-1)) days” +%Y-%m-%dT00:00:00Z`;
ENDTIME=`date -d “+1 month -$(date +%d) days” +%Y-%m-%dT23:59:59Z`;
fi

echo $STARTTIME
echo $ENDTIME


Another snippets today.

s3cmd put \
    --add-header=Expires:"`date -R --date='10 years'`"; \
    --add-header=Cache-Control:'max-age=31536000, public' \
    -P \
    [file] [bucket]

Update

s3cmd put \
    --add-header=Expires:"`date -u +"%a, %d %b %Y %H:%M:%S GMT" --date='10 years'`"  
    --add-header=Cache-Control:'max-age=31536000, public'  \   
    -P \
    [file] [bucket]
%d blogger menyukai ini: