<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>bits by bernd</title>
	<atom:link href="http://bernde.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bernde.wordpress.com</link>
	<description>programming, web, linux and others from bernd essl</description>
	<lastBuildDate>Fri, 02 Jan 2009 12:46:15 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='bernde.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/3da40d8e6fabbe9d734984fd02af0493?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>bits by bernd</title>
		<link>http://bernde.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bernde.wordpress.com/osd.xml" title="bits by bernd" />
		<item>
		<title>Git hints</title>
		<link>http://bernde.wordpress.com/2009/01/02/git-hints/</link>
		<comments>http://bernde.wordpress.com/2009/01/02/git-hints/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 12:46:15 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[version controll system]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=180</guid>
		<description><![CDATA[Here are some hints I find very useful for working with git.
More colour 
To get a colourful output in your terminal.


$ git config --global color.branch auto
$ git config --global color.status auto
$ git config --global color.diff true


Merging
For merging I like to use the program `meld`. Add any merge tool you want, such as kdiff3 or xxdiff.


$ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=180&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here are some hints I find very useful for working with git.</p>
<p><strong>More colour </strong></p>
<p>To get a colourful output in your terminal.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git config --global color.branch auto
$ git config --global color.status auto
$ git config --global color.diff true
</pre>
</div>
<p><strong>Merging</strong></p>
<p>For merging I like to use the program `meld`. Add any merge tool you want, such as kdiff3 or xxdiff.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git config --global merge.tool meld
</pre>
</div>
<p>For conflicts, you can solve the mess, with your favourite merge program.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git mergetool
</pre>
</div>
<p><a href="http://bernde.files.wordpress.com/2009/01/meld.png"><img src="http://bernde.files.wordpress.com/2009/01/meld.png?w=300&#038;h=177" alt="meld" title="meld" width="300" height="177" class="alignnone size-medium wp-image-185" /></a></p>
<p><strong>Checking the logs</strong></p>
<p>Shows the commit log like `git log` including a listing of which files had modifications in a particular commit.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git whatchanged
</pre>
</div>
<p><strong>Reset a file to an old revision</strong></p>
<p>Overwrite the file `foobar` with the third last revision of `foobar`.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git show HEAD~3:foobar &gt; foobar
</pre>
</div>
<p><strong>Writing a hook</strong></p>
<p>Remove all compiled python files (pyc) before a commit start. To activate a hook you have to make the hook you want in `.git/hooks/` executable.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ echo "find -name '*.pyc' -delete" &gt;&gt; .git/hooks/pre-commit
$ chmod u+x .git/hooks/pre-commit
</pre>
</div>
<p><strong>Exporting</strong></p>
<p>Create a clean repository export to a folder `foo` in a compressed archive.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git archive --format=tar --prefix=foo/ HEAD | gzip -c &gt; foo.tar.gz
</pre>
</div>
<p>That&#8217;s not so handy like in svn, I know. Maybe you want to use rsync instead?</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ rsync --exclude='.git'
</pre>
</div>
<p><strong>Blame with GUI</strong></p>
<p>You must install the git-gui package for using it.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
$ git gui blame file
</pre>
</div>
<p><a href="http://bernde.files.wordpress.com/2009/01/git-gui-blame.png"><img src="http://bernde.files.wordpress.com/2009/01/git-gui-blame.png?w=300&#038;h=185" alt="git-gui-blame" title="git-gui-blame" width="300" height="185" class="alignnone size-medium wp-image-184" /></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=180&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2009/01/02/git-hints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>

		<media:content url="http://bernde.files.wordpress.com/2009/01/meld.png?w=300" medium="image">
			<media:title type="html">meld</media:title>
		</media:content>

		<media:content url="http://bernde.files.wordpress.com/2009/01/git-gui-blame.png?w=300" medium="image">
			<media:title type="html">git-gui-blame</media:title>
		</media:content>
	</item>
		<item>
		<title>Mit GNOME Do produktiver am GNOME-Desktop (freiesMagazin)</title>
		<link>http://bernde.wordpress.com/2008/12/03/mit-gnome-do-produktiver-am-gnome-desktop-freiesmagazin/</link>
		<comments>http://bernde.wordpress.com/2008/12/03/mit-gnome-do-produktiver-am-gnome-desktop-freiesmagazin/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 11:08:12 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[freiesMagazin]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=176</guid>
		<description><![CDATA[GNOME Do erlaubt den Anwendern, sehr schnell durch heterogene Daten zu navigieren, Anwendungen und Skripte zu starten sowie Aktionen auszuführen. Ein ähnliches Programm existiert für Mac OS X und heißt Quicksilver. GNOME Do ist einfach, wenn gewollt komplett ohne Maus zu bedienen und sieht auch grafisch hervorragend aus. Nicht zu Unrecht heißt es auf der [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=176&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>GNOME Do erlaubt den Anwendern, sehr schnell durch heterogene Daten zu navigieren, Anwendungen und Skripte zu starten sowie Aktionen auszuführen. Ein ähnliches Programm existiert für Mac OS X und heißt Quicksilver. GNOME Do ist einfach, wenn gewollt komplett ohne Maus zu bedienen und sieht auch grafisch hervorragend aus. Nicht zu Unrecht heißt es auf der Entwickler-Website „A powerful, speedy, and sexy remote control for your GNOME Desktop“.</p>
<p>erschienen im freiesMagazin November 2008</p>
<p><a href="http://www.freiesmagazin.de/mobil/freiesMagazin-2008-11-bilder.html#08_11_gnomedo">http://www.freiesmagazin.de/mobil/freiesMagazin-2008-11-bilder.html#08_11_gnomedo</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=176&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/12/03/mit-gnome-do-produktiver-am-gnome-desktop-freiesmagazin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>Gnome Deskbar Applet plugins</title>
		<link>http://bernde.wordpress.com/2008/11/20/gnome-deskbar-applet-plugins/</link>
		<comments>http://bernde.wordpress.com/2008/11/20/gnome-deskbar-applet-plugins/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:06:34 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=152</guid>
		<description><![CDATA[This is a collection of my plugins, I wrote for the Gnome Deskbar Applet. Feel free to use them!
You can find the code repository on launchpad  https://code.launchpad.net/~bernde/+junk/deskbar-plugins. 
leo de/en translate &#8211; plugin
Queries the online dictionary of dict.leo.org, only for english or german words.


MD5 &#8211; plugin
Converts any string to a MD5 hash.

timestamp &#8211; plugin
Returns datetime [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=152&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is a collection of my plugins, I wrote for the Gnome Deskbar Applet. Feel free to use them!<br />
You can find the code repository on launchpad <a href="https://code.launchpad.net/~bernde/+junk/deskbar-plugins"> https://code.launchpad.net/~bernde/+junk/deskbar-plugins</a>. </p>
<p><strong>leo de/en translate &#8211; plugin</strong></p>
<p>Queries the online dictionary of dict.leo.org, only for english or german words.</p>
<p><a href="http://bernde.files.wordpress.com/2008/11/deskbar-leo.png"><img src="http://bernde.files.wordpress.com/2008/11/deskbar-leo.png?w=353&#038;h=228" alt="deskbar-leo" title="deskbar-leo" width="353" height="228" class="alignnone size-full wp-image-153" /></a></p>
<p><span id="more-152"></span></p>
<p><strong>MD5 &#8211; plugin</strong></p>
<p>Converts any string to a MD5 hash.</p>
<p><a href="http://bernde.files.wordpress.com/2008/11/deskbar-md5.png"><img src="http://bernde.files.wordpress.com/2008/11/deskbar-md5.png?w=353&#038;h=196" alt="deskbar-md5" title="deskbar-md5" width="353" height="196" class="alignnone size-full wp-image-163" /></a></p>
<p><strong>timestamp &#8211; plugin</strong></p>
<p>Returns datetime from given timestamp.</p>
<p><a href="http://bernde.files.wordpress.com/2008/11/deskbar-timestamp.png"><img src="http://bernde.files.wordpress.com/2008/11/deskbar-timestamp.png?w=352&#038;h=195" alt="deskbar-timestamp" title="deskbar-timestamp" width="352" height="195" class="alignnone size-full wp-image-165" /></a></p>
<p><strong>password generator &#8211; plugin</strong></p>
<p>Returns random password, ready to copy.</p>
<p><a href="http://bernde.files.wordpress.com/2008/11/deskbar-pwgen.png"><img src="http://bernde.files.wordpress.com/2008/11/deskbar-pwgen.png?w=352&#038;h=194" alt="deskbar-pwgen" title="deskbar-pwgen" width="352" height="194" class="alignnone size-full wp-image-167" /></a></p>
<p><strong>Install</strong></p>
<p>Do a bzr (Bazar) checkout: </p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">bzr branch lp:~bernde/+junk/deskbar-plugins</div>
<p>Copy the python files (.py) to the folder ~/.gnome2/deskbar-applet/modules-2.20-compatible/ and activate the plugins you want in the preferences settings of Gnome Deskbar.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=152&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/20/gnome-deskbar-applet-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>

		<media:content url="http://bernde.files.wordpress.com/2008/11/deskbar-leo.png" medium="image">
			<media:title type="html">deskbar-leo</media:title>
		</media:content>

		<media:content url="http://bernde.files.wordpress.com/2008/11/deskbar-md5.png" medium="image">
			<media:title type="html">deskbar-md5</media:title>
		</media:content>

		<media:content url="http://bernde.files.wordpress.com/2008/11/deskbar-timestamp.png" medium="image">
			<media:title type="html">deskbar-timestamp</media:title>
		</media:content>

		<media:content url="http://bernde.files.wordpress.com/2008/11/deskbar-pwgen.png" medium="image">
			<media:title type="html">deskbar-pwgen</media:title>
		</media:content>
	</item>
		<item>
		<title>Praxiswissen Ruby</title>
		<link>http://bernde.wordpress.com/2008/11/20/praxiswissen-ruby/</link>
		<comments>http://bernde.wordpress.com/2008/11/20/praxiswissen-ruby/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 14:20:19 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Book]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=148</guid>
		<description><![CDATA[Sascha Kersken hilft mit seinem leicht verständlichen Buch &#8220;Praxiswissen Ruby&#8221; AnfängerInnen und UmsteigerInnen mit praktischen Beispielen in die Welt der Ruby-Programmierung einzusteigen.
Den Anfang machen die Geschichte von Ruby, die Installation und das klassische &#8220;Hello World&#8221;-Skript. In den nächsten Kapiteln geht es darum, sich mit den Sprachgrundlagen und jeder Menge Ruby-typischem &#8220;syntactic sugar&#8221; vertraut zu machen. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=148&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sascha Kersken hilft mit seinem leicht verständlichen Buch &#8220;Praxiswissen Ruby&#8221; AnfängerInnen und UmsteigerInnen mit praktischen Beispielen in die Welt der Ruby-Programmierung einzusteigen.</p>
<p>Den Anfang machen die Geschichte von Ruby, die Installation und das klassische &#8220;Hello World&#8221;-Skript. In den nächsten Kapiteln geht es darum, sich mit den Sprachgrundlagen und jeder Menge Ruby-typischem &#8220;syntactic sugar&#8221; vertraut zu machen. Nach funktionalen und prozeduralen Programmier-Beispielen geht es im dritten Kapitel um Objektorientierte Programmierung. Dabei wird das Verwenden von eingebauten Ruby-Klassen (Ein- und Ausgabe, Datum und Zeit usw.) sowie der Ruby-Hilfe &#8220;ri&#8221; vermittelt. Im nächsten Kapitel beginnen die LeserInnen mit dem Erstellen eigener Klassen. Dabei bleiben keine Fragen rund um die Objektorientiertung von Ruby offen. Nach einer sehr kurzen und gelungenen Einführung in die Netzwerk-Topologie werden Netzwerkanwendungen mit Ruby gebaut, etwa ein Browser und ein Server. Einer der bekanntesten Bereiche von Ruby ist eindeutig das Web-Framework Ruby on Rails, das im letzten Kapitel eingesetzt wird um eine Webanwendung zu bauen, mit der sich die CD-Sammlung verwalten lässt. Um Webanwendungen ging es schon im Kapitel davor, allerdings um einfachere, ohne Ruby on Rails, mittels CGI. Ebenso ging es um Zugriffe auf MySQL-Datenbanken. Ganz hinten befindet sich eine hilfreiche Kurzreferenz.</p>
<p>Das Buch bietet einen guten und vor allem schnellen Einstieg in die Sprache Ruby und schneidet dabei auch das Web-Framework Ruby on Rails kurz an. Der Aufbau ist logisch und die Beispiele praxisnahe. Damit ist es für jedeN, egal mit welchem Vorwissen, eine ausgezeichnete und flott durchgearbeitete Lektüre, die mit Ruby vertraut macht.</p>
<p><em>Sascha Kersken<br />
Praxiswissen Ruby<br />
O’Reilly Verlag 2008<br />
408 Seiten<br />
EUR 29.90<br />
ISBN: 978-3-89721-478-1</p>
<p>rezensiert von Bernd Essl (November 2008)</em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=148&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/20/praxiswissen-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>Different templates for iPhone/iPod in Django</title>
		<link>http://bernde.wordpress.com/2008/11/14/detection-for-iphone-django/</link>
		<comments>http://bernde.wordpress.com/2008/11/14/detection-for-iphone-django/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 16:03:57 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[middleware]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=136</guid>
		<description><![CDATA[I use this Django Middleware for detecting iPhones or iPods and for setting the template directory dynamically. If the user agent is an iPhone or iPod, the template directory is changed, so that different templates for the iProducts can be used. The idea is taken from this snippet, but it only detects iPhones and I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=136&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I use this Django Middleware for detecting iPhones or iPods and for setting the template directory dynamically. If the user agent is an iPhone or iPod, the template directory is changed, so that different templates for the iProducts can be used. The idea is taken from <a href="http://www.djangosnippets.org/snippets/1098/">this snippet</a>, but it only detects iPhones and I had some troubles with caching so I wrote one myself. </p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
from django.conf import settings
import re

class iPhoneMiddleware(object):
    """
    If the Middleware detects an iPhone/iPod the template dir changes to the
    iPhone template folder.
    """

    def __init__(self):
        self.normal_templates = settings.TEMPLATE_DIRS
        self.iphone_templates = (settings.TEMPLATE_DIRS[0] + '/iphone',)

    def process_request(self, request):
        p = re.compile('iPhone|iPod', re.IGNORECASE)
        if p.search(request.META['HTTP_USER_AGENT']):
            # user agent looks like iPhone or iPod
            settings.TEMPLATE_DIRS = self.iphone_templates
        else:
            # other user agents
            settings.TEMPLATE_DIRS = self.normal_templates
        return
</pre>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=136&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/14/detection-for-iphone-django/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>tips and tricks with .htaccess</title>
		<link>http://bernde.wordpress.com/2008/11/12/tips-and-tricks-with-htaccess/</link>
		<comments>http://bernde.wordpress.com/2008/11/12/tips-and-tricks-with-htaccess/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 18:08:06 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=131</guid>
		<description><![CDATA[.htaccess (hypertext access) is the default name of Apache&#8217;s directory-level configuration file. .htaccess is placed in a particular directory, and the directives in the .htaccess file apply to that directory, and all subdirectories thereof. 
The most common feature is to restrict access to a folder by force the user to a login prompt, but there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=131&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>.htaccess (hypertext access) is the default name of Apache&#8217;s directory-level configuration file. .htaccess is placed in a particular directory, and the directives in the .htaccess file apply to that directory, and all subdirectories thereof. </p>
<p>The most common feature is to restrict access to a folder by force the user to a login prompt, but there are some other helpful things also that I show you in this posting.</p>
<p><span id="more-131"></span></p>
<p>Allow access only for the IP 127.0.0.1</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
order deny,allow<br />
allow from 127.0.0.1<br />
deny from all
</div>
<p>Forbid access to files with extensions .bak, .sql, .inc.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:.5em;">&lt;FilesMatch &#8220;\.(bak|sql|inc)$&#8221; &gt;<br />
deny from all<br />
&lt;/FilesMatch&gt;</div>
<p>This line make the “.txt” extension to executable PHP scripts.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:.5em;">AddType application/x-httpd-php .txt</div>
<p>Redirceting from web folder &#8220;bla&#8221; to http://phpsecurity.wordpress.com/</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:.5em;">Redirect /bla http://phpsecurity.wordpress.com/</div>
<p>Rewriting you can use to make better reading URLs. It&#8217;s very handy for SEO and looks much more friendlier than long-cryptic looking URLs for your visitors.<br />
In this example the URL can be http://example.org/de/ or http://example.org/en/ and the Rewrite engine catches the parameters in the brackets and give the value “de” or “en” to the $lang to index.php.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:.5em;">RewriteEngine on<br />
RewriteRule ^(de|en)/$ /test/index.php?lang=$1</div>
<p>Last but not least, set a password prompt to any directory you want</p>
<p>on linux you create a .htpasswd file with:</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:.5em;">htpasswd -c /path_to_folder/.htpasswd username</div>
<p>than you put this lines to your .htaccess:</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:.5em;">AuthUserFile /path_to_folder/.htpasswd<br />
AuthGroupFile /dev/null<br />
AuthName &#8220;name&#8221;<br />
AuthType Basic<br />
&lt;Limit GET&gt;<br />
require valid-user<br />
&lt;/Limit&gt;
</div>
<p>If you have any problems with .htaccess and you have access to your server, look in the error logs of your apache server. You find them in /var/log/apache2/error.log (depending on system).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=131&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/12/tips-and-tricks-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>Protect your application against SQL injections (2)</title>
		<link>http://bernde.wordpress.com/2008/11/11/protect-your-application-against-sql-injections-2/</link>
		<comments>http://bernde.wordpress.com/2008/11/11/protect-your-application-against-sql-injections-2/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 22:43:39 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=87</guid>
		<description><![CDATA[In part 1 we made sure that the value is an integer, but what if a value could be a string?
You have to escape special characters in a string for using in a SQL statement. This means that a single quote (&#8216;) get a backslash before (\&#8217;).
There are escape functions for each popular database:

MySQL: mysql_real_escape_string()
PostgreSQL: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=87&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In <a href="http://phpsecurity.wordpress.com/2007/12/05/protect-your-application-against-sql-injections-part-1/">part 1</a> we made sure that the value is an integer, but what if a value could be a string?<br />
You have to escape special characters in a string for using in a SQL statement. This means that a single quote (&#8216;) get a backslash before (\&#8217;).</p>
<p>There are escape functions for each popular database:</p>
<p><span id="more-87"></span></p>
<p>MySQL: mysql_real_escape_string()<br />
PostgreSQL: pg_escape_string()<br />
SQLite: sqlite_escape_string() </p>
<p>You can also use PDO&#8217;s prepared statements support. PDO uses the native prepared statement support for your database.<br />
As you can see in the next example $_GET['name'] would be escaped, before the query touches the database.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
&lt;?php<br />
prepare(&#8220;INSERT INTO user (name) VALUES (<strong>?</strong>)&#8221;);<br />
$s-&gt;bindParam(1, $_GET['name']);<br />
$s-&gt;execute();<br />
?&gt;
</div>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
&lt;?php<br />
// Using named parameters<br />
$s = $db-&gt;prepare(&#8220;INSERT INTO user (name) VALUES (<strong>:name</strong>)&#8221;);<br />
$s-&gt;execute(array(&#8216;name&#8217; =&gt; $_GET['name']);<br />
?&gt;
</div>
<p>There are some database abstraction layer (DAL) for PHP, such as AdoDB, PEAR::MDB2, or Zend_Db. Most DAL&#8217;s provide support for prepared statements and quoting like PDO.</p>
<p>It&#8217;s up to you which protection you use, but think about that your database is the heart of your website.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=87&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/11/protect-your-application-against-sql-injections-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>Protect your application against SQL injections (1)</title>
		<link>http://bernde.wordpress.com/2008/11/11/protect-your-application-against-sql-injections-1/</link>
		<comments>http://bernde.wordpress.com/2008/11/11/protect-your-application-against-sql-injections-1/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 22:39:00 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=83</guid>
		<description><![CDATA[Many applications use a database to store data. Popular products are MySQL, SQLite and PostgreSQL.
A lot websites use a number called ID in the URL to get more information to a dataset like a product or a posting. 
The problem of using ID&#8217;s is if they aren&#8217;t validated, bad guys and girls can spy, change [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=83&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Many applications use a database to store data. Popular products are MySQL, SQLite and PostgreSQL.<br />
A lot websites use a number called ID in the URL to get more information to a dataset like a product or a posting. </p>
<p>The problem of using ID&#8217;s is if they aren&#8217;t validated, bad guys and girls can spy, change or destroy your database by manipulating the SQL query.<br />
This attack is called <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL injection</a>.</p>
<p>An example to get the field “title” in the row with the value of $_GET['id']</p>
<p><span id="more-83"></span></p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
&lt;?php<br />
$result = mysql_query(“SELECT title FROM data WHERE id = $_GET['id']”);<br />
?&gt;
</div>
<p>If $_GET['id'] is an integer everything is fine but it&#8217;s possibly to manipulate the URL-query with something like this:</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">1;DROP TABLE data;</div>
<p>In this case your table was deleted.</p>
<p>To protect your database first validate and then cast if you&#8217;re waiting for an integer in your code logic.</p>
<p>In PHP 5.2 you can use the native filter to validate the user input:</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
&lt;?php<br />
if (filter_var($_GET['id'],FILTER_VALIDATE_INT))<br />
	$save_id = $_GET['id'];<br />
?&gt;
</div>
<p>If the value is something nasty like “?id=1;DROP TABLE users”, $save_id would be false otherwise it would get the value of the user input (integer).</p>
<p>In older PHP versions you can check against the <a href="http://at.php.net/manual/de/function.is-numeric.php">is_numeric() function</a>.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
&lt;?php<br />
if (is_numeric($_GET['id']))<br />
	$save_id = $_GET['id'];<br />
?&gt;
</div>
<p>The use of (int) to cast a variable type to an integer, removes any doubt that the output will be an integer and not a string.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">&lt;?php<br />
$foo = (int)$_GET['id'];<br />
?&gt;
</div>
<p>This makes a nasty URL like “.php?id=23;DROP TABLE users” to 23 as value from $foo.</p>
<p>Put them all together and the code should look like this:</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">&lt;?php<br />
$save_id = “”;<br />
if (is_numeric($_GET['id'])) {<br />
	$save_id = (int)$_GET['id'];<br />
	$sql = &#8216;SELECT * FROM table WHERE id = &#8216;.$save_id.&#8217; &#8216;;<br />
}<br />
?&gt;
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=83&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/11/protect-your-application-against-sql-injections-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>Train websecurity with WebGoat</title>
		<link>http://bernde.wordpress.com/2008/11/11/train-websecurity-with-webgoat/</link>
		<comments>http://bernde.wordpress.com/2008/11/11/train-websecurity-with-webgoat/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 21:41:42 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Web Security]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://bernde.wordpress.com/?p=8</guid>
		<description><![CDATA[WebGoat is a insecure web application which is designed to teach web  application security concepts.
You can try hacking: Access Control Flaws, Authentication Flaws, Session Management Flaws, Cross-Site Scripting (XSS), Buffer Overflows, Injection Flaws, Improper Error Handling, Insecure Storage,  Denial of Service, Insecure Configuration, Web Services and AJAX Security.
There is a &#8220;Lesson Plan&#8221; a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=8&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>WebGoat is a insecure web application which is designed to teach web  application security concepts.<br />
You can try hacking: Access Control Flaws, Authentication Flaws, Session Management Flaws, Cross-Site Scripting (XSS), Buffer Overflows, Injection Flaws, Improper Error Handling, Insecure Storage,  Denial of Service, Insecure Configuration, Web Services and AJAX Security.</p>
<p>There is a &#8220;Lesson Plan&#8221; a kind of tutorial and in the &#8220;Hints Menu&#8221; you can view the parameters, cookies, the Code and the solution.<br />
It&#8217;s a lot of fun and you learn more about web application security.</p>
<p><span id="more-8"></span><br />
You can download the app from http://code.google.com/p/webgoat/.</p>
<p>It comes with the Java Runtime Environment and a configured Tomcat 5.5<br />
server and should run on any platform.</p>
<p>If you are using Linux or OSX you must download http://webgoat.googlecode.com/svn/tags/webgoat-5.1/main/webgoat.sh  to start webgoat.<br />
Put the webgoat.sh in your unpacked webgoat directory and start it<br />
with the terminal:</p>
<p>$ sh webgoat.sh start8080</p>
<p>On Windows it should run throw a double-click on webgoat8080.bat.</p>
<p>Browse to http://guest:guest@127.0.0.1:8080/WebGoat/attack with your<br />
browser and start your first lesson.</p>
<p>happy hacking</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=8&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/11/train-websecurity-with-webgoat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
		<item>
		<title>Some notes on handling Development and Production Servers with Django.</title>
		<link>http://bernde.wordpress.com/2008/11/11/development-and-production-servers-with-django/</link>
		<comments>http://bernde.wordpress.com/2008/11/11/development-and-production-servers-with-django/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 16:05:50 +0000</pubDate>
		<dc:creator>bernd essl</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://djangoscope.wordpress.com/?p=22</guid>
		<description><![CDATA[How to find out if we are on development or production?
The first thing I do is to define a variable &#8220;DEVELOPMENT_MODE&#8220; in settings.py, that checks if the server is running on my local machine or not. I found this nice idea on the djangoproject.com website: http://code.djangoproject.com/browser/djangoproject.com/django_website/settings.py



import os, platform

DEVELOPMENT_MODE = (platform.node() != "my_hostname")


Set the hostname, you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=22&subd=bernde&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>How to find out if we are on development or production?</strong></p>
<p>The first thing I do is to define a variable &#8220;DEVELOPMENT_MODE&#8220; in settings.py, that checks if the server is running on my local machine or not. I found this nice idea on the djangoproject.com website: <a href="http://code.djangoproject.com/browser/djangoproject.com/django_website/settings.py">http://code.djangoproject.com/browser/djangoproject.com/django_website/settings.py</a></p>
<p><span id="more-22"></span></p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
import os, platform

DEVELOPMENT_MODE = (platform.node() != "my_hostname")
</pre>
</div>
<p>Set the hostname, you can find it out with the command
<pre>hostname</pre>
<p> in your terminal.<br />
Now on your local machine DEVELOPMENT_MODE variable is True, on production should be False.</p>
<p><strong>settings </strong></p>
<p>With this variable you can split your settings for production and development. This makes sense for the settings like DATABASE_*, DEBUG, MEDIA_*, CACHE_BACKEND and others none django-related-stuff like google-API keys.</p>
<p>An example of my settings.py:</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
if DEVELOPMENT_MODE:
    DEBUG = True
    DATABASE_ENGINE = 'postgresql_psycopg2'
    DATABASE_NAME = 'xxx'
    DATABASE_USER = 'xxx'
    DATABASE_PASSWORD = 'xxx'
    DATABASE_HOST = 'localhost'
    TEMPLATE_DIRS = ('/xxx/templates')
    MEDIA_ROOT = '/xxx/media/'
    MEDIA_URL = '/media/'
    GOOGLE_KEY = "ABQIAAAA2OXrNyQ" #localhost
    CACHE_BACKEND = 'dummy:///'
else:
    DEBUG = False
    DATABASE_ENGINE = 'postgresql_psycopg2'
    DATABASE_NAME = 'xxx'
    DATABASE_USER = 'xxx'
    DATABASE_PASSWORD = 'xxx'
    DATABASE_HOST = ''
    TEMPLATE_DIRS = ('/xxx/templates',)
    MEDIA_ROOT = '/var/www/server/media/'
    MEDIA_URL = 'http://server/media/'
    GOOGLE_KEY = "ABQIA66g" #domain
    CACHE_BACKEND = 'file:///var/tmp/django_cache'

DATABASE_PORT = ''
...
</pre>
</div>
<p><strong>serve static files</strong></p>
<p>I had a long time on my local machine an apache2 for serving static/media files running. I changed this setting now to &#8216;django.views.static.serve&#8217; which is the build-in fileserver from django. The reason was that I didn&#8217;t want to configure on every webdesigners machine the apache2, only for serving the media. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
With the DEVELOPMENT_MODE variable it&#8217;s easy to do that. Only append this to the urls.py.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
from settings import DEVELOPMENT_MODE

if DEVELOPMENT_MODE:
    urlpatterns += patterns('',
        url(r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': "/media/"}),
    )
</pre>
</div>
<p>The &#8216;django.views.static.serve&#8217; works very well for development, but never ever use it on production!</p>
<p><a href="http://www.djangoproject.com/documentation/static_files/">http://www.djangoproject.com/documentation/static_files/</a></p>
<p><strong>caching</strong></p>
<p>When you use a cache framework, I&#8217;m sure you want it only on your production site, so you can use on your local machine the dummy cache that doesn&#8217;t actually cache.</p>
<div style="border:1px dashed rgb(140,172,187);overflow:auto;background-color:rgb(247,249,250);color:rgb(101,101,101);font-size:12px;margin-bottom:10px;padding:1em 1em 10px;">
<pre>
if DEVELOPMENT_MODE:
    CACHE_BACKEND = 'dummy:///'
...
</pre>
</div>
<p><a href="http://www.djangoproject.com/documentation/cache/#dummy-caching-for-development">http://www.djangoproject.com/documentation/cache/#dummy-caching-for-development</a></p>
<p><strong>database</strong></p>
<p>I&#8217;m using PostgreSQL now on development and production site. I found it hard to import/export dumps (structure/data) from Sqlite to PostgreSQL and vice versa. I worked a lot with MySQL and have the most experience with it, but with Django it really sucks sometimes, no fixtures support and no transactions.</p>
<p>Ok that&#8217;s it I hope you enjoy reading and please give me some of your tips.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bernde.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bernde.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bernde.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bernde.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bernde.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bernde.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bernde.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bernde.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bernde.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bernde.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bernde.wordpress.com&blog=5485495&post=22&subd=bernde&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bernde.wordpress.com/2008/11/11/development-and-production-servers-with-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7eaf1643f948b71fd91c0947a195d913?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bernd essl</media:title>
		</media:content>
	</item>
	</channel>
</rss>