Mail client: An easy smtplib wrapper.

I published to github [mailclient](, a wrapper for the standard smtplib and email libraries. Smtplib and email are no fun to work with, for example if you want to attach a file, you have to import the right MIMEType. I built this wrapper to make sending emails with Python easier, for example: # create message … [Read more…]

Fix pulse audio problems Fedora 17.

With this release, I have been having some pulse audio problems. Sometimes I do not have sound while playing  Spotify, Rhythmbox or any other desktop player. After a research, it is usually fixed with this three lines (not always): rm -rf ~/.pulse pulseaudio –kill pulseaudio -vvvvv Do not run it as root.

Convert m4a files to mp3 with this script.

Some of my library was in m4a files, which I have problems to play, furthermore I prefer having everything in mp3 format. So I wrote the following script: echo “Dependencies: mplayer and lame” if [ $# -lt 1 ]; then echo “Usage: sh ‘/path/to/files'” else echo “This could take sometime. Converting to 320kbps MP3 … [Read more…]

Quick tip: Adding and substracting dates in PHP

More simple than it may seems. It will take care of adjusting months and days automatically: **Working with days:** // My date Y-m-d $mydate = “2012-05-06″; //Adding five days $newdate = date(“Y-m-d”, strtotime($mydate. ” +5 days”)); // Substracting five days $newdate = date(“Y-m-d”, strtotime($mydate. ” -5 days”)); **Working with weeks:** // My date Y-m-d $mydate … [Read more…]