Raspberry Pi automate certain tasks – script example

2014-03-10 2 min read Raspberry Pi

Now, if you have followed these :

fetchmail

ssmtp

Then you already have a working system for sending and receiving mail. Now, you can set the mda in the fetmailrc to a script which can do few things for you. The script below will get a page and mail it to you, if you have the subject as “get” and send “wake on LAN” to desired PC if you have subject as “wol”. Cool 🙂

Continue reading

some interesting alias

2011-09-27 1 min read Linux

For this time, I will just give you a link to to bashrc file.

http://hayne.net/MacDev/Bash/aliases.bash

Head over there and see some very interesting aliase’s.

Enhanced by Zemanta

The power of find command in Linux – advanced.

2010-05-24 2 min read Linux

Generally whoever uses Linux, would know about the find command. Find the man page <a href="http://amit.themafia.info/phpMan.php?parameter=find&mode=man" target="_blank">here.

There are also lots of blogs, tutorials and other articles on find command on the web, so why write another one. Because it&#8217;s worth every word spent on it 🙂
find is a very powerful command, let&#8217;s see how (options for find command from man page and usage):

depth — Process each directory&#8217;s contents before the directory itself.
maxdepth — Descend at most <span style="text-decoration: underline;">levels (a non-negative integer) levels of directories below the command line arguments.
xdev — Don&#8217;t descend directories on other filesystems.
executable — Matches files which are executable and directories which are searchable (in a file name resolution sense).
This takes into account access control lists and other permissions artefacts which the -perm test ignores.
iname — Like -name, but the match is case insensitive.
nogroup — No group corresponds to file&#8217;s numeric group ID.
nouser — No user corresponds to file&#8217;s numeric user ID.
fls <span style="text-decoration: underline;">file — True; like -ls but write to <span style="text-decoration: underline;">file like -fprint.
ok <span style="text-decoration: underline;">command — Like -exec but ask the user first (on the standard input);
print0 — True; print the full file name on the standard output, followed by a null character
(instead of the newline character that -print uses).
printf <span style="text-decoration: underline;">format — True; print <span style="text-decoration: underline;">format on the standard output, interpreting &#8217;&#8217; escapes and &#8217;%&#8217; directives.

Continue reading