1-cent Tip: passing one line commands to at
Lew Pitcher [lew.pitcher at digitalfreehold.ca]
Mon, 21 Sep 2009 10:37:40 -0400
On September 21, 2009 01:08:09 Mulyadi Santosa wrote: [snip]
> Don't worry, you don't need to use GUI automation tool such as dogtail > for doing so. Simply use gnome-power-cmd.sh command to do that. Note: > make sure atd daemon is running first. Then do: > $ at now + 10 minutes > at> gnome-power-cmd.sh suspend > at> (press Ctrl-D)[snip]
This post reminded me that at(1) reads it's commands from stdin. Not that I had forgotten that fact, but that I usually avoid it. I rarely need to enter multi-line commands into at-scripts, and avoid having to cope with at's stdin by using the echo command.
For instance, I would have written the above at(1) invocation as
echo gnome-power-cmd.sh suspend | at now + 10 minutes
Trivial, I know. That's why I called it a "1 cent tip"
-- Lew Pitcher Master Codewright & JOAT-in-training | Registered Linux User #112576 http://pitcher.digitalfreehold.ca/ | GPG public key available by request ---------- Slackware - Because I know what I'm doing. ------
2-cent Tip: Free beginners books
Oscar Laycock [oscar_laycock at yahoo.co.uk]
Mon, 14 Sep 2009 14:06:30 +0000 (GMT)
I recently came across some old notes listing the books I read when starting to use Linux.
At first, I wasn't sure what Free Software was, so I read the following:
- Free as in Freedom, Richard Stallman's Crusade for Free Software, 2002 http://oreilly.com/openbook/freedom/
- Open Sources: Voices from the Open Source Revolution, 1999 http://oreilly.com/catalog/opensources/book/toc.html I especially liked the chapter 'Freeing the Source - The Story of Mozilla'
- The Cathedral and the Bazaar, Eric S. Raymond http://www.catb.org/~esr/writings/cathedral-bazaar/ I particularly enjoyed reading the section 'A Brief History of Hackerdom'
- http://www.gnu.org/philosophy/ This has various articles about free software
I also read these Unix books and articles:
- The Art of Unix Programming, Eric S. Raymond http://www.catb.org/esr/writings/taoup/html/
- The UNIXHATERS Handbook http://web.mit.edu/~simsong/www/ugh.pdf This reminded me that Unix is not the only way of doing things.
- Why Pascal is Not My Favorite Programming Language, Brian W. Kernighan, 1981 http://www.cs.virginia.edu/~evans/cs655-S00/readings/bwk-on-pascal.html
I must have read almost every entry in 'The Jargon File' at 'http://www.catb.org/jargon/'.
I always wanted to know about networking, so I read 'The Linux Network Administrator's Guide' on the Linux Documentation projects website, 'http://tldp.org/guides.html'. On the same site I found two old books: 'The Linux Programmer's Guide' and 'The Linux Kernel' by David Rusling. I know a bit of C which helped. I also went through most of the series of 'Anatomy of...' articles at 'http://www.ibm.com/developerworks/linux/'. I even browsed through the 'Intel 64 and IA-32 Architectures Software Developer's Manuals' at 'http://www.intel.com/products/processor/manuals/'.
I enjoyed the 'The Bastard Operator From Hell' articles. You can google for them. There are some at 'http://members.iinet.net.au/~bofh/'. Also try searching for lists of how 'You know you've been hacking too long when...'. I also liked the 'Real Programmers Don't Use Pascal' and 'The Story of Mel' posts. You can find discussions of them on wikipedia.
I learnt about Linux distro's from reading the Distrowatch Weekly at 'http://distrowatch.com/'.
[ ... ]
2-cent Tip: Suspending and Hibernating from CLI ala GNOME
Mulyadi Santosa [mulyadi.santosa at gmail.com]
Mon, 21 Sep 2009 12:08:09 +0700
In some cases, you might want to hibernate or suspend your Linux system solely from command line i.e because you want to schedule it via "at".
Don't worry, you don't need to use GUI automation tool such as dogtail for doing so. Simply use gnome-power-cmd.sh command to do that. Note: make sure atd daemon is running first. Then do:
$ at now + 10 minutes at> gnome-power-cmd.sh suspend at> (press Ctrl-D)will do suspend-to-RAM 10 minutes from now. Replace "suspend" with "hibernate", "shutdown" or "reboot" to do the respective actions.