Friday, December 9, 2011

evolution expunge - Ctrl+E

This is news to me - that Evolution doesn't delete mails(Ctrl+D). It only marks them as deleted in the respective folders (Drafts, Deleted Items) and hides it from the user's view. If you are not aware, you will have your Evolution meta directory(~/.evolution) growing big.

To delete mails permanently use the 'expunge' command. From the GUI select - Folder > Expunge or highlight the folder using mouse and press Ctrl+E.


evolution mail client with evolution-connector enabled - hangs

Evolution with a mail box configured with MS Exchange as the mail server doesn't work that great. I have had issues before, so I make it a point not to sync mails to my local machine, instead I store it on the Exchange server itself. I also point my Drafts and Sent Items to the Exchange server. This helps me in accessing my mails, drafts and send folders anytime anywhere using my OWA URL; especially when my evolution client behaves weird - as it happened today.

I can't remember any specific reason why it happened, however this morning when i started 'Evolution' it just did not open. The client appeared in the status bar for a few seconds and then disappeared.

I didn't want to waste time nor did I know how to debug. I decided to clean up my Exchange related meta directories from the Evolution meta directory(~/.evolution).

I fired this command:
find ~/.evolution -name "exchange" -exec rm -rf {} \;

Tried starting Evolution again. It did not work. Tried a few times to no avail. I went ahead and deleted the "~/.evolution" directory; with the same results. I also tried reinstalling evolution and related packages, even that was of no use.

I logged in as a different user and tried configuring the same mailbox. This worked as expected and proved my assumption that Evolution installation was fine, but there was some sort of corrupted data from my previous configuration that the evolution-connector package was holding on to.

I logged in again as the old user and started Evolution from the command line using plugin disabled option (evolution --disable-eplugin). Once Evolution was running I deleted my previous mailbox from the GUI and stopped it. To be safe I did a force shutdown (evolution --force-shutdown) from the command line and then deleted all Evolution related meta data (rm -rf ~/.evolution, rm -rf ~/.spamassasin).

I restarted Evolution and recreated my profile. Huff... here i am
blogging through my email client - Evolution.

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.