Friday, April 29, 2011

Screenshot software: Greenshot

If you have been spoilt by SnagIT (made by Techsmith) which is probably one of the best screenshot tool out there and are now looking for a free alternative, you may find Greenshot to be a pretty good replacement. Greenshot lets you edit, add additional text, pointers on top of the snagged images.

How to run command on one windows PC from another

If you don't know about it yet, psexec is a nice utility which allows you to run a windows command on one PC from another. Here is an example:
psexec \\remote-machine C:\RunBatchFile.bat

Run a Unix command remotely from Windows


After helping a customer numerous times by diagnosing a failed cron job, I was looked up how to call the job from Windows. This turned out to be interesting given it was a command which could only be run from sudo. Here are the details:

  1. First you need a program called plink which is part of the putty distribution. You can download putty from  http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe
  2. Create a text file with your commands somewhere on the PC. For example:
    1. /usr/bin/sudo su -
  3. Either set up your path environment variable on Windows or simply go the putty install folder (e.g C:\Program Files\Putty).
  4. plink -t zz000412@PRODDOCS-VORA -m
psexec is another command to run from windows to call a script on another windows box.

Mediawiki + Bugzilla + SVN + SCMBug + Tweaks = Software Manager's recipe

It was fun trying to integrate SVN, Bugzilla and Mediawiki using SCMBug and BugzillaReports. The integrated system is really an efficiency booster and considering how easy it was to set up the value/effort ratio was well worth it. I am listing the steps needed to set this system up on Windows here which makes things very interesting sometimes. Linux install is similar and simpler.
  1. The first step was installing Apache, PHP and Active Perl on Windows. This is straightforward and well documented.
  2. Install MySQL
  3. Install Bugzilla. This is straightforward as well. Bugzilla uses Perl.
  4. Install Mediawiki.
    1. Turn off caching in Mediawiki. With caching on, you get stale data on bugs which can lead you to make wrong decisions.
  5. Install the Mediawiki - BugzillaReports Addon. This gives the ability to write short scripts in mediawiki which query bugzilla and present data on a web page as a reports. This itself takes you from zero to fifty.
  6. Set up backup scripts for MySQL.
  7. Install SVN
    1. Collabnet worked out pretty well.
    2. Set up Backup scripts for SVN
  8. Create custom fields in Bugzilla for recording code change list
  9. Install SCMBug
  10. Customize code in SCMBug. This will help:
    1. Format the regular expression for parsing out the bug ID from the comments.
    2. Change code to post changes to custom field instead of comments. SCMBug by default posts changes to Bugzilla comments which can be very annoying to users.

Tuesday, June 29, 2010

NX client and server for RHEL

After having used numerous ssh sessions open from your windows PC to linux, you are going to appreciate the NX client and server. They are extremely fast and easy to set up. I followed the instructions on http://www.penlug.org/twiki/bin/view/Main/FreeNX for my RHEL 5 distributions.


Here are the quick steps. I am planning to set this up on all my boxes:


  1. Make sure what the release of RHEL or any other flavor of linux you are running is by typing the following command: cat /etc/*-release
  2. Get into a temporary folder where you can download all the binaries (e.g /tmp)
  3. Go to the Centos site to find the binaries for freenx, nx and expect which will work for you. After a bit of checking I found that CentOS release numbers are matched up with their RHEL counterparts, so I downloaded the packages for the CentOS 5.X releases:
    • wget http://mirror.centos.org/centos/5/extras/i386/RPMS/freenx-0.7.3-4.el5.centos.i386.rpm
    • wget whttp://mirror.centos.org/centos/5/extras/i386/RPMS/nx-3.4.0-4.el5.centos.i386.rpm
  4. Now install these rpms as follows:
    • rpm -Uvh nx-3.4.0-4.el5.centos.i386.rpm
    • rpm -Uvh freenx-0.7.3-4.el5.centos.i386.rpm
  5. This may tell you that you need expect. So download and install it as well
    • wget http://mirror.centos.org/centos/5/os/i386/CentOS/expect-5.43.0-5.1.i386.rpm
    • rpm -Uvh expect-5.43.0-5.1.i386.rpm
You are now done with the server side. Now download the client from http://www.nomachine.com/download.php. The client requires some set up. You can pick any name for the session. If it fails to connect to the server, you need to check if you disabled encryption - it may be trying to connect to ports which are not open on your linux box. So enable encryption. Also root account works in case you have that question! Also you must remember to copy paste the client key from the server as the link above notes in the client. The windows client comes coded with some default key which doesnt work.


Note: The client key is located on the server at:
/var/lib/nxserver/home/.ssh/client.id_dsa.key
and I found most of the other dependencies for RHEL 5 here (for some reason my yum update wouldnt work): 
http://mirror.centos.org/centos/5/os/i386/CentOS/
Ciao and enjoy!