Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, January 27, 2010

How to add more swap space on Linux

An easy method if you don't want to repartition the whole disk.

dd if=/dev/zero of=/tmp/swap.img bs=1M count=256

Set up a loop device and connect the dummy file with that device:

losetup /dev/loop3 /tmp/swap.img


Then, it's just formatting the loop device:

mkswap /dev/loop3


It also needs activation:

swapon /dev/loop3


Voilá, there is a new swap partition.

To remove it:

swapoff /dev/loop3
losetup -d /dev/loop3
rm /tmp/swap.img

Saturday, January 2, 2010

Using apt behind a proxy in Ubuntu

It's really easy. All you have to do is:


http_proxy='http://someproxy:someport"
$export http_proxy


and voila, you can apt-get update, apt-get install, whatever.