Play/pause music in Guayadeque through global keyboard shortcuts

I’ve tried a lot of music players on Linux, ranging from the desktop environment standards like Rhythmbox, Banshee and Amarok, to experimental ones like Tomahawk and Guayadeque. The latter has been my music player of choice for over a year now – its simple UI and small memory footprint works well for me.

One feature Guayadeque doesn’t seem to have is global keyboard shortcuts. Ctrl+Right/Left skips to the next/previous track, and Ctrl+Space plays/pauses the current track, but these shortcuts work only when the Guayadeque window has focus. Referring to this thread and this article, I went about writing a tiny shell script to play/pause music when Guayadeque is running, or launch Guayadeque and then perform the action. Here’s guayadeque_playpause.sh

dbus-send --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Pause
returnCode=$?
if [ $returnCode -ne 0 ];
then
  guayadeque &
  sleep 5
  dbus-send --type=method_call --dest=org.mpris.guayadeque /Player org.freedesktop.MediaPlayer.Pause
fi

I replaced MediaPlayer.Pause in the above script with MediaPlayer.Next and MediaPlayer.Prev in separate scripts to handle skipping to the next or previous track. I mapped the shortcut Ctrl+F10 to launch guayadeque_playpause.sh, to use at times when I just want music to start playing!

Downloads:
guayadeque_playpause.sh
guayadeque_prev.sh
guayadeque_next.sh

Shell script to attack a WPA/WPA2 network [Based on reaver and aircrack-ng]

I’ve spent the past few days playing around with the command line, and that is not something I do very often. It all began when I discovered this handy tool called Reaver¬†which exploits vulnerabilities of the WPS standard. Naturally, I had to test it out on the numerous WPS-enabled wireless networks around me: I must say I have very, err, co-operative [and oblivious] neighbours!

I had previously tried in vain to learn to use the aircrack-ng suite of WiFi hacking. Since reaver is based on aircrack-ng, I had no choice but to give it another shot. This time, however, things made more sense, and I managed to use reaver successfully.

I made a small configurable shell script that will hopefully make the command line options seem a little less intimidating to the newcomer.

Continue reading →