Home » Uncategorized » Technology can make us happier

Technology can make us happier

None of the following is technically challenging or impressive, but they have some positive impact on others. The bottom line of this post is that if we can’t use technology to make our lives happier, then we should reconsider about its usage.

I like alias. My favorite trick is to edit the ~/.bash_aliases on the computer of a friend as she is missing and add a line like alias friendname='echo "Dimitris is thinking of you"'  or something more thoughtful. Be creative!

Another trick I especially like is sending a mail multiple time. Because it is not very pleasant to do it manually, here is an automatic way in Bash.


#!/bin/bash

if [ $# -ne 3 ]
then
    echo "Usage: progname mailaddress body birthday"
    exit 1
fi

mailaddress="$1"
body="$2"
age="$3"
for ((i=1; i <= age; i++))
do
    sleep 1;
    mail -s "Happy Birthday $i" $mailaddress < "$body"
done

exit 0

Put the code in a file and name it: birthday.sh. Give it execution permissions (chmod 700 birthday.sh) Then run it like:
./birthday friend@example.com wishes.txt 24
And she will receive 24 for times an email with your wishes. Be aware of the spam filters! Not everyone appreciates it, especially as they are getting older!

Thinkingcapwhoa

Advertisements

1 Comment

  1. […] while ago, I had posted a bash script which could spam a friend with a message. It required a computer which was capable of running the mail command, something not […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: