Archive for June, 2013

Online Security

June 29, 2013 Leave a comment

Read this: The Best Browser Extensions that Protect Your Privacy @lifehacker.

I installed the following extensions:

Categories: firefox, security Tags: ,

beep when ready

June 29, 2013 1 comment

Sometimes I launch a script and if it takes too much time to finish, I leave the machine alone. I do something else but I check back from time to time to see if it has finished. It would be nice if I could get an audio notification when the job is done.

Here it is:

$ ./; beep

There is a package called “beep” that should do it but it was mute on my system, so I came up with an own solution. First, you need a short audio file. Here is mine: alert.wav. Download it and put it in the directory $HOME/bin. Make sure $HOME/bin is in your PATH.

Then add the following lines to your ~/.bashrc file:

#uncomment the next 2 lines to add $HOME/bin to your PATH
#export PATH

alias beep="mplayer -ao alsa $HOME/bin/alert.wav &>/dev/null"

Open a new terminal and try this:

$ sleep 2; beep
Categories: bash Tags: , , ,

mplayer doesn’t quit

June 28, 2013 Leave a comment

When I play a song with mplayer (from the package mplayer2), the song is played but mplayer doesn’t quit, I don’t get the prompt back. This is annoying if I want to play sound effects from a script and tens of mplayer processes are hanging…

Add the “-ao alsa” switch as a temporary solution (tip from here):

mplayer -ao alsa audio.mp3
Categories: bash Tags: ,

Google’s URL shortener

June 25, 2013 Leave a comment

You want to shorten a long URL from the command line / from a script.

There are lots of URL shorteners. With the Google URL shortener you can do it like this:

curl -H 'Content-Type: application/json' -d '{"longUrl": ""}'

Sample output:

    "kind": "urlshortener#url",
    "id": "",
    "longUrl": ""

Let’s do it in Python using the requests module:

import requests
import json

url = ""
data = {"longUrl": ""}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r =, data=json.dumps(data), headers=headers)
print r.text
print 'Short URL:', r.json()["id"]


Name generators

June 25, 2013 Leave a comment

I had a project idea that would have needed fake names. I postponed this project but I found some useful links that I would collect here for future references:

Categories: python Tags: ,

Locate by IP

You have an IP address and you want to get more info about it.

infoSNIPER does the job. However, I didn’t find an API to it.

MaxMind offers several services. They also have a free service called GeoLite, which is a bit less accurate and the databases are updated once a month. If you want to use it from Python, here is an API (pygeoip) to the databases (that you need to download and extract and they take about 44 MB disk space).

If you don’t want to download any databases then IPInfoDB can be a nice solution. They have an API, thus you can use this service in your applications. You’ll have to register for a free API key. There is a Python library to it called pyipinfodb.

Categories: python Tags: ,

10 Productivity tips for software developers

How to Stop Procrastinating by Using The “2-Minute Rule”

How to Stop Procrastinating by Using The “2-Minute Rule”

Recently, I’ve been following a simple rule that is helping me crush procrastination and making it easier for me to stick to good habits at the same time.

Categories: Uncategorized Tags:

10 Minute Mail: a great alternative

Usually I use the service but 10 Minute Mail is even simpler.

Thanks Jeszy for the tip.


Digitally Imported station URLs

June 6, 2013 14 comments

You want to listen to Digitally Imported radio channels from command line for instance. For this you need the URL of the stations but it’s somewhat hidden on the web interface.

There is a public list of stations at You can write pub1, pub2, …, pub7 in this address.

I wrote a quick and dirty script that extracts station URLs (see the script here).

The output of the script is here (download the list here):

(01)                  Ambient - a blend of ambient, downtempo, and chillout
(02)             Big Room House - The most uplifting, floor-filling Big Room House!
(03)                   Breaks - a fine assortment of trance and house breaks
(04)                 ChillHop - Trip Hop infused, downtempo nujazz and chillout beats.
(05)                 Chillout - ambient psy chillout, check out our trippy flavors!
(06)           Chillout Dreams - relax to the sounds of dream and ibiza style chillout
(07)                Chiptunes - Playing the best chiptunes and video game music.
(08)         Classic EuroDance - Finest imported cheese on the net!
(09)         Classic EuroDisco - Relive the sounds of Euro & Italo Disco.
(10)            Classic Trance - relive the classic trance hits!!
(11)       Classic Vocal Trance - Classic fusion of trance, dance, and chilling vocals together!
(12)              Club Dubstep - Enjoy the liquid sounds of Dubstep
(13)               Club Sounds - the hottest club and dance tunes 24/7
(14)          Cosmic Downtempo - A downtempo journey into the cosmos
(15)                  Dark DnB - A twisted blend of heavy hitting Dark Drum and Bass!
(16)                Deep House - Only the sexiest, silky smooth and groovy Deep House.
(17)              Deep Nu-Disco - The new sounds of Deep Disco!
(18)                 Deep Tech - Deeper shades of House and Techno with Dub and Blues influences.
(19)               Disco House  - Grooviest Disco House hits on the planet!
(20)                  DJ MIXES - non-stop DJ sets featuring various forms of techno & trance!
(21)          Downtempo Lounge - Relax with some Downtempo grooves.
(22)              Drum and Bass - tasty assortment to satisfy your drum and bass fix!
(23)                  Dubstep - Dubstep hits and mixes!!!!
(24)             EcLectronica - An eclectic mixture of modern electronica.
(25)             Electro House - an eclectic mix of electro and dirty house
(26)               Epic Trance - Epic & uplifting trance hits
(27)                EuroDance - the newest and best of Eurodance hits
(28)               Funky House - A fine selection of funky house music!!
(29)           Future Synthpop - Finest selection of futurepop and synthpop!!
(30)                Glitch Hop - Bit-crushing, dub-infused Hip Hop sounds!
(31)                   Goa & Psychedelic Trance - a voyage out of this world!
(32)                  Hands Up  - Dance to the best Hands Up hits!!
(33)                 Hardcore - DJ mixes, hard dance and NuNRG!
(34)                Hard Dance - are you ready for this!
(35)                Hardstyle - Banging Hardstyle for your ears!!!
(36)                    House - silky sexy deep house music direct from New York city!
(37)               Latin House - Finest selection of Latin house!!
(38)                Liquid DnB  - Flowing with the freshest Liquid DnB!!
(39)            Liquid Dubstep - Mellow out to the rolling, soothing deep bass of Liquid Dubstep.
(40)                   Lounge - sit back and enjoy the lounge grooves!
(41)                Mainstage - The biggest DJs from the best festivals around the world!
(42)                  Minimal - Finest selection of Minimal Techno & House!!
(43)            Oldschool Acid - Oldschool sounds of Acid Techno, House, and Trance!
(44)     Classic Electronica - old school techno, trance & rave!
(45)              Progressive - house, techno, and trance beats for your mind!
(46)           Progressive Psy - progressive psychedelic grooves
(47)                 PsyChill - downtempo psychedelic dub grooves, goa ambient, and world beats.
(48)          Russian Club Hits - Russia's hottest club hits.
(49)                  Sankeys Radio - The sound of the white isle direct from Sankeys Ibiza.
(50)             Soulful House - house music selected from Paris with love!
(51)               Space Dreams - ambient space music for expanding minds
(52)                Tech House - A fusion of techno and house with a deep, soulful vibe.
(53)                   Techno - From Minimal to Detroit to Schranz & all in between!
(54)                   Trance Channel - we can't define it!
(55)                     Trap - Electronic 808 beats with Hip Hop roots.
(56)              Tribal House - Finest selection of tribal and tech house!!
(57)                 UK Garage - The latest and greatest in UK Garage!!
(58)                 UMF Radio - UMF Radio
(59)            Vocal Chillout - Enjoy the relaxing vocal sounds of ibiza chillout
(60)              Vocal Trance - a fusion of trance, dance, and chilling vocals together!

Play a station with mplayer for instance: “mplayer“.

Update (20140703)
Another way is to extract all links and then filter the result:

$ ./ | grep -v "\.xsl$" | grep -v "http://http://" | grep "fm/" | sort -u

The script is here.

Update (20141102)
As it was pointed out in the comments by one of our dear readers, Abel Omar Serú, the radio stations above are not top quality, i.e. the bitrate is 96 KBPS. However, following Omar’s tip, here is the premium list with an incredible 320 KBPS :)

Update (20150726): I got an email from Digitally Imported and they asked me to remove the list. So it’s no longer available.