Battery Powered

Entries tagged as ‘fun’

Howto: Alias in Ubuntu (or I CAN HAS ALIAS)

June 13, 2008 · Leave a Comment

When you found this blog post you were probably fed up with repeating some really difficult-to-write commands. You’ve probably heard of this alias command from somewhere and decided to look it up on your favorite search engine. Look no further my good man… or woman… because I will tell all you will need in few minutes of your time. The basic command for binding one new command to replace the old one looks like this:

alias new_command='old_command'

Just typing alias into your shell will list all bindings available for you. If you have Ubuntu like me, the default output should look like this:

$ alias
alias ls='ls --color=auto'

As an example, let us amend on what a windows admin geek griefs about the most when using linux. We’ll bind the well known windows dir command with the common one that your linux computer uses.

$ alias dir='ls'

Whenever you type in dir the bash shell will look up the alias and execute the old command. But because you who are most likely a wannabe Linux geek who wants to phase out of the windows world we’ll remove that stupid binding and test it:

$ ualias dir
$ dir
bash: dir: command not found

The binding should now be removed and your bash shell should not know what the command dir is. Whenever you’re binding useful commands and you restart your shell, the bindings will reset. In order to retain the changes you’ll need to edit your bashrc file and add the commands there. If you have Ubuntu like me you might want to do the following. Go to your home directory and fire up your favorite editor.

$ cd ~
$ nano .bashrc

Further down the file you will find the alias definitions and there you will find a commented if-statement. The default configuration suggests you add your bindings to the bash_aliases file. So let us first uncomment those lines like this:

# Alias definitions.
# ...
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

Save, exit and start editing the bash_aliases file which will most likely be a new file.

$ nano .bash_aliases

And add your bindings in that file. So now you know how to add alias definitions and change your bash configuration to retain them. Of course you can do some really funny meowy things with this:

I can has Sudo!

The primary reason for me to write this blog post is because during an IRC chat I found out about a unix geek who bound some lolcat commands. Such as the:

alias plz=sudo

The power of this alias binding is in it’s innocently intrinsic humor:

$ plz adduser Cat
$ plz umount kittypictures

I’m pretty sure that you can invent some much more funny alias bindings yourself.

Categories: dev
Tagged: , , , ,

Shaking Booty with Wii Fit

June 5, 2008 · Leave a Comment

I may be sexist to agree with the following video clip that the only reason for guys to buy a Wii Fit is to see your girlfriend shake her booty. This strikes me also as an interesting example of word of mouth marketing. Accidental, yet funny as heck to be passed around to other guys on the Internet who find this equally funny.

Boys will be boys, y’know.

Link: The Only Reason To Get A Wii Fit @ Kontraband

Categories: fun
Tagged: , ,