<?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/"
	>

<channel>
	<title>The Zash Blag &#187; ubuntu</title>
	<atom:link href="http://blag.zash.se/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blag.zash.se</link>
	<description>Åt helvete med hela skiten.</description>
	<lastBuildDate>Tue, 31 Aug 2010 12:27:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>“sudo gedit” must die!</title>
		<link>http://blag.zash.se/2010/07/sudo-gedit-must-die/</link>
		<comments>http://blag.zash.se/2010/07/sudo-gedit-must-die/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 07:00:02 +0000</pubDate>
		<dc:creator>zash</dc:creator>
				<category><![CDATA[Crappy world]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ninja]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blag.zash.se/?p=264</guid>
		<description><![CDATA[Why is it that so many Ubuntu guides tell you to do sudo gedit /path/to/somefile when there is a sudoedit command? An editor, like Gedit, doesn&#8217;t need to run as root, ever. This is so much better and safer: SUDO_EDITOR=gedit sudo -e /path/to/somefile This will &#8230; Copy the file to /tmp/ Invoke gedit as your [...]]]></description>
			<content:encoded><![CDATA[<p>Why is it that so many <a href="http://www.ubuntu.com/">Ubuntu</a> <a href="http://www.google.com/search?q=%22sudo+gedit%22">guides</a> tell you to do <code>sudo gedit /path/to/somefile</code> when there is a <code>sudoedit</code> command? An editor, like <a href="http://projects.gnome.org/gedit/">Gedit</a>, <strong>doesn&#8217;t</strong> need to run as <code>root</code>, <strong>ever</strong>.</p>

<p>This is so much better and safer:</p>

<pre><code>SUDO_EDITOR=gedit sudo -e /path/to/somefile
</code></pre>

<p>This will &#8230;</p>

<ol>
<li>Copy the file to <code>/tmp/</code></li>
<li>Invoke <code>gedit</code> as your user</li>
<li>Update the original file if you changed the temporary file</li>
</ol>

<p>It would of course be really useful if <a href="http://www.nongnu.org/gksu/"><em>gksudo</em></a>  had this built in already, and could be used in a nice way by <a href="apt://nautilus-gksu">nautilus-gksu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blag.zash.se/2010/07/sudo-gedit-must-die/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stuff</title>
		<link>http://blag.zash.se/2010/05/stuff/</link>
		<comments>http://blag.zash.se/2010/05/stuff/#comments</comments>
		<pubDate>Wed, 05 May 2010 03:05:16 +0000</pubDate>
		<dc:creator>zash</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[minimalism]]></category>
		<category><![CDATA[piratpartiet]]></category>
		<category><![CDATA[prosody]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[webdav]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://blag.zash.se/?p=252</guid>
		<description><![CDATA[Random stuff jag borde blagat om men inte orkat, i till synes omvänd kronologisk ordning. Uppgraderat Servorn till Ubuntu 10.04 från 8.04 Bytt från ejabberd till prosody Byggt ännu en minimalistisk wiki, baserad på WebDAV Updatering: Har nu ersatt min gammla GPG-baserade wiki Satt upp en XMPP-server åt Piratpartiet Byggt autentisering för detta mot PirateWeb [...]]]></description>
			<content:encoded><![CDATA[<p>Random stuff jag borde blagat om men inte orkat, i till synes omvänd kronologisk ordning.</p>

<ul>
<li>Uppgraderat <a href="http://gladius.zash.se">Servorn</a> till Ubuntu 10.04 från 8.04</li>
<li>Bytt från <a href="http://ejabberd.im/">ejabberd</a> till <a href="http://prosody.im">prosody</a></li>
<li><a href="http://wiki.zash.se/">Byggt ännu en minimalistisk wiki</a>, baserad på WebDAV

<ul>
<li><strong>Updatering:</strong> Har nu ersatt <a href="http://wiki-2.zash.se/">min gammla GPG-baserade wiki</a></li>
</ul></li>
<li>Satt upp <a href="http://xmpp.piratpartiet.se/">en XMPP-server</a> åt <a href="http://www.piratpartiet.se/">Piratpartiet</a>

<ul>
<li>Byggt <a href="http://github.com/Zash/XMPPirateWeb.net">autentisering</a> för detta mot <a href="http://pirateweb.net/">PirateWeb</a></li>
</ul></li>
<li>Upptäckt <a href="http://haml-lang.com/">Haml</a> och <a href="http://sass-lang.com/">Sass</a></li>
<li><a href="http://github.com/Zash/Pastebin">Lekt med <code>git</code></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blag.zash.se/2010/05/stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rösträkning med Bash</title>
		<link>http://blag.zash.se/2010/01/votecounter-sh/</link>
		<comments>http://blag.zash.se/2010/01/votecounter-sh/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 02:45:14 +0000</pubDate>
		<dc:creator>zash</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[piratpartiet]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[val]]></category>

		<guid isPermaLink="false">http://blag.zash.se/?p=211</guid>
		<description><![CDATA[Piratpartiets primärval är avslutat. 1300 röster registrerades av partiets ca 48 tusen medlemmar, dvs ca 2.7%. Grattis till Norrbotten som hade överlägset högst valdeltagande Här är ett stycke Bash-magi som ger dig en votes.txt med antal röster och på vem, sorterad fallande efter antal röster. Paketen curl, grep, sed och coreutils behövs om de inte [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.piratpartiet.se">Piratpartiets</a> <a href="http://ungpirat.blogspot.com/2010/01/piratpartiets-primarval-slutar-ikvall.html">primärval</a> <a href="http://www.piratpartiet.se/nyheter/piratpartiets_primarval_ar_avslutat">är avslutat</a>. <a href="http://data.piratpartiet.se/Data/DisplayInternalPollVotes.aspx?PollId=2">1300 röster</a> registrerades av partiets <a href="http://www.piratpartiet.se/storlek">ca 48 tusen</a> medlemmar, dvs ca 2.7%.</p>

<p><strong>Grattis till Norrbotten</strong> <a href="http://osmidigt.bloggaren.eu/?p=654">som hade</a> <a href="http://data.piratpartiet.se/Charts/InternalPollTurnoutPerCircuit.aspx">överlägset högst valdeltagande</a></p>

<p>Här är ett stycke Bash-magi som ger dig en <code>votes.txt</code> med antal röster och på vem, sorterad fallande efter antal röster. Paketen <a href="apt:curl"><code>curl</code></a>, <a href="apt:grep"><code>grep</code></a>, <a href="apt:sed"><code>sed</code></a> och <a href="apt:coreutils"><code>coreutils</code></a> behövs om de inte är installerade, iaf i <a href="http://www.ubuntu.com/">Ubuntu</a> och förmodligen de flesta <a href="http://debian.org/">Debian</a>-baserade <a href="http://distrowatch.com/">distributionerna</a>.</p>

<p><strong>Notera</strong> att detta endast visar hur många röster som <a href="http://www.piratpartiet.se/primarvalskandidater">kandidaterna</a> fått.</p>

<pre><code>#!/bin/bash

curl -s "http://data.piratpartiet.se/Data/DisplayInternalPollVotes.aspx?PollId=2" |
    sed -r 's/\s$|^\s*//g' | # tar bort blanktecken
    grep -E '^[A-Z0-9]{12}\b' | # endast röster
    sed -r 's/^[A-Z0-9]{12}\s*//' | # ta bort röst-id
    sed -r 's/\s+/\n/g' | # dela upp i en kandidat per rad
    grep -E '^[0-9]' | # tar bort tomma rader
    sort | uniq -c | sort -nr &gt; votes.txt # räkna och sortera

# Detta hämtar och byter ut medlems-nr mot namn.
curl -s "http://www.piratpartiet.se/primarvalskandidater" |
    grep -Eo '&lt;span[^&gt;]*SpanCandidateName[^&gt;]*&gt;[^&lt;]*' | cut -d\&gt; -f2 |
    sed -r 's/^(.*)\s+\(#([0-9]+)\)$/sed -i "s,\\b\2\\$,\1," votes.txt;/' | sh
</code></pre>

<p>De faktiska ska som jag förstått det viktas efter hur högt man placerat kandidater, <a href="http://www.skivadlime.se/2010/01/primarvalsrostande/">eventuell kvotering samt</a> hur fördelningen mellan distrikt ser ut. Så, <abbr title="2010-01-18T16:00:00+0100">16:00 idag</abbr> presenteras de färdiga listorna. Frågan är; <a href="http://jimmycallin.se/2010/01/lat-18-januari-bli-nytandning-vad-ska-du-gora-for-piratpartiet/">vad gör vi nu?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blag.zash.se/2010/01/votecounter-sh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liferea vs tiny screen</title>
		<link>http://blag.zash.se/2009/12/liferea-vs-tiny-screen/</link>
		<comments>http://blag.zash.se/2009/12/liferea-vs-tiny-screen/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 14:26:22 +0000</pubDate>
		<dc:creator>zash</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[liferea]]></category>
		<category><![CDATA[minimalism]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blag.zash.se/?p=189</guid>
		<description><![CDATA[I use Liferea for RSS-feeds. I also have a craptop with a tiny screen (1024×576px). I think there is room for optimizing this, more spatial perhaps? This could use some miller-columnification. Optimally, I would like to have this: Single pane Oldest unread post first Headlines which expand when clicked]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://liferea.sourceforge.net/">Liferea</a> for <a href="http://en.wikipedia.org/wiki/RSS">RSS-feeds</a>. I also have a <a href="http://images.google.com/images?q=compaq+mini+730eo">craptop</a> with a tiny screen (1024×576px).</p>

<div id="attachment_190" class="wp-caption aligncenter" style="width: 310px"><a href="http://blag.zash.se/wp-content/uploads/2009/12/Liferea-normal.png"><img src="http://blag.zash.se/wp-content/uploads/2009/12/Liferea-normal-300x168.png" alt="Liferea - Normal view" title="Liferea - Normal view" width="300" height="168" class="size-medium wp-image-190" /></a><p class="wp-caption-text">Liferea - Normal view</p></div>

<p>I think there is room for optimizing this, <a href="http://en.wikipedia.org/wiki/Spatial_file_manager">more spatial perhaps</a>?</p>

<div id="attachment_191" class="wp-caption aligncenter" style="width: 310px"><a href="http://blag.zash.se/wp-content/uploads/2009/12/Liferea-wide.png"><img src="http://blag.zash.se/wp-content/uploads/2009/12/Liferea-wide-300x168.png" alt="Liferea - wide view" title="Liferea - wide view" width="300" height="168" class="size-medium wp-image-191" /></a><p class="wp-caption-text">Liferea - wide view</p></div>

<p>This could use some <a href="http://en.wikipedia.org/wiki/Miller_Columns">miller-columnification</a>.</p>

<p>Optimally, I would like to have this:</p>

<ul>
<li>Single pane</li>
<li>Oldest unread post first</li>
<li>Headlines which expand when clicked</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blag.zash.se/2009/12/liferea-vs-tiny-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Damn you Ctrl+W</title>
		<link>http://blag.zash.se/2009/11/damn-you-ctrlw/</link>
		<comments>http://blag.zash.se/2009/11/damn-you-ctrlw/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:28:45 +0000</pubDate>
		<dc:creator>zash</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gconf]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blag.zash.se/?p=184</guid>
		<description><![CDATA[Don&#8217;t know how many times I accidentally pressed Ctrl+W when I wanted to delete a word in some non-terminal app, instead closing it and losing all the text I&#8217;ve written. Now I found out you can do this: gconftool --set /desktop/gnome/interface/gtk_key_theme \ --type string Emacs Then Ctrl+W does what it should!]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t know how many times I accidentally pressed <code>Ctrl+W</code> when I wanted to delete a word in some non-terminal app, instead closing it and losing all the text I&#8217;ve written. Now <a href="https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/60085/comments/4">I found out</a> you can do this:</p>

<pre><code>gconftool --set /desktop/gnome/interface/gtk_key_theme \
  --type string Emacs
</code></pre>

<p>Then <code>Ctrl+W</code> does what it should!</p>
]]></content:encoded>
			<wfw:commentRss>http://blag.zash.se/2009/11/damn-you-ctrlw/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Destrutting xfce4-panel</title>
		<link>http://blag.zash.se/2009/07/destrutting-xfce4-panel/</link>
		<comments>http://blag.zash.se/2009/07/destrutting-xfce4-panel/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 20:03:00 +0000</pubDate>
		<dc:creator>zash</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[minimalism]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[window management]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://blag.zash.se/?p=87</guid>
		<description><![CDATA[I didn&#8217;t like that when xfce4-panel is in a fixed position and not expanded to the full width of the screen, it sets _NET_WM_STRUT and _NET_WM_STRUT_PARTIAL which reserves space at the screen border. The unused space on my tiny screen above the maximized window annoys me, so i downloaded the source whith apt-get source xfce4-panel [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t like that when <a href="http://www.xfce.org/projects/xfce4-panel/">xfce4-panel</a> is in a fixed position and not expanded to the full width of the screen, it sets <a href="http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html#NETWMSTRUT"><code>_NET_WM_STRUT</code> and <code>_NET_WM_STRUT_PARTIAL</code></a> which reserves space at the screen border.</p>

<div id="attachment_88" class="wp-caption aligncenter" style="width: 310px"><a href="http://blag.zash.se/wp-content/uploads/2009/07/before.png"><img src="http://blag.zash.se/wp-content/uploads/2009/07/before-300x168.png" alt="Waste of space on my tiny screen" title="before" width="300" height="168" class="size-medium wp-image-88" /></a><p class="wp-caption-text">Waste of space on my tiny screen</p></div>

<p>The unused space on <a href="http://images.google.com/images?q=compaq+mini+730eo">my tiny screen</a> above the maximized window annoys me, so i downloaded the source whith <code>apt-get source <a href="http://packages.ubuntu.com/jaunty/xfce4-panel">xfce4-panel</a></code> and added a setting to disable setting the <code>_NET_WM_STRUT</code> properties.
Here&#8217;s a <a href="http://blag.zash.se/wp-content/uploads/2009/07/disable_struts-zash.tgz">tarball of my patches</a>.</p>

<div id="attachment_89" class="wp-caption aligncenter" style="width: 310px"><a href="http://blag.zash.se/wp-content/uploads/2009/07/after.png"><img src="http://blag.zash.se/wp-content/uploads/2009/07/after-300x168.png" alt="Yay, less wasted space." title="after" width="300" height="168" class="size-medium wp-image-89" /></a><p class="wp-caption-text">Yay, less wasted space.</p></div>

<p>The setting can be enabled by editing <code>~/.config/xfce/panel/panels.xml</code> and add (or change if it already exists) <code>&lt;property name="disable_struts" value="1"/&gt;</code> in the <code>&lt;properties&gt;</code> element.</p>

<p>A better long term solution would probably to have the window manager ignore struts for maximized windows when a panel does not cover the entire border.</p>
]]></content:encoded>
			<wfw:commentRss>http://blag.zash.se/2009/07/destrutting-xfce4-panel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
