Friday, August 7, 2009

Perl and CPAN reconfigure

To reconfigure CPAN do the following:

perl -MCPAN -e shell

When inside the shell...type:

cpan> o conf init

That's it...you will get interactive question and answer to setup CPAN etc...cheers.

Another way to do this is ..just by executing cpan directly from shell.. as pointed out by chorny :) thx.
# cpan
cpan> o conf init


Again..there maybe more ways to do this...choose yours :)

OpenBSD tips and tricks - adding swap on the fly

******* Adding swap on fly *******

# dd if=/dev/zero of=/usr/swap0 bs=1024k count=64

This will create basically a 64MB file that we will use for adding some swap space.

set the proper permissions on (/usr/swap0)

# chmod 0600 /usr/swap0

Now to add the swap file on fly

# swapctl -a /usr/swap0

Check to make sure you are using swap by running top or:

# swapctl -l

You can then further add swap at boot time in /etc/rc.local by adding the swapctl command.

** Note there maybe some security implications with this ...so I won't advise you to do that for production system. This is for those times when you forgot to create proper swap partition and now one of you programs is causing segmentation faults etc cuz you are running out of physical memory. ** You've been cautioned, please use at your own risk.