Linux top for network

February 27, 2009

If you want to see how much bandwidth is being used per connection from your box, try iftop: http://www.ex-parrot.com/~pdw/iftop/ Here is a screenshot on from their site:

0

A stoppable DOCXMLRPCServer class for Python

February 27, 2009

If you are using the built-in XMLRPCServer or DOCXMLRPCServer in Python on Windows, you may have noticed that you cannot stop the server with a CTRL-C. You have to kill the window! The code below is a derived DOCXMLRPCServer class that works in conjunction with the included ServerWrapper class. The ServerWrapper spins the RPC server [...]

0

An Python object CLI interactor

February 27, 2009

The code below will provide a “cli” for a class instance… For example, if you have a class Car which has a method setDoors(someValue) and an attribute doors which is initialized to 0. When using interactor code saved as interactor.py: import interactor i = interactor.Interact(Car()) > doors 0 > setDoors 5 > doors 5 > [...]

0

Getting modeline in vim to work in Fedora / Ubuntu

February 5, 2009

Parsing the modeline by vim in your files is off by default in most linux distros. In order to enable it, you have to add set modeline to the vimrc file. For more context, see: http://www.nabble.com/modeline-off-by-default–td18550230.html.

0

Monitoring progress of data through a unix pipe

February 5, 2009

Check this utility out: http://www.ivarch.com/programs/pv.shtml Sample usage: # pv /var/log/messages | gzip > messages.gz                        574kB 0:00:00 [9.37MB/s] [=================================>] 100% Blurb From the site: pv – Pipe Viewer – is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a [...]

0

A windows equivalent for commands.getstatusoutput

February 5, 2009

In python, I often use commands.getstatusoutput in unix, however it doesn’t work in windows… here is a function that provides equivalent capability: def commands_getstatusoutput(cmd): from subprocess import Popen, PIPE, STDOUT p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT) output, unused = p.communicate() status = p.returncode return status, output Credit: http://groups.google.com/group/comp.lang.python/browse_thread/thread/f0ff3ca6b89041b3/256b5052fadb0d80?lnk=raot

0

extssh support in WinCVS / CVSNT

February 5, 2009

If you use eclipse and WinCVS / CVSNT, you may have noticed that you cannot perform CVS operations using WinCVS / CVSNT on files checked out from CVS by eclipse. One way around this is to copy the ssh.dll in C:\PROGRA~1\CVSNT\protocols to extssh.dll. This works because CVSNT (which is also used by WinCVS) works by [...]

0