I spent about 1 hours to rebuild the resPyre website. Now it’s an old fashion plain html (despite it use ZPT and reST to buld them.
Mail Archives / mdirarchive.py
Since i totally switched my mail system to imap, i’m looking for a way to keep the folders ‘small as possible’. I talked w/ Phil about this, and he (http://base-art.net/wk/Article/3.html) hacked a existing python script. The main difference between his hack and the orginal one, is that now the folder are archived in a ‘normal’ way.
This should only work w/ courier-imap server but this is the one i use :) . I can now read mailing archive without too much pain !
Python Wing Editor
http://wingide.com is a really kool IDE for python. I usually write code w/ emacs but i tested this ..
More comments to come .
Webware at the Washing Machine Service
Webware is one of my favorite webapp. Simply because i understand how it works. There is no magic in.. just a standard Servlet way of think.
But on the other side, i really think some part of webware should be left out. Look at the standard webware packages:
- CGIWrapper
- WebKit
- WebUtils
- MiscUtils
- COMKit
- MiddleKit
- PSP
- TaskKit
- UserKit
Only CGIWrapper / WebKit / WebUtils are used in Webware core. (+ TaskKit) All other stuff are not webware centric, even if they are usually working only by webware developpers:
- COMKit is win32 COM object related (nothing to do w/ webware core)
- MiddleKit is a DB abstraction layer
- PSP is a template language
- UserKit is a user framework ..( someone ever used it ???)
I really think we should provide only a simple package w/ webware core, and find a way to install third parties code as ‘Products’. This is definitly the main feature of Zope.
The recent post of Ian on the webware-discuss mailing list show that we shall write webware component like Wiki .. or AuthModule .. and provide them to the community.
I worked on Zope for about 2 years.. and right now when i want to build a simple website for the lab. Webware never come to my mind simply because it enforce me to rewrite the wheel for everything. In common web project we need some core components like auth, or photo gallery .. things that are really simple and provided w/ simple Zope Products. but for webware we only provide some _unusefull_ / _unmaintained_ Kit.
This is not a contestation post! but a open letter to the webware community.
The current webware package try to enforce developper to use some tools (like PSP / MiddleKit) but this is the wrong way. I never used PSP (i hate this syntax).. and MiddleKit has serious competitor, right now. I usually use SQLObject and ZPTPage. But there is no place on the web where a newbie can find that you can write ZPT in webware .. Webware really need a clean way to build Products and a website that present all this stuff to users.
Borg with MetaClass ?
Singleton is one of the well known design pattern.
In python, most of us use the Borg Singleton like, which is not a true Singleton, since only the ‘state is shared’. In fact, you use distinct objects but they share the same __dict__.
Yesterday, i played a bit w/ python metaclass. Beside this can be really usefull under certain condition, i discover that you can build a Borg with that too :)
class Single_imp: def __init__(cls,name,base,dict): cls.value = 1 def __call__(cls): return cls def setValue(cls,value): cls.value = value class Single: __metaclass__ = Single_imp a = Single() b = Single() print a print b a.setValue(10) print b.value
and the result:
<__main__.Single_imp instance at 0x401eb96c> <__main__.Single_imp instance at 0x401eb96c> 10
Ok .. the code looks strange.. and not a true Singleton .. but how can i build a real true in Python ?
Linux APM (Suspend to disc) on a Dell Inspiron / Latitude
This is a quick introduction to the Linux suspend to disc on Dell Inspiron / Latitude. This tips should work on Inspiron 3800 to 8200, and Latitude C serie. (all phoenix bios shipped w/ a Dell computer in fact)
There is two kind of suspend in APM:
- suspend to disc
- suspend to RAM
Suspend to RAM:
This is the easier thing to do: simply build your kernel w/ APM enable (as module or not). There is no other required option. To test: press Fn + Ecape
Suspend to disc:
- This part is little more tricky.
- First download http://support.dell.com/filelib/format.aspx?releaseid=r22768 > (Suspend to Disk Util for Dell)
- This is a .exe ok .. but just unzip it (yes it’s a self-extractable zip file)
- Take a empty floppy, run ./setup.sh
- This will make a dos boot disk w/ all required tools on
- So it’s time to reboot on this floppy
- Here you will get a dos prompt
- Run mk2sd.exe (this will make a special hibernation partition)
- Important Note : This partition must be in the first cylinders of the hard drive. DOS has old restrictions about the partition size .. (I used partimage and parted to find the right place for this)
- So that’s all
- reboot Linux and press FN+A (Q on azerty keyboard) to test :)
– Enjoy hibernation …
What ‘s wrong w/ Linux-Laptop ?
I take a long time to write a article on the howto install a debian on a Dell Latitude D400 laptop. I submitted to www.linux-on-laptops.com/ a couple of weeks ago..
And no answer, not added yet .. i chat w/ another guy last week, and he has the same trouble.. but this is far more old than my post.
So what’s wrong .. should i need sexy links or ads on the page to be linked ?
Bye Bye
Video Card Hack
I run into trouble with my GeForce Ti 4000 (a Creative one). After doing a lot of noise, the ventillator decide to stop.
So i decided to hack it:

Netgear WG311 on Linux
Well, somebody ask me if i will try yet another wifi card. So the answer is yes :). Today i will look at the Netgear WG311.
I decided to sell this fucking Linksys WMP54G because, i’m sick of ndiswrapping, and because my Netgear WG511 works very well. So i decided to buy another netgear. "Et la c’est le drame" :) In fact the WG311 works w/ the prism54 driver since it use a Atheros chipset, despite a lot of users report it as a supported card w/ prism54. This is a fake !!! WG311 use Madwifi driver. Despite i’m really fond of prism durette / GT card, Atheros isn’t a bad choice too.
Installation:
First you need to use the current CVS version (don’t try the latest snapshot since the cvs support more things.) I decided to patch install this on a 2.6.4 kernel (support for 2.4.23 isn’t working for me). So simply build the module. And modprobe it .
You should get something like this:
ath0: mac 5.6 phy 4.1 5ghz radio 1.7 2ghz radio 2.3 ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps ath0: 802.11 address: 00:09:5b:98:0d:85 ath0: Atheros 5212: mem=0xcffb0000, irq=11
Next:
The ad-hoc mode is a bit buggy right now (but it should be fixed soon..) i read the mailing list and issue seems to be on the way. So I decided to
use as an AP (madwifi support the master mode). There isn’t any hostap like on 54g card but a good old fashion bridge can do the stuff.
echo -n "Creating bridge" brctl addbr br0 brctl addif br0 ath0 brctl addif br0 eth0 echo "Done" echo -n "Configuring interfaces" ifconfig eth0 0.0.0.0 ifconfig ath0 0.0.0.0 ifconfig br0 192.168.1.20 route add default gw 192.168.1.1 echo -n "Done"
Test:
First pings take a long time, since the bridge use the cards in promiscous mode, and brigde packet that are usefull, so building the ARP table can be a bit slow.. but it’s works perfectly ..
Important notes:
- Don’t try to build bridges w/ ndiswrapper since i won’t work.. due to the hack of promisc i think
- The prism54 seems to have trouble the Managed mode, it ask for a dissociation when you try to make it work w/ an hostap or a bridge like me . I use a old cisco (11mb) right now on my new Netgear AP :)
Time for stats: One python coder is a spammer too !
So after 102 posts on this blog: it’s time to look at the stats.
Numbers:
- 2/3 days off downtime
- 102 posts
- 153 comments
- 65 comments in the ‘I want SPAM’ post
- 1500 hits per day
- +200 hits per month since the start
- 35% of hits are RSS feed reader
- main traffic come from google
- main keywords are wifi oriented (perhaps because I use to try strange wifi drivers)
- i have been ‘Python DailyEd’ 3 times !! (and believe me, it drives a lot of traffic)
- I have been massively spammed 2 times (same day i was in the Daily Py)
- I’m only in one blogroll (Ian’s one.. and i’m very proud of)
- I give up french post since nobody read them (except my Finix friends)
- most of the posts are python or web oriented (despite i haven’t found a google keyword that match :)
So, to conclude:
- Many users reading this blog want spam and get trouble w/ wifi cards
- Many python coders read the Daily Py :)
- One python coder is a spammer too / perhaps Guido should remove email.py ?
- I need to add a true blogroll here (even if i only put Ian in:)
– Many thanks readers / and writers ( except you.. the spammer)