Archive

Tag Archives: modding

Often, when using linux, there are times when you need to re-use a long-winded command on a regular basis. Wouldnt it be nice if you could configure your system to carry out that command with just a simple keyword commmand?

Well luckily for us, we can. let me give you an example. The command i use if i want to watch a video within the framebuffer (ouside of X) is as follows:

sudo mplayer -vo fbdev -fs -vf scale=800:-3 /name/of/video.avi

There is no way i’m going to remember that everytime i come to watch a video… Now sure, i could save this into a txt file and grab it when i need it, or even write a script to handle it, but there is a more elegant way. Use an alias.

An alias is just like giving your own unique name to a command for simplicity. I want my alias to be ‘clivid’ so that i can type ‘clivid /path/to/video.avi’ and the computer will do – ‘sudo mplayer -vo fbdev -fs -vf scale=800:-3 /path/to/video.avi’

Heres what you do: open a terminal emu, type

sudo leafpad ~/.bashrc

Or whatever txt editor you use if you dont like leafpad.

You will be confronted with your .bashrc file. Scroll to the very bottom, this is where we will add the alias

First add a comment so you know what the alias does my case its:

#Alias for opening mplayer within framebuffer

Next is the line which actually adds the alias

alias clivid='sudo mplayer -vo fbdev -fs -vf scale=800:-3'

its that simple. You type alias nameOfAlias=’bashCommand’

Save the document, and you’re almost finished. You must recompile .bashrc, type:

source ~/.bashrc

Now test out your new alias on the command line – good luck!

I frequently find, when I run htop, that X is sucking up ~25% of my CPU. From what I have researched it seems I might have an issue with my video driver.

Given that I havent yet found a solution to this,  I like to run my system without X when possible. One quick fix that makes this so much more pleasurable is to us a framebuffer.

Using a framebuffer allows you to run the command line in a higher resolution than normal, it also lets you display images, browse the net with a graphical CLI browser, and even watch video.

The easiest way to do this is to edit ‘/boot/grub/menu.lst’

start by typing ‘sudo leafpad /boot/grub/menu.lst’ on the command line and press enter. If you dont use leafpad, replace that with your favourite text editor.

When that opens, scroll down and you will see something that looks a bit like this:

title        Ubuntu 8.10, kernel 2.6.27-8-eeepc-lean
uuid        01225088-77c2-4dc9-8113-2ef89ac2f7e8
kernel        /boot/vmlinuz-2.6.27-8-eeepc-lean root=UUID=01225088-77c2-4dc9-8113-2ef89ac2f7e8 ro quiet splash
initrd        /boot/initrd.img-2.6.27-8-eeepc-lean
quiet

Depending on your grub config, you might have more than one of these – the top one should be your default boot.

On the end of the kernal line, where it says ‘splash’ you need to type ‘vga=xxx’. The xxx should be replaced by 3 digits based on what colour depth and resolution you want. for example, mine is ‘vga=788’ which is 800×600 16bit. See this page for a table outlining possible setups and the relevant codes.

Once that is done, save and restart your system – you should now have a framebuffer on your command line!

to try it out, download fbi (a command line  image viewer) ‘sudo apt-get install fbi’

then ‘fbi ~/some/image.png’ and you’ll see for yourself!

This worked perfectly for me on my EEE900 running chunchbang. I take no responsibility if you muck up your system. GOOD LUCK!