Skip to main content

Posts

Showing posts from March, 2008

Awesome Linux Utilities for five hundred, Alex!

I just discovered 'rename' today after briefly considering writing it myself. Here's the gist of it: rename [ -v ] [ -n ] [ -f ] perlexpr [ files ] So, for example: rename 's/(.*?), (\w+)/$2 $1/' *.avi Changes a bunch of videos from "World Is Not Enough, The.avi" to "The World Is Not Enough.avi" Hooray!
Read more

Moving the Xbox Overseas

I was going to title this " not my balls ," but I decided other people may find this interesting so I gave it a more descriptive (but equally accurate) title. When I brought my Xbox from the USA to Germany, I had a little trouble connecting to Xbox Live. It was an easy fix though. I changed my locale to Germany and then recovered my Xbox Live account. Now it works just fine.
Read more

Tomato

I just finished setting up Tomato on my new WRT54GL. Tomato is a small, lean and simple replacement firmware for Linksys' WRT54G/GL/GS , Buffalo WHR-G54S/WHR-HP-G54 and other Broadcom-based routers. So far, it's pretty awesome. There were a few pleasant surprises: My settings (PPPoE, WLAN, etc.) from the original Linksys firmware were preserved. There's a lot of presets for QoS Layer 7 and IPP2P classifications including Xbox Live, Waste, BitTorrent, etc. Most of the charts use JavaScript to provide a streaming display. One of the coolest displays is the list of wireless clients which includes their link quality. Installation was simple. You install Tomato just like you would a normal firmware upgrade.
Read more

How to Check if a Child Process is Still Running in Python

The solution to this I found online was: import os, errno def PidIsAlive(pid): try: os.kill(pid, 0) return True except OSError, e: return e.errno == errno.EPERM However, it fails if the process is a zombie. This is a much better solution if the process is a child: import os, errno def PidIsAlive(pid): try: return os.waitpid(pid, os.WNOHANG) == (0, 0) except OSError, e: if e.errno != errno.ECHILD: raise Granted, this is exposed through subprocess.Popen.poll(). However, poll() doesn't allow you to check on child processes of the Popen object.
Read more