Archive for the ‘Linux’ Category

Get latest bleeding edge gfx drivers in Ubuntu

Friday, June 18th, 2010

Want the latest of the latest updated bleeding edge graphic drivers in Ubuntu?

Open /etc/apt/sources.list:

sudo gedit /etc/apt/sources.list

Add these lines at the bottom:

deb http://ppa.launchpad.net/xorg-edgers/ubuntu lucid main
deb-src http://ppa.launchpad.net/xorg-edgers/ubuntu lucid main

Update and upgrade:

sudo apt-get update
sudo apt-get upgrade

If you don’t use Lucid (Ubuntu 10.04) just change “lucid” to what ever you use, for example ‘karmic’.

Enjoy :)

Free Up Some Ubuntu Space!

Wednesday, May 19th, 2010

cleaning up ubuntuHaving trouble cleaning up space for your Ubuntu installation?
I only have a 4GB SSD drive on my Lenovo S10e netbook, so I have the problem myself. Here are some handy tips for you!

Remove files not needed

sudo apt-get autoremove

Remove all stored archives in the cache

Basically it clears up the ‘/var/cache/apt/archives/’ and ‘/var/cache/apt/archives/partial’ folders

sudo apt-get clean

Remove package files that can no longer be downloaded

sudo apt-get autoclean

Remove locale data

This will remove unneeded locale files and localized man pages.

sudo apt-get install localepurge

Run it:

localepurge

A window will pop up. There choose your language. I use English, therefor I chose “en”.
Ignore the capitalized ones.

Remove orphaned packages

It shows you which packages that have no other packages depending on them.

sudo apt-get install deborphan

Run it:

sudo deborphan | xargs sudo apt-get -y remove --purge

Cleaning up log files

sudo find /var/log -type f -exec rm {} \;

Cleaning up doc files (use only when desperate use of space)

sudo rm -rf /usr/share/doc/*

Remove Linux kernels not in use

Check what kernel you are using:

uname -r

Goto System->Administration->Synaptic Package Manager

Search for “Linux” and mark all Linux header/kernel files which you are not currently using for complete removal. Then hit ‘apply’.

Not Enough Space to Upgrade Ubuntu

Wednesday, May 19th, 2010

I have just a small 4GB SSD drive with my Ubuntu installation on it, and when I was going to upgrade to Ubuntu 10.04 (Lucid), I had to free up some space. Instead of removing all programs that I had installed, I googled and found something neat.
Ubuntu logo
New packages are downloaded to ‘/var/cache/apt/archives’ and by creating a link to another place with more space you will “trick” the upgrader.

I have also a 150GB drive which I have my home folder located in, so I created a folder there to take the heavy upgrading.

sudo su
cd /var/cache/apt
mv archives archives-original
mkdir -p archives/partial
mkdir -p /home/<username>/temp/archives
ln -s /home/<username>/temp archives
upgrade-manager

Restore to default:

rm archives
mv archives-original archives
rm -r /home/<username>/temp

Source:
http://www.webupd8.org/2009/11/how-to-upgrade-to-ubuntu-1004-lucid.html

Vim Config Tips

Monday, April 5th, 2010

Vim logo
One thing I love about vim is that it is extreme configurable. I have put together this config with comments for explenation. Be sure to know what thing does before using them.
Just leave a comment of you think I have forgotten something.

"Enable syntax highlighting and select color scheme:
syntax on | colorscheme wombat256

"Enable 256 colors:
set t_Co=256

"If you have the problem that most of the text gets bold, this works. But nothing gets bold after this:
set t_md=

"Enable auto-Indent:
set autoindent smartindent

"Enable line numbering:
set nu

"Enable mouse:
set mouse=a

"Enable unicode:
set encoding=utf8

"Enable incremental search:
set incsearch

"Replace tab with 4 spaces:
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab

"So you get all error messages at once and just have to click enter one time:
set nomore

"Match parens and braces:
set showmatch

"Makes search case insensitive:
set smartcase ignorecase

"Highlight the line you are at:
"set cursorline

"Remove toolbar (waste of space):
set go-=T

"Enable statusline (also waste of space, but it might be handy):
set ls=2

"Show changes commands make:
set report=1

"Highlights what you search for:
set hlsearch

"Shows whitespaces and tabs:
set list listchars=tab:\|\ ,trail:· "

"You don't lose selection when you indent selected code:
noremap < <gv | vnoremap > >gv

"Check php files for syntax errors:
noremap <C-B> :!php -l %<CR>

"Bind ALT+1 and ALT+2 for moving through tabs:
nmap <A-1> :tabprevious<CR>
map <ESC>1 :tabprevious<CR>
map <A-2> :tabnext<CR>

nmap <ESC>2 :tabnext<CR>
nmap ,t :tabnew<CR>
map ,T :tabclose<CR>

"Screen redraw also clears highlights:
nnoremap <silent> <C-L> :nohls<CR><C-L>

Aptitude Easter Egg

Sunday, April 4th, 2010

Probably old news, but if you didn’t knew here’s a little cool thing in Aptitude :)

echofish@ubuntu:~$ aptitude moo
There are no Easter Eggs in this program.
echofish@ubuntu:~$ aptitude -v moo
There really are no Easter Eggs in this program.
echofish@ubuntu:~$ aptitude -vv moo
Didn't I already tell you that there are no Easter Eggs in this program?
echofish@ubuntu:~$ aptitude -vvv moo
Stop it!
echofish@ubuntu:~$ aptitude -vvvv moo
Okay, okay, if I give you an Easter Egg, will you go away?
echofish@ubuntu:~$ aptitude -vvvvv moo
All right, you win.

                               /----\
                       -------/      \
                      /               \
                     /                |
   -----------------/                  --------\
   ----------------------------------------------
echofish@ubuntu:~$ aptitude -vvvvvv moo
What is it?  It's an elephant being eaten by a snake, of course.