Entries from December 2008 ↓

quick python cgi to send email

In the previous post I mentioned a python script I was using with curl to send me a SMS message. Its a pretty quick and dirty one, but here is the script I use. Since these are quick messages meant for my phone – I don’t do much with the body. And I just use this with a GET style URL, although the python cgi lib could just as easily handle a POST. So I call it like this:

http://www.domain.net/cgi-bin/sendmemail.py?to=number@txt.att.net&subject=printing_done

I use this via curl in other scripts as a sort of notification system. Continue reading →

Script to alert you when printing is done

At work I’m doing a bunch of printing of some large documents.  I wanted a way of being notified when it was done printing.  The action to take is up to you, I’m using curl to load a python CGI on a server to send an email/SMS to my phone. If you want to watch your non-default printer – just use the -P flag to lpq.

#!/bin/bash
LPQSTAT=lpq | head -1 | awk '{ print $NF }'
while [ $LPQSTAT = 'printing' ];do
 echo $LPQSTAT
 sleep 5
 LPQSTAT=lpq | head -1 | awk '{ print $NF }'
 done
curl ....
exit 0

stripping out ACLs

Here is a quick bash script to delete all ACLs from a file or folder:

#!/bin/bash
LINECT=`ls -ed "$1" | wc -l`
while [ $LINECT -gt 1 ]
    do
        chmod -a# 0 "${1}"
        LINECT=`ls -ed "$1" | wc -l`
    done

Thank you NPR

In times of plunging gas prices – it takes some real smarts and guts to remind people that the peak oil problem has not disappeared.

Some quick observations.  It seems that CERA is always contacted for the “oil is not a problem” perspective.  I don’t know why they get so much cred, when it has been shown they have been wrong in the past.

Also, interesting to note that the next generation of oil professionals is more in tune with peak oil as a reality.

Lastly – Simmons is one smart guy, Obama should invite him in for a private presentation.

Now to convince the barnacles to stay off

I predict we will see people getting excited about projects like this.  But I have to wonder if the scientists working on these have ever seen the fouled bottom or pier piling.  What is the energy cost after you factor in maintenance?