<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8054689530244757700</id><updated>2011-11-28T01:44:04.812+01:00</updated><category term='ruby'/><category term='asterisk'/><category term='ez_install'/><category term='setuptools'/><category term='python'/><category term='twisted'/><category term='web'/><category term='pje'/><category term='wsgi'/><category term='security'/><category term='debian'/><category term='dsa'/><category term='network'/><category term='language'/><category term='framework'/><category term='pypy'/><category term='rant'/><category term='cleverharold'/><category term='svn'/><category term='pylons'/><title type='text'>Snake says Ni!</title><subtitle type='html'>Lior Gradstein's blog about Computer languages, Python and its finest modules.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-4074776316399391883</id><published>2007-05-14T12:32:00.000+02:00</published><updated>2007-05-14T12:45:22.428+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asterisk'/><title type='text'>Change in syntax and functionnality in Asterisk AstDB functions</title><content type='html'>Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged "simpler" one named Set (except for DbDel which seems to still exist). There was a functionnality that when a key was not found in AstDB, a jump would be done to n+101. So the following would be OK:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;exten = s,1,Set(forward_number=${DB(FORWARD/1234)})&lt;br /&gt;exten = s,2,Background(one_local/forward/forward_number_is)&lt;br /&gt;exten = s,3,sayalpha(${forward_number})&lt;br /&gt;exten = s,4,Goto(s-report_mode,1)&lt;br /&gt;exten = s,102,NoOp(Pas de valeur ce qui est normal)&lt;br /&gt;exten = s,103,Goto(s-not_set,1)&lt;/blockquote&gt;But with my newly installed Asterisk 1.4.4, it doesn't jump anymore. It continues to s,2 :-(.&lt;br /&gt;So I guess I need to add a &lt;a href="http://www.voip-info.org/wiki/view/Asterisk+func+db_exists"&gt;supplementary line&lt;/a&gt; to explicitely test the presence of the key:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;exten = s,1,GotoIf(${DB_EXISTS(FORWARD/${F_EXT})}?:102)&lt;br /&gt;exten = s,2,Set(forward_number=${DB_RESULT})&lt;br /&gt;exten = s,3,Background(one_local/forward/forward_number_is)&lt;br /&gt;exten = s,4,sayalpha(${forward_number})&lt;br /&gt;...&lt;br /&gt;exten = s,102,NoOp(Pas de valeur ce qui est normal)&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-4074776316399391883?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/4074776316399391883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=4074776316399391883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/4074776316399391883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/4074776316399391883'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/05/change-in-syntax-and-functionnality-in.html' title='Change in syntax and functionnality in Asterisk AstDB functions'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-2479042100878448819</id><published>2007-05-07T10:37:00.000+02:00</published><updated>2007-05-07T10:40:16.017+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pylons'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>Nice introduction article on Pylons</title><content type='html'>&lt;a href="http://pylonshq.com/"&gt;Pylons&lt;/a&gt; is a cool web framework (one more, besides TurboGears, Django, Zope, etc.). Someone posted on the mailing list a reference to a &lt;a href="http://www.rexx.com/%7Edkuhlman/"&gt;nice introduction&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-2479042100878448819?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/2479042100878448819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=2479042100878448819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/2479042100878448819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/2479042100878448819'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/05/nice-introduction-article-on-pylons.html' title='Nice introduction article on Pylons'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-6929449104786429040</id><published>2007-04-25T17:06:00.000+02:00</published><updated>2007-04-25T17:16:35.189+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='twisted'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Troll of the day: Why Ruby sucks and why Python rocks!</title><content type='html'>I found a &lt;a href="http://blog.cbcg.net/articles/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-then-its-bound-to-drizzown"&gt;nicely written article&lt;/a&gt; about the problems with Ruby, written by a Ruby user, and why he found Python to be really good. There's even a quote about Twisted!&lt;br /&gt;&lt;blockquote&gt;And, there are a bunch of things available to a Python guy that Ruby just can’t compete with that are of particular interest to me. Two that come to mind immediately are &lt;a href="http://twistedmatrix.com/trac/"&gt;Twisted&lt;/a&gt; and &lt;a href="http://www.stackless.com/"&gt;Stackless Python&lt;/a&gt;. The former was used by others at TurnTide for creating a really powerful &lt;span class="caps"&gt;SMTP&lt;/span&gt; testing tool and the latter was used by TurnTide’s competitor &lt;a href="http://www.ironport.com/"&gt;IronPort&lt;/a&gt; to build one of the industry’s best MTAs.&lt;/blockquote&gt;I didn't knew that IronPort was done in Python, even in Stackless Python!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-6929449104786429040?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/6929449104786429040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=6929449104786429040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/6929449104786429040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/6929449104786429040'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/04/troll-of-day-why-ruby-sucks-and-why.html' title='Troll of the day: Why Ruby sucks and why Python rocks!'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-2199898771326670878</id><published>2007-04-10T09:05:00.000+02:00</published><updated>2007-04-10T13:47:29.476+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wsgi'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>New Apache module for integrating WSGI apps</title><content type='html'>Finally, after such painful setups, I really never could find a really suitable configuration that could satisfy me. Here are the different methods I tried to implement &lt;a href="http://www.turbogears.org/"&gt;TurboGears&lt;/a&gt;/&lt;a href="http://pylonshq.com/"&gt;Pylons&lt;/a&gt; or similar WSGI/Python projects (&lt;a href="http://moinmoin.wikiwikiweb.de/"&gt;MoinMoin &lt;/a&gt;for example):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;FastCGI: So complex to setup, crashes on its own so often, and leaves running processes in memory so have to kill them each time manually to start again with a clean environment. I have to admit it is easier to configure on &lt;a href="http://www.lighttpd.net/"&gt;Lighttpd&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.mems-exchange.org/software/scgi/"&gt;SCGI&lt;/a&gt;: As complex as FastCGI and not so used in the world, but not bad. Too few options.&lt;/li&gt;&lt;li&gt;Proxy: Redirecting on a local different port gives nore work, and as soon as you have several other virtual hosts, you'll have to keep a registry of all your allocated ports. Painful, but easy to setup. Maybe be hard to configure if you're using Zope, and if you need some remote information (ip address of the user for example), you're dead!&lt;/li&gt;&lt;li&gt;Direct Access: Configuring you app to run on a local ip alias on your machine and eventually configure your firewall to DNAT on it. Not that complex to setup, but requires access to you OS confiugration and many apps don't allow you to only listen on a specific interface (MoinMoin allows it, that's cool)&lt;/li&gt;&lt;li&gt;mod_python: Loads Python into memory. Everybody shares the same namespace. Dangerous.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now here's a new contender, &lt;a href="http://code.google.com/p/modwsgi/"&gt;mod_wsgi&lt;/a&gt; written by &lt;a href="http://blog.dscpl.com.au/"&gt;Graham Dumpleton&lt;/a&gt;. That's right, it will not work for every app. Zope, not being WSGI aware, is out of the way, except for &lt;a href="http://blog.d2m.at/2006/09/23/zope3-and-wsgi-integration/"&gt;Zope 3.x&lt;/a&gt;. But most of Python apps can be modded to be WSGI aware (&lt;a href="http://moinmoin.wikiwikiweb.de/WsgiRequestPatch"&gt;MoinMoin is an example&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-2199898771326670878?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/2199898771326670878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=2199898771326670878' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/2199898771326670878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/2199898771326670878'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/04/new-apache-module-for-integrating-wsgi.html' title='New Apache module for integrating WSGI apps'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-8794761783812894837</id><published>2007-03-28T10:08:00.000+02:00</published><updated>2007-03-28T10:20:51.366+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pypy'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>PyPy 1.0 has been announced!</title><content type='html'>PyPy version 1.0 is now available. That's really a great news, and a milestone for the Python community (and the rest of the programming world). It's not yet recommended to use it in production, but we're not that far from that.&lt;br /&gt;&lt;br /&gt;Please read the &lt;a href="http://codespeak.net/pypy/dist/pypy/doc/release-1.0.0.html"&gt;announcement&lt;/a&gt; and go in the different links referenced there to learn more about PyPy and what it will change in your life.&lt;br /&gt;&lt;br /&gt;Python is so cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-8794761783812894837?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/8794761783812894837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=8794761783812894837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/8794761783812894837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/8794761783812894837'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/03/pypy-10-has-been-announced.html' title='PyPy 1.0 has been announced!'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-2578190553203134570</id><published>2007-03-21T22:36:00.000+01:00</published><updated>2007-03-21T23:15:25.750+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>How to understand the ARP queries and replies fields with pypcap</title><content type='html'>I had a hard time understanding the function of each field in an ARP packet. The problem is that the fields change of meaning, depending on the opcode field. The two useful ones are for ARP queries (&lt;span style="font-style: italic;"&gt;what is the ethernet address of the ip address I'm giving now&lt;/span&gt;) and ARP replies (&lt;span style="font-style: italic;"&gt;that ip address is located at this ethernet address&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;So to fix this problem once for all, I decided to write a python script that shows the different field values when an ARP packet is captured.&lt;br /&gt;&lt;br /&gt;There are several libraries available to the pythonista to manipulate network packets. The most known is certainly &lt;a href="http://pylibpcap.sourceforge.net/"&gt;pylibpcap&lt;/a&gt; which is quite old now, and not really object oriented. It is more an adaptation one-to-one of the C libpcap library, which may be useful for some people.&lt;br /&gt;Another library is &lt;a href="http://code.google.com/p/pypcap/"&gt;pypcap&lt;/a&gt;, which is like pylibpcap, but &lt;span style="font-weight: bold;"&gt;much much&lt;/span&gt; more object oriented.&lt;br /&gt;pypcap includes a huge quantity of protocols definitions, so it's really cool to use, especially because it also includes a network packet capture method. There is no included method to send packets, but there are examples of how to do this in the test files.&lt;br /&gt;Another possibility is &lt;a href="http://www.secdev.org/projects/scapy/"&gt;scapy&lt;/a&gt;, which is an extremely complete program (more a program than a library, even though you can use it as a module). The fact that it's not that easy to include scapy in my own program, even though there's now a &lt;a href="http://www.secdev.org/projects/scapy/build_your_own_tools.html"&gt;howto&lt;/a&gt;. My program doesn't need all the bells and whistles given by scapy, so I settled on pypcap.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;import dpkt, pcap&lt;br /&gt;from socket import inet_ntoa&lt;br /&gt;&lt;br /&gt;def ether_decode(p):&lt;br /&gt;   return ':'.join(['%02x' % ord(x) for x in str(p)])&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;   iface_name = 'eth1'  # Here set your listening interface&lt;br /&gt;&lt;br /&gt;   pc = pcap.pcap(iface_name)&lt;br /&gt;   pc.setfilter('arp')&lt;br /&gt;&lt;br /&gt;   for ts,pkt in pc:&lt;br /&gt;       packet = dpkt.ethernet.Ethernet(pkt)&lt;br /&gt;&lt;br /&gt;       print "ARP packet received:"&lt;br /&gt;       print "op=%d" % packet.data.op&lt;br /&gt;       print "src=%s" % ether_decode(packet.src)&lt;br /&gt;       print "dst=%s" % ether_decode(packet.dst)&lt;br /&gt;       print "spa=%s" % inet_ntoa(packet.data.spa)&lt;br /&gt;       print "tpa=%s" % inet_ntoa(packet.data.tpa)&lt;br /&gt;       print "tha=%s" % ether_decode(packet.data.tha)&lt;br /&gt;       print "sha=%s" % ether_decode(packet.data.sha)&lt;br /&gt;       print&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's it. Now, for example, 192.168.4.3 wants to get 192.168.4.254's ethernet address (192.168.4.254 has 00:90:4c:49:00:2a address and 192.168.4.3 has 00:50:70:b4:19:0c), here is the output:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;ARP packet received:&lt;br /&gt;op=1&lt;br /&gt;src=00:50:70:b4:19:0c&lt;br /&gt;dst=ff:ff:ff:ff:ff:ff&lt;br /&gt;spa=192.168.4.3&lt;br /&gt;tpa=192.168.4.254&lt;br /&gt;tha=00:00:00:00:00:00&lt;br /&gt;sha=00:50:70:b4:19:0c&lt;br /&gt;&lt;br /&gt;ARP packet received:&lt;br /&gt;op=2&lt;br /&gt;src=00:90:4c:49:00:2a&lt;br /&gt;dst=00:50:70:b4:19:0c&lt;br /&gt;spa=192.168.4.254&lt;br /&gt;tpa=192.168.4.3&lt;br /&gt;tha=00:50:70:b4:19:0c&lt;br /&gt;sha=00:90:4c:49:00:2a&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-2578190553203134570?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/2578190553203134570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=2578190553203134570' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/2578190553203134570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/2578190553203134570'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/03/how-to-understand-arp-queries-and.html' title='How to understand the ARP queries and replies fields with pypcap'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-6165855428321377863</id><published>2007-02-08T10:28:00.000+01:00</published><updated>2007-02-08T11:26:20.200+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twisted'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Extension for Twisted AMP to support dictionaries and lists</title><content type='html'>Henrik Thostrup Jensen announced on the Twisted Users mailing list he made two extensions for the Twisted AMP protocol.&lt;br /&gt;&lt;blockquote&gt;Currently there are two types: A dictionary and a list. The types of the element must be specified (key and value can be different in the dictionary), otherwise they are free form, i.e., the keys in the dictionary can have any name, and the list can be of any size. The types can be nested, e.g., you can create a list of list of strings. I use (or will) the latter to return a query result, for which I do not know the row size. This is currently impossible (AFAICT), in the otherwise excellent AMP protocol.&lt;/blockquote&gt;You can get them on &lt;a href="http://www.cs.aau.dk/%7Ehtj/code/amptypes-0.1.tar.gz"&gt;http://www.cs.aau.dk/~htj/code/amptypes-0.1.tar.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For people that live under a rock, AMP is a new communication protocol for Twisted (added in Twisted 2.5) much lighter/simpler than PB. It is just a request/response protocol over a persistent connection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-6165855428321377863?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/6165855428321377863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=6165855428321377863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/6165855428321377863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/6165855428321377863'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2007/02/extension-for-twisted-amp-to-support.html' title='Extension for Twisted AMP to support dictionaries and lists'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-9046261294612603276</id><published>2006-09-13T10:49:00.000+02:00</published><updated>2006-09-13T10:51:50.267+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pje'/><category scheme='http://www.blogger.com/atom/ns#' term='ez_install'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='setuptools'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Adding automatically ez_setup in your SVN repository</title><content type='html'>For users that don't yet have setuptools installed (or a too old version) or who want to include a copy of ez_setup.py in their package distribution, here is the one-true-way. This method is already documented on &lt;a href="http://dirtsimple.org/"&gt;Phillip J. Eby&lt;/a&gt;'s &lt;a href="http://peak.telecommunity.com/DevCenter/setuptools"&gt;setuptools pages&lt;/a&gt;, but it's buried in the middle, and I keep forgetting how to do it. So here it is:&lt;br /&gt;&lt;br /&gt;First, go to the root (trunk) of your project, and edit the properties of your SVN folder using the following command:&lt;br /&gt;&lt;blockquote&gt;svn propedit svn:externals .&lt;/blockquote&gt;&lt;br /&gt;This will open your favorite text editor where you'll put the following line:&lt;br /&gt;&lt;blockquote&gt;ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup&lt;/blockquote&gt;&lt;br /&gt;Then do a svn ci, and then svn update, you're all set!&lt;br /&gt;Note: If you use the find_packages method in your project, you'll have to explicitely exclude the ez_setup folder. You can edit your setup.py file to add:&lt;br /&gt;&lt;blockquote&gt;setup(&lt;br /&gt;  ...&lt;br /&gt;  packages = find_packages(exclude=['ez_setup']),&lt;br /&gt;)&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-9046261294612603276?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/9046261294612603276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=9046261294612603276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/9046261294612603276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/9046261294612603276'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2006/09/adding-automatically-ezsetup-in-your.html' title='Adding automatically ez_setup in your SVN repository'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-1105210678016586813</id><published>2006-09-12T16:17:00.000+02:00</published><updated>2006-09-12T16:20:07.311+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='dsa'/><title type='text'>Security monitoring of Debian alerts is less than practical</title><content type='html'>I was looking for a program (command-line) that would allow me to check if a Debian system&lt;br /&gt;was up to date against all the offical security annoucements (DSA). Something like the program glsa-check which is available for Gentoo systems.&lt;br /&gt;&lt;br /&gt;I just found two, none of them being really useful:&lt;ul&gt;&lt;li&gt;forgotten_name: It works, but the bad point is that the inner working is to test the upgrade for ALL packages, which is quite slow...&lt;/li&gt;&lt;li&gt;tiger: They cheated a little, as they made a "static" file used to compare to a filesystem.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So I decided to make my own. Alas, the people responsible for Debian security&lt;br /&gt;don't seem to give any easy way to get the DSA in a stable/correct way.&lt;/p&gt;Here are the different possibilities, and why they're hard/impossible to use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;There's a "&lt;a href="http://search.debian.org/"&gt;search engine&lt;/a&gt;" that is supposed to allow you to search for CVE entries, but it doesn't work (has it worked at one time?) and now you only get a message "Debian Search disabled".&lt;/li&gt;&lt;li&gt;You can get the "latest" security alerts (DSA) from the &lt;a href="http://www.debian.org/security/"&gt;Debian security page&lt;/a&gt;, even in a &lt;a href="http://www.debian.org/security/dsa"&gt;RDF format&lt;/a&gt;. That would be cool, except:&lt;span class="" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;It's just the 15 or less last alerts&lt;/li&gt;&lt;li&gt;The contents are just a title, a link, a two words description and the issued date&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;There is the security-announce mailing list. Not really practical.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To correct the problem of the 15 or less entries in the distributed RDF file, I took instead the "&lt;a href="http://www.debian.org/security/2006/"&gt;year&lt;/a&gt;" page which gives exactly the same thing but in HTML. Some regexp, and we get the same result as the RDFs, but with the whole list of DSAs (but still not enough information).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Next, to get the detailed data, that is, the affected packages and the corrected version numbers (the most important things) we need to download the corresponding DSA page. For example, for the DSA 1174, you would get the content of the page http://www.debian.org/security/2006/dsa-1174 .&lt;/p&gt;Here begins the fun. That page doesn't have a static structure at all! Many inconsistencies are making the parsing of the page unreliable.&lt;br /&gt;For example, let's just start with the DSA number. For example, for the DSA 1174, you find that on the details page, it's 1174-1.&lt;br /&gt;&lt;p&gt;Next, you would think that with the use of templates, that page would have some kind of fixed format. Que nenni! The text is not always the same. For example, the text 'has been fixed in' isn't always formatted the same way.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;About the affected packages, you have a paragraph named 'Affected Packages', which is inconsistent with the really affected packages (never more that one package), which can be found later in the page in 'Fixed in'.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Redhat is submitting its alerts to &lt;a href="http://oval.mitre.org/"&gt;OVAL&lt;/a&gt;, which uses a really nice format and also gives an interpreter for the language. I saw just one or two messages on the OVAL mailing list about debian :-(&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-1105210678016586813?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/1105210678016586813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=1105210678016586813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/1105210678016586813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/1105210678016586813'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2006/09/security-monitoring-of-debian-alerts-is.html' title='Security monitoring of Debian alerts is less than practical'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8054689530244757700.post-3956166537987740133</id><published>2006-09-04T10:10:00.000+02:00</published><updated>2006-09-04T12:11:54.896+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wsgi'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='cleverharold'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>Another fine new web framework: Clever Harold</title><content type='html'>&lt;a href="http://www.cleverharold.com/"&gt;Clever Harold&lt;/a&gt; is a new &lt;a href="http://www.python.org/"&gt;python&lt;/a&gt; web framework (another one :-) that uses &lt;a href="http://www.python.org/dev/peps/pep-0333/"&gt;WSGI&lt;/a&gt; as its core glue. This allows you to define your own stack of elements (sessions, authentications, compression, templates, etc.).&lt;br /&gt;It is really well done (for a 0.1 version), and, compared to other WSGI based &lt;a href="http://wiki.python.org/moin/WebFrameworks"&gt;frameworks&lt;/a&gt; (like RhubarbTart or Pylons), seems easier to grasp. The big difference (except it's well organized, thanks to &lt;a href="http://pythonpaste.org/"&gt;Paste&lt;/a&gt;) is that it automatically guesses the required modules, so you don't need to specify them in your source header.&lt;br /&gt;Take a look at it, and don't forget to register on the &lt;a href="http://groups.google.com/group/cleverharold"&gt;mailing list&lt;/a&gt;!&lt;br /&gt;&lt;span class="" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8054689530244757700-3956166537987740133?l=snakesaysni.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snakesaysni.blogspot.com/feeds/3956166537987740133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8054689530244757700&amp;postID=3956166537987740133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/3956166537987740133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8054689530244757700/posts/default/3956166537987740133'/><link rel='alternate' type='text/html' href='http://snakesaysni.blogspot.com/2006/09/another-fine-new-web-framework-clever.html' title='Another fine new web framework: Clever Harold'/><author><name>Luc</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://static.flickr.com/24/59491594_f814f2cb05.jpg'/></author><thr:total>0</thr:total></entry></feed>
