Disable auto word wrap in nano

Quite annoying when editing source code via console in nano is the automatic word wrap, which often screws up compilation of the edited file. To disable the word wrap, just edit the .nanorc in your home directory and add:

set nowrap

You can also do this when starting nano:

nano -w <file>
Advertisements

Portable virtual boxes

I’ve been looking for an alternative to VMWare and came across Sun’s VirtualBox. I also found the portable version, which is very cool if you want to setup a bunch of  virtual machines and share it with your colleagues. I installed CentOS5, which is a free linux distribution very similar to RedHat. To get access to the “Guest Additions” coming with VirtualBox, you need a little note how to setup the kernel headers.

Furthermore, if you want to make a copy of a virtual machine drive you created with virtualbox, you can use CloneVDI. Also very nice is the not-so-obvious-possibility to map network ports from the virtual machine to your local computer using the VBoxManage tool. For instance I rerouted the VM’s ports 22 (SSH), 80 (WWW) and 443 (SSL) to my local computer’s ports 2222, 2280 and 22443:

VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_ssh/Protocol" TCP
VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_ssh/GuestPort" 22
VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_ssh/HostPort" 2222

VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_www/Protocol" TCP
VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_www/GuestPort" 80
VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_www/HostPort" 2280

VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_ssl/Protocol" TCP
VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_ssl/GuestPort" 443
VBoxManage setextradata "CentOS5" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest_ssl/HostPort" 22443

If you’re walking your first steps in CentOS – like I did, you might find it helpful that the basic configuration screen which appears right after the installation can be re-run using just the setup command. And if you are coming from Debian (apt-get ..) or SuSE (yast2) be aware that the installer for repository packets in RedHat and CentOS ist called yum.

Default editor for midnight commander

Mcedit isn’t the choice of everyone. It’s quite hard to copy & paste text with mcedit, so I wanted to use nano for the F4 key’s job. You can easily change the editor seperately for each user by setting the EDITOR variable:

export EDITOR="nano"

In addition you have to disable the internal mcedit editor by editing the midnight commander’s ini file in the user’s home directory, say the: ~/.mc/ini file:

use_internal_edit=0