Saturday, December 5, 2009

Eclipse Character Set Problem During Save

I'm using ECLIPSE as the Perl editor on my Windows machine together with EPIC Perl. If I copy/paste sample code from Perl books I get the error :

Save could not be completed.
Reason:

Some characters cannot be mapped using "Cp1254" character encoding.
Either change the encoding or remove the characters which are not supported by the "Cp1254" character encoding..



In order to overcome this problem go Window > Preferences > General > Content Types > Text > Perl Source Files > Default Encoding and make it UTF-8

Tuesday, December 1, 2009

How to see the path of a process that's listening on specific port

From time to time you can have multiple instances of Apache installed on your server. As ps aux only shows the entire path, if you started the process using full path convention; you need to check /proc presudo file system to gather path information for the process. I generally use the below one liner to fetch this info :

[root@VM1 bin]# ls -altr /proc/`netstat -natp | grep 80 |  awk '{print $7}' | awk -F/ '{print $1}'`/exe
lrwxrwxrwx 1 root root 0 Nov 30 13:03 /proc/25316/exe -> /apache_test/bin/httpd

It uses netstat to gather process ID for specific port (also lsof can be used) then checks the /proc/$PROCESS_ID/exe soft link to see where the process resides. 



Saturday, November 21, 2009

How to increase the Logging Level of NFSD

NFS Server logging is by default very good, but in case you need more logging for deeper inspection you can use :
echo 32767 > /proc/sys/sunrpc/nfsd_debug 
echo 32767 > /proc/sys/sunrpc/rpc_debug 
And for the client side use :
echo 32767 > /proc/sys/sunrpc/nfs_debug
In order to return back to old debugging level use :
echo 0 > /proc/sys/sunrpc/nfsd_debug
echo 0 > /proc/sys/sunrpc/rpc_debug
echo 0 > /proc/sys/sunrpc/nfs_debug 

Sunday, November 15, 2009

Master Certificate in Experts-Exchange

I really find Experts-Exchange a great way of challenging yourself for different problems then you have in your daily job. As I contribute in various areas, I could finally got enough points to get Master Certificate. Next target is Guru ;-)

How to Rescan SCSI Bus in Linux

I have a RHEL5 lab on my laptop, that's hosted on Vmware 7. For my RHCE prep I usually add/remove disks while the VM is up and running (hot swap). In order to make Redhat recognize the new disk you need to trigger the rescan of the SCSI bus :
echo “- - -” > /sys/class/scsi_host/hostX/scan
instead of hostX use the HBA ID. It's host0 in my case. Immediately after you can see the new disk on "fdisk -l"


NOTE : This works on 2.6 kernel only.

Friday, October 30, 2009

SCVMM Unknown Error 0x80338104

If you get the below error message on SCVMM while connecting to your hosts :

VMM does not have appropriate permissions to access the WSMan resources on the vmtest server.
 (Unknown error (0x80338104))
Make sure you have the Service Account for VMM is under Local Administrator Group of each host you manage and this is not blocked by group policy enforcements.

Saturday, October 17, 2009

SCVMM Error 403 : %ComputerName; is not a valid network computer name

While adding your Hyper-V hosts to your VMM inventory. If you get the error below :

Error 403 : %ComputerName; is not a valid network computer name

please make sure you are resolving the DNS entry for that host correctly. Especially check /etc/hosts file for any incorrect static entries (that's was the problem in my case)