2009
09.05

A while ago I learned you can set Mac OS X’s volume from cli, so I came up with a way to wake me up.
It starts based on crontab, but mpg123 does a lot of work. Basically I make an Applescript call that will whisper (before waking me up in a big fanfare) that I will be called soon, with a mild volume and OS X’s whispering voice. Then mpg123 does it’s magic: starts playing the mp3 loops I’ve downloaded within an interval of 8 minutes.  Actually, it is pretty effective.
So, all you have to do is add the following line to your crontab. To do so, load up Terminal and type in “crontab -e”; then just paste the line below (obviously changing the paths as needed):

40      8       *       *       1,2,3,4,5     osascript -e "set volume output volume 50"; /usr/bin/say -v Whisper "Wake up! Alarm will start in 8 minutes."; /usr/local/bin/mpg123 -D 490 -z $HOME/Documents/Coding/Scripts/Alarm/mp3/*;

If you do not understand how cron jobs are set, basically the line above says “at the 40th minute of the 8th hour of days 1, 2, 3, 4 and 5 of the week, run the following command”. The command line is separated in 3 parts:
1) osascript -e “set volume output volume 50″ – as you may have figured, it sets OS X’s main volume to 50% of the total;
2) /usr/bin/say -v Whisper “Wake up! Alarm will start in 8 minutes.” – also, clear as crystal, calls the say (”voice”) application, sending the text;
3) /usr/local/bin/mpg123 -D 490 -z $HOME/Documents/Coding/Scripts/Alarm/mp3/* -  tells mpg123 to run all mp3 inside the specified folder, with an interval of 490 seconds.

One of the most interesting things is that, instead of changing OS X’s volume divided in 16 steps (that’s what you get when using your keyboard), you can actually divide it by 100, a real fine tuning.
So, after all, if you are not into downloading mp3 alarm programs, this might be useful.

2009
09.02

Verify (deeply) if an email address exists

While searching for strong yet flexible regular expressions to verify if an email address submitted thru a simple form is actually valid, a friend of mine pointed me out this great script, which checks beyond the character count/positions. It actually probes for the user’s existence inside the provided domain. Just a quote from the script’s comments:

Check only by syntax [...]
Check syntax + DNS MX records [...]
Check syntax + DNS records + SMTP probe [...]

Nice huh? Go grab it!

2009
09.02
MediaTemple

MediaTemple

If you have problems with users from your server asking every day to change their email password, hassle no longer! As for my MediaTemple (dv) server, this guide worked like a charm. Actually, I took information from lots of places, all credited. It involves a little bit of cli and supposes you can login via ssh and know how to use vi or vim. Hope it helps: the guide.

2009
08.28

Hello world!

This SlideShowPro photo gallery requires the Flash Player plugin and a web browser with JavaScript enabled.

fim do footer -->