iss's blog

t

Reusing Persistent SSH Connections for Performance Reasons

Blog categories: 

Some weeks ago I had to run a simulation for my research which has been very elaborate and involved externally invoked scripts on remote machines (so-called Wuchtbrummen). These external calls were dispatched by a central main script, that was running on my local PC. To avoid a complete SSH session setup and teardown every time a new call should be invoked on a Wuchtbrumme, I wanted to have a persistent SSH connection, where all subsequent commands can be tunneled through.

Eclipse with PyDev under OS X Lion

Blog categories: 

Yesterday I wanted to start using the Eclipse extension PyDev, because I was tired of using the pdb module. Even more sophisticated debugging modules like pudb did not satisfy my need for intuitive and comfortable python debugging. Even though I heard of the PyDev extension quite a while ago, I never gave it a try, as I was reluctant using the Eclipse Framework for Python.

Site Clean-Up

Blog categories: 

You might have noticed, I made this site a bit cleaner and added the possibility for you to support nesono.com a bit by flattr. The search field is now in the header and the right sidebar is completely gone. Just in case you’ve been searching for it… ;)

Cheers, iss

rm2trash for OS X update

I recently updated the shell add-on for OS X, that overloads rm to not remove the items, but move them into trash instead. Before the update, a for loop moved every single item given in the command line into trash using one osascript (Apple Script) call per item. This caused a blocking shell with one ‘flupp’ sound effect for each moved item, which can be quite tedious, when removing many items, even if they are small. Now, after the update, a item list is created and filled with all given items to remove and in the end passed to one osascript call.

Add SSH Public Key With One Command

As I always forget the exact syntax and am too chicken-hearted to fool around, I note down the command to add one’s public key to the authorized keys on the remote machine (to login using pub/private key pair only) here. Use the following command (id_rsa.pub might be id_dsa.pub on your site).

cat ~/.ssh/id_rsa.pub | ssh user@site.com "cat - >> ~/.ssh/authorized_keys"

That’s it,
iss

Python minidom parse xml.gz File

Blog categories: 

To parse a gzipped xml file using the minidom parser in Python, one has two options: Either hand over the file object pointing to the xml file or hand over the full content as a string. As I thought it would be the more powerful variant in terms of efficiency, I chose to use the file object, given by gzip.open(). This works for the SAX parser, but fails for the minidom parser somehow. This is for sure a bug, but it persists over many versions and many operating systems (tried Linux and Mac).

Insert Output from Command Line in Vim

Blog categories: 

I just figured out once more, that vim works as expected. If you need to insert the output (e. g., stdout) from a command into the open buffer, e. g. to insert a certain type of files into something like .gitignore, svn::ignore, .cvsignore, you can simply type

:r !ls *.aux

In command mode and the text will be inserted at the cursor position.

Cheers, iss

OS X Lion Tedious Installation

Blog categories: 

Even though the title seems to exaggerate slightly, I need to say, that the 33 minutes OS X Lion claims to need for installation - and it does not correct itself by measuring the time - can never be reached with hard drives, at least not for an upgrade. For my first installation, I was waiting for 75 minutes and the second installation tells me that 28 minutes are left (after 40 ‘real’ minutes).

Remove Old Snow Leopard Shortcut For Spaces - Cmd-Middle Button

Blog categories: 

It’s a bit tricky, but today I fixed a small problem of an obsolete shortcut in OS X Lion. I used to have Cmd-Right on Exposé and Cmd-Middle on Spaces, to have both functions short at hand. After I upgraded to Lion from Snow Leopard, Spaces and Exposé are merged into Mission Control, which was a wise decision, but my mouse shortcuts were migrated BOTH to Mission Control.

Pages

B