Monday, November 28, 2011

i powercycled it via ipdu, but to no avail.

Recently, I got a mail where the title of this post was there.

I was stumped. The Internet being the abyss of knowledge, I read about power cycling and pdu. And I realised these are the admin terminologies used by data centre administrators.

The sentence can be rephrased as -  I restarted the machine remotely but it didn't start.

And if my guess is correct, IPDU stands for Intelligent PDU.

Thursday, November 17, 2011

Ethernet Controller not detected with CentOS 5.4 on Dell Latitude E6420

This is related to my earlier post on CentOS 5.4 installation on Dell Latitude E 6420.

The installation of CentOS 5.4 went smooth. Once installed I realised that my ethernet controller was not detected correctly. Having a laptop and not being connected is worthless. The output of the lspci command says it all.
------- lspci --------
00:00.0 Host bridge: Intel Corporation Unknown device 0104 (rev 09)
00:01.0 PCI bridge: Intel Corporation Unknown device 0101 (rev 09)
00:16.0 Communication controller: Intel Corporation Unknown device 1c3a (rev 04)
00:19.0 Ethernet controller: Intel Corporation Unknown device 1502 (rev 04)
00:1a.0 USB Controller: Intel Corporation Unknown device 1c2d (rev 04)
00:1b.0 Audio device: Intel Corporation Unknown device 1c20 (rev 04)
........

........
-------------
Luckily, mine was a dual boot machine. I booted using the other OS(Windows 7 Professional) to find out the Ethernet controller on my machine. I had Intel 82579 Ethernet Controller and e1000e linux base driver was the one I needed. The README txt inside the tar archive had all the details. I just installed it and rebooted my machine.

Voila! I am connected to my LAN.
To check my network connection i executed 'dmesg | grep e1000e'. 
--------
[raghu@raghu-ti8105 ~]$ dmesg | grep e1000
e1000e 0000:00:19.0: Using NUMA node 0 for memory allocations
e1000e 0000:00:19.0: eth0: (PCI Express:2.5GT/s:Width x1) 5c:26:0a:6b:06:81
e1000e 0000:00:19.0: eth0: Intel(R) PRO/1000 Network Connection
e1000e 0000:00:19.0: eth0: MAC: 11, PHY: 11, PBA No: 3041FF-0FF
e1000e: eth1 NIC Link is Up 100 Mbps Half Duplex, Flow Control: Rx/Tx
e1000e 0000:00:19.0: eth1: 10/100 speed: disabling TSO
[raghu@raghu-ti8105 ~]$
-------

Later after upgrading to CentOS 5.7 the 'lspci' command gave me this output.
---------
[root@raghu-ti8105 net]# lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family HECI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced

.......
.......
---------

Tuesday, November 15, 2011

vpnc sh: /etc/vpn/vpnc-script: Permission denied

    I use vpnc to login to my company VPN(Cisco). It was all working fine. Recently, I had changed my laptop and so I had to install vpnc again. After installing vpnc when I tried to connect, it threw me a 'permission denied' error as shown below:

[root@raghu-ti8105 raghu]# vpnc ./vpn
Enter password for raghu@mycompany.com:
sh: /etc/vpnc/vpnc-script: Permission denied
sh: /etc/vpnc/vpnc-script: Permission denied
VPNC started in background (pid: 6986)...
[root@raghu-ti8105 raghu]#

    I searched the internet and found a few 'permission denied' threads however nothing worked for me. To make it work, I decided to login using the Windows Cisco VPN Client. Once connected, I can convert the profile(*.pcf) file using 'pcf2vpnc' script to a vpnc conf file and try again with vpnc.

    I was able to login from Windows however it still didn't work with vpnc. That's when I decided to look closely at the error.

    It was a 'permission denied' error from the shell. The user running did not have permission to run the script!!!

    The solution was to allow the owner of the script to execute.

chmod u+x /etc/vpnc/vpnc-script

    After running the above command, I ran vpnc again.

[root@raghu-ti8105 raghu]# vpnc ./vpn
Enter password for raghu@mycompany.com:
Connect Banner:
| UNAUTHORIZED USERS WILL BE PROSECUTED TO THE FULL EXTENT OF THE LAW.
|

VPNC started in background (pid: 7260)...
[root@raghu-ti8105 raghu]#


Note: I believe by default the
/etc/vpnc/vpnc-script is installed with execute privilege for the owner but it did not happen in my case, not sure why.

Monday, November 14, 2011

local rsync to sync directories under different users

    In my current project, all developers have their own userids for the source control and a common user(appuser) for checking out and running the application on staging and production machines.
  
    For a developer who needs to code and test the app on his machine; needs to sync (check out and update) the code twice - one with his userid(raghu) for development and the other with the appuser for running the applicaiton.
 
    Switching between users was a pain, so I was thinking of an alternative, where I do not have to sync the same code twice. Thats when rsync came as the rescuer.

    Solution:
  • dev(raghu) user needs to checkout the code under a directory(app) inside his home(/home/raghu)
  • appuser needs to be part of the dev(raghu) group(usermod -G raghu appuser)
  • dev(raghu) user needs to grant read and execute privilege for the dev(raghu) group (chmod g+rx /home/raghu) on the home directory (/home/raghu).
  • an rsync process needs to be run as cron to sync the /home/raghu/app directory with /home/appuser
  # cron to keep files in /home/raghu/app/ and /home/appuser in sync 
  0 11 * * * cd /home/appuser; rsync -avz --no-g --no-o --exclude=CVS /home/raghu/app/ .
The cron above is set for the appuser. It runs daily at 11 am. The rsync is run in archive(-a) mode with the symbolic links, devices, owners, groups and permissions preserved in transfer. In my case, I don't need the owner and group to be preserved. This can be done by (--no-g and --no-o). The --exclude option can be used to exclude directories that shoud not be sync'd. In my case it omits all files under the CVS meta directory.


Friday, November 11, 2011

To check whether a perl module exists on your machine.

To find out whether the Net::Twitter perl module exists on your machine.
To print the path:
[raghu@raghu-ti8105 ~]$ perl -MNet::Twitter -e 'print $INC{"Net/Twitter.pm"}'
/usr/lib/perl5/site_perl/5.8.8/Net/Twitter.pm 
To just confirm whether it exists:
[raghu@raghu-ti8105 ~]$ perl -MNet::Twitter -le 'print 1'
1
Note: Replace the Net::Twitter module with yours.

Wednesday, November 9, 2011

Show all processes in FreeBSD

    Those who are familiar with the Linux distributions mostly use ps -ef to find all processes that are running. If you log on to a FreeBSD machine and try the same; you will only see processes started by you.

    To see all processes running on FreeBSD the best option is to use ps -auxww.

DELL LATITUDE E6420

I have moved to a new laptop after four and half years of my association with an HP laptop (Compaq nx6310). I have been provided with a new DELL Latitude (E6420). The machine is sleek and I have moved up in the 'eyes of the beholder'.

I had asked for a dual boot option and the administrator conceded by giving a Windows 7 Professoinal (without admin rights) with unformatted(free) 180GB space. The next thing I did was to fetch my old CentOS 5.4(Final) DVD and install it.

The installation went smooth however the trouble started after that. The machine didn't recognise the network card and most of the other things present on my mother board. Here's how I fixed it.

  • Windows 7 partition had no problems in connecting to my LAN.
  • I tried booting Ubuntu 11.04 using a USB drive and it worked. I could connect to the network with that. This reduced my search to a compatible network driver within CentOS.
  • I got the driver details here.
  • Downloading and installing as mentioned in this README fixed it.

Once connected to the network I updated my OS to the latest (CentOS 5.7).

This blog helped me move from CentOS 5.4 to 5.7.

Friday, November 4, 2011

borborygmi - rumbling in the intestines


The only reason to have this here is because of this  word - borborygmi. I found it interesting.

 The rumbling sound in the intestines when solid,liquid or gas passes through it is called borborygmi. If the noise is loud enough, then a teaspoon of olive oil or a cup of herbal tea with lemon may ease you.