Category Archives: Computer Tips

disable ipv6 address on linux or linode

if you want to remove ipv6 address run the below command:
sysctl -w net.ipv6.conf.all.autoconf=0
sysctl -w net.ipv6.conf.eth0.autoconf=0
sysctl -w net.ipv6.conf.all.accept_ra=0

to make it permanently add it to the sysctl.conf

Also on Debian Etch (probably on newer too), without setting the accept_ra, the system will autoconfigure using the Link local adress (fe80..)

Further more, automatic address configuration and router discovery will be disabled if the host itself is a router and accept_ra is not 2, i.e
net.ipv6.conf..forwarding=1
and
net.ipv6.conf..accept_ra=0 or net.ipv6.conf..accept_ra=1.

reference:

http://superuser.com/questions/33196/how-to-disable-autoconfiguration-on-ipv6-in-linux

enable virutal memory on linux debian

Most of the time, virtual memory is enabled by default on linux, in case it’s not there, run below commands:
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab

And you can use this command to check for memory status:
free

curl download files with the file name from server

To download files with the file name from server with curl, you need to specify this command:
curl -O -J -L

And this is the explanation of the command switch used:
-O, –remote-name Write output to a file named as the remote file
-J, –remote-header-name Use the header-provided filename (H)
-L, –location Follow redirects (H)

build openvpn from command line

first download the source and cd to the extracted directory, you should run follow commands:

wget http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.tar.gz
tar -zxvpf openvpn-2.3.4.tar.gz
cd openvpn-2.3.4
aptitude install libssl-dev liblzo2-dev libpam0g-dev gcc make -y
./configure
make
make install