Saturday, 19 November 2011

Create persistent Bash aliases

Having recently updated to Xubuntu I found that the command "l" no longer showed a colourised 'ls' output, which was rather irritating. The solution is, of course, to re-create the bash alias so that the command 'l' executes what I expect it to. I'm unsure whether or not I managed to remove this functionality myself at some point, or whether it's simply not a default alias in Xubuntu.

In any case, I didn't have a .bashrc file in my home directory, so the first thing I did was to copy the default one to it:

cp /etc/skel/.bashrc ~/
It turns out this is enough to get the 'l' command back, as it already exists in that bashrc. Having had a look through this default .bashrc though, I couldn't resist the temptation to add another alias for convenience!

Simply append the following to the end of your ~/.bashrc to have the terminal update and upgrade when you type 'update'
alias update='sudo apt-get update && sudo apt-get dist-upgrade'
It's tempting to go nuts and start adding aliases left right and centre for mundane tasks, this is something that should probably be resisted for anything that isn't both genuinely useful, and frequently executed however.

Friday, 11 November 2011

Force Nvidia Powermizer to always set performance mode - Ubuntu 11.10 (Update)

This is an update from an older post, as that particular method no longer seems to work in the latest version of Ubuntu. This one, however, does.

Open xorg.conf with your favourite editor:

sudo nano /etc/X11/xorg.conf
Add the following line under the section "Device"
Option "RegistryDwords" "PerfLevelSrc=0x2222"
So that your device section looks something like this:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "NoLogo" "True"
Option "RegistryDwords" "PerfLevelSrc=0x2222"
Save and reboot, hopefully your performance level is now always at maximum.