<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>.::ich-wars-nicht.ch::.</title>
	<atom:link href="http://blog.ich-wars-nicht.ch/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ich-wars-nicht.ch</link>
	<description>yet another blog about technology, linux, and everyday life...</description>
	<lastBuildDate>Sun, 22 Jan 2012 22:59:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
		<item>
		<title>phpBB Soundcloud Embed BBCode</title>
		<link>http://blog.ich-wars-nicht.ch/2012/01/phpbb-soundcloud-embed-bbcode/</link>
		<comments>http://blog.ich-wars-nicht.ch/2012/01/phpbb-soundcloud-embed-bbcode/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 22:59:19 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[bbcode]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[soundcloud]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3246</guid>
		<description><![CDATA[Um Soundcloud-Songs direkt in ein phpBB Forum einzubinden, einfach folgenden BB-Code im Backend erstellen: Benutzung [Soundcloud]{URL}[/Soundcloud] HTML Ersetzung &#60;object height=&#34;81&#34; width=&#34;100%&#34;&#62; &#60;param name=&#34;movie&#34; value=&#34;http://player.soundcloud.com/player.swf?url={URL}&#38;amp;g=bb&#34;&#62;&#60;/param&#62; &#60;param name=&#34;allowscriptaccess&#34; value=&#34;always&#34;&#62;&#60;/param&#62; &#60;embed allowscriptaccess=&#34;always&#34; height=&#34;81&#34; src=&#34;http://player.soundcloud.com/player.swf?url={URL}&#38;amp;g=bb&#34; type=&#34;application/x-shockwave-flash&#34; width=&#34;100%&#34;&#62;&#60;/embed&#62; &#60;/object&#62; &#60;a href=&#34;{URL}&#34;&#62;{URL}&#60;/a&#62; Tipp-Anzeige [Soundcloud]http://soundcloud.com/user/track[/Soundcloud]]]></description>
			<content:encoded><![CDATA[<p>Um Soundcloud-Songs direkt in ein phpBB Forum einzubinden, einfach folgenden BB-Code im Backend erstellen:</p>
<p><a href="http://blog.ich-wars-nicht.ch/wp-content/uploads/2012/01/2012-01-22-235418_1421x609_scrot.png" class="thickbox"><img src="http://blog.ich-wars-nicht.ch/wp-content/uploads/2012/01/2012-01-22-235418_1421x609_scrot-300x128.png" alt="Soundcloud BBCode Configuration Screenshot" title="Soundcloud BBCode" width="300" height="128" class="alignnone size-medium wp-image-3247" /></a></p>
<h4 class="clear">Benutzung</h4>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">[Soundcloud]{URL}[/Soundcloud]</pre></div></div>

<h4>HTML Ersetzung</h4>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">&lt;object height=&quot;81&quot; width=&quot;100%&quot;&gt;
&lt;param name=&quot;movie&quot;
value=&quot;http://player.soundcloud.com/player.swf?url={URL}&amp;amp;g=bb&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
&lt;embed allowscriptaccess=&quot;always&quot; height=&quot;81&quot;
src=&quot;http://player.soundcloud.com/player.swf?url={URL}&amp;amp;g=bb&quot;
type=&quot;application/x-shockwave-flash&quot; width=&quot;100%&quot;&gt;&lt;/embed&gt;
&lt;/object&gt; &lt;a href=&quot;{URL}&quot;&gt;{URL}&lt;/a&gt;</pre></div></div>

<h4>Tipp-Anzeige</h4>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">[Soundcloud]http://soundcloud.com/user/track[/Soundcloud]</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2012/01/phpbb-soundcloud-embed-bbcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>dwm config &#8211; volume, battery notification, unread e-mail count &amp; more</title>
		<link>http://blog.ich-wars-nicht.ch/2012/01/dwm-config-volume-battery-notification-unread-e-mail-count-more/</link>
		<comments>http://blog.ich-wars-nicht.ch/2012/01/dwm-config-volume-battery-notification-unread-e-mail-count-more/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 10:09:31 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[arch linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dwm]]></category>
		<category><![CDATA[window manager]]></category>
		<category><![CDATA[xinitrc]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3166</guid>
		<description><![CDATA[As many other dwm users do, I customized my .xinitrc file and the dwm status bar in to display some useful information. Here is my configuration: .xinitrc This is what my .xinitrc looks like: # set keyboard layout to Swiss German setxkbmap ch &#160; # Load .Xresources file xrdb -merge ~/.Xresources &#160; # Start xbindkeys [...]]]></description>
			<content:encoded><![CDATA[<p>As many other <a href="http://dwm.suckless.org/">dwm</a> users do, I customized my .xinitrc file and the dwm status bar in to display some useful information. Here is my configuration:</p>
<h3>.xinitrc</h3>
<p>This is what my .xinitrc looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># set keyboard layout to Swiss German</span>
setxkbmap ch
&nbsp;
<span style="color: #666666; font-style: italic;"># Load .Xresources file</span>
xrdb <span style="color: #660033;">-merge</span> ~<span style="color: #000000; font-weight: bold;">/</span>.Xresources
&nbsp;
<span style="color: #666666; font-style: italic;"># Start xbindkeys</span>
xbindkeys <span style="color: #000000; font-weight: bold;">&amp;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set some defaults</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BROWSER</span>=chromium <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EDITOR</span>=<span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
xdg-mime default evince.desktop application<span style="color: #000000; font-weight: bold;">/</span>pdf <span style="color: #000000; font-weight: bold;">&amp;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Loop</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #666666; font-style: italic;"># Set root title</span>
    <span style="color: #c20cb9; font-weight: bold;">sh</span> .xsetroot.sh
&nbsp;
    <span style="color: #666666; font-style: italic;"># Check battery level</span>
    <span style="color: #007800;">BATT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> acpi <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/.*[charging|unknown], \([0-9]*\)%.*/\1/gi'</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #007800;">STATUS</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> acpi <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/.*: \([a-zA-Z]*\),.*/\1/gi'</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$BATT</span> <span style="color: #660033;">-le</span> <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$STATUS</span> == <span style="color: #ff0000;">'Discharging'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># Beep</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;\007&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty10 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">0.2</span> 
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;\007&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty10 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">0.2</span> 
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;\007&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty10 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">0.2</span> 
        <span style="color: #666666; font-style: italic;"># Blink</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'on'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>acpi<span style="color: #000000; font-weight: bold;">/</span>ibm<span style="color: #000000; font-weight: bold;">/</span>light <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'off'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>acpi<span style="color: #000000; font-weight: bold;">/</span>ibm<span style="color: #000000; font-weight: bold;">/</span>light
    <span style="color: #000000; font-weight: bold;">fi</span>  
&nbsp;
    <span style="color: #666666; font-style: italic;"># Update every 10s</span>
    <span style="color: #c20cb9; font-weight: bold;">sleep</span> 10s
<span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set up rotated dual screen without touching my xorg.conf</span>
xrandr <span style="color: #660033;">--output</span> DVI-<span style="color: #000000;">1</span> <span style="color: #660033;">--auto</span> <span style="color: #660033;">--rotate</span> left <span style="color: #660033;">--pos</span> 0x0 <span style="color: #660033;">--output</span> DVI-<span style="color: #000000;">0</span> <span style="color: #660033;">--auto</span> <span style="color: #660033;">--pos</span> 1080x720 <span style="color: #660033;">--rotate</span> normal
&nbsp;
<span style="color: #666666; font-style: italic;"># Read .xsessionrc</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> ~<span style="color: #000000; font-weight: bold;">/</span>.xsessionrc <span style="color: #000000; font-weight: bold;">&amp;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set wallpaper</span>
feh <span style="color: #660033;">--bg-scale</span> ~<span style="color: #000000; font-weight: bold;">/</span>.xwallpaper-dwm.png
&nbsp;
<span style="color: #666666; font-style: italic;"># Set WM name (for Java apps)</span>
wmname LG3D
&nbsp;
<span style="color: #666666; font-style: italic;"># Run dwm</span>
<span style="color: #7a0874; font-weight: bold;">exec</span> dwm</pre></div></div>

<h3>.Xresources</h3>
<p>In my .Xresources, I&#8217;m setting the UXTerm color to white on black, as well as fixing a bug with the <code>Alt</code> key in SSH sessions. The last line is to set the window URGENT flag when the window uses the system bell.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">UXTerm<span style="color: #000000; font-weight: bold;">*</span>eightBitInput: <span style="color: #c20cb9; font-weight: bold;">false</span>
UXTerm<span style="color: #000000; font-weight: bold;">*</span>metaSendsEscape: <span style="color: #c20cb9; font-weight: bold;">true</span>
UXTerm<span style="color: #000000; font-weight: bold;">*</span>reverseVideo: <span style="color: #c20cb9; font-weight: bold;">true</span>
UXTerm<span style="color: #000000; font-weight: bold;">*</span>bellIsUrgent: <span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<h3>.xsetroot.sh</h3>
<p>As you&#8217;ve seen in my .xinitrc file, I didn&#8217;t want to keep my xsetroot commands in the .xinitrc file. The main reason for this is that now I can update the status information from an external script, e.g. when pushing some volume buttons on my notebook.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">DATETIME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">UPTIME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uptime</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/.*up\s*//'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/,\s*[0-9]* user.*//'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/  / /g'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">VOLUME</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> amixer sget Master <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'Front Left:'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/[^\[]*\[\([0-9]\{1,3\}%\).*\(on\|off\).*/\2 \1/'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/off/M/'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/on //'</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">UNREADMAIL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> .unreadmail<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">BATTERYSTATE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> acpi <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ split($5,a,&quot;:&quot;); print substr($3,0,2), $4, &quot;[&quot;a[1]&quot;:&quot;a[2]&quot;]&quot; }'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">','</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #000000; font-weight: bold;">`</span> == <span style="color: #000000;">30</span> <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #000000; font-weight: bold;">`</span> == 00 <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> python imap_check_unread.py <span style="color: #000000; font-weight: bold;">&gt;</span> .unreadmail; <span style="color: #000000; font-weight: bold;">fi</span>
xsetroot <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;Unread <span style="color: #007800;">${UNREADMAIL}</span> | <span style="color: #007800;">${VOLUME}</span> | <span style="color: #007800;">${DATETIME}</span> | Up <span style="color: #007800;">${UPTIME}</span>h | <span style="color: #007800;">${BATTERYSTATE}</span>&quot;</span></pre></div></div>

<p>The uptime value doesn&#8217;t look perfect, there are bugs if the uptime is &lt;1h. But that doesn&#8217;t bug me <img src='http://blog.ich-wars-nicht.ch/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In summary, my status bar displays the following things:</p>
<ul>
<li>Unread e-mail count</li>
<li>Volume</li>
<li>Date and time</li>
<li>Uptime</li>
<li>Battery status</li>
</ul>
<h3>imap_check_unread.py</h3>
<p>To check the unread mail count in my IMAP account, I created a little Python script. But because I don&#8217;t want to query the server every second, I&#8217;m caching the value in a file and updating it every 30 seconds. Create a cronjob or similar to update the file.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">imaplib</span>
&nbsp;
obj = <span style="color: #dc143c;">imaplib</span>.<span style="color: black;">IMAP4_SSL</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'xxx.xxx.xxx.xxx'</span>, <span style="color: #483d8b;">'993'</span><span style="color: black;">&#41;</span>
obj.<span style="color: black;">login</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'user'</span>, <span style="color: #483d8b;">'password'</span><span style="color: black;">&#41;</span>
obj.<span style="color: #dc143c;">select</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>obj.<span style="color: black;">search</span><span style="color: black;">&#40;</span><span style="color: #008000;">None</span>, <span style="color: #483d8b;">'UnSeen'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2012/01/dwm-config-volume-battery-notification-unread-e-mail-count-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>django-sphinx sorting</title>
		<link>http://blog.ich-wars-nicht.ch/2011/12/django-sphinx-sorting/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/12/django-sphinx-sorting/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 17:05:15 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3224</guid>
		<description><![CDATA[Unfortunately, the django-sphinx module is not very thoroughly documented. One thing which I could not figure out is how to do sorting. I thought that I had to set some kind of keyword argument on the SphinxSearch instance&#8230; (I have to admit though that the sorting is indeed demonstrated in the project README.rst &#8211; I [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, the <a href="https://github.com/dcramer/django-sphinx">django-sphinx</a> module is not very thoroughly documented. One thing which I could not figure out is how to do sorting. I thought that I had to set some kind of keyword argument on the SphinxSearch instance&#8230; (I have to admit though that the sorting is indeed demonstrated in the project README.rst &#8211; I simply overlooked it&#8230;)</p>
<p>But the solution was much simpler &#8211; you can use <code>order_by</code> directly on the SphinxSearch instance.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">Model.<span style="color: black;">search</span>.<span style="color: black;">query</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'spam'</span><span style="color: black;">&#41;</span>.<span style="color: black;">order_by</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-amount'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Make sure that the selected sorting key is marked as a sortable attribute (e.g. sql_attr_uint or sql_attr_str2ordinal) in your sphinx.conf.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/12/django-sphinx-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>jQuery On-Off Toggle/Switch</title>
		<link>http://blog.ich-wars-nicht.ch/2011/11/jquery-checkbox-on-off-toggleswitch/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/11/jquery-checkbox-on-off-toggleswitch/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 14:17:51 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[toggle]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3199</guid>
		<description><![CDATA[Today I was looking for a nice graphical on/off switch to replace checkboxes on a webpage I&#8217;m working on. I found a beautiful solution, but the button was too large. Instead of changing the button size, I made my own switch using jQuery JavaScript and CSS. This is what it looks like: 1. HTML &#60;div [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was looking for a nice graphical on/off switch to replace checkboxes on a webpage I&#8217;m working on. I found <a href="http://devgrow.com/iphone-style-switches/">a beautiful solution</a>, but the button was too large. Instead of changing the button size, I made my own switch using jQuery JavaScript and CSS.</p>
<p>This is what it looks like:</p>
<p><img alt="Screenshot of Toggles" src="http://ich-wars-nicht.ch/tmp/screenshots/20111121_151358.png" title="Screenshot" width="150" height="82" /></p>
<h3 class="clear" style="padding-top: 20px;">1. HTML</h3>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;switch&quot;&gt;
  &lt;label for=&quot;mycheckbox&quot; class=&quot;switch-toggle&quot; data-on=&quot;On&quot; data-off=&quot;Off&quot;&gt;&lt;/label&gt;
  &lt;input type=&quot;checkbox&quot; id=&quot;mycheckbox&quot; /&gt;
&lt;/div&gt;</pre></div></div>

<p>The element containing the checkbox and the label should have the class <code>switch</code> assigned. The label element needs the class <code>switch-toggle</code> as well as the <code>data-on</code> and <code>data-on</code> attributes to define the label texts for the two statuses.</p>
<p>It is important that the <code>.switch</code> element contains only one checkbox and that the checkbox and the label are direct children of the <code>.switch</code> element.</p>
<h3>2. CSS</h3>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">label<span style="color: #6666ff;">.switch-toggle</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'switch.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span> !important<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">26px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
label<span style="color: #6666ff;">.switch-toggle</span><span style="color: #6666ff;">.on</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
label<span style="color: #6666ff;">.switch-toggle</span><span style="color: #6666ff;">.off</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
label<span style="color: #6666ff;">.switch-toggle</span>.<span style="color: #993333;">hidden</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Don&#8217;t forget to download the <a href="http://blog.ich-wars-nicht.ch/wp-content/uploads/2011/11/switch.png">switch.png file</a>.</p>
<h3>3. jQuery</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.switch'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> checkbox <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=checkbox]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> toggle <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'label.switch-toggle'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkbox.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            checkbox.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hidden'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            toggle.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hidden'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkbox<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                toggle.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'on'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                toggle.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                toggle.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>toggle.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-on'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                toggle.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                toggle.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'on'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                toggle.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>toggle.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-off'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>  
        <span style="color: #009900;">&#125;</span>   
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.switch-toggle'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> checkbox <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=checkbox]'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> toggle <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// We need to inverse the logic here, because at the time of processing,</span>
        <span style="color: #006600; font-style: italic;">// the checked status has not been enabled yet.</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkbox.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            toggle.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            toggle.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'on'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            toggle.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>toggle.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-off'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            toggle.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'on'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            toggle.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'off'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            toggle.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>toggle.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-on'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>  
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Yes, I violated the DRY principle, but the logic works, so that&#8217;s good enough for now <img src='http://blog.ich-wars-nicht.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><em>Credits: The image used was taken from the <a href="http://www.heise.de/extras/socialshareprivacy/">Heise&#8217;s socialshareprivacy plugin</a> which I&#8217;m also using on this blog.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/11/jquery-checkbox-on-off-toggleswitch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Django Forms with Multiple Inheritance</title>
		<link>http://blog.ich-wars-nicht.ch/2011/09/django-forms-with-multiple-inheritance/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/09/django-forms-with-multiple-inheritance/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 17:00:55 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[multiple inheritance]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3183</guid>
		<description><![CDATA[Sometimes you want to validate only parts of a Django form. A use case for this would be a user profile. A user may have an extensive user profile, but sometimes you only want to validate a subset of the form fields, e.g. the city and the phone number, when providing a profile edit form. [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to validate only parts of a Django form. A use case for this would be a user profile. A user may have an extensive user profile, but sometimes you only want to validate a subset of the form fields, e.g. the city and the phone number, when providing a profile edit form. On another page you might want to offer a username change. If you try to validate one of those forms using POST data for the provided fields only, the validation will fail because there are other mandatory fields.</p>
<p>In that case, Python&#8217;s support for multiple inheritance will help you.</p>
<h3>Multiple form inheritance</h3>
<p>First, define a form for all the form field subsets you might need to validate.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> FormA<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    username = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">True</span>, label=_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Username'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> FormB<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    city = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">True</span>, label=_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'City'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    phone = forms.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">True</span>, label=_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Phone'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Then create a third form that extends both the first and the second form. You may also add additional fields.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> FormAB<span style="color: black;">&#40;</span>FormA, FormB<span style="color: black;">&#41;</span>:
    language = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">True</span>, label=_<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Language'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Display the forms:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">    &lt;h2&gt;Change Username&lt;/h2&gt;
    {{ formA.as_ul }}
&nbsp;
    &lt;h2&gt;Change City/Phone&lt;/h2&gt;
    {{ formB.as_ul }}
&nbsp;
    &lt;h2&gt;Entire Userprofile&lt;/h2&gt;
    {{ formAB.as_ul }}</pre></div></div>

<h3>The result looks correct:</h3>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> a = FormA<span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'username'</span>: <span style="color: #483d8b;">'danilo'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> a.<span style="color: black;">is_valid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">True</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> b = FormB<span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'city'</span>: <span style="color: #483d8b;">'Bern'</span>, <span style="color: #483d8b;">'phone'</span>: <span style="color: #483d8b;">'0791112233'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> b.<span style="color: black;">is_valid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">True</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> c = FormAB<span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'username'</span>: <span style="color: #483d8b;">'danilo'</span>, <span style="color: #483d8b;">'city'</span>: <span style="color: #483d8b;">'Bern'</span>, <span style="color: #483d8b;">'phone'</span>: <span style="color: #483d8b;">'0791112233'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> c.<span style="color: black;">is_valid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">False</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> c = FormAB<span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'username'</span>: <span style="color: #483d8b;">'danilo'</span>, <span style="color: #483d8b;">'city'</span>: <span style="color: #483d8b;">'Bern'</span>,
...             <span style="color: #483d8b;">'phone'</span>: <span style="color: #483d8b;">'0791112233'</span>, <span style="color: #483d8b;">'language'</span>: <span style="color: #483d8b;">'de'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> c.<span style="color: black;">is_valid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">True</span></pre></div></div>

<p><img src="http://blog.ich-wars-nicht.ch/wp-content/uploads/2011/09/2011-09-12-185255_291x225_scrot.png" alt="" title="Django form" width="291" height="225" class="alignnone size-full wp-image-3190" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/09/django-forms-with-multiple-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>DWM ssh/screen/irssi notifications</title>
		<link>http://blog.ich-wars-nicht.ch/2011/09/dwm-sshscreenirssi-notifications/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/09/dwm-sshscreenirssi-notifications/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 09:00:39 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[beep]]></category>
		<category><![CDATA[dwm]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3177</guid>
		<description><![CDATA[I always keep an irssi session open inside a screen session on my server via ssh. I always thought that notifications aren&#8217;t possible for such a setup. But they are. 1. In your irssi session, issue the following commands: /set beep_msg_level NOTICE MSGS HILIGHT /set bell_beeps OFF You can save this configuration permanently by issueing [...]]]></description>
			<content:encoded><![CDATA[<p>I always keep an irssi session open inside a screen session on my server via ssh. I always thought that notifications aren&#8217;t possible for such a setup. But they are.</p>
<p>1. In your irssi session, issue the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">/set beep_msg_level NOTICE MSGS HILIGHT
/set bell_beeps OFF</pre></div></div>

<p>You can save this configuration permanently by issueing <code>/save</code>.</p>
<p>2. In your ~/.screenrc, add the following lines:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">vbell off
bell_msg 'Bell in window %n^G'</pre></div></div>

<p>3. Tell your terminal to set the URGENT flag when beeping. Add one of the following lines to your .Xresources:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;"># For UXterm users:
UXTerm*bellIsUrgent: true
&nbsp;
# For (u)rxvt users:
Rxvt.urgentOnBell: true</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/09/dwm-sshscreenirssi-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Google Plus &#8211; Inspired by Diaspora?</title>
		<link>http://blog.ich-wars-nicht.ch/2011/08/google-plus-inspired-by-diaspora/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/08/google-plus-inspired-by-diaspora/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 17:32:11 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Kurioses]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[diaspora]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google plus]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3150</guid>
		<description><![CDATA[After all the buzz around Google+, one of its competitors, Diaspora (free and open source) was almost forgotten. I have to admit, the same thing counts for me. In the last weeks, I&#8217;ve spent a lot of time on Google+ and none on Diaspora (mainly because I don&#8217;t have many contacts on there (yet?), of [...]]]></description>
			<content:encoded><![CDATA[<p>After all the buzz around Google+, one of its competitors, <a href="https://joindiaspora.com/">Diaspora</a> (free and open source) was almost forgotten. I have to admit, the same thing counts for me. In the last weeks, I&#8217;ve spent a lot of time on Google+ and none on Diaspora (mainly because I don&#8217;t have many contacts on there (yet?), of course). Anyways, today I logged back into Diaspora and &#8211; being accustomed to Google+ &#8211; almost didn&#8217;t note any difference concerning the layout.</p>
<p><a href="http://blog.ich-wars-nicht.ch/wp-content/uploads/2011/08/google1.png"><img src="http://blog.ich-wars-nicht.ch/wp-content/uploads/2011/08/google1-1024x744.png" alt="Google+" title="Google+" width="650" height="472" class="alignnone size-large wp-image-3152" /></a></p>
<p><a href="http://blog.ich-wars-nicht.ch/wp-content/uploads/2011/08/diaspora1.png"><img src="http://blog.ich-wars-nicht.ch/wp-content/uploads/2011/08/diaspora1-1024x613.png" alt="Diaspora" title="Diaspora" width="650" height="389" class="alignnone size-large wp-image-3151" /></a></p>
<p>(Sorry about forgetting to switch Diaspora to English&#8230;)</p>
<h3>List of similarities</h3>
<ol>
<li>Avatar and first name in upper left  corner</li>
<li>&#8220;Stream&#8221; and a textbox with some icons (image upload) above the main column</li>
<li>Avatar and full name in the header bar</li>
<li>List of contact avatars in upper right corner</li>
<li>Invitations below contact list</li>
<li>Aspects/circles on the left, right below the name</li>
<li>Tags/sparks below the aspects/circles</li>
<li>Display of receiver limiting next to the post</li>
</ol>
<h3>Well&#8230;</h3>
<p>I&#8217;m not saying Google copied Diaspora, especially as many of those things are common and obviously chosen web design elements, but Google+ certainly looks strongly inspired by Diaspora, which &#8211; as far as I remember &#8211; didn&#8217;t change much of its layout over the last year or so.</p>
<p>Also, many ideas/philosophies behind Google+ that make it successful are almost identical to those of Diaspora. The concept of circles/aspects, the focus on sharing which information with whom, the concept of &#8220;unidirectional relationships&#8221; (following without being followed) etc&#8230;</p>
<p>Opinions?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/08/google-plus-inspired-by-diaspora/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Drittweltländer: Soforthilfe oder Zukunftsorientierte Hilfe?</title>
		<link>http://blog.ich-wars-nicht.ch/2011/07/drittweltlander-soforthilfe-oder-zukunftsorientierte-hilfe/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/07/drittweltlander-soforthilfe-oder-zukunftsorientierte-hilfe/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 11:37:15 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Anderes]]></category>
		<category><![CDATA[Politik]]></category>
		<category><![CDATA[aufsatz]]></category>
		<category><![CDATA[bms]]></category>
		<category><![CDATA[deutsch]]></category>
		<category><![CDATA[entwicklungshilfe]]></category>
		<category><![CDATA[erörterung]]></category>
		<category><![CDATA[kiva]]></category>
		<category><![CDATA[Schule]]></category>
		<category><![CDATA[spenden]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3142</guid>
		<description><![CDATA[Mein Deutsch-Aufsatz aus der Berufsmaturitätsprüfung 2010. Soforthilfe oder Zukunftsorientierte Hilfe? Wenn von Welthunger die Rede ist, kommt man auch an einem verwandten Themenbereich nicht vorbei: den Hilfemassnahmen. Man möchte meinen, dass die Bevölkerung nach Ereignissen wie dem Tsunami 2004 und dem Haiti-Erdbeben vor kurzer Zeit sehr für Hilfe und Notbekämpfung sensibilisiert ist. Doch kaum fällt [...]]]></description>
			<content:encoded><![CDATA[<p><i>Mein Deutsch-Aufsatz aus der Berufsmaturitätsprüfung 2010.</i></p>
<h3>Soforthilfe oder Zukunftsorientierte Hilfe?</h3>
<p>Wenn von Welthunger die Rede ist, kommt man auch an einem verwandten Themenbereich nicht vorbei: den Hilfemassnahmen. Man möchte meinen, dass die Bevölkerung nach Ereignissen wie dem Tsunami 2004 und dem Haiti-Erdbeben vor kurzer Zeit sehr für Hilfe und Notbekämpfung sensibilisiert ist. Doch kaum fällt man in den Alltagstrott zurück und kaum holt einen die Wirtschaftskrise ein, sind die guten Vorsätze vergessen und es wird wieder auf Kosten anderer gespart. Dies wirft die Frage auf: hilft so eine Soforthilfe-Mentalität wirklich? Oder sollte man anstatt der Soforthilfe voll auf zukunftsorientierte Entwicklungshilfe setzen?</p>
<p>Es gibt vieles, was dafür und dagegen spricht. Was man jedoch nicht ignorieren darf: Die bedürftigen Menschen haben jetzt Hunger, eine neue Schule hilft ihnen auch nicht, kurzfristig zu überleben. Wenn eine Umweltkatastrophe wie in Haiti geschieht, muss ohne zu zögern gehandelt werden, um den Menschen noch helfen zu können.</p>
<p>Einen – zugegebenermassen recht makaberen – Vorteil hat die Katastrophe aber: die westliche Bevölkerung wird durch solche Ereignisse aufgerüttelt greift viel eher in den Geldbeutel. Durch das schon mehrfach erwähnte Erdbeben in Haiti wurden in der Schweiz Spendengelder in Rekordhöhe gesammelt. Und mit dem Geld kann sehr schnell sehr effektiv geholfen werden: Mit Nahrungsmitteln, Medikamenten und sonstigen Hilfsgütern. Dies hat vermutlich die Ursache, dass Menschen durch die Berichterstattung emotional bewegt werden und den Effekt der Spenden, im Gegensatz zur Unterstützung von Bildung, sofort beobachten können.</p>
<p>Die Frage „Soforthilfe oder langfristige Hilfe“ führt aber auch in einen Gewissenskonflikt, da beispielsweise in Bildung investiertes Geld kurzfristig anderweitig eingesetzt viel mehr Leid und Not verhindern könnte. Soll man jetzt verhungernden Eltern helfen oder deren Kinder unterrichten?</p>
<p>Es kommt ganz auf die Betrachtungsweise an. Einerseits wird zwar Not gelindert, andererseits können sich die Betroffenen dadurch nie aus ihrem Teufelskreis der Armut befreien, im Gegenteil: Sie werden sogar vom Westen abhängig. Durch &#8220;Hilfe zur Selbsthilfe&#8221; kann viel zukunftsorientierter vorgegangen werden. Wer das Angeln erlernt, dem ist mehr geholfen as dem, der nur einen Fisch erhält. Er kann sich ab sofort unabhängig von Dritten selber ernähren. Zudem ist ein selber erarbeiteter Besitz in vielen Kulturen viel mehr wert als ein Geschenk.</p>
<p>Auf diesem Weg bewegen sich auch viele neuartige Fördermassnahmen, wie beispielsweise die Organisation Kiva mit ihrem Kleinkredit-System. Privatleute vergeben über eine Website Kleinkredite an Personen in Drittweltländern, welche diese dann beim Starten ihres eigenen Gewerbes unterstützen. So wird in die Zukunft investiert und gleichzeitig das Potential der Drittweltbevölkerung genutzt. Die Leute helfen sich selbst. Kiva hat sich bewährt und kann den Weg zu neuen Fördermassnahmen weisen.</p>
<p>Was aber für eine positive Entwicklung eines Landes unabdingbar ist, ist die Bildung. In der Schule lernen die Kinder die Grundlagen für ihr Leben. Eigenes Denken wird vermittelt und gefördert. René Descartes traf mit seinem Zitat &#8220;Ich denke, also bin ich&#8221; den Nagel auf den Kopf. Nur wer selbstständig denken lernt, wird unabhängig. Eigenes Denken und Bildung sind Voraussetzung für eine positive Zukunftsperspektive.</p>
<p>Zugegeben &#8211; man kann die beiden Standpunkte nicht ganz gegeneinander ausspielen. Weder &#8220;nur Selbsthilfe&#8221; noch &#8220;ausschliesslich zukunftsorientierte Hilfe&#8221; kann die bestehenden Probleme lösen. Beide Angehensweisen bieten Vor- wie auch Nachteile. Deshalb wird die beste Lösung wohl ein Kompromiss der beiden bleiben. Die Zukunft ist wichtig, aber auch die Zukunft ist in der Gegenwart verwurzelt. Das Wichtigste ist, dass geholfen wird. Und wenn diese Hilfe auch in zehn Jahren noch Wirkung zeigt &#8211; umso besser.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/07/drittweltlander-soforthilfe-oder-zukunftsorientierte-hilfe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Show MySQL Storage Engines</title>
		<link>http://blog.ich-wars-nicht.ch/2011/04/show-mysql-storage-engines/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/04/show-mysql-storage-engines/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 13:09:00 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Serveradministration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3127</guid>
		<description><![CDATA[If you have ever wanted to know the storage engine type of every table in one of your MySQL databases, you know how tedious that can be. I have written a Python script that will simplify that task. You can get it on Github. Usage: $ ./show-engines.py or $ python show-engines.py Download: https://github.com/gwrtheyrn/MySQL-Show-Storage-Engines]]></description>
			<content:encoded><![CDATA[<p>If you have ever wanted to know the storage engine type of every table in one of your MySQL databases, you know how tedious that can be.</p>
<p>I have written a Python script that will simplify that task. You can get it on <a href="https://github.com/gwrtheyrn/MySQL-Show-Storage-Engines">Github</a>.</p>
<h3>Usage:</h3>
<p>
<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">$ ./show-engines.py</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">$ python show-engines.py</pre></div></div>

</p>
<h3>Download:</h3>
<p><a href="https://github.com/gwrtheyrn/MySQL-Show-Storage-Engines">https://github.com/gwrtheyrn/MySQL-Show-Storage-Engines</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/04/show-mysql-storage-engines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>1. April 2011</title>
		<link>http://blog.ich-wars-nicht.ch/2011/04/1-april-2011/</link>
		<comments>http://blog.ich-wars-nicht.ch/2011/04/1-april-2011/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 07:35:36 +0000</pubDate>
		<dc:creator>danilo</dc:creator>
				<category><![CDATA[Anderes]]></category>
		<category><![CDATA[Kurioses]]></category>
		<category><![CDATA[Witziges]]></category>
		<category><![CDATA[1. april]]></category>
		<category><![CDATA[aprilscherze]]></category>
		<category><![CDATA[intetnet]]></category>
		<category><![CDATA[lustig]]></category>
		<category><![CDATA[nerds]]></category>

		<guid isPermaLink="false">http://blog.ich-wars-nicht.ch/?p=3100</guid>
		<description><![CDATA[Hier ein paar der Aprilscherze 2011: DayDeal: DIY Lego-Haus (screenshot) XKCD: Alle Comics in 3D mit Parallaxscrolling (screenshot) OMG! Ubuntu: X11 Error &#8211; Terminal fallback mode (link, screenshot) Icinga: We&#8217;re moving from GIT to CVS (link) IETF RFC: RFC 5984, 6214 und 6217 local.ch: Local has got balls today (screenshot) NZZ online: Wikileaks-Dokumente zu Caesars [...]]]></description>
			<content:encoded><![CDATA[<p>Hier ein paar der Aprilscherze 2011:</p>
<ul>
<li><a href="http://daydeal.ch/">DayDeal</a>: DIY Lego-Haus (<a href="http://i.imgur.com/527DV.png">screenshot</a>)</li>
<li><a href="http://xkcd.com/">XKCD</a>: Alle Comics in 3D mit Parallaxscrolling (<a href="http://i.imgur.com/YLoH2.png">screenshot</a>)</li>
<li><a href="http://www.omgubuntu.co.uk/">OMG! Ubuntu</a>: X11 Error &#8211; Terminal fallback mode (<a href="http://www.omgubuntu.co.uk/bash/">link</a>, <a href="http://i.imgur.com/b7Azv.png">screenshot</a>)</li>
<li><a href="https://www.icinga.org/">Icinga</a>: We&#8217;re moving from GIT to CVS (<a href="https://www.icinga.org/2011/04/01/icinga-moves-from-git-to-cvs/">link</a>)</li>
<li><a href="http://www.ietf.org/rfc.html">IETF RFC</a>: RFC <a href="http://tools.ietf.org/html/rfc5984">5984</a>, <a href="http://tools.ietf.org/html/rfc6214">6214</a> und <a href="http://tools.ietf.org/html/rfc6217">6217</a></li>
<li><a href="http://local.ch/">local.ch</a>: Local has got balls today (<a href="http://i.imgur.com/bqF1i.png">screenshot</a>)</li>
<li><a href="http://www.nzz.ch/">NZZ online</a>: Wikileaks-Dokumente zu Caesars Ermordung (<a href="http://www.nzz.ch/nachrichten/kultur/medien/wikileaks-dokumente_zu_caesars_ermordung_1.8931839.html">link</a>)</li>
<li><a href="https://twitter.com/omgubuntu">@omgubuntu</a>: Gnome 3 delay announcement (<a href="https://twitter.com/omgubuntu/status/53735379156742144">tweet1</a>, <a href="https://twitter.com/omgubuntu/status/53740594098479104">tweet2</a>)</li>
<li><a href="http://blog.memonic.com/">memonic Blog</a>: Offline clipping for memonic (<a href="http://blog.memonic.com/2011/04/01/todays-changes-offline-clipping/">link</a>)</li>
<li><a href="http://tagesanzeiger.ch/">Tagesanzeiger online</a>: Militär prüft Prime Tower auf Erdbeben- und Sturmfestigkeit (<a href="http://www.tagesanzeiger.ch/zuerich/stadt/Militaer-prueft-Prime-Tower-auf-Erdbeben-und-Sturmfestigkeit-/story/15564992">link</a>)</li>
<li><a href="http://mail.google.com/mail/help/motion.html">Google Motion</a>: A new way to communicate (<a href="http://mail.google.com/mail/help/motion.html">link</a>, <a href="http://www.youtube.com/watch?v=Bu927_ul_X0">video</a>)</li>
<li><a href="http://stackoverflow.com/">Stackoverflow</a>: Unicorns appear on upvote (<a href="http://imgur.com/a/7Jpyc">screenshots</a>)</li>
<li><a href="http://blog.flattr.net/">Flattr Blog</a>: Flattr Partners with North Korea (<a href="http://blog.flattr.net/2011/04/flattr-partners-with-asian-country/">link</a></li>
<li><a href="http://blog.mezeske.com/">Mezeske Blog</a>: cppsh &#8211; a bash-like shell with c++ syntax (<a href="http://blog.mezeske.com/?p=377">link</a>)</li>
<li><a href="http://www.microsoft.com/germany/presseservice/news/pressemitteilungen.mspx">Microsoft Newsroom</a>: Microsoft kündigt 42&#8243; Tablet an (<a href="http://www.microsoft.com/germany/presseservice/news/pressemitteilung.mspx?id=533347">link</a>)</li>
<li><a href="http://www.wuv.de/">wuv.de</a>: &#8220;Social-Media-Experte&#8221; wird geschützte Berufsbezeichnung (<a href="http://www.wuv.de/nachrichten/digital/social_media_experte_wird_geschuetzte_berufsbezeichnung">link</a>)</li>
<li><a href="http://stackoverflow.com/">Stackoverflow</a>: Program is erroneously rejected by three C++ compilers (<a href="http://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers">link</a>)</li>
<li><a href="http://google.com/">Google</a>: Suche nach &#8220;Helvetica&#8221; liefert Ergebnisse in Comic Sans (<a href="http://i.imgur.com/1utfU.png">screenshot</a>)</li>
</ul>
<p>Liste wird laufend ergänzt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ich-wars-nicht.ch/2011/04/1-april-2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

