Archive for the 'Python' Category

Hacking your window manager with Python

I was looking for a way to hack my window manager in Python. I want to use special piece of code to handle the window placement, or display stuffs in the background..
It looks like pyxfce meet my needs, so I decided to give it a try. The first thing to do is to build the [...]

admin June 27th, 2005

Send hand-crafted Ethernet Frames in Python (ARP for example)

Tonight I decided to send ARP flood over the wireless link to find who is using it. This is a strange thing .. ok but it works pretty fine and quickly ..
First step is to build the custom packet.. I tested several suffs and i decided to keep the dpkt package. It support a large [...]

admin June 7th, 2005

Extract GPS from Kismet log with ElementTree

I have read a lot of noise about ElementTree but never really used it. Tonight i need to extract a bunch of GPS data from a kismet log file. Let’s give it a try
from elementtree import ElementTree

data = open(’Kismet-May-22-2005-4.xml’,'r’).read()

detection = ElementTree.XML(data)

for node in detection.getchildren():
try:
print “SSID: ” + node.find(’SSID’).text,
except AttributeError:pass #hidden SSID
print “BSSID: ” + [...]

admin May 23rd, 2005

Small is beautifull: CherryPy

Today, I decided to write a new webapp (this will be out soon). I have been off since a while in the webapp developpement, so it’s a bit hard to start this new project.
I decided to look on recent Quixote’s developpement on Alinea. I first used the same components.. after 2 hours.. nothing works :

issues [...]

admin May 1st, 2005

Glade-2 to .py

In a past life, I spent a lot of time with gtk-1 and glade (for a commercial app). After this experience, I tested several approach:

PyQT (using QTDesigner)
wxPython (w/ wxGlade)
Glade 2 + libglade

Here is my personnal feeling:

PyQT, is really great. But I really don’t like the licence. And since I work in a school, using this [...]

admin January 13th, 2005

Keyboard shortcut with Python-Xlib

I use this little script on another computer for a while. Meanly to remote drive my xmms throught the xmms python module. Anyway I just write this little intro here, perhaps other people may be interested..
This litte script use Xlib python module to grab keys. If the key is special key on my laptop, i [...]

admin December 16th, 2004

Python on a WRT54GS ?

Ok, I ‘ve been off for a little time right now. The main reason, is that I spend some time hacking my new Wireless access point: WRT54GS.
I spend a lot of time tweaking the config to use this in client mode with dhcp thought the WAN port and other nuts. I spend some time on [...]

admin December 1st, 2004

The secret behind memory allocation in Python

I’ve been looking for this for a while !! Why this f***ing Python process eat so much memory ? I freed all the objects, and don’t have any circular references ..
Every advanced Python programmer need to read this carefully.
On the other side, i’m looking for a good shared memory module for Py ? Do you [...]

admin November 5th, 2004

Packet filtering w/ Python and Linux

While looking for a fun way to filter my WIFI traffic, I decided to look at userland firewall API in Python. I found: ipqueue.
I haven’t really wrote a full featured app with it, but here the first things to make it work.
# load the kernel queue module
modprobe ip_queue
# all outgoing ping will pass throught the [...]

admin November 1st, 2004

Python ALSA-SIG ? :)

Is it the time for a python alsa SIG ? Phil seems to think about it, why not. I guess it’s time to read the pyrex howto for me:))

admin October 27th, 2004