Friday, 13 April 2012

Linux Find

I was always a little hesitant to play with the Find command.  The Man page alone is 40 pages long.  :)

find  -mtime +360 -name *.zip -exec rm {} \;


This will find all files over 360 days old and delete them

Thursday, 12 April 2012

unable to connect to vmware host in vCenter

VMWARE

When you can't connect to your host anymore in vCenter, but the host replys to ping, and your VMs are runing fine...Here is  what you do:
  1. Ssh to the host
  2. Become root
  3. Type: service mgmt-vmware restart
  4. If the command hangs, in another console window, establish another connection to the host.  Again su to root and run:
  5. ps -ef | grep vmware-hostd
  6. Now kill -9 that PID
  7. Return to the original terminal and the command should complete successfully.

Tuesday, 20 March 2012

A great IDE... Sublime text 2


Just came across this IDE, Sublime Text 2. Before this I have been using gVim for windows. OMG this one is incredible.. Text completion included. :)

Append date timestamp to a file in linux:


cp filename filename.$(date +%Y-%m-%d)
This is useful when backing up a file before making modifications...