Saturday, September 27, 2008

Func: Python Systems Management

Func: Fedora Unified Network Controller looks pretty interesting.


A lot of programs, systems, and tools need some way to communicate. Func provides a two-way authenticated system for generically doing these sort of things. You can build your own applications on top of it, and easily expand func by adding in additional modules, whether you want these to work through the func command line or by means of some other application. If you just want to use the func command line, that's great. If you want to build apps on the func tools, that's great too. If this sounds generically vague, it's only because it really is that expandable.


With some examples


# func target.example.org call hardware info
# func "*.example.org" call yumcmd update
# func "*" call moduleyouwrote functionname 1234 5678 firetruck acmelabs hike!

Sunday, September 21, 2008

Converting Subnet to CIDR in Python

A nice recipe, here is the meat of an even faster version in the comments.

def calcDottedNetmask(mask):
bits = 0xffffffff ^ (1 << 32 - mask) - 1
return inet_ntoa(pack('>I', bits))


Which also led me to the Python netaddr project. Very cool!

Rundown on Django 1.0 Upgrade Problems (and Solutions)

I've been too swamped with my teaching lately to make much progress on a little app I initially wrote in 0.96.2 and have been trying to port to 1.0.

Besides some bonehead typos that wasted a lot of time, here are the summary of issues I've run across:
  1. Creation of the new admin.py
  2. Modifications of urls.py
  3. Conversion between max_length and maxlength in your modles
I still don't have my admin interfaces working even though I've followed the exact steps, so I'm sure it is something else.

The main problems related to the admin interface, but there are a number of resources I've run across including Porting your apps from Django 0.96 to 1.0 and the complete list of backward incompatible changes and a conversion script to create the new admin interface conversion.

Monday, September 1, 2008

And how easy is Django CSV?

I'm a few hours (and of course I already have a functional app) into converting a spreadsheet "database" we currently store on Sharepoint with a Django app and I was pleased to see how easy it was to do CSV dumps of data. And it worked on the first time. Amazing.