Coherent Ramblings

2008/07/07

Getting python-ldap installed on OS X

Filed under: Python, Quick Tips — Tags: , , — plathrop @ 4:13 pm

If you want to use Fink, and build a bunch of crap you don’t need, follow these instructions.

If you are like me and prefer to use the libraries that are already installed, just do this:

  1. If you haven’t already, install XCode.
  2. Download python-ldap
  3. and extract it.

  4. Edit setup.cfg. The relevant lines are below:
    library_dirs = /Developer/SDKs/MacOSX10.5.sdk/usr/lib/
    include_dirs = /Developer/SDKs/MacOSX10.5.sdk/usr/include/ /Developer/SDKs/MacOSX10.5.sdk/usr/include/sasl
  5. sudo python setup.py install
  6. That’s all!

2008/03/24

SSH tab completion

Filed under: Quick Tips, Tools — Tags: — plathrop @ 9:57 am

This is awesome. Put the following into your ~/.bash_profile file:

complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' \
| sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh

Open a new shell and type ssh tab tab. I love tab completion, don’t you?

2008/03/17

FreeBSD Update

Filed under: Quick Tips — Tags: — plathrop @ 10:32 am

I just followed these instructions to update my server from FreeBSD 6.2-RELEASE to FreeBSD 7.0-RELEASE.

Aside from taking almost a day, it went flawlessly. I’m extremely impressed!

2008/03/12

Bash History

Filed under: Meta, Quick Tips — Tags: — plathrop @ 10:35 am

Here are a couple of tips for more effective use of your Bash command history. I think the Ctrl-R trick will save me a lot of typing.

I have some articles planned, but have been busy starting my new job. Those few of you who actually read this, don’t worry – I’ll be back.

2008/02/23

Useful SSH-isms

Filed under: Quick Tips — Tags: — plathrop @ 2:53 pm

Two useful SSH-isms

2008/02/14

Simple SSH speed-up

Filed under: Quick Tips — Tags: — plathrop @ 4:00 pm

I just discovered something that is very simple but saves a significant amount of time. Specifically, the SSH ControlMaster feature, which allows you to re-use an existing SSH connection whenever you connect to a host you are already connected to.

In your ~/.ssh/config file, add:

Host *
        ControlMaster auto
        ControlPath /tmp/%r@%h:%p

Whenever you connect to server.example.com as user joeuser, SSH will create a named pipe at /tmp/joeuser@server.example.com:22. If you open another connection to the same server (as the same user), instead of creating a new TCP/IP connection, SSH will automatically multiplex the new session with the existing connection (through the named pipe)! This reduces time spent setting up new connections. Although this usual only saves a couple of seconds per connection, I’m constantly opening several simultaneous sessions; this will definitely add up to a significant savings over the long term!

Powered by WordPress