Thursday, August 13, 2009

The Rules of SYS::SYSLOG

From the Perl documentation of Syslog:

The First Rule of Sys::Syslog is: You do not call setlogsock .
The Second Rule of Sys::Syslog is: You do not call setlogsock .
The Third Rule of Sys::Syslog is: The program crashes, dies, calls closelog , the log is over.
The Fourth Rule of Sys::Syslog is: One facility, one priority.
The Fifth Rule of Sys::Syslog is: One log at a time.
The Sixth Rule of Sys::Syslog is: No syslog before openlog .
The Seventh Rule of Sys::Syslog is: Logs will go on as long as they have to.
The Eighth, and Final Rule of Sys::Syslog is: If this is your first use of Sys::Syslog, you must read the doc.

Sunday, August 9, 2009

Downloading flash videos

Here is a hack where you have to do very little actually, its mostly about the discovery. When using Firefox on GNU/Linux, the Adobe Flash plug-in automatically downloads flash videos you are viewing in Firefox to your /tmp directory.

e.g. when I view http://www.youtube.com/watch?v=xO0gSJGJ7Fs in Firefox, a randomly named file /tmp/Flashn3T33b shows up, which I can play using mplayer, copy, rename, do anything with. When I close the tab, this file is deleted, but the plug-in does forget to clean up on few occasions.