Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Tuesday, April 22, 2008

Automating interective application on UNIX

I was trying to write a shell script which would scp my files to another computer and execute some commands on that machine. My first thought was I won't be able to do this in shell script until I discovered expect. There is another tool called empty, which looked little better at first look, but I haven't tried it.

Command Line XML tool

I was looking for a tool to parse and query XML document from command line in UNIX environment. I needed this to be used in a shell script where I had to parse a XML file generated by another Application. I found XmlStarlet, after some googling, the tool is very useful to be used inside shell script as well as from command-line. Here is a good getting Started tutorial.

Thursday, January 24, 2008

Accessing remote Linux UI from windows

Sometime you need to access UI of the remote *nix platform from windows machine, I need this quite often for testing my standalone Java swing application.

  1. Download Xming and install.
  2. Open ${xming_home}/X0.hosts file, add the IP of your linux box, this works like xhost config on *nix.
  3. Restart Xming from system tray.
  4. set the DISPLAY to your PC, e.g. for bash shell use cmd: export DISPLAY=${my_pc_ip}:0.0
  5. run your GUI command on the shell