Archive for the ‘How-to’ Category

Postfix –

1) Append smtp_generic_maps to Postfix
[root@server1 ~]# echo ‘smtp_generic_maps = hash:/etc/postfix/generic’ >> /etc/postfix/

2) Append the necessary outgoing email masks to Postfix address mapping table
<user>@<your_server> <your_email_address>

[root@server1 ~]# echo ‘root@server1.mydomain.local’ >> /etc/postfix/generic

3) Create lookup table for Postfix address mapping table
[root@server1 ~]# postmap /etc/postfix/generic

4) Restart Postfix to take effect Postfix changes
[root@server1 ~]# /etc/init.d/postfix restart

Mutt –

1) ‘set envelope_from=yes‘ in /etc/Muttrc file

2) Create .muttrc file if it’s not alredy created at your user’s home
[sajithr@server1 ~]$ touch ~/.muttrc

3) Add the necessary masks to ~/.muttrc
set from=”<from_email_address>”
set realname=”<username>”

[sajithr@server1 ~]$ cat ~/.muttrc
set from=”
set realname=”foo, server1″

The following scripts were written to bulk upgrade VMware virtual machines’ hardware from v4 to v7.

After the upgrade of a specific virtual machine, the first NIC adapter is also changed to use the new VMXNET3 adapter. And finally some of the changes are done to the virtual machine configuration to gain maximum performance (disable VM logging, set unlimited CPU and memory reservations)

Download the script collection from here.

The script collection includes three scripts.


1)    Extend the LUN from storage array (If you HP EVA, locate the LUN, extend it and finally save the changes). And you need wait a few seconds here (to allow the changes to be identified by the OS) before you proceed with the next step.

2)    Identify the underlying SCSI devices (use multipath -ll to see the underlying devices) and rescan the SCSI devices

[root@zenhat ~]# echo 1 > /sys/block/sds/device/rescan
[root@zenhat ~]# echo 1 > /sys/block/sdr/device/rescan

3)    Drop and add each device path from multipath(no problem, multipath will correctly failover the paths) and resize the related multipath map ( OR reloading the multipathd will do the same job sometimes)

[root@zenhat ~]# multipathd -k
multipathd> del path sds
multipathd> add path sds
multipathd> del path sdr
multipathd> add path sdr
multipathd> resize map dm-23

This is a sample kickstart file for VMware ESXi 4.1 installations.

PXE environment is setup under CentOS 5.5-x86_64, with restricted dhcpd (i.e. no free leases), tftp-server and httpd (for hosting installation and some configuration files). Instructions for setting up PXE environment for VMware ESXi 4.1 can be founded here. Here, the typical VMware scripted installation processe has slightly been modified to automatically install multiple hosts simultaneously without any user interaction. The host needs to be *manually* PXE boot. Then it will install OS according to the ks.cfg file and reboot. After the reboot the %firstboot section will execute. During the %firstboot execution, it will look for file, post_install.cfg which includes all the post installation configurations. post_install.cfg requires a file called arp_table to grab the correct IPv4 addresses and hostname(based on vmnic0 MAC address). After executing all post configurations, the host will enter into the maintenance mode and reboots.

According to this setup, all files, ks.cfg, post_install.cfg and arp_table, should be placed under http://<pxe_server>/kickstart directory.

Note: At the time of this writing, in VMware ESXi 4.1 scripted installation, %post section changes are only applied to the pre-boot environment. i.e. the changes you made in %post section will be lost after the first reboot. So %firstboot section is used to make the post installation changes.


How To: Setup DBD::Oracle in Ubuntu

Posted: September 11, 2010 in FOSS, How-to

This how-to outlines the setup of Perl-Oracle connectivity under Ubuntu.

  • Install DBI (DBI module should be installed before installing DBD::Oracle)

root@cratlk1:~# perl -MCPAN -e shell

cpan shell — CPAN exploration and modules installation (v1.9402)
Enter ‘h’ for help.

cpan[1]> m DBI
CPAN: Storable loaded ok (v2.21)
Going to read ‘/home/sajithr/.cpan/Metadata’
Database was generated on Tue, 24 Aug 2010 07:47:51 GMT
Module id = DBI
DESCRIPTION  Generic Database Interface (see DBD modules)
CPAN_USERID  TIMB (Tim Bunce <>)
CPAN_FILE    T/TI/TIMB/DBI-1.613.tar.gz
UPLOAD_DATE  2010-07-25
DSLIP_STATUS MmcOp (mature,mailing-list,C,object-oriented,Standard-Perl)
MANPAGE      DBI – Database independent interface for Perl
INST_FILE    /usr/local/lib/perl/5.10.1/

(If it’s not installed, install DBI)

  • Download DBD::Oracle

cpan[2]> get DBD::Oracle

  • Install libaio, libaio-dev (for Oracle instant-client)

root@cratlk1:~# sudo aptitude install libaio libaio-dev

  • Download and install oracle-instant-client-basic and oracle-instant-client-devel

root@cratlk1:~# alien –scripts oracle-instantclient11.2-*.rpm
root@cratlk1:~# sudo dpkg -i *.deb


Jaunty on T61

Posted: August 11, 2009 in FOSS, How-to, Life

Yes, It was a hard decision!

It took a very long time to move from Fedora. The main reason why I sticked with Fedora was to align with my RHEL and CentOS servers. But finally I realized the need of a “desktop”. So I decided to go ahead with Ubuntu 9.04 on my Lenovo T61.

Before the installation I read this excellent ThinkWiki article.

Here’s the result.


Video – nVIDIA Quadro NVS 140M; OK

Sound; OK

Wireless NIC – Intel; OK

Wired NIC – Intel 1GbE; OK

Bluetooth; OK

Keyboard Shortcuts; Almost OK, even ThinkVantage button! ( except the Atl+F8, Alt+F9, Alt+F12 and Alt+Space bar). To solve Alt+F8 ( Touch-pad on/off) here’s the fix.

Fingure-print; This ThinkWiki solution was helpful to fix the  problem of getting the finger-print reader hot. I had “USB Not Found”, “USB Timeout” and “Reading Error” errors when I was trying to tf-tool –acquire && tf-tool –verify. But after very patient retries, I figured out that swiping a finger “tip” was the trick. If you’ve any problems creating the .bir file, just give a try by swipping a finger “tip” rather than the whole thumb.


Oracle – 11gR1; Here’s the doc. If $DISPLAY environment variable not working, please run xhost local:oracle as privileged user to open ACL for the oracle user to access X and then export DISPLAY=0:0 for the user, oracle.

PL/SQL Developer – v7.1.4; On Wine it’s works pretty muck OK. I un-zipped Oracle basic instant client under ~/.wine/drive_c and specify the oci.dll path on PL/SQL Developer. And created a directory for TNS_ADMIN enviroment variable and set the variable from regedit. Finally created a valid tnsnames.ora at $TNS_ADMIN location. Basically these routings worked well and I could login to a db without any issue. But the images on the tool-bar are not displayed. I haven’t tested all the fuctionalities yet.

Citrix ICA Client – v11; OK, Please read the official doc and install pre-requisists before the installation.

Skype – v2.0; OK

VMware Workstation – v6.5.2; OK

It took whole 2-days to come up with a satisfied desktop.
And finally, thanks to the Internet and community works, the mission was successfully completed!