Static Site Generation

Posted by matt
on Tuesday, February 10

There seems to have been a recent glut in static site generators. It looks like you can pick your templating language, and find a generator to go with it. Recently, I discovered hyde via the github blog, and decided it was worth trying out on a project I’m working on. That project is zshbits, a tutorial/screencast site for ZSH. I’ll be unveiling some zshbits content soon (for now I’m waiting for a cold to let up, so I don’t sound quite so nasal, and a new microphone) and readers here will be the first to know.

Recent versions of hyde, which is a fork of any-cms, have support for typogrify, a must for pretty posts, a sitemap generator, and other goodness. If, like me, you’re looking for something lightweight, which supports markdown, it’s probably worth taking a look. It’s probably also a good way of learning about django templates.

My MacHeist Release Estimate

Posted by matt
on Friday, February 06

Like a lot of mac users, I get excited about MacHeist, and why not, it’s fun and a good bargain.

Since we’re snowed out of work, and a MacHeist Bundle release seems imminent, I decided to hack up a quick script to find out how wide the progress bar thing is, and use that to estimate the release time. Here’s what I’ve been up to for the last half hour or so:

MacHeist: Mainframe
Uploaded with plasq’s Skitch!

I used BeautifulSoup with urllib2 and a tiny regular expression, and here’s the result:

I’m running it in a simple shell loop:

  while true; do sleep 60; python heist_parse.py >> heist_countdown; done

Which is collecting the width every minute (that doesn’t seem too often).

Now that I’ve had this loop running for a while I’ve got 34 data points, so I can do a bit of simple linear regression, with scipy. Here’s a graph:

macheist_release_estimate
Uploaded with plasq’s Skitch!

And here’s the code used to do the regression, and generate the plot.

It’s important to remember that this is based on the assumption that the bar is full up at 500 pixels wide. This may or may not be reasonable.

If it is though, I’d tentatively estimate that the bundle will be release at 3AM (GMT) on the 7th Feb 2009. You read it here first!

Update: Well, it looks like they cheated! Here’s a graph of the bar’s length with time:

Rounded up!
Uploaded with plasq’s Skitch!

As you can probably see, it was rounded up. Ahh well. So much for the estimate!

Paramiko: Scripting SSH with Python

Posted by matt
on Friday, February 06

Python Scriptable SSH

For a simple way of remotely administering machines, over SSH, with Python, have a look at paramiko. You can grab it using easy_install, which can itself be grabbed from PyPi, and installed using sudo sh easy_install_filename.egg.

Here’s a simple script I rustled up, based on the tutorial. It fires up mediatomb, on my server microwave:

If you don’t like using password-less sudo, don’t worry, it can cope with that too. That’s what the second half of the gist above does.

So, if you use SSH for any kind of repetitive system administration, give the article a read, and give paramiko a try.

TextMate Command: Add comments to end of line

Posted by matt
on Sunday, December 14

After reading this message on the textmate-users mailing list, I decided to have a go at writing a command to add comment chars to the ends of lines. Here’s what I ended up with:

To use it, create a command in TextMate’s bundle editor, then make a new command, and set the input and output dropdowns to look like this:

end-of-line-comments
Uploaded with plasq’s Skitch!

Finally, set up scope selections (e.g. source.python, source.shell, …), and a key binding if you want one.

IPython TextMate Bundle: Future Directions

Posted by matt
on Tuesday, December 09

IPython Server

Now that the IPython TextMate bundle has been around for a little while, and has struck a chord with the TextMate wielding, IPython hacking community, I decided that now might be a good time to sum up a few of my ideas for the future.

I’ve really been heartened by the response and enthusiasm of the IPython community, and of particular note is the work by Brain Granger. Brian is currently working on a Twisted based editor server for TextMate (and other editors too), with a block based protocol for robust communications. You can find some initial work in Launchpad, and grab it using bazaar using:

lp:~ellisonbg/ipython/textmate-server

Just be aware that this branch/link might not be around for long.

My top priority for the bundle with regards to this is the creation of a client library, probably also based on Twisted. It would be great to have this core library included in IPython, so it can be called on by other editors.

Core Bundle Content

I think that the core of the bundle is fairly coherent (at least for me!), with the most useful commands appearing at the top of the list. I ideally though, all communications with IPython should be done through the server, so the debugging commands need work in that respect.

My top priority for this area is the implementation of a more user-friendly preferences / config. method. Here’s my initial stab at creating a nib. I now need to work out how best to hook it up with tm_dialog, to store the preferences. Hopefully recent changes to dialogs in TM will make this easier.

IPython Preferences
Uploaded with plasq’s Skitch!

Snippets / Scipy

A lot of IPython users, myself included, are using IPython for scientific computing and number crunching. For that reason, decent support for scientific python libraries is essential.

Thanks to Ben Racine, we’ve got some decent snippets for scipy/numpy/pylab, and we’re adding more fairly regularly. Feel free to send me your ideas, and I’ll be sure to implement them if I can.

Documentation and Demos

The bundle documentation is fairly complete, and since it’s combined with the README, it’s fairly easy to maintain. This is a good thing.

Demo-wise, so far there’s only the first screencast I made. I’m extremely surprised to see it has over 200 views, so I’m planning on making more short and sweet screencasts, which we can hopefully integrate with the bundle’s help.

You Contributions

Are very, very welcome. Please join the [google group](http://groups.google.com/group/ipython-tmbundle/ “ipython-tmbundle | Google Groups”), or if you’re a gihubber, you can fork the bundle, make your own changes and send me a pull request. Only with help can we make this bundle all it can be.