I suspected cron was running twice. I confirmed by checking the system logs
grep CRON /var/log/syslog
Then I killed cron and restarted it
sudo /etc/init.d/cron stop
sudo /etc/init.d/cron start
Wednesday, August 16, 2017
Tuesday, August 1, 2017
Tail vs Less
Learnt a good chunk about less and tail from this site http://www.brianstorti.com/stop-using-tail/
Thursday, July 20, 2017
Wednesday, September 28, 2016
Sending mail in unix with attachment
You would need to install sharutils
sudo apt-get install sharutils
Then run this
uuencode <path_to_file> <name_to_give_attachment> | mail -s "Subject" foo@example.com
Also see http://soamweird.blogspot.com/2016/03/sending-mail-in-unix.html
sudo apt-get install sharutils
Then run this
uuencode <path_to_file> <name_to_give_attachment> | mail -s "Subject" foo@example.com
Also see http://soamweird.blogspot.com/2016/03/sending-mail-in-unix.html
Sunday, April 17, 2016
Sorting by type first then alphabetically
The script below ensures that items are sorted by type first then by alphabetical order.
The spaceship operator
Just ran into this and I thought it was really cool.
So the spaceship operator (<=>) delegates to the compareTo method:
For more checkout http://groovy-lang.org/operators.html
So the spaceship operator (<=>) delegates to the compareTo method:
assert (1 <=> 1) == 0
assert (1 <=> 2) == -1
assert (2 <=> 1) == 1
assert ('a' <=> 'z') == -1
For more checkout http://groovy-lang.org/operators.html
Thursday, March 3, 2016
Sending mail in unix
When sending an email from unix do the following
echo "Mail Message" | mail -s "Subject" person@home.com
In order to avoid getting your email marked as spam, ensure that the sending email is something realistic, probably a domain you own i.e. awesome@homelypeople.com
echo "Mail Message" | mail -s "Subject" person@home.com
In order to avoid getting your email marked as spam, ensure that the sending email is something realistic, probably a domain you own i.e. awesome@homelypeople.com
Subscribe to:
Posts (Atom)