[python-nl] My presentation last night at the PUN

Remco Wendt remco.wendt at gmail.com
Mon Oct 24 16:38:21 CEST 2011


Hey all,

Hereby also some short notes accompanying my mini presentation during the PUN. I presented two small python utilities that make my live easier on the command line:

- vcprompt which is a small python script that allows you to show VCS information in your prompt if the current directory is managed by a VCS system. You can see an example of my use of vcprompt here: http://cl.ly/2d3N1E0o3X3h2U1T0F07. Vcprompt can be downloaded from github: https://github.com/djl/vcprompt

- dotfiles, a small python utility that can automatically symlink files in a so called repo (like .dotfiles) into your home directory. See: http://pypi.python.org/pypi/dotfiles. Basically I use this to quickly install or update remote environments so that wherever I log in I always have the same shell environment (I do this by syncing dot files on login once every hour through git/github).

Also if you want to take a look at my dotfiles, see: https://github.com/shanx/dotfiles. Far from complete but maybe nice to look at, more people should share their dotfiles :)

Muxing or connection sharing in SSH like a presented can be done by using the following lines in your .ssh/config file:

# Use ssh connection sharing (muxing)                                                                                                                                                                                                         
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r

# Keep connections open for one hour
ControlPersist 1h

This makes logging into a remote server multiple times very fast, since one connection is used. Also this connection is kept open when the last ssh client disconnects, so you can quickly reconnect afterwards. Two caveats though:
- Sometimes this can have unexpected behavior. Keep in mind that some state remains even after disconnecting. Updating my shell setting in /etc/passwd to bash instead of sh kept me logging into a sh session. This was because there was still an open connection.
- Jan Jaap explained also that he had some troubles with VPN connections using this trick.

I really enjoyed the last PUN! Thanks JJ and THA/Minddistrict.

Remco
--
Maykin Media
Herengracht 416, 1017 BZ Amsterdam
tel.: +31 (0)20 753 05 23
mob.: +31 (0)6 187 967 06
http://www.maykinmedia.nl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-nl/attachments/20111024/629b3459/attachment.html>


More information about the Python-nl mailing list