<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Lior Gradstein's Blog</title>
	
	<link>http://www.gradstein.info</link>
	<description />
	<pubDate>Mon, 29 Sep 2008 12:39:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/LiorGradsteinsBlog" type="application/rss+xml" /><item>
		<title>Synchronization methods of a file with Puppet</title>
		<link>http://www.gradstein.info/ruby/synchronization-methods-of-a-file-with-puppet/</link>
		<comments>http://www.gradstein.info/ruby/synchronization-methods-of-a-file-with-puppet/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 12:39:32 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[puppet]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[cluster]]></category>

		<category><![CDATA[management]]></category>

		<category><![CDATA[reductivelabs]]></category>

	<!-- AutoMeta Start -->
	<category />
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/?p=37</guid>
		<description><![CDATA[Usually, to synchronize a file with remote hosts, using puppet, one would use the following pattern:
file &#123; &#34;/etc/init.d/pvfs2-server&#34;:
&#160; &#160; &#160; owner =&#62; root, group =&#62; root, 
&#160; &#160; &#160; mode =&#62; 755, 
&#160; &#160; &#160; source =&#62; &#34;puppet:///files/pvfs2-server&#34; &#160; &#160;
&#125;
(using &#8220;source&#8221; to copy data as-is, and using &#8220;template(&#8221;filename&#8221;) to use a template structure as data).
Or, [...]]]></description>
			<content:encoded><![CDATA[<p>Usually, to synchronize a file with remote hosts, using <a href="http://reductivelabs.com/trac/puppet/" class="liexternal">puppet</a>, one would use the following pattern:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span> <span style="color: #483d8b;">&quot;/etc/init.d/pvfs2-server&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; owner =&gt; root, group =&gt; root, <br />
&nbsp; &nbsp; &nbsp; mode =&gt; <span style="color: #ff4500;">755</span>, <br />
&nbsp; &nbsp; &nbsp; source =&gt; <span style="color: #483d8b;">&quot;puppet:///files/pvfs2-server&quot;</span> &nbsp; &nbsp;<br />
<span style="color: black;">&#125;</span></div>
<p>(using &#8220;source&#8221; to copy data as-is, and using &#8220;template(&#8221;filename&#8221;) to use a template structure as data).</p>
<p>Or, if one wishes to directly set the content of the target file:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span> <span style="color: #483d8b;">&quot;/etc/init.d/pvfs2-server&quot;</span>:<br />
&nbsp; &nbsp;owner =&gt; root, group =&gt; root, <br />
&nbsp; &nbsp;mode =&gt; <span style="color: #ff4500;">755</span>, <br />
&nbsp; &nbsp;source =&gt; <span style="color: #483d8b;">&quot;puppet:///files/pvfs2-server&quot;</span> &nbsp; &nbsp;<br />
<span style="color: black;">&#125;</span></div>
<p>Please note that on the first line, for example &#8216;file { &#8220;/etc/mpd.conf&#8221;:&#8217;), the &#8220;/etc/mpd.conf&#8221; is a merge of two functionalities/concepts: Usually, the syntax is clear and simple:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span> mon_fichier_mpd_conf:<br />
&nbsp; &nbsp; &nbsp;path =&gt; <span style="color: #483d8b;">&quot;/etc/mpd.conf&quot;</span>,<br />
&nbsp; &nbsp; &nbsp;<span style="color: black;">&#91;</span>&#8230;<span style="color: black;">&#93;</span><br />
<span style="color: black;">&#125;</span></div>
<p>The first line is about the resource description. Its goal is to be able to reference to it a little later from another resources (Notify[], etc.). By putting directly the file path and name (I think it&#8217;s identified as a filename and not as a description because there are quotes, or maybe it&#8217;s because it begins with a slash?) you mege the &#8220;path&#8221; attribute with its description.<br />
On the other end, we&#8217;ll not be able to reference to it later, if you need to.</p>
<p>You may also need to synchronize a file that is not present in the repository (puppet:///files/*). That usually happens, for example, when that file is regenerated by an external program or an external action (like /etc/passwd).</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #008000;">file</span> <span style="color: black;">&#123;</span><span style="color: #483d8b;">&quot;/etc/passwd&quot;</span>:<br />
&nbsp; &nbsp; &nbsp;owner =&gt; root, group =&gt; root, mode =&gt; <span style="color: #ff4500;">644</span>,<br />
&nbsp; &nbsp; &nbsp;content =&gt; <span style="color: #008000;">file</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;/etc/passwd&quot;</span><span style="color: black;">&#41;</span><br />
<span style="color: black;">&#125;</span></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=TGeGL"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=TGeGL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=AzIyl"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=AzIyl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/406225306" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/ruby/synchronization-methods-of-a-file-with-puppet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to automatically run a script after inserting a USB device on Ubuntu?</title>
		<link>http://www.gradstein.info/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/</link>
		<comments>http://www.gradstein.info/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 21:32:01 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[hardware]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[automatic]]></category>

		<category><![CDATA[download]]></category>

		<category><![CDATA[hotplug]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mount]]></category>

		<category><![CDATA[photos]]></category>

		<category><![CDATA[program]]></category>

		<category><![CDATA[run]]></category>

		<category><![CDATA[script]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[udev]]></category>

		<category><![CDATA[usb]]></category>

	<!-- AutoMeta Start -->
	<category />
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/?p=35</guid>
		<description><![CDATA[Here&#8217;s the setup: you have a computer which has a SD port (small memory cards, mostly used in cameras, phones, etc.). You want to get all of your photos from that card automatically as soon as you insert your card (may be a USB key as well), that is, run a script which will search [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the setup: you have a computer which has a SD port (small memory cards, mostly used in cameras, phones, etc.). You want to get all of your photos from that card automatically as soon as you insert your card (may be a USB key as well), that is, run a script which will search for all of your photos, and copy them to a local directory.</p>
<p><span id="more-35"></span></p>
<p>I know, some programs already do this, but they require Xwindow and some <a href="http://f-spot.org/Main_Page" class="liexternal">ugly Gnome</a>/KDE app. What we&#8217;re doing here is a minimal setup, using the least memory.</p>
<p>Normally, on a normal Unix system you would use the included device detection mechanism, which is <a href="http://linux-hotplug.sourceforge.net/" title="Linux Hotplug project" class="liexternal">hotplug</a>. But on Ubuntu (at least <em>Gutsy</em> and <em>Hardy</em>), the de-facto/required way is by using <strong>udev</strong>, which is an event based system, using rules to fire new events/mount/symlink or run programs according to some patterns defined as &#8220;rules&#8221;.</p>
<p>So, the first thing to do is to identify your device according to USB events. udevinfo is your friend. So, after looking at the output of dmesg, you&#8217;ll see your USB device is available on some sd* device.</p>
<p>So run:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"> udevinfo -a -p &nbsp;/<span style="color: #dc143c;">sys</span>/block/sda<br />
<span style="color: black;">&#40;</span>replace sda with you device<span style="color: black;">&#41;</span></div>
<p>You will get a list of &#8220;blocks&#8221; representing each layer of drivers. For example:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">root@sleek:/etc/udev/rules.<span style="color: black;">d</span><span style="color: #808080; font-style: italic;"># udevinfo -a -p /sys/block/sda/</span></p>
<p>looking at device <span style="color: #483d8b;">&#8216;/block/sda&#8217;</span>:<br />
KERNEL==<span style="color: #483d8b;">&quot;sda&quot;</span><br />
SUBSYSTEM==<span style="color: #483d8b;">&quot;block&quot;</span><br />
DRIVER==<span style="color: #483d8b;">&quot;&quot;</span><br />
ATTR<span style="color: black;">&#123;</span><span style="color: #dc143c;">stat</span><span style="color: black;">&#125;</span>==<span style="color: #483d8b;">&quot; &nbsp;229567 &nbsp; &nbsp;[...] 456048 &nbsp;3697068&quot;</span><br />
ATTR<span style="color: black;">&#123;</span>size<span style="color: black;">&#125;</span>==<span style="color: #483d8b;">&quot;488397168&quot;</span><br />
ATTR<span style="color: black;">&#123;</span>removable<span style="color: black;">&#125;</span>==<span style="color: #483d8b;">&quot;0&quot;</span><br />
ATTR<span style="color: black;">&#123;</span><span style="color: #008000;">range</span><span style="color: black;">&#125;</span>==<span style="color: #483d8b;">&quot;16&quot;</span><br />
ATTR<span style="color: black;">&#123;</span>dev<span style="color: black;">&#125;</span>==<span style="color: #483d8b;">&quot;8:0&quot;</span></p>
<p>looking at parent device <span style="color: #483d8b;">&#8216;/devices/pci0000:00/00[...]:<br />
KERNELS==&quot;2:0:0:0&quot;<br />
SUBSYSTEMS==&quot;scsi&quot;<br />
DRIVERS==&quot;sd&quot;<br />
ATTRS{ioerr_cnt}==&quot;0&#215;0&quot;<br />
ATTRS{iodone_cnt}==&quot;0xcc26b&quot;<br />
ATTRS{iorequest_cnt}==&quot;0xcc26c&quot;<br />
ATTRS{iocounterbits}==&quot;32&quot;<br />
ATTRS{timeout}==&quot;30&quot;<br />
ATTRS{state}==&quot;running&quot;<br />
ATTRS{rev}==&quot;3.AA&quot;<br />
ATTRS{model}==&quot;ST3250310AS &nbsp; &nbsp; &quot;<br />
ATTRS{vendor}==&quot;ATA &nbsp; &nbsp; &quot;</span></div>
<p>These are in fact attributes that you can use in your rule to filter the devices. So for example,<br />
to run a shell script when a SCSI device is detected which has a size of 1GB, I&#8217;ll use the following line:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">KERNEL==<span style="color: #483d8b;">&quot;sd?1&quot;</span>, ATTRS<span style="color: black;">&#123;</span>size<span style="color: black;">&#125;</span>==<span style="color: #483d8b;">&quot;1999872&quot;</span>, RUN+=<span style="color: #483d8b;">&quot;/usr/local/bin/recup_usb.sh&quot;</span></div>
<p>This line is to be put in a new file in /etc/udev/rules.d, named something like 91-backuptousbdrivetrigger.rules. It&#8217;s better to put the file at the end of the rules (the &#8220;91&#8243;), as not to disturb other module loadings.</p>
<p>The content of the recup_usb.sh file can be:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #808080; font-style: italic;">#!/bin/bash</span></p>
<p><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#91;</span> <span style="color: #483d8b;">&quot;${ACTION}&quot;</span> = <span style="color: #483d8b;">&quot;add&quot;</span> <span style="color: black;">&#93;</span>; then<br />
&nbsp; &nbsp;rm -rf /tmp/x<br />
&nbsp; &nbsp;mkdir /tmp/x<br />
&nbsp; &nbsp;mount -t vfat /dev/sdc1 /tmp/x<br />
&nbsp; &nbsp;find /tmp/x -name <span style="color: #483d8b;">&quot;*jpg&quot;</span> -<span style="color: #ff7700;font-weight:bold;">exec</span> /usr/bin/rsync -avz <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span> &nbsp;\<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /home/foobar/Pictures/Incoming/`date +%Y-%m-%d`/ \;<br />
&nbsp; &nbsp;umount /tmp/x<br />
fi</div>
<p><em>(yes, I know this code is dirty, I should have used mktemp, but you get the point&#8230;)</em><br />
Don&#8217;t forget to chmod +x the shell script and reload the configuration with:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">udevcontrol reload_rules</div>
<p>For more detailed information about writing udev rules, take a look at the<a href="http://reactivated.net/writing_udev_rules.html" class="liexternal"> official documentation</a>, or <a href="http://tlug.dnho.net/?q=smeserver_udev_automated_backups" class="liexternal">another&#8217;s detailed information</a> about doing the same thing.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=TGbaNJ"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=TGbaNJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=6tq7Sj"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=6tq7Sj" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/269630751" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TurboGears and Pylons will merge! (and CleverHarold RIP)</title>
		<link>http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/</link>
		<comments>http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 15:20:08 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[framework]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[web]]></category>

	<!-- AutoMeta Start -->
	<category />
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/</guid>
		<description><![CDATA[Mark Ramm, one of TurboGears&#8217;s core developers announced on TurboGears&#8217;s mailing list that they will merge with Pylons! To be more precise, the API of TurboGears will be implemented on top of Pylons. It seems they already made some test/proof of concept that are, as they say &#8220;a huge success&#8221;. That&#8217;s really good news for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phptr.com/authors/bio.asp?a=304cff7b-5886-4dcf-ae59-6bbf140dd802&amp;rl=1" class="liexternal">Mark Ramm</a>, one of <a href="http://turbogears.org/" class="liexternal">TurboGears</a>&#8217;s core developers announced on <a href="http://groups.google.com/group/turbogears/browse_thread/thread/d1d2e416023e7033" class="liexternal">TurboGears&#8217;s mailing list</a> that they will merge with <a href="http://pylonshq.com/" class="liexternal">Pylons</a>! To be more precise, the API of TurboGears will be implemented on top of Pylons. It seems they already made some test/proof of concept that are, as they say &#8220;a huge success&#8221;. That&#8217;s really good news for Python web frameworks development, and a good news for me, as I&#8217;ll not have to choose between the two :-</p>
<p>As a sidenote, it seems another framework, <a href="http://www.gradstein.info/python/another-fine-new-web-framework-clever-harold/" class="liinternal">CleverHarold</a> has disappeared without anybody noticing. Its domain is parked, and today its <a href="http://groups.google.com/group/cleverharold" class="liexternal">Google Group page</a> went off (the last messages were from people asking if the project was still alive).</p>
<p><strong>Update:</strong>  <a href="http://www.oreillynet.com/pub/au/3039" class="liexternal">Noah Gift</a><span class="ISI_IGNORE"> wrote a <a href="http://www.oreillynet.com/onlamp/blog/2007/06/python_web_application_framewo.html" class="liexternal">nice article</a> about the merge. </span></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=OAjWoNGD"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=OAjWoNGD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=P81vWqsT"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=P81vWqsT" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489481" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/turbogears-and-pylons-will-be-merged/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CCT (CalCubeTimer) v0.2 is now available</title>
		<link>http://www.gradstein.info/rubik/cct-calcubetimer-v02-is-now-available/</link>
		<comments>http://www.gradstein.info/rubik/cct-calcubetimer-v02-is-now-available/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 20:29:24 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[rubik]]></category>

	<!-- AutoMeta Start -->
	<category />
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/rubik/cct-calcubetimer-v02-is-now-available/</guid>
		<description><![CDATA[CalCubeTimer in its newest version is now available! For people who don&#8217;t know, CCT is a java program that times for Rubik&#8217;s cubing performance. It is really cool not only because it is beautiful, easy to use, has a client mode to connect to a central server (for contests), but because it allows you to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gnehzr.net/cct/" class="liexternal">CalCubeTimer</a> in its newest version is now available! For people who don&#8217;t know, CCT is a java program that times for Rubik&#8217;s cubing performance. It is really cool not only because it is beautiful, easy to use, has a client mode to connect to a central server (for contests), but because it allows you to <a href="http://gnehzr.net/cct/readme.html#setup" class="liexternal">plug</a> you <a href="http://http://www.speedstacks.com/store/products/406.htm" class="liexternal">stackmat</a> and show its content in full screen!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=i6I5kGOm"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=i6I5kGOm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=ZRyZ2kuM"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=ZRyZ2kuM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489482" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/rubik/cct-calcubetimer-v02-is-now-available/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO Installation of OpenWRT on a WGT634U usb router Part 2</title>
		<link>http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router-part-2/</link>
		<comments>http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router-part-2/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 08:05:51 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[hardware]]></category>

	<!-- AutoMeta Start -->
	<category />
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router-part-2/</guid>
		<description><![CDATA[OK, we now have to configure the network. The goal is to be able to connect to our access point, where we&#8217;ll get information to connect to our &#8220;sound server&#8221; (I call it like that because I&#8217;ve still not decided between using mpd+mpc+samba or some more direct access like the use of esd).
We&#8217;ll set the [...]]]></description>
			<content:encoded><![CDATA[<p>OK, we now have to configure the network. The goal is to be able to connect to our access point, where we&#8217;ll get information to connect to our &#8220;sound server&#8221; (I call it like that because I&#8217;ve still not decided between using mpd+mpc+samba or some more direct access like the use of esd).</p>
<p>We&#8217;ll set the wifi interface as a client for a remote access point. We&#8217;ll keep the WAN interface with a static ip (here, 192.168.1.1)</p>
<p class="alert">Please note, that changing the configuration will make the remote network access as previously used unusable. The only secure access is still through the serial console.</p>
<p>First, edit the file /etc/config/network:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">config switch eth0<br />
&nbsp; &nbsp; &nbsp;option vlan0 <span style="color: #483d8b;">&quot;0 1 2 3 5*&quot;</span><br />
&nbsp; &nbsp; &nbsp;option vlan1 <span style="color: #483d8b;">&quot;4 5&quot;</span><br />
<span style="color: black;">&#91;</span>&#8230;<span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;"># localhost config here</span><br />
<span style="color: black;">&#91;</span>&#8230;<span style="color: black;">&#93;</span><br />
config interface wan<br />
&nbsp; &nbsp;option ifname <span style="color: #483d8b;">&quot;eth0.1&quot;</span><br />
&nbsp; &nbsp;option proto static<br />
&nbsp; &nbsp;option ipaddr <span style="color: #ff4500;">192.168</span><span style="color: #ff4500;">.1</span><span style="color: #ff4500;">.1</span><br />
&nbsp; &nbsp;option netmask <span style="color: #ff4500;">255.255</span><span style="color: #ff4500;">.255</span><span style="color: #ff4500;">.0</span><br />
<span style="color: black;">&#91;</span>&#8230;<span style="color: black;">&#93;</span><br />
config interface lan<br />
&nbsp; &nbsp;option <span style="color: #008000;">type</span> bridge<br />
&nbsp; &nbsp;option ifname <span style="color: #483d8b;">&quot;eth0.0&quot;</span><br />
&nbsp; &nbsp;option proto dhcp</div>
<p>And then the file /etc/config/wireless:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">config wifi-device wifi0<br />
&nbsp; &nbsp;option <span style="color: #008000;">type</span> atheros<br />
&nbsp; &nbsp;option channel <span style="color: #ff4500;">8</span><br />
&nbsp; &nbsp;option disabled <span style="color: #ff4500;">0</span><br />
<span style="color: black;">&#91;</span>&#8230;<span style="color: black;">&#93;</span><br />
config wifi-iface<br />
&nbsp; &nbsp;option device wifi0<br />
&nbsp; &nbsp;option network lan<br />
&nbsp; &nbsp;option mode sta<br />
&nbsp; &nbsp;option ssid YOUR_SSID<br />
&nbsp; &nbsp;option encryption none<br />
&nbsp; &nbsp;option hidden <span style="color: #ff4500;">0</span></div>
<p>If your access point has some encryption, like WEP, do this instead of the wifi-iface block:</p>
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">config wifi-iface<br />
&nbsp; &nbsp;option device wifi0<br />
&nbsp; &nbsp;option network lan<br />
&nbsp; &nbsp;option mode sta<br />
&nbsp; &nbsp;option ssid YOUR_SSID<br />
&nbsp; &nbsp;option encryption wep<br />
&nbsp; &nbsp;option key <span style="color: #ff4500;">1234567899</span><br />
&nbsp; &nbsp;option hidden <span style="color: #ff4500;">0</span></div>
<p>You can take a look at the different available options <a href="http://www.nbd.name/openwrt.html#x1-80001.2.1" class="liexternal">on this documentation</a>. If all is well, you should have an ip address on your br-lan interface (your WHGT634U hub port is bridged with the wifi interface).</p>
<p>Next part will be the most interesting :-) I think I&#8217;ll try all the different methods to implement an automatic player daemon. Direct methods, and indirect methods, using a share fielsystem like CIFS.</p>
<h2>Reference</h2>
<p><a href="http://www.larsen-b.com/Article/258.html" class="liexternal">Jkx@Home&#8217;s</a> article explaining another use of WGT634U</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=apoMTGDF"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=apoMTGDF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=8K6sSm6e"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=8K6sSm6e" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489483" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router-part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Videos of every presentation of Journée Python 2007 are now online!</title>
		<link>http://www.gradstein.info/python/videos-of-every-presentation-of-journee-python-2007-are-now-online/</link>
		<comments>http://www.gradstein.info/python/videos-of-every-presentation-of-journee-python-2007-are-now-online/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 00:50:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[language]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[twisted]]></category>

	<!-- AutoMeta Start -->
	<category>presentation</category>
	<category>filmed</category>
	<category>and</category>
	<category>uploaded</category>
	<category>the</category>
	<category>title</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/language/videos-of-every-presentation-of-journee-python-2007-are-now-online/</guid>
		<description><![CDATA[As the title says it, each presentation was filmed, and has just been uploaded for everyone&#8217;s pleasure! Here is the two-part video presentation of Twisted, done by Michael SCHERER.
[googlevideo]http://video.google.com/videoplay?docid=8739163173039026567[/googlevideo]
[googlevideo]http://video.google.com/videoplay?docid=1837647658089311574[/googlevideo]
Oh, by the way, please take a minute to vote for your favourite Internet Engine!


]]></description>
			<content:encoded><![CDATA[<p>As the title says it, each <a href="http://journees.afpy.org/programme" class="liexternal">presentation was filmed</a>, and has just been uploaded for everyone&#8217;s pleasure! Here is the two-part video presentation of Twisted, done by Michael SCHERER.</p>
<p>[googlevideo]http://video.google.com/videoplay?docid=8739163173039026567[/googlevideo]<br />
[googlevideo]http://video.google.com/videoplay?docid=1837647658089311574[/googlevideo]</p>
<p>Oh, by the way, please take a minute to vote for your favourite Internet Engine!</p>
<p align="center">
<iframe src="http://jyte.com/widget/claim/twistedmatrix.com-is-the-engine-of-your-internet" style="width:400px;height:60px;border:1px solid #777;" scrolling="no"></iframe></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=VVDmF51G"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=VVDmF51G" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=zFP59NBP"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=zFP59NBP" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489484" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/videos-of-every-presentation-of-journee-python-2007-are-now-online/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Security patching Wordpress themes against Cross-Script Attacks (XSS)</title>
		<link>http://www.gradstein.info/security/security-patching-wordpress-themes-against-cross-script-attacks-xss/</link>
		<comments>http://www.gradstein.info/security/security-patching-wordpress-themes-against-cross-script-attacks-xss/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 21:27:02 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[security]]></category>

		<category><![CDATA[wordpress]]></category>

	<!-- AutoMeta Start -->
	<category>worpdress</category>
	<category>themes</category>
	<category>in</category>
	<category>fact</category>
	<category>a</category>
	<category>nice</category>
	<category>article</category>
	<category>explaining</category>
	<category>the</category>
	<category>vulnerability</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/wordpress/security-patching-wordpress-themes-against-cross-script-attacks-xss/</guid>
		<description><![CDATA[A nice article explaining the vulnerability in Worpdress themes (in fact anything using php :-) was published some days ago. Now, there&#8217;s even a vulnerability scanner available (done in Perl).
I ran it on several of the blogs I manage, and all of them were vulnerable to XSS (wp-scanner also tests other vulnerabilities) :-(
I followed the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/wp_scanner.png" onclick="ps_imagemanager_popup(this.href,\'WP Scanner\',\'781\',\'431\');return false" onfocus="this.blur()" rel="lightbox"><img src="/wp-content/uploads/.thumbs/.wp_scanner.png" alt="WP Scanner" title="WP Scanner" align="right" width="96" height="53" border="0" /></a>A <a href="http://blogsecurity.net/wordpress/articles/article-070607/" class="liexternal">nice</a> article explaining the vulnerability in Worpdress themes (in fact anything using php :-) was published some days ago. Now, there&#8217;s even a <a href="http://blogsecurity.net/wordpress/tools/wp-scanner/" class="liexternal">vulnerability scanner available</a> (done in Perl).</p>
<p>I ran it on several of the blogs I manage, and <strong>all of them were vulnerable to XSS</strong> (wp-scanner also tests other vulnerabilities) :-(<br />
I followed the advices on blogsecurity&#8217;s website and modified all of the search functions I could find. Now wp-scanner doesn&#8217;t report any vulnerability (<em>it doesn&#8217;t mean it is cracker-proof, but it&#8217;s a good start</em>).</p>
<p>So if anybody else uses the <a href="http://www.deanjrobinson.com/wordpress/redoable" class="liexternal">Redoable theme</a> like me, you should patch the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">header.<span style="color: black;">php</span></div>
<p> file. Near the top of the file, find the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;"><span style="color: #483d8b;">&quot;Search for&quot;</span></div>
<p> string, and enclose the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">$s</div>
<p> string with the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">htmlspecialchars<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div>
<p> method:</p>
<p class="code">Search for &lt;?php echo htmlspecialchars($s); }</p>
<p>Do the same for the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">searchform.<span style="color: black;">php</span></div>
<p> file:</p>
<p class="code">searchform&#8221; action=&#8221;&lt;?php echo htmlspecialchars($_SERVER['PHP_SELF']);</p>
<p>An even better protection would be to use the <a href="http://www.modsecurity.org/" class="liexternal">mod_security module</a> for Apache/Apache2, which can detect and block these kind of attacks. But this requires that you control your server.<br />
To prevent web visitors from sending tags, you can add the following rule in your virtual host:</p>
<p class="code">SecFilter &#8220;&lt;(.|\n)+&gt;&#8221;</p>
<p>Now, when someone requests &lt; anything &gt;, the visitor gets a 403 error, and in your audit log, you now have:</p>
<p class="code">==36d82a37==============================<br />
Request: www.gradstein.info 82.67.175.56 - - [11/Jun/2007:11:10:56 +0200] &#8220;GET /?s=%3Cwpscan%3E HTTP/1.1&#8243; 403 202 &#8220;-&#8221; &#8220;Mozilla/5.0&#8243; - &#8220;-&#8221;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
GET /?s=%3Cwpscan%3E HTTP/1.1<br />
mod_security-message: Access denied with code 403. Pattern match &#8220;<(.|\\n)+>&#8221; at REQUEST_URI [severity "EMERGENCY"]<br />
mod_security-action: 403<br />
HTTP/1.1 403 Forbidden<br />
Content-Length: 202
</p>
<p class="information">Please note, that mod_security does not correct your application. Here if you only use mod_security, Wordpress theme will still be vulnerable on the underlaying level. It is OK to use mod_security, but it is much much more advisable to correct the origin of the problem and not cover it.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=uQcg2Zw8"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=uQcg2Zw8" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=SdP3KufY"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=SdP3KufY" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489485" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/security/security-patching-wordpress-themes-against-cross-script-attacks-xss/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO Installation of OpenWRT on a WGT634U usb router</title>
		<link>http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router/</link>
		<comments>http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 15:00:15 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[hardware]]></category>

	<!-- AutoMeta Start -->
	<category>warning</category>
	<category>responsibility</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router/</guid>
		<description><![CDATA[Before the 7.06 stable version of OpenWRT there were many problems for making USB audio working on this exceptional router (the only one I know with a USB port). Problems with kernel version 2.4/2.6, problems with alsa, problems with USB not working (usb2), etc. Take a look at the forums, and see all horrible, painful [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/uploads/img_0571.jpg" onclick="ps_imagemanager_popup(this.href,\'NetGear WGT634U with OpenWRT\',\'600\',\'800\');return false" onfocus="this.blur()" rel="lightbox"><img src="/wp-content/uploads/.thumbs/.img_0571.jpg" alt="NetGear WGT634U with OpenWRT" title="NetGear WGT634U with OpenWRT" align="left" width="72" height="96" border="0" /></a>Before the 7.06 stable version of OpenWRT there were many problems for making USB audio working on this exceptional router (the only one I know with a USB port). Problems with kernel version 2.4/2.6, problems with alsa, problems with USB not working (usb2), etc. Take a look at the <a href="http://forum.openwrt.org/search.php?search_id=574741614" class="liexternal">forums</a>, and see all horrible, painful modifications/patches you needed to apply to make it working.<br />
I have to say that the OpenWRT developers/contributors (and the forum members) <strong>did a wonderful job</strong> and <strong>corrected every known problems</strong>. So with this version, the installation is really straightforward!</p>
<p>Please read the following to get all the details.<br />
<span id="more-23"></span></p>
<p class="alert">I take no responsibility if you damage your router.</p>
<p class="information">This installation procedure has been done with <a href="http://openwrt.org/" class="liexternal">OpenWRT</a> <a href="http://downloads.openwrt.org/kamikaze/" class="liexternal">v. 7.06 (stable)</a>.</p>
<p>These requirements are not really requirements, but are the tools/material I used to make it work. So with these, you&#8217;re sure to make it work, like me :-)</p>
<h2>Hardware Requirements</h2>
<ul>
<li>A PC with a serial port</li>
<li>A breadboard</li>
<li>A serial cable that you can unwire</li>
<li>A network cable</li>
<li>A USB sound adapter</li>
</ul>
<h2>Software requirements</h2>
<ul>
<li>A connection to Internet</li>
<li>A Linux OS (I use Gentoo, but any will be OK)</li>
<li>A TFTPd server</li>
<li>A DHCP server</li>
<li>Screen software</li>
</ul>
<h2>Serial updates</h2>
<p><a href="/wp-content/uploads/WGT634U.jpg" onclick="ps_imagemanager_popup(this.href,\'WGT634U plugged on a breadboard\',\'800\',\'600\');return false" onfocus="this.blur()" rel="lightbox"><img src="/wp-content/uploads/.thumbs/.WGT634U.jpg" alt="WGT634U plugged on a breadboard" title="WGT634U plugged on a breadboard" align="left" width="96" height="72" border="0" /></a> First thing to do is build a serial connexion to the WGT634U to be able to flash it. Read the infos about the serial console <a href="http://wiki.openwrt.org/OpenWrtDocs/Hardware/Netgear/WGT634U" class="liexternal">on this page</a>. I choose to get a normal serial cable, remove one side of the cable and plug it on my breadboard, which is itself linked to the 3 pins on the NetGear.</p>
<p>Install TFTPd, and set it to get its files from
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">/tftproot</div>
<p> (for example). Put the OpenWRT binary file for WGT634U in it (get it from  openWRT&#8217;s <a href="http://downloads.openwrt.org/kamikaze/7.06/brcm47xx-2.6/openwrt-wgt634u-2.6-squashfs.bin" class="liexternal">download section</a>).</p>
<p>Run the following command to catch everything from your Linux ttyS0 port:</p>
<p class="code">screen /dev/ttyS0 115200</p>
<p>Put a network cable on the WAN port of your Netgear, and connect it on your network (which should be linked to Internet):</p>
<p align="center"><img src="/wp-content/uploads/img_0570.jpg" alt="Back of the router, network on WAN" title="Back of the router, network on WAN" width="500" height="375" border="0" /></p>
<p><em>Here, the yellow network cable is plugged in the WAN port (right).</em></p>
<p>Unplug and replug the power supply cable, and at the same time press Ctrl-C several times.</p>
<p>You should get a
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">CFE&gt;</div>
<p> prompt.<br />
Type: </p>
<p class="code">ifconfig eth0 -auto<br />
flash -noheader 192.168.0.44:openwrt-wgt634u-2.6-squashfs.bin flash0.os
</p>
<p>This will ask the DHCP server on the network for an ip address to set on the NetGear WAN interface<br />
(you can verify that the link is OK by pinging your TFTPd server:
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">ping <span style="color: #ff4500;">192.168</span><span style="color: #ff4500;">.0</span><span style="color: #ff4500;">.44</span></div>
<p>) and then upload the OpenWRT image to the NetGear.<br />
When done, type reboot.</p>
<p>Wait a few minute, for the flash to be reinitialized, then hit enter to get a console.<br />
Set a password for root (which will activate the SSH daemon):
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">passwd root</div>
<p>.<br />
Edit the file
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">/etc/firewall.<span style="color: #dc143c;">user</span></div>
<p> and uncomment the two lines that allow SSH (port 22) connections to the WAN interface:</p>
<p class="code">### Open port to WAN<br />
# &#8212; This allows port 22 to be answered by (dropbear on) the router<br />
 iptables -t nat -A prerouting_wan -p tcp &#8211;dport 22 -j ACCEPT<br />
 iptables        -A input_wan      -p tcp &#8211;dport 22 -j ACCEPT
</p>
<p>Then reboot.<br />
You should now be able to log in remotely without using the serial cable!</p>
<p align="center"><img src="/wp-content/uploads/logon.png" alt="OpenWRT Logon" title="OpenWRT Logon" width="505" height="294" border="0" /></p>
<p>Logon and type:</p>
<p class="code">ipkg update<br />
ipkg install kmod-soundcore<br />
ipkg install kmod-usb-core<br />
ipkg install kmod-usb-ohci<br />
ipkg install kmod-usb-audio
</p>
<p>Verify that everything is OK by looking into the
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">/dev</div>
<p> directory. There should be a
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">/dev/control*</div>
<p> and a
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">/dev/pcm*</div>
<p> file:</p>
<p class="code">root@OpenWrt:~# ls /dev/pcm* /dev/cont*<br />
/dev/controlC0  /dev/pcmC0D0c   /dev/pcmC0D0p
</p>
<p> If yes, cool! Otherwise, take a look at the kernel logs (
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">dmesg</div>
<p>) for any problem.<br />
Now, your USB soundcard should be activated. <strong>But that&#8217;s not sufficient to make it work</strong>. You&#8217;ll have to add some symlinks to make alsa work correctly.<br />
First install alsa utilities:</p>
<p class="code">ipkg install alsa-utils<br />
ipkg install alsa-lib
</p>
<p>Then create the symlinks:</p>
<p class="code">mkdir /dev/snd<br />
ln -s /dev/controlC0 /dev/snd/controlC0<br />
ln -s /dev/pcmC0D0c /dev/snd/pcmC0D0c</p>
<p>Now run
<div class="python" style="font-family: monospace;color: #000066; border: 1px solid orange; margin: 5px; padding: 5px; background-color: #ffffff;">alsamixer</div>
<p>. You should get an ASCII vertical bar that allows you to set the volume:</p>
<p align="center"><img src="/wp-content/uploads/alsamixer.png" alt="alsamixer on openwrt" title="alsamixer on openwrt" width="667" height="443" border="0" /></p>
<p>That&#8217;s all for now. You now have a working WGT63U router which can play sound.</p>
<p class="information">Next part will be about configuring Wifi as a client, and installing mpd (http://www.musicpd.org/ Music Player Daemon) and linking it to a server to allow direct play from a remote server!
</p>
<h2>References</h2>
<ul>
<li><a href="http://forum.openwrt.org/search.php?search_id=574741614" class="liexternal">Search for WGT634U</a> on http://forum.openwrt.org</li>
<li><a href="http://devices.natetrue.com/musicap/" class="liexternal">Nathan True</a>&#8217;s howto for doing the same thing</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=Oe8ragsl"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=Oe8ragsl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=podSEcYX"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=podSEcYX" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489486" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/hardware/howto-installation-of-openwrt-on-a-wgt634u-usb-router/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Journées Python Francophone 2007 Conference at La Villette, France</title>
		<link>http://www.gradstein.info/python/22/</link>
		<comments>http://www.gradstein.info/python/22/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 20:35:17 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[python]]></category>

	<!-- AutoMeta Start -->
	<category>today</category>
	<category>the</category>
	<category>journée</category>
	<category>python</category>
	<category>2007</category>
	<category>conference</category>
	<category>prepare</category>
	<category>advanced</category>
	<category>twisted</category>
	<category>presentation</category>
	<category>half</category>
	<category>the</category>
	<category>twisted</category>
	<category>intro</category>
	<category>finely</category>
	<category>presented</category>
	<category>alas</category>
	<category>lightning</category>
	<category>talks</category>
	<category>year</category>
	<category>conference</category>
	<category>there</category>
	<category>introductory</category>
	<category>type</category>
	<category>and</category>
	<category>the</category>
	<category>afternoon</category>
	<category>presentations</category>
	<category>thanks</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/python/22/</guid>
		<description><![CDATA[I went today to the Journée Python 2007 Conference in France. I managed to see half of the Twisted intro, some lightning talks, and most of the afternoon presentations (thanks to Ido&#8217;s mid-day nap).
Most of the talks were introductory type, but they were finely presented (alas most of the audience already knew python). I hope [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gradstein.info/wp-content/uploads/image5.jpg"  rel="lightbox"><img src="http://www.gradstein.info/wp-content/uploads/.thumbs/.image5.jpg" alt="Journee Python Conference 2007" align="right" border="0" height="72" width="96" /></a>I went today to the Journée Python 2007 Conference in France. I managed to see half of the Twisted intro, some lightning talks, and most of the afternoon presentations (thanks to Ido&#8217;s mid-day nap).</p>
<p>Most of the talks were introductory type, but they were finely presented (alas most of the audience already knew python). I hope I&#8217;ll find the time to prepare some more advanced Twisted presentation for next year&#8217;s Conference (there&#8217;s one, right?)</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=ljdJZwCD"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=ljdJZwCD" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=0xXaYjzq"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=0xXaYjzq" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489487" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/22/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Change in syntax and functionality in Asterisk AstDB functions</title>
		<link>http://www.gradstein.info/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/</link>
		<comments>http://www.gradstein.info/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/#comments</comments>
		<pubDate>Mon, 14 May 2007 10:32:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[asterisk]]></category>

	<!-- AutoMeta Start -->
	<category>access</category>
	<category>the</category>
	<category>astdb</category>
	<category>database</category>
	<category>a</category>
	<category>berkeley</category>
	<category>local</category>
	<category>database</category>
	<category>2</category>
	<category>background one_local forward forward_number_is</category>
	<category>3</category>
	<category>background one_local forward forward_number_is</category>
	<category>1</category>
	<category>gotoif   db_exists forward   f_ext</category>
	<category>1</category>
	<category>set forward_number   db forward 1234</category>
	<category>1</category>
	<category>my</category>
	<category>newly</category>
	<category>installed</category>
	<category>asterisk</category>
	<category>1 4 4</category>
	<category>3</category>
	<category>sayalpha   forward_number</category>
	<category>4</category>
	<category>sayalpha   forward_number</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/</guid>
		<description><![CDATA[Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged &#8220;simpler&#8221; 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 [...]]]></description>
			<content:encoded><![CDATA[<p>Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged &#8220;simpler&#8221; 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:</p>
<p class="code">exten = s,1,Set(forward_number=${DB(FORWARD/1234)})<br />
exten = s,2,Background(one_local/forward/forward_number_is)<br />
exten = s,3,sayalpha(${forward_number})<br />
exten = s,4,Goto(s-report_mode,1)<br />
exten = s,102,NoOp(Pas de valeur ce qui est normal)<br />
exten = s,103,Goto(s-not_set,1)</p>
<p>But with my newly installed Asterisk 1.4.4, it doesn&#8217;t jump anymore. It continues to s,2 :-(.<br />
So I guess I need to add a <a href="http://www.voip-info.org/wiki/view/Asterisk+func+db_exists" class="liexternal">supplementary line</a> to explicitely test the presence of the key:</p>
<p class="code">exten = s,1,GotoIf(${DB_EXISTS(FORWARD/${F_EXT})}?:102)<br />
exten = s,2,Set(forward_number=${DB_RESULT})<br />
exten = s,3,Background(one_local/forward/forward_number_is)<br />
exten = s,4,sayalpha(${forward_number})<br />
&#8230;<br />
exten = s,102,NoOp(Pas de valeur ce qui est normal)</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=NRkfThQ5"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=NRkfThQ5" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?a=9WUBy04M"><img src="http://feeds.feedburner.com/~f/LiorGradsteinsBlog?i=9WUBy04M" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LiorGradsteinsBlog/~4/130489488" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
