Archive for the ‘CLI’ Category


This is a useful script for playing di.fm stations with mplayer (requires zenity, curl and mplayer)

1. open a terminal

sudo gedit /usr/bin/zenplayer

2. Add a bash shebang


3. paste this:

zenity --list --width 500 --height 500 --column 'radio' --column 'url' --print-column 2$(curl -s http://www.di.fm/ | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | sort | awk -F '/|\.' '{print $(NF-1) " " $0}') | xargs mplayer

4. Save

5. Make executable

sudo chmod +x /usr/bin/zenplayer

Then to run, just type zenplayer in a terminal and choose a station

otherwise make a new menu entry in your gnome menu and add zenplayer to properties.

If you want notifications when the track changes, add this:

| grep --line-buffered "StreamTitle='.*S" -o | grep --line-buffered "'.*'" -o > mus & tail -n0 -f mus | while read line; do notify-send "Zen Player" "$line";done

THANKS polaco and spiffwalker at commandlinefu.com

Read Full Post »

Although U8UNTU eLXR’s much vaunted migration to Blogetery.Com appears to have run aground, with the site disappearing off the Bermuda Triangle — word only now reaches us about the server getting impounded by authorities for copyright violations related to free and open source software — we can still report about two amazing command line / console apps. Both fit the bill for “wish I had this when I started out” with the new fangled Ubuntu craze featuring. Return to the Command Line by the Open Source Kid.


You can get CLIcompanion by running the following command in a Terminal:

bzr branch lp:~duanedesign/+junk/clicompanion

Move the .clicompanion file found in the clicompanion directory into your $HOME. You may need to select View –> Show hidden files (Ctrl +H) to see the .clicompanion file.
After moving the file return to the Terminal and run the following to move into the clicompanion directory:

cd clicompanion/

Start the application with the command:

python clicompanion.0.0.7.py

THANKS okiebuntu

2. Cheatsheet

A console app which pretty much does the same thing, but from the command line.

You can get the cheatsheet code with the command:

bzr branch lp:cheatsheet

then move into the directory
cd cheatsheet/
Make the file executable:
chmod +x cheatsheet.py
Then move it to one of your $PATH directories. You can view these with the command: echo $PATH
I chose /usr/local/bin/ for the next command
Move the file with the command:
sudo cp cheatsheet.py /usr/local/bin/cheat
Then from a Terminal you can view the command usage by running:
cheat –help

Read Full Post »

Type this in a console:

telnet towel.blinkenlights.nl

Read Full Post »

It had to happen, an official google application that provides access to google services via the command line. In April we showed you how to do this, the unofficial way using surfraw. Now you can do it with the blessing of the worlds most popular search engine company, Google

GoogleCL can be used to google the following services (examples shown):

  • Blogger
    $ google blogger post –title “foo” “command line posting”
  • Calendar
    $ google calendar add “Lunch with Jim at noon tomorrow”
  • Contacts
    $ google contacts list name,email > contacts.csv
  • Docs
    $ google docs edit –title “Shopping list”
  • Picasa
    $ google picasa create –album “Cat Photos” ~/photos/cats/*.jpg
  • Youtube
    $ google youtube post –category Education killer_robots.avi

Unfortunately, the deb which was released yesterday, doesn’t automatically setup the terminal browser. You will have to do this yourself:

gedit /home/user/.googlecl/config

After running one of the services for the first time, the above config was created. I opened it with gedit and added

auth_browser = w3m

Which is the w3m text-based browser. There are a lot more services on the way, and one can only hope this is a sign of things to come. I can think of a number of Net services which could do with a CLI interface.

( Remember to fill in forms with w3m , to log into your google account, you have to hit the enter key.)

Please check the official development page site for the last update.
Please visit the official download page to download GoogleCL (You’ll find a nice deb there waiting for U8UNTU users!)


Read Full Post »

Google via the command line

Sometimes opening a terminal is a lot faster than opening a browser. If you like me, then you will enjoy having some extra supercow powers at the command line.

Here is how to set up Google on the command line.

1. Install the surfraw essentials

apt-get install surfraw surfraw-extra w3m

2. Setup surfraw

sudo gedit /etc/surfraw.conf

Change the following:




3. Now you have three choices:

A)  You can stick with the default action, which is:

sr google <subject>

B) You can add an alias to your bashrc

gedit /home/<user>/.bashrc

ADD under aliases section:

alias google="sr google"


C) You can add the surfraw ELVIS   dirctory to yout PATH variable

usually /usr/lib/surfraw/ or /usr/local/lib/surfraw/

eg. PATH=/usr/lib/surfraw/:$PATH

This is probably not such a good option since it will also give you instant access to the 80 or so “Elvi” which are  in the surfraw directory and part of the Surfraw suite. Since  some of the commands might conflict with commands already on your system,  we might want to first check to see which Surfraw “Elvi” commands and powers you need and which ones you don’t.

Remove the ELVIS  you don’t need by deleting or moving the ELVIS from the /usr/lib/surfraw/ and placing it in /usr/local/lib/surfraw/ or vice versa. You really only want one surfraw directory in your path!!!

That’s right ELVIS isn’t dead, he just lives on as the Shell Users’ Revolutionary Front Against the World wide web.

You can still command ELVIS to do your bidding.

More info

Read Full Post »

BashStyle-NG is a graphical tool that allows us to easily change the behavior and appearance of the terminal. It comes with 15 pre-defined styles that you can change as well as create your own. You can define up to 7 Alias, control the type and amount of orders to recall in history, put a message of welcome, change the startup path and lots of other options.


Read Full Post »

Yes there’s always IRC but if you want something a little more counter-cultural, why not try MUD? Multi-User Dungeons are the mainstay of the old-school UNIX BBS. Similar to IRC, the text-based chat & role-play is a lot more entertaining. To log into a MUD you will need to set up a shell account with an online BBS.

There are a number of shell accounts & BBSs available. The telnet BBS guide is a good place to start.

I ssh’ed into the Super Dimension Fortress, a Seattle-based BBS with an evocative name and set-up my account like this:

ssh new@<name-of-the-server>

This took me through a setup in which I was asked to supply a username and password.  I could then login with username@server.

Then using the unix commode programme available from the shell I quickly learnt how to join a room. Sound familier? MUDs are essentially chatrooms, but with a slightly different ethos and character. Some are exceedingly elaborate. I actuallyprefer the good old cyberspace hackers meeting up in text-mode. B&W or Colour, toggle on of off, you choose. To enter the real MUD game using the mud command, I chose a character and became a samurai leprechaun.

My first realisation on returning, was that today’s MUD, apart from the game, could make a nice addition to Pidgin, as a plugin. A better nCurses interface would also be cool in terms of development.

Whereas IRC is usually organised around a topic or channel, MUDs are very connected to a sense of place and presence on the Net. You can feel like you live and work in Seattle for instance, by joining SDF which also has a Texas presence.

MUD, considered by many to be some kind of Pre-Mosaic relic,, may have slipt under the radar, but thanks to Ubuntu, the shell is making a come-back. Chatting via a MUD is more anonymous than Facebook, and less of a chore than IRC, which is geared towards rapid communication. MUD is also a lot slower, and laid-back. Give it a try and let us know what you like or dislike.

UPDATE: There are two clients in the repos which one should consider.  PuTTY is an sh client with some excellent options such as proxy. There is also Gnome-MUD, a GTK MUD client.

Read Full Post »

Older Posts »