<?xml version="1.0"?>
<rss version="2.0">

<channel>
	<title>Planet Redpill Linpro</title>
	<link>http://planet.linpro.no/</link>
	<language>en</language>
	<description>Planet Redpill Linpro - http://planet.linpro.no/</description>

<item>
	<title>Nicolai Langfeldt: It's just too easy</title>
	<guid>tag:blogger.com,1999:blog-5503161573964621051.post-8279511650031913636</guid>
	<link>http://twistylife.blogspot.com/2010/09/its-just-too-easy.html</link>
	<description>I'm often among early adopters.  Not so with flat screen TVs.  Just got a one of the way flat Samsung &quot;LED&quot; ones. My wife wanted white frame, I wanted &lt;a href=&quot;http://www.dlna.org/&quot;&gt;DLNA&lt;/a&gt; support.  Digital Living Network Alliance has made a UPnP based standard for connecting multimedia appliances to  network resources.  Like my (*cough* our) new TV.  All our network resources run Linux though, so windows software is no good for us. One of my colleagues figured this out for us, there are multiple DLNA servers for Linux. One of the most promising was &lt;a href=&quot;http://www.tvmobili.com/&quot;&gt;TVMOBiLi&lt;/a&gt;. And they make Debian and Fedora packages. To get it working with Samsungs you, right now, need a &lt;a href=&quot;http://www.tvmobili.com/release-candidates.php&quot;&gt;release candidate&lt;/a&gt; (I installed 1.4.0.2196).&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_hkPphrzI8Eg/TH7tIl4FmnI/AAAAAAAAADY/Ajc6NA5xh0g/s1600/tvmobili.png&quot;&gt;&lt;img src=&quot;http://4.bp.blogspot.com/_hkPphrzI8Eg/TH7tIl4FmnI/AAAAAAAAADY/Ajc6NA5xh0g/s400/tvmobili.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5512103725810162290&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Start it.  Point browser to http://localhost:30888/ where there is a nice web GUI. Click the &quot;SETTINGS&quot; link, and set up all the different directories we use for movies, mp3s and pictures. Fire up media player app on TV, and it already knows about the tvmobili server. And browsing the My Content folder on the TV showed all our files.  And Samsung firmwares supports quite a lot of video and sound codecs.&lt;br /&gt;&lt;br /&gt;Sometimes being slow to adopt new stuff saves a lot of work.  And deprived me of a learning adventure. I still don't know much about DLNA.&lt;br /&gt;&lt;br /&gt;Happy though.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5503161573964621051-8279511650031913636?l=twistylife.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 02 Sep 2010 03:07:00 +0000</pubDate>
	<author>noreply@blogger.com (Nicolai)</author>
</item>
<item>
	<title>Kristian Lyngstol: Wiki.sh  mediawiki for geeks</title>
	<guid>http://kristianlyng.wordpress.com/?p=307</guid>
	<link>http://kristianlyng.wordpress.com/2010/08/31/wiki-sh-mediawiki-for-geeks/</link>
	<description>&lt;p&gt;We at Varnish Software use mediawiki internally for various documentation-like tasks, as does Redpill Linpro and a number of projects I&amp;#8217;ve been involved with.&lt;/p&gt;
&lt;p&gt;The problem is that Firefox and Chrome are web browsers, not editors. I prefer vim. A solution was needed. A geeky one.&lt;/p&gt;
&lt;p&gt;I checked around for cli-based mediawiki-editing tools, and found a bunch of broken crappy-ass tools. There were at least two different approaches to fuse-based mediawiki-editing, none of them really worked or were possible to hack without investing far more effort into the matter than it was worth. (Somehow, when people measure the quality of FUSE filesystems and playing games in wine, the definition of &amp;#8220;works well&amp;#8221; seem to be &amp;#8220;it&amp;#8217;s theoretically possible with a lot of effort to get it to mostly do something somewhat similar to what you should want it to do.&amp;#8221;). Then there were some other tools that were even written in perl(!). The horror.&lt;/p&gt;
&lt;p&gt;So I wrote my own. Couldn&amp;#8217;t be THAT hard, right? And it gave me the opportunity to hack around with Awk, which is always a bonus.&lt;/p&gt;
&lt;h1&gt;Presenting wiki.sh&lt;/h1&gt;
&lt;p&gt;Turns out, it wasn&amp;#8217;t that hard.&lt;/p&gt;
&lt;p&gt;wiki.sh is 219 line shell script, or 149 lines once comments and blank lines are removed. It uses basic auth to authenticate and uses the mediawiki api to fetch and edit content.&lt;/p&gt;
&lt;p&gt;It can be reviewed at:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/KristianLyng/wikish/raw/master/wiki.sh&quot;&gt;http://github.com/KristianLyng/wikish/raw/master/wiki.sh&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The code repository living at &lt;a href=&quot;http://github.com/KristianLyng/wikish&quot;&gt;http://github.com/KristianLyng/wikish&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As it&amp;#8217;s mainly tested by myself on a single wiki, it&amp;#8217;s likely to break for other setups. But it&amp;#8217;s a simple shell script, and should be fairly straight forward to work with.&lt;/p&gt;
&lt;p&gt;It uses curl, &amp;#8220;supports&amp;#8221; XDG basedirs for configuration (aka: let&amp;#8217;s test how many environmental variables are never ever use before we try the default location), allows multiple configs based on PWD, has explicit POST and GET commands, or the more convenient EDIT command, which will fetch a page, open it in your $EDITOR then post the new version if you changed it. It fetches edit-tokens in mediawiki-style, but should probably not be used in environments where you anticipate edit conflicts yet, since it fetches the edit token right before the post, not when it fetches the content.&lt;/p&gt;
&lt;p&gt;All in all, it&amp;#8217;s a cute little hack. So far, I haven&amp;#8217;t been able to make it really break after the initial protocol-mick-mockery was resolved.&lt;/p&gt;
&lt;h1&gt;Demo&lt;/h1&gt;
&lt;p&gt;Step 1, pick a page to edit.&lt;br /&gt;
&lt;img src=&quot;http://bohemians.org/~kristian/misc/wikish/step-1.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Step 2, it&amp;#8217;s now fetched and open in vim.&lt;br /&gt;
&lt;img src=&quot;http://bohemians.org/~kristian/misc/wikish/step-2.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Step 3, edit it however you want, save in the normal vim-way.&lt;br /&gt;
&lt;img src=&quot;http://bohemians.org/~kristian/misc/wikish/step-3.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Step 4, wikish updates the wiki for you.&lt;br /&gt;
&lt;img src=&quot;http://bohemians.org/~kristian/misc/wikish/step-4.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The gpg-output is because I keep the password in a gpg-encrypted file. The result and title is to verify that it posted it to the right title.&lt;/p&gt;
&lt;p&gt;Step 5: Showing off the horribly complex configuration.&lt;br /&gt;
&lt;img src=&quot;http://bohemians.org/~kristian/misc/wikish/step-5.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Cute tricks&lt;/h1&gt;
&lt;p&gt;If you use rewrite rules for mediawiki, and not the overly ugly wikipedia naming scheme of having &amp;#8216;wiki&amp;#8217; at least three or four times in a url, you&amp;#8217;ll want to set &amp;#8216;$wgUsePathInfo = false&amp;#8217; in mediawiki. This isn&amp;#8217;t specific to wiki.sh, but anything that wants to use the api. Otherwise, you&amp;#8217;re likely to find yourself editing /Mediawiki/Api.php instead of whatever you were really intending to edit.&lt;/p&gt;
&lt;p&gt;An other neat trick I use is to execute &amp;#8220;cd /home/kristian/tmp/wikish/&amp;#8221; at the top of the config. That way, I can keep all the trash in one place &amp;#8211; with the added benefit of being able to do open old wiki pages directly in vim &amp;#8211; even if I can&amp;#8217;t edit them directly.&lt;/p&gt;
&lt;p&gt;I also keep the passwords in a gpg file, as the example points out.&lt;/p&gt;
&lt;p&gt;You will almost certainly want to symlink wiki.sh to /usr/local/bin/wikiedit for example. wiki.sh checks how it was invoked: &amp;#8220;wikiedit PAGE&amp;#8221; is the equivalent of &amp;#8220;./wiki.sh EDIT PAGE&amp;#8221;, &amp;#8220;wikipost PAGE&amp;#8221; == &amp;#8220;./wiki.sh POST PAGE&amp;#8221; etc. PAGE being the actual title you want to edit.&lt;/p&gt;
&lt;p&gt;Feel free to post issues on the github issue tracker. I do review them, though if they are not relevant to my own setup, you may want to add a patch too &lt;img src=&quot;http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/kristianlyng.wordpress.com/307/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/kristianlyng.wordpress.com/307/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=kristianlyng.wordpress.com&amp;amp;blog=13096927&amp;amp;post=307&amp;amp;subd=kristianlyng&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 31 Aug 2010 15:26:17 +0000</pubDate>
</item>
<item>
	<title>Jorge Enrique Barrera: Recommended Firefox addons</title>
	<guid>http://jorge.fbarr.net/?p=870</guid>
	<link>http://jorge.fbarr.net/2010/08/27/recommended-firefox-addons/</link>
	<description>&lt;p&gt;This post never gets old. I constantly keep finding new and useful addons for Firefox. Here&amp;#8217;s the list of what I consider to be some of the best Firefox addons out there.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/1865&quot;&gt;Adblock Plus&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Ever been annoyed by all those ads and banners on the internet that often take longer to download than everything else on the page? Install Adblock Plus now and get rid of them.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/446&quot;&gt;MediaplayerConnectivity&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Allow you to launch embed video of website in an external application with a simple click.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/9808&quot;&gt;StartupMaster&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Asks for the master password at startup (fixes multiple password prompt).&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/1122&quot;&gt;Tab Mix Plus&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Tab Mix Plus enhances Firefox&amp;#8217;s tab browsing capabilities. It includes such features as duplicating tabs, controlling tab focus, tab clicking options, undo closed tabs and windows, plus much more. It also includes a full-featured session manager.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/1455&quot;&gt;Tiny Menu&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Replace the standard menu bar with a tiny menu popup.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/5890&quot;&gt;Tree Style Tab&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Show tabs like a tree.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/2410&quot;&gt;Xmarks&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Xmarks is the #1 bookmarking add-on. Install it on all your computers to keep your bookmarks and (optionally) passwords backed up and synchronized. Xmarks also helps you uncover the best of the web based on what millions of people are bookmarking.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/4125/&quot;&gt;It&amp;#8217;s all Text!&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Right click on a text area, select &amp;#8220;It&amp;#8217;s All Text!&amp;#8221; and edit the text in the editor of your choice.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/60&quot;&gt;Web Developer&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The Web Developer extension adds a menu and a toolbar with various web developer tools.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/67651/&quot;&gt;BarTab&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;BarTab can intercept when tabs are loaded in the background or restored after a browser restart and will only load the content when the tab is actually visited. It also allows you to free memory by unloading already loaded tabs, either manually or automatically.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;</description>
	<pubDate>Fri, 27 Aug 2010 09:15:56 +0000</pubDate>
</item>
<item>
	<title>Lars Strand: Bubba Two - some performance numbers</title>
	<guid>tag:blog.larsstrand.org,2010-08-25:/article.php?story=bubba-performance</guid>
	<link>http://blog.larsstrand.org/article.php?story=bubba-performance</link>
	<description>&lt;p&gt;Here are my experience with the &lt;a href=&quot;http://blog.larsstrand.org/article.php?story=bubba-two-nas&quot;&gt;Bubba Two NAS&lt;/a&gt; so far. Below are some performance numbers.
&lt;p&gt;Write locally:
&lt;pre&gt;
lks@bubba:~&amp;#36; dd if=/dev/zero of=bigfile bs=1M count=1K&lt;br /&gt;
1024+0 records in&lt;br /&gt;
1024+0 records out&lt;br /&gt;
1073741824 bytes (1.1 GB) copied, 96.8614 seconds, &lt;strong&gt;11.1 MB/s&lt;/strong&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;p&gt;
&lt;p&gt;Testing raw network traffic:

&lt;pre&gt;
lks@bubba:~&amp;#36; iperf -c 192.168.1.10&lt;br /&gt;
------------------------------------------------------------&lt;br /&gt;
Client connecting to 192.168.1.10, TCP port 5001&lt;br /&gt;
TCP window size: 16.0 KByte (default)&lt;br /&gt;
------------------------------------------------------------&lt;br /&gt;
[  3] local 192.168.1.3 port 54697 connected with 192.168.1.10 port 5001&lt;br /&gt;
[  3]  0.0-10.0 sec  76.4 MBytes  &lt;strong&gt;64.1 Mbits/sec&lt;/strong&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;p&gt;

&lt;p&gt;Write over NFS (exported with UDP):
&lt;pre&gt;
root@titan:/mnt/lks# dd if=/dev/zero of=bigfile bs=1M count=1K&lt;br /&gt;
1024+0 records in&lt;br /&gt;
1024+0 records out&lt;br /&gt;
1073741824 bytes (1.1 GB) copied, 174.882 s, &lt;strong&gt;6.1 MB/s&lt;/strong&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;p&gt;
&lt;p&gt;During the test, the CPU clocks in at about 70%. Since the disk can deliver almost the double of that, I guess the bottleneck is the bus. 

&lt;p&gt;Downloading over &lt;strong&gt;ftp give around 7-8MB/s (~55-65Mbits/s). Samba around 5-6MB/s (~40-48Mbit/s).&lt;/strong&gt;

&lt;p&gt;These numbers are more than adequate for most of my multimedia needs. A 720p HD film encoded in MPEG2 needs around 20Mbits/s (~2.4MB/s). But since most films are encoded using MPEG4 (or similar) - a proper encoded 1080p movie will only use around 2-3MB/s.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Wed, 25 Aug 2010 18:14:22 +0000</pubDate>
</item>
<item>
	<title>Lars Strand: The Bubba Two NAS</title>
	<guid>tag:blog.larsstrand.org,2010-08-23:/article.php?story=bubba-two-nas</guid>
	<link>http://blog.larsstrand.org/article.php?story=bubba-two-nas</link>
	<description>&lt;p&gt;My &lt;a href=&quot;http://blog.larsstrand.org/article.php?story=Balcony-Server&quot;&gt;balcony server&lt;/a&gt; finally died on my the other day. It has been running 24/7 for four years in all kinds of weather. I wasn't very surprised - in fact I've been waiting for it to happen. The motherboard had died. I've replaced the motherboard, and its back up. But for how long before a disk or something else fails?

&lt;p&gt;I have backup of (mostly) everything here and there, but I would like to have everything on a separate NAS box. One of the most exciting NAS boxes on the market right now is something called &lt;a href=&quot;http://www.excito.com/bubba/products/overview.html&quot;&gt;Bubba|Two&lt;/a&gt;.
&lt;p&gt;Bubba Two is produced by the Swedish company &lt;a href=&quot;http://www.excito.com&quot;&gt;Excito&lt;/a&gt;. Its basically a small Linux server with a big disk. You can use the slick web-interface, or you can ssh into the NAS and treat it like an ordinary Linux-server. It is a LAMP server with SSH running Debian Etch. Samba, proftpd and Mediatomb (upnp) provide the box with file-server capabilities. It even have Squeezecenter installed if you have a &lt;a href=&quot;http://www.logitechsqueezebox.com/&quot;&gt;Squeezebox&lt;/a&gt; (which I happen to have).

&lt;p&gt;Its a ARM processor clocked at 333MHz with 256MB RAM and a 2TB disk. It uses ridiculous low amount of power (max 12W). There is no fan, so the only noise is from the HDD itself - which is barely audible.

&lt;p&gt;Since the default apt-repositories are no longer working (Etch is too old), I change sources.list to:
&lt;p&gt;
&lt;pre&gt;
  deb http://archive.debian.org/debian/ etch main
&lt;/pre&gt;
&lt;p&gt;
&lt;p&gt;I can now proceed to install NFS-server, Munin-node and Bind. A couple of minutes later, and its all running smoothly. Too easy.

&lt;p&gt;&lt;img width=&quot;800&quot; height=&quot;600&quot; src=&quot;http://blog.larsstrand.org/images/articles/bubba-two-nas_1_original.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 23 Aug 2010 20:00:56 +0000</pubDate>
</item>
<item>
	<title>Jean-Marc Reymond: How to update Smooks in JBoss ESB</title>
	<guid>tag:blogger.com,1999:blog-5508944150741454216.post-4375847494871127250</guid>
	<link>http://minibiti.blogspot.com/2010/08/how-to-update-smooks-in-jboss-esb.html</link>
	<description>The latest JBoss SOA platform (5.0) uses JBoss ESB 4.7 (https://www.jboss.com/products/platforms/soa/components/) which itself uses Smooks 1.2.3 (http://docs.jboss.org/jbossesb/docs/4.7/manuals/html/ReleaseNotes.html)&lt;br /&gt;The latest and greatest Smooks is 1.3.1 and contains certain new features.&lt;br /&gt;So if you absolutely need them in your JBoss Soa Platform 5.0, you will have to update Smooks manually. To do so, download the zip file from  http://downloads.sourceforge.net/smooks/smooks-1.3.1.zip, unpack it and replace all the milyn-* from $JBOSS_ESB_HOME/server/default/deployers/esb.deployer/lib/ with the ones from the lib folder in the zip file.&lt;br /&gt;&lt;br /&gt;Warning: This configuration is most likely not supported in case you need support from Red Hat.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5508944150741454216-4375847494871127250?l=minibiti.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 23 Aug 2010 11:51:00 +0000</pubDate>
	<author>noreply@blogger.com (Bambitroll)</author>
</item>
<item>
	<title>Ingvar Hagelund: RPMS of varnish-2.1.3</title>
	<guid>http://ingvar.blog.linpro.no/?p=939</guid>
	<link>http://ingvar.blog.linpro.no/2010/08/17/rpms-of-varnish-2-1-3/</link>
	<description>&lt;p&gt;Varnish is a high performance, state of the art HTTP accelerator, used by sites like Facebook and Twitter.&lt;/p&gt;
&lt;p&gt;I recently built RPMS of varnish-2.1.3 for RHEL and derivates. Source and binary packages for el4 and el5 on x86_64 are available from &lt;a href=&quot;http://sourceforge.net/projects/varnish/files/&quot;&gt;http://sourceforge.net/projects/varnish/files/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Packages for other arches and test builds for el6 may be found &lt;a href=&quot;http://users.linpro.no/ingvar/varnish/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As before, packages in the 2.1 series will not reach EPEL4 and EPEL5, as they are stuck at the 2.0 version, and updating to 2.1 needs manual intervention, and possibly changing of the VCL configuration. I&amp;#8217;ll try to push an update to 2.1 in EPEL6 soon.&lt;/p&gt;</description>
	<pubDate>Tue, 17 Aug 2010 13:17:46 +0000</pubDate>
</item>
<item>
	<title>Espen Braastad: munincollector-ng</title>
	<guid>http://braastad.org/blog/?p=5</guid>
	<link>http://braastad.org/blog/2010/08/munincollector-ng/</link>
	<description>&lt;p&gt;Munincollector-ng is a perl script that collects graphs from multiple &lt;a href=&quot;http://munin-monitoring.org&quot; target=&quot;_self&quot;&gt;munin&lt;/a&gt; installations to display them in one page. A scenario where this is helpful is when you have (too) many munin clients on (too) many munin masters, and you want to look through some of the graphs &amp;#8211; i.e. the &lt;em&gt;Disk usage in percent&lt;/em&gt; (aka &lt;em&gt;df&lt;/em&gt;) plugin &amp;#8211; without spending/wasting too much time browsing through the less important graphs.&lt;/p&gt;
&lt;p&gt;It consists of one perl script and one configuration file. It is being executed regularly by cron. At each run, it iterates through the configuration file; downloads the graphs to a local directory and generates an html file:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://braastad.org/blog/wp-content/uploads/2010/08/munincollector-ng.png&quot;&gt;&lt;img src=&quot;http://braastad.org/blog/wp-content/uploads/2010/08/munincollector-ng-300x293.png&quot; alt=&quot;&quot; title=&quot;munincollector-ng&quot; width=&quot;300&quot; height=&quot;293&quot; class=&quot;alignnone size-medium wp-image-44&quot; /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Below is some example configuration that will gather the &lt;em&gt;week&lt;/em&gt; and &lt;em&gt;month&lt;/em&gt; graphs from the &lt;em&gt;df&lt;/em&gt; plugin from four separate munin masters (three without authentication and one with authentication). The graphs will be downloaded to &lt;em&gt;/var/www/munincollector-ng/&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;# General configuration
graph.plugin df
graph.type week month
graph.log /var/log/munincollector-ng.log
graph.dir /var/www/munincollector-ng

# Configuration per munin master you want to collect graphs from.
# The format is: &amp;lt;id&amp;gt;.&amp;lt;option&amp;gt; &amp;lt;value&amp;gt;

# Three munin installations with no authentication
uio.url http://munin.ping.uio.no
foo.url http://foo.com/munin/
bar.url http://bar.com/munin/

# One munin master that requires authentication
baz.url http://baz.com/munin/
baz.realm Munin
baz.username user1
baz.password pass1
baz.netloc baz.com:80&lt;/pre&gt;
&lt;p&gt;An example cron job that will execute the script once per day (make sure &lt;em&gt;user&lt;/em&gt; have write permissions in &lt;em&gt;/var/www/munincollector-ng/&lt;/em&gt;):&lt;/p&gt;
&lt;pre&gt;8 8 * * * user /usr/local/bin/munincollector-ng -c /etc/munincollector-ng/example.conf&lt;/pre&gt;
&lt;p&gt;The current (as of this writing) latest revision is &lt;a href=&quot;http://braastad.org/download/munincollector-ng&quot;&gt;available for download&lt;/a&gt;. I might put it in some publicly available revision system one day.&lt;/p&gt;
&lt;p&gt;PS: Put the &lt;em&gt;logo.png&lt;/em&gt; and &lt;em&gt;style.css&lt;/em&gt; from your &lt;em&gt;/etc/munin/templates/&lt;/em&gt; directory into &lt;em&gt;/var/www/munincollector-ng/&lt;/em&gt; to make it look a bit nicer.&lt;/p&gt;</description>
	<pubDate>Mon, 16 Aug 2010 20:15:53 +0000</pubDate>
</item>
<item>
	<title>David Jensen: Chroot'd Ubuntu on Samsung Galaxy S (Android)</title>
	<guid>http://burningbroccoli.se/post/949205350</guid>
	<link>http://burningbroccoli.se/post/949205350</link>
	<description>&lt;p&gt;So I got my hands on a &lt;a href=&quot;http://galaxys.samsungmobile.com/&quot; target=&quot;_blank&quot;&gt;Samsung Galaxy S&lt;/a&gt; (or SGS) a while ago, and it’s a really nice phone using Android 2.1 as it OS. Before I settled on the SGS the Nokia N900 had caught my eye. The 900 has great hardware and its OS is more of a “standard” Linux. Its Maemo OS is really just a Linux distro with all that entails (X11,QT,GTK), this means you can easily run any Linux app you can compile, and since it’s easy to install Debian or Ubuntu chroot’d on it you can even run things like OpenOffice etc (But the speed and screen real estate won’t be good). The problem is that Maemo is &lt;a href=&quot;http://meego.com/community/blogs/imad/2010/welcome-meego&quot; target=&quot;_blank&quot;&gt;being merged into to Meego&lt;/a&gt; and there is only one phone, the N900, which means no apps what so ever except open source ones.&lt;/p&gt;

&lt;p&gt;Android is linux based, but it doesn’t use X11 and most applications are written in Java and executed on a custom JVM called ‘Dalvik’. Therefore I was a bit sceptical of buying a android device, it felt a bit stupid to not take advantage of the massive amount of open source programs, libraries and toolkits out there. I still do, but android struck me as a much more mature OS, an it’s very nice to have lot’s of apps :-)&lt;/p&gt;

&lt;p&gt;Anyway, having linux underneath means that we can easily install a chroot’d Ubuntu in Android, giving us access to many nice applications… like openssh, python, webservers, transsmission (with web gui) etc. This is nothing new, it has been done before, both with &lt;a href=&quot;http://www.saurik.com/id/10&quot; target=&quot;_blank&quot;&gt;Debian&lt;/a&gt; and &lt;a href=&quot;http://nexusonehacks.net/nexus-one-hacks/ubuntu-on-nexus-one-android/&quot; target=&quot;_blank&quot;&gt;Ubuntu&lt;/a&gt;, but here is how I did it on my SGS. If you don’t know what chroot is, &lt;a href=&quot;http://en.wikipedia.org/wiki/Chroot&quot; target=&quot;_blank&quot;&gt;read up&lt;/a&gt; before you do anything. For X11 application there is a &lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=486247&quot; target=&quot;_blank&quot;&gt;trick with VNC&lt;/a&gt; to get them running, I haven’t tried it yet though.&lt;/p&gt;

&lt;h2&gt;A couple of prerequisites:&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Root access (su)&lt;/li&gt;
&lt;li&gt;busybox&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I got both by rooting my phone after &lt;a href=&quot;http://www.swedroid.se/forum/showthread.php?t=15049&quot; target=&quot;_blank&quot;&gt;this guide&lt;/a&gt; .&lt;/p&gt;

&lt;h2&gt;Partition&lt;/h2&gt;

&lt;p&gt;First of we need somewhere to put the system, android uses FAT32 for the SD card and that’s no good for us. We need a real file system, like ext4. Unfortunately the kernel in my SGS didn’t support it. You can get a list of supported filesystems with ‘cat /proc/filesystems’. This is from my
SGS:&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   cgroup
nodev   binfmt_misc
nodev   sockfs
nodev   pipefs
nodev   anon_inodefs
nodev   tmpfs
nodev   inotifyfs
nodev   devpts
    ext3
    ext2
    cramfs
nodev   ramfs
    vfat
    msdos
    romfs
    rfs
    j4fs

&lt;/pre&gt;

&lt;p&gt;So we settle for ext3. The easiest way to partition the SD card is to connect it to you’re computer (not through the phone), and use gparted. I used the SD card reader on my laptop with the use of an adapter that came with the card when I bought it. It’s best to just shrink the vfat partition because if you remove it your phone is going to complain that the card is broken or needs formatting. If your starting from scratch just make sure the vfat partition is the first partition.&lt;/p&gt;

&lt;p&gt;The size of the ext3 partition of course depends on the size of your SD card. But at least 1 gigabyte is probably a good idea. I used a 2 gigabyte card, 512 megabytes for the vfat, the rest for the ext3 partition. Don’t forget to tell gparted to format your new partition.&lt;/p&gt;

&lt;h2&gt;Create a rootfs with rootstock&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://launchpad.net/project-rootstock&quot; target=&quot;_blank&quot;&gt;Rootstock&lt;/a&gt; is a great tool for building a basic ubuntu image to use with your ARM based device. It uses good old &lt;a href=&quot;http://wiki.debian.org/Debootstrap&quot; target=&quot;_blank&quot;&gt;debootstrap&lt;/a&gt;, running the second stage of the installation (the one you usually need to run on the device) under qemu. Pretty smart. This means that the tarball you get is a fully finished root base file system. You can even specify some extra packages that rootstock can install. A SSH server is a good idea, I like less, screen, ne (nice editor, like nano but with ordinary key-bindings, like ctrl-s etc), build-essential so that  we can compile things.&lt;/p&gt;

&lt;p&gt;Note that you specify a user and a password. You should choose a good password.&lt;/p&gt;

&lt;p&gt;Create a rootfs tarball:&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ sudo rootstock --fqdn ubuntu --login sgs --password temporary --imagesize 1G --seed openssh-server,less,build-essential,screen,ne
&lt;/pre&gt;

&lt;p&gt;Unpack the tarball and copy the content to your fine new partition on the SD card.
Then set up googles DNS server (the ext3 partition is mounted on /mnt):&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ mv mv armel-rootfs-201008012234.tgz /mnt/
$ cd /mnt
$ tar xvzf armel-rootfs-201008012234.tgz
$ rm armel-rootfs-201008012234.tgz 
$ echo 'nameserver 8.8.8.8' &gt; etc/resolv.conf
&lt;/pre&gt;

&lt;p&gt;It’s time to put the card back into the phone…&lt;/p&gt;

&lt;h2&gt;Now on your phone&lt;/h2&gt;

&lt;p&gt;For the rest you need to drop into root:&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ su
#
&lt;/pre&gt;

&lt;p&gt;First mount the ext3 partition, I use a dir on the SD card called “ubuntu”, you can put it anywhere you want though. Since the SGS has internal storage too the SD card has the device /dev/block/mmcblk1p2&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
# busybox mount /dev/block/mmcblk1p2 /sdcard/sd/ubuntu
&lt;/pre&gt;

&lt;p&gt;chroot by itself is not enough, we need to mount /proc,/dev and /sysfs too.
An the path on android is a bit strange so we need to set that too.&lt;/p&gt;

&lt;p&gt;Tap this on your phone for a glorious chrooted ubuntu:&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
# busybox mount -t proc proc /sdcard/sd/ubuntu/proc
# busybox mount --bind /sys /sdcard/sd/ubuntu/sys
# busybox mount --bind  /dev /sdcard/sd/ubuntu/dev
# export PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH
# busybox chroot /sdcard/sd/ubuntu 
&lt;/pre&gt;

&lt;h2&gt;Log in via SSH&lt;/h2&gt;

&lt;p&gt;When your chroot’d you can start the SSH server and log into it that way. This will give you full terminal emulation (as opposed to “adb shell”), i.e.bash completion, emacs, vim etc.&lt;/p&gt;

&lt;p&gt;Start server and check what ip nr your phone has&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
# /etc/init.d/ssh start
# ifconfig | grep &quot;inet addr&quot;
&lt;/pre&gt;

&lt;p&gt;Note that since this is Ubuntu the root user doesn’t have any password so you have to ssh to it with the user name  and password you specified to rootstock. In my example above that’s “sgs” and “temporary”. To get root privileges use sudo, remember this is Ubuntu.&lt;/p&gt;

&lt;h2&gt;A script to help&lt;/h2&gt;

&lt;p&gt;If you think tapping all that mounts and path etc on your phone is a bit tiresome to tap you can make a script of it. Shell scripting is not my strong point so it can probably be improved, but it seems to work for me. It mounts the ext3 partition and sets up everything needed. Note that it does &lt;em&gt;not&lt;/em&gt; drop you into a chroot’d ubuntu, it just starts the ssh server.&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
#!/bin/sh
#we need to setup test [
busybox ln -s /system/xbin/busybox /system/xbin/[

if [ -d /sdcard/sd/ubuntu/etc ] ; then
    echo &quot;ubuntu partition is already mounted&quot;
else
    echo &quot;Mounting ext3 partition to /sdcard/sd/ubuntu&quot;
    busybox mount -o noatime /dev/block/mmcblk1p2 /sdcard/sd/ubuntu

    echo 'Mounting proc,sys and dev'
    busybox mount -t proc proc /sdcard/sd/ubuntu/proc
    busybox mount --bind /sys /sdcard/sd/ubuntu/sys
    busybox mount --bind  /dev /sdcard/sd/ubuntu/dev
fi

echo 'Exporting a proper path'
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH

echo 'Chrooting and starting ssh server'
busybox chroot /sdcard/sd/ubuntu /etc/init.d/ssh start

echo &quot;And your ip is:&quot;
busybox ifconfig | busybox grep &quot;inet addr&quot;
&lt;/pre&gt;

&lt;p&gt;Put it on the sdcard  or the on the internal storage and execute it like this:&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ su
# sh /sdcard/sd/ubuntu.sh
&lt;/pre&gt;</description>
	<pubDate>Fri, 13 Aug 2010 22:12:00 +0000</pubDate>
</item>
<item>
	<title>Kristian Lyngstol: Stripping cookies with VCL</title>
	<guid>http://kristianlyng.wordpress.com/?p=299</guid>
	<link>http://kristianlyng.wordpress.com/2010/08/13/stripping-cookies-with-vcl/</link>
	<description>&lt;p&gt;The easiest way to get Varnish to help you out of the box, is to strip cookies you don&amp;#8217;t want. Other than that, the default settings are pretty good.&lt;/p&gt;
&lt;p&gt;So to ease that whole mess, I wrote a bash script for the occasion, maintained as of now at ﻿&lt;a href=&quot;http://varnish-cache.org/browser/trunk/varnish-tools/cookie-stripper&quot;&gt;http://varnish-cache.org/browser/trunk/varnish-tools/cookie-stripper&lt;/a&gt;. It can create everything you need for a VCL file to just remove cookies and define a web server. A copy of the current version is here:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;#!/bin/sh
# Author: Kristian Lyngstol
# Date: August 2010
# More info: http://kristianlyng.wordpress.com
# License: Consider it public domain.
#

usage() {
	echo
	echo &quot;Varnish Cookie-strip VCL generator&quot;
	echo &quot;Copyright (C) 2010 Kristian Lyngstol &quot;
	echo
	echo &quot;$0 [-b backend:port] [-i indentation] [-c cookie] [-c cookie] ...&quot;
	echo &quot;Generates VCL for Varnish to strip cookies.&quot;
	echo &quot; -c \tStrip cookie named \`cookie'. Can be&quot;
	echo &quot;            \tspecified multiple times&quot;
	echo &quot; -b \tAlso generate the backend definition to use&quot;
	echo &quot;               \ta web server at host:port as the backend. Both&quot;
	echo &quot;               \thost AND port, separated by colon, must be specified&quot;
	echo &quot; -t \tUse \`indent' when indenting the code, instead of&quot;
	echo &quot;            \t4 spaces.&quot;
	echo &quot; -i         \tCreate case-insensitive cookie matching&quot;
	echo
	echo &quot;Example: $0 -b localhost:8181 -c __utmz -c __utma &amp;gt; /etc/varnish/default.vcl&quot;
	echo
	echo &quot;The VCL generated is for Varnish 2.1 and beyond and with the&quot;
	echo &quot;-b option there is no need to add or modify the final VCL to&quot;
	echo &quot;make Varnish \&quot;just work\&quot;&quot;
}
ind() {
	echo -n &quot;$indent&quot;
}

TEMP=`getopt -o hb:c:it: -n $0 -- &quot;$@&quot;`

if [ $? != 0 ] ; then echo &quot;$(usage)&quot; &amp;gt;&amp;amp;2 ; exit 1 ; fi

eval set -- &quot;$TEMP&quot;

icase=&quot;&quot;
indent=&quot;    &quot;
backend=&quot;&quot;
cookiestring=&quot;&quot;

while true ; do
	case &quot;$1&quot; in
		-b) backend=&quot;$2&quot;; shift 2;;
		-i) icase=&quot;(?i)&quot;; shift 1;;
		-t) indent=&quot;$2&quot;; shift 2;;
		-c) cookiestrip=&quot;$cookiestrip $2&quot;; shift 2;;
		-h) usage; exit 0 ;;
		--) shift; break ;;
		*) echo &quot;Internal error! See $0 -h&quot; ; exit 1 ;;
	esac
done

host=`echo $backend | sed s/:.*//`
port=`echo $backend | sed s/.*://`

if [ ! -z &quot;$backend&quot; ]; then
	if [ -z &quot;$host&quot; ] || [ -z &quot;$port&quot; ]; then
		echo &quot;Invalid backend \&quot;$backend\&quot;&quot; 1&amp;gt;&amp;amp;2
		echo &quot;$(usage)&quot; 1&amp;gt;&amp;amp;2
		exit 1;
	fi

	echo &quot;backend default {&quot;
	ind
	echo &quot;.host = \&quot;$host\&quot;;&quot;
	ind
	echo &quot;.port = \&quot;$port\&quot;;&quot;
	echo &quot;}&quot;
	echo
fi

if [ -z &quot;$cookiestrip&quot; ] &amp;amp;&amp;amp; [ -z &quot;$backend&quot; ]; then
	echo &quot;No -c or -b option specified.&quot; 1&amp;gt;&amp;amp;2
	echo &quot;$(usage)&quot; 1&amp;gt;&amp;amp;2
	exit 2;
fi

echo &quot;sub vcl_recv {&quot;
for a in $cookiestrip; do
	ind
	echo &quot;# Remove cookie $a&quot;
	ind
	echo -n 'set req.http.cookie = regsub(req.http.cookie,';
	echo -n &quot;\&quot;${icase}$a=[^;]*;?( |$)\&quot;&quot;
	echo ',&quot;&quot;);'
done

echo
ind
echo &quot;# Remove the cookie header if it's empty after cleanup&quot;
ind
echo 'if (req.http.cookie ~ &quot;^ *$&quot;) {'
ind
ind
echo 'remove req.http.cookie;'
ind
echo '}'
echo '}'&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Since I don&amp;#8217;t have any cookie-needing web sites or servers, I haven&amp;#8217;t tested it properly. I figure someone else will test it if it&amp;#8217;s a worthwhile script to have around.&lt;/p&gt;
&lt;p&gt;Feedback welcome.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/kristianlyng.wordpress.com/299/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/kristianlyng.wordpress.com/299/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=kristianlyng.wordpress.com&amp;amp;blog=13096927&amp;amp;post=299&amp;amp;subd=kristianlyng&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Fri, 13 Aug 2010 19:07:30 +0000</pubDate>
</item>
<item>
	<title>Jorge Enrique Barrera: Introduction to irssi</title>
	<guid>http://jorge.fbarr.net/?p=1003</guid>
	<link>http://jorge.fbarr.net/2010/08/10/introduction-to-irssi/</link>
	<description>&lt;p&gt;There are a load of IRC clients for UNIX-based systems out there, but I personally feel that irssi suits me best. Incredibly flexible, adjustable for every user, and doesn&amp;#8217;t depend on X to be able to run it. Haven&amp;#8217;t really found a guide out there that explains things in an easy and understandable manner, aimed particularly at new users. So here&amp;#8217;s my attempt at it.&lt;/p&gt;
&lt;div id=&quot;toc&quot;&gt;&lt;div id=&quot;toc_title&quot;&gt;Table of contents&lt;/div&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Getting-started&quot;&gt;Getting started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Customizing-the-settings&quot;&gt;Customizing the settings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Connecting-to-an-IRCnetwork&quot;&gt;Connecting to an IRC-network&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Navigation&quot;&gt;Navigation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Adding-networks-servers-and-channels&quot;&gt;Adding networks, servers and channels&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Logging&quot;&gt;Logging&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Scripts&quot;&gt;Scripts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jorge.fbarr.net/category/linux/feed/#Minor-adjustments&quot;&gt;Minor adjustments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id=&quot;Getting-started&quot;&gt;Getting started&lt;/h3&gt;
&lt;p&gt;What we need, of course, is irssi itself. You can get it at http://www.irssi.org/download, or use your system&amp;#8217;s package manager to download it.&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;yum &lt;span&gt;install&lt;/span&gt; irssi&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;..for RPM-based systems.&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;&lt;span&gt;sudo&lt;/span&gt; &lt;span&gt;aptitude&lt;/span&gt; &lt;span&gt;install&lt;/span&gt; irssi&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;..for Debian/Ubuntu type of distributions.&lt;/p&gt;
&lt;p&gt;Now, once installed, you can fire up irssi by typing&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;irssi&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;in the commandline. You should now be running irssi, whoo!&lt;/p&gt;
&lt;h3 id=&quot;Customizing-the-settings&quot;&gt;Customizing the settings&lt;/h3&gt;
&lt;p&gt;Now that irssi is up and going, you can change the settings, adjust it so that if suits you. By typing:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SET &amp;lt;KEYWORD&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;you will get a list of settings. For instance, let&amp;#8217;s try out &lt;b&gt;/SET nick&lt;/b&gt;. This is what pops up:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;&amp;lt;09:07&amp;gt; [completion]
&amp;lt;09:07&amp;gt; completion_nicks_lowercase = OFF
&amp;lt;09:07&amp;gt; [lookandfeel]
&amp;lt;09:07&amp;gt; hilight_nick_matches = ON
&amp;lt;09:07&amp;gt; query_track_nick_changes = ON
&amp;lt;09:07&amp;gt; show_nickmode = ON
&amp;lt;09:07&amp;gt; show_nickmode_empty = ON
&amp;lt;09:07&amp;gt; show_own_nickchange_once = OFF
&amp;lt;09:07&amp;gt; [misc]
&amp;lt;09:07&amp;gt; netjoin_max_nicks = 10
&amp;lt;09:07&amp;gt; netsplit_max_nicks = 10
&amp;lt;09:07&amp;gt; netsplit_nicks_hide_threshold = 15
&amp;lt;09:07&amp;gt; [server]
&amp;lt;09:07&amp;gt; alternate_nick = joba7_
&amp;lt;09:07&amp;gt; nick = joba7&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here you see the various settings containing the word &lt;b&gt;nick&lt;/b&gt;. irssi will automatically set your nick based on your account name. So if your username on your machine is &lt;b&gt;foo&lt;/b&gt;, irssi will set your nick to &lt;b&gt;foo&lt;/b&gt;. You can of course change this:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SET nick joba7
/SET alternate_nick joba7_&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;..followed up by a &lt;b&gt;/SAVE&lt;/b&gt; and &lt;b&gt;/RELOAD&lt;/b&gt; to save and reload the settings.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: Every time you change a default setting, you will have to use &lt;b&gt;/SAVE&lt;/b&gt; to save the configuration.&lt;/p&gt;
&lt;h3 id=&quot;Connecting-to-an-IRCnetwork&quot;&gt;Connecting to an IRC-network&lt;/h3&gt;
&lt;p&gt;The usual way to connect to an IRC-network is to use &lt;b&gt;/SERVER&lt;/b&gt; or &lt;b&gt;/CONNECT&lt;/b&gt;. After having started up irssi, you can type:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SERVER powertech.no.eu.dal.net&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will then connect me to the server &lt;b&gt;powertech.no.eu.dal.net&lt;/b&gt; on the DALnet network. At the same time though, I&amp;#8217;d like to be on the EFnet network. You can connect to multiple networks by typing:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/CONNECT irc.homelien.no&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This connects you to the EFnet network as well. You are perhaps wondering how you can change from one network to the other? Look at your status-window. This is usually window number 1. Use &lt;b&gt;ALT-1&lt;/b&gt; or &lt;b&gt;ESC-1&lt;/b&gt; to change to that window. Right now my active network is EFnet, on the server irc.homelien.no. Which means that I&amp;#8217;m seeing this:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;[08:38] [joba7(+i)] [1:homelien (change with ^X)]&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;«Change with ^X» &amp;#8211; ^X means &lt;b&gt;Ctrl-X&lt;/b&gt;, so upon pressing it, you will change your active network. You will see something like this in your status window:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;08:38 -!- Irssi: Changed to server powertech.no.eu.dal.net&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To disconnect from one of the servers, or stop irssi&amp;#8217;s attempt at reconnecting, use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;/DISCONNECT&lt;/b&gt; &amp;lt;network&amp;gt; &amp;#8211; Disconnects server with tag &lt;b&gt;network&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/DISCONNECT&lt;/b&gt; recon-1 &amp;#8211; Cancels an attempt to connect to the server named &lt;b&gt;recon-1&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/RMRECONNS&lt;/b&gt; &amp;#8211; Cancels all attempts to reconnect.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/RECONNECT&lt;/b&gt; recon-1 &amp;#8211; Will attempt to reconnect you to &lt;b&gt;recon-1&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/RECONNECT ALL&lt;/b&gt; &amp;#8211; Will attempt to reconnect to all the servers in the reconnection queue.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;Navigation&quot;&gt;Navigation&lt;/h3&gt;
&lt;p&gt;You can scroll upwards/downwards with the &lt;b&gt;Page Up&lt;/b&gt; / &lt;b&gt;Page Down&lt;/b&gt; keys. If they aren&amp;#8217;t working for you, you can use &lt;b&gt;Meta-p&lt;/b&gt; / &lt;b&gt;Meta-n&lt;/b&gt;, where &lt;b&gt;Meta&lt;/b&gt; can be &lt;b&gt;ESC&lt;/b&gt; and/or &lt;b&gt;ALT&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;Default behavior is that irssi pretty much creates hidden windows for just about everything. Hidden windows are created every time you join a channel or start a conversation. There are different ways to switch between them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Meta-1&lt;/b&gt; &amp;#8230; &lt;b&gt;Meta-0&lt;/b&gt;- Switch between window 1-10.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Meta-q&lt;/b&gt; &amp;#8230; &lt;b&gt;Meta-o&lt;/b&gt; &amp;#8211; Switch between window 11-19.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/WINDOW &amp;lt;number&amp;gt;&lt;/b&gt; &amp;#8211; Switch to window number &amp;lt;number&amp;gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Ctrl-p / Ctrl-n&lt;/b&gt; &amp;#8211; Switch to the previous/next window.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;Adding-networks-servers-and-channels&quot;&gt;Adding networks, servers and channels&lt;/h3&gt;
&lt;p&gt;On the network &lt;b&gt;DALnet&lt;/b&gt; you have a function called Nickserv, which lets you register a nick, so that you can become the owner of it. To be able to use this nick you will have to identify to it when logging on to the IRC network. It&amp;#8217;s a bit tiresome having to type &lt;/p&gt;/nickserv identify &amp;lt;yournick&amp;gt; &amp;lt;yourpassword&amp;gt; every time you connect. I&amp;#8217;m assuming you want this a bit more automated? I at least do. :) But before we do this we have to do a couple of things. Like adding a network:

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/IRCNET ADD &amp;lt;YourNetwork&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/IRCNET ADD DALnet&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you&amp;#8217;d like to execute a command when logging on, as in the example above with nick-identification, use &lt;b&gt;-autosendcmd&lt;/b&gt;:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/IRCNET ADD -autosendcmd &amp;quot;/nickserv identify &amp;lt;YourNick&amp;gt; &amp;lt;ThePassword&amp;gt;;wait -DALnet 2000&amp;quot; DALnet&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The command above automatically sends the identify-command to Nickserv when you log on. The &lt;b&gt;-wait 2000&lt;/b&gt; tells irssi to wait two seconds after having logged on to the server before sending the command.&lt;/p&gt;
&lt;p&gt;Now that we&amp;#8217;ve added a network, we need servers to go along with it. The command to do so is:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SERVER ADD -ircnet DALnet powertech.no.eu.dal.net 6667&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you&amp;#8217;d like to automatically connect to this server when you start irssi, simply add an &lt;b&gt;-auto&lt;/b&gt; right after &lt;b&gt;ADD&lt;/b&gt;. Specifying the port is optional.&lt;/p&gt;
&lt;p&gt;So, first network, then server, now for a channel:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/CHANNEL ADD -auto #linuxhjelp DALnet [password]&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;[password] is optional, use of it depends on if the channel you&amp;#8217;re trying to join needs a password to be accessed.&lt;/p&gt;
&lt;h3 id=&quot;Logging&quot;&gt;Logging&lt;/h3&gt;
&lt;p&gt;irssi has the ability to log both away-messages and regular conversations in channels. Logging for away messages is enabled by default, but not regular logging. First, it&amp;#8217;s possible to define what the awaylog should log:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;/SET awaylog_level MSGS HILIGHT&lt;/b&gt; &amp;#8211; Defines what kind of messages to log.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/SET awaylog_file ~/.irssi/away.log&lt;/b&gt; &amp;#8211; Defines the file the log should write to.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The easiest way of enabling logging, and not just away messages, is to execute:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SET autolog ON&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Per default irssi logs to &lt;b&gt;~/irclogs/&amp;lt;Servername or Networkname&amp;gt;/&amp;lt;Channel or nick&amp;gt;.log&lt;/b&gt;. This can be defined by:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SET autolog_path ~/irclogs/$tag/$0.log&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is the default value. The path will automatically be created if it doesn&amp;#8217;t exist. &lt;b&gt;$0&lt;/b&gt; points to the target (channel/nick). You can make irssi to automatically rotate the logs by adding a time/date stamp to the filename. You find more about the formatting used by typing &lt;b&gt;man strftime&lt;/b&gt; in your commandline. But for example:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;%Y for year, %m for month and %d for day.&lt;/p&gt;
&lt;p&gt;For more information about logging have a look at:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/HELP LOG&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;Scripts&quot;&gt;Scripts&lt;/h3&gt;
&lt;p&gt;If you&amp;#8217;ve used other IRC clients, you&amp;#8217;ve probably encountered the possibility to use scripts. Scripts can be used for various things, from showing a channel what song you&amp;#8217;re currently playing to flaunting your machine&amp;#8217;s hardware specs. A good site for scripts is &lt;a href=&quot;http://scripts.irssi.org/&quot;&gt;http://scripts.irssi.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The scripts you download should be placed in &lt;b&gt;~/.irssi/scripts/&lt;/b&gt;. If the folder doesn&amp;#8217;t exist, create it yourself. Once the script is placed there, you can load it in your irssi by doing a:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SCRIPT LOAD ~/.irssi/scripts/TheScript.pl&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is a good approach if you don&amp;#8217;t want certain scripts to load when irssi starts. If you do however want them to load when starting irssi, create a symlink in the folder &lt;b&gt;~/.irssi/scripts/autorun&lt;/b&gt;, just create the folder if it doesn&amp;#8217;t exist. Symlink, what&amp;#8217;s that? Well, it&amp;#8217;ss a special type of file that contains a reference to another file or directory in the form of an absolute or relative path. So in other words:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;bash&quot;&gt;&lt;span&gt;cd&lt;/span&gt; ~&lt;span&gt;/&lt;/span&gt;
&lt;span&gt;wget&lt;/span&gt; http:&lt;span&gt;//&lt;/span&gt;scripts.irssi.org&lt;span&gt;/&lt;/span&gt;scripts&lt;span&gt;/&lt;/span&gt;splitlong.pl
&lt;span&gt;mkdir&lt;/span&gt; &lt;span&gt;-p&lt;/span&gt; ~&lt;span&gt;/&lt;/span&gt;.irssi&lt;span&gt;/&lt;/span&gt;scripts&lt;span&gt;/&lt;/span&gt;autorun
&lt;span&gt;mv&lt;/span&gt; ~&lt;span&gt;/&lt;/span&gt;splitlong.pl ~&lt;span&gt;/&lt;/span&gt;.irssi&lt;span&gt;/&lt;/span&gt;scripts
&lt;span&gt;cd&lt;/span&gt; ~&lt;span&gt;/&lt;/span&gt;.irssi&lt;span&gt;/&lt;/span&gt;scripts&lt;span&gt;/&lt;/span&gt;autorun
&lt;span&gt;ln&lt;/span&gt; &lt;span&gt;-s&lt;/span&gt; ..&lt;span&gt;/&lt;/span&gt;splitlong.pl&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So the file is really in &lt;b&gt;~/.irssi/scripts&lt;/b&gt;, but you&amp;#8217;ve made a shortcut to it from &lt;b&gt;~/.irssi/scripts/autorun&lt;/b&gt;. Pretty neat if you ask me.&lt;/p&gt;
&lt;p&gt;To unload a script simply use:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;/SCRIPT UNLOAD %lt;Name of script&amp;amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;Minor-adjustments&quot;&gt;Minor adjustments&lt;/h3&gt;
&lt;p&gt;It&amp;#8217;s not just what I&amp;#8217;ve mentioned above that you can adjust and customize to your own liking. Another thing is the use of themes. You&amp;#8217;re probably using the default blue theme that irssi comes with, which is just fine for my use, but perhaps not for you. I do however like the minor modification just for kicks.&lt;/p&gt;
&lt;p&gt;Every time you use &lt;b&gt;/SAVE&lt;/b&gt;, a message like this will appear in your status window:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;08:38 -!- Irssi: Saved configuration to file /home/jorge/.irssi/config
08:38 -!- Irssi: Theme saved to /home/jorge/.irssi/default.theme&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Settings are stored in the configuration file named &lt;b&gt;config&lt;/b&gt; and the theme in &lt;b&gt;default.theme&lt;/b&gt;. Both files are editable through a text editor. I&amp;#8217;ve never really changed things manually in the &lt;b&gt;config&lt;/b&gt;-file, but I&amp;#8217;ve tampered with &lt;b&gt;default.theme&lt;/b&gt; a bit, like what my own nick appears to me. Default appearance of your nick is like so:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;text&quot;&gt;&amp;lt; YourNick&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Where YourNick is in bold white, while the inequality signs are in gray.&lt;/p&gt;
&lt;p&gt;Open the file &lt;b&gt;~/.irssi/default.theme&lt;/b&gt; and find the line that says something like:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;perl&quot;&gt;ownmsgnick &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;quot;{msgnick $0 $1-}&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Change this to:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;perl&quot;&gt;ownmsgnick &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;quot;%R&amp;lt;%n$0$1-%R&amp;gt;%n %|&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will make the inequality signs turn red. Your nick will still be in white bold. But you can always change the inequality signs to something else. For instance:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;perl&quot;&gt;ownmsgnick &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;quot;%Y(%n$0$1-%Y)%n %|&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Will make the parenthesis turn yellow. If you want to change the color of your nick, from default white to something else, find this line:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;perl&quot;&gt;ownnick &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;quot;%W$*%n&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;..and replace it with the color you want:&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;perl&quot;&gt;ownnick &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;quot;%G$*%n&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For a nice overview of colors, check out &lt;a href=&quot;http://irssi.org/documentation/formats&quot;&gt;http://irssi.org/documentation/formats&lt;/a&gt;, and for more information about irssi, visit &lt;a href=&quot;http://www.irssi.org/&quot;&gt;http://www.irssi.org/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And here&amp;#8217;s a screenshot of irssi:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://jorge.fbarr.net/wp-content/uploads/2010/08/irssi.png&quot;&gt;&lt;img src=&quot;http://jorge.fbarr.net/wp-content/uploads/2010/08/irssi-300x195.png&quot; alt=&quot;&quot; title=&quot;irssi&quot; width=&quot;300&quot; height=&quot;195&quot; class=&quot;aligncenter size-medium wp-image-1050&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;</description>
	<pubDate>Tue, 10 Aug 2010 07:09:26 +0000</pubDate>
</item>
<item>
	<title>Kacper Wysocki: tune2fs and green disks</title>
	<guid>http://kacper.blog.linpro.no/?p=147</guid>
	<link>http://kacper.blog.linpro.no/archives/147</link>
	<description>&lt;p&gt;Hey folks,&lt;br /&gt;
old news I&amp;#8217;m sure, but if you get tempted into buying the new&lt;a href=&quot;http://www.wdc.com/en/products/products.asp?driveid=576&quot;&gt; WD Caviar &amp;#8220;Green Power&amp;#8221; disks&lt;/a&gt; there is something you need to know about them: they fake 512-byte blocksizes while in reality having 4096-byte blocks! The move to 4K blocks is reasonable considering we just busted the 2 terabyte barrier, but the disk firmware is faking 512-byte blocks in the name of compatibility (read: so windows xp won&amp;#8217;t shit itself). &lt;/p&gt;
&lt;p&gt;Unfortunately, running in bs512 mode makes the disk exactly &lt;strong&gt;3x slower&lt;/strong&gt; than it should be!&lt;br /&gt;
The fix: line up your partitions at 4k boundries, so start partition one at block 64, 1024 or even 2048 (the win7 start block) &lt;strong&gt;not the default&lt;/strong&gt;, 63, in most partitioning software. Start &lt;code&gt;fdisk&lt;/code&gt; with the &lt;code&gt; -u&lt;/code&gt; parameter and carefully specify the start block. In &lt;code&gt;gparted&lt;/code&gt; you&amp;#8217;ll have to unhook the &amp;#8220;snap to cylinder boundries&amp;#8221; checkbox, and then I suppose you could even &lt;em&gt;move a partition&lt;/em&gt; to the right block,  but expect this to take an inordinate amount of time!&lt;/p&gt;
&lt;p&gt;On a related note, fsck&amp;#8217;ing an ext filesystem on boot is a drag, and fsck&amp;#8217;ing 2TB file systems is a huge drag. Sure you &lt;strong&gt;should&lt;/strong&gt; be running the fsck but it has a nasty tendency to happen on your workstation precisely when you can&amp;#8217;t afford the extra 5 minute delay!&lt;/p&gt;
&lt;p&gt;I bump the default 10 mounts count to 0 (disabling mount count fscking) and auto-fsck my disks every 99 days, staggered so not all disks get checked on the same day. Do this with the &lt;code&gt;tune2fs&lt;/code&gt; command:&lt;/p&gt;
&lt;pre&gt;
wasp:~# tune2fs -c 0 -i 99d /dev/sda1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
Setting interval between checks to 8553600 seconds
&lt;/pre&gt;
&lt;p&gt;out.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PS&lt;/em&gt; I recently managed to achieve sustained throughputs of 110MB/s with these WD disks and properly aligned partitions:&lt;/p&gt;
&lt;pre&gt;
7516192768 bytes (7.5 GB) copied, 68.4392 s, 110 MB/s
115+0 records in
114+0 records out
&lt;/pre&gt;
&lt;p&gt;yes that&amp;#8217;s disk-to-disk with ext4 and one large file, no fragmentation.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;PPS&lt;/em&gt; the defaults have nowadays changed to 120 days and 39 mounts, to which I say -1 mounts is better anyway!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;edit:&lt;/strong&gt; Now that your files are aligned, you can specify a block size to mkfs as well, which might avoid unaligned fragments: &lt;code&gt;mkfs.ext4 -b 4096 -L gigantor -O sparse_super /dev/sdb1&lt;/code&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 05 Aug 2010 10:05:22 +0000</pubDate>
</item>
<item>
	<title>Edward Bjarte Fjellskål: snort-2.8.6.1 debian/ubuntu packages</title>
	<guid>http://www.gamelinux.org/?p=92</guid>
	<link>http://www.gamelinux.org/?p=92</link>
	<description>&lt;p&gt;Back from vacation &lt;img src=&quot;http://www.gamelinux.org/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/p&gt;
&lt;p&gt;I did pack 2.8.6.0, but it never made it to the public before I went on vacations :/&lt;/p&gt;
&lt;p&gt;You can find 2.8.6.1 here:&lt;br /&gt;
http://debs.gamelinux.org/snort/hardy/&lt;/p&gt;
&lt;p&gt;-*&amp;gt; Snort! &amp;lt;*-&lt;br /&gt;
Version 2.8.6.1 IPv6 GRE (Build 39)&lt;/p&gt;</description>
	<pubDate>Thu, 05 Aug 2010 09:58:31 +0000</pubDate>
</item>
<item>
	<title>Sigvard Lyth: A vacation in Bornholm</title>
	<guid>tag:blogger.com,1999:blog-7850101855375546752.post-2761527229866815486</guid>
	<link>http://sigvard-lyth.blogspot.com/2010/08/vacation-in-bornholm.html</link>
	<description>My family and I decided a year or so ago, that we wanted to take a trip together. We wanted something active, and maybe a little sportish, and also wanted it to be possible to change location from time to time. My wife quite quickly found Bornholm for a location, and bicycling as the activity. We invited all the familly to join us, but sadly only got my mom to join us, as the final decissions came quite late.&lt;br /&gt;&lt;br /&gt;So, finally, we were ready to lieve. For easy departure we went to my grandma, who lives in Akershus, the day before our flight. I bother to mention this because an important part happend at this point... I lost my smartphones during this bit...That means that I didn't write this on my htc Magic. :) Rather I write it on my wife's eee 701, running ubutu 10.04.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/7850101855375546752-2761527229866815486?l=sigvard-lyth.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Thu, 05 Aug 2010 09:33:00 +0000</pubDate>
	<author>noreply@blogger.com (Sigvard)</author>
</item>
<item>
	<title>Christopher Grenness: Solving Android Market Download Problems</title>
	<guid>http://grenness.blog.linpro.no/?p=39</guid>
	<link>http://grenness.blog.linpro.no/2010/08/03/solving-android-market-download-problems/</link>
	<description>&lt;div&gt;
&lt;p&gt;&lt;img src=&quot;http://grenness.blog.linpro.no/files/androidmkt4-300x300.jpg&quot; alt=&quot;Android Market&quot; width=&quot;180&quot; height=&quot;180&quot; /&gt;I can&amp;#8217;t promise that I have the solutions for all, but hopefully others can chip in with their tricks, workarounds and hopefully positive results.&lt;/p&gt;
&lt;p&gt;So, for the past few months, I have struggled when trying to download apps from Android Market.&lt;br /&gt;
I had no problems downloading apps at work, and it also worked over 3G (but as I don&amp;#8217;t have an unlimited data plan, it&amp;#8217;s not preferred&amp;#8230;).&lt;br /&gt;
At the same time, logging into Gtalk is impossible.&lt;/p&gt;
&lt;p&gt;I found several threads online discussing the problem &amp;#8211; even an &amp;#8220;official&amp;#8221; thread started by a Google employee, which unfortunately has been closed without offering a definite solution, at least not for me &amp;#8211; but you can still read it &lt;a href=&quot;http://www.google.com/support/forum/p/Android%20Market/thread?tid=57b5e3efa7477b50&amp;amp;hl=en&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So that leads me to the two solution suggestions I have to offer, but if anyone have other suggestions please add them as comments.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you are a Google user in UK, and have been using @googlemail.com as your email address and Google login name, try to replace @googlemail.com with @gmail.com, and if that doesn&amp;#8217;t solve it, follow &lt;a href=&quot;http://androinica.com/2010/06/07/how-to-fix-uk-android-market-download-and-gmail-log-in-errors/&quot; target=&quot;_blank&quot;&gt;this how-to&lt;/a&gt; to clear caches etc (see the comments below the article)&lt;/li&gt;
&lt;li&gt;If you&amp;#8217;re not a UK Google user, but still face problems like I described, try what solved it for me &amp;#8211; access your firewall (either a standalone box or typically integrated in your DSL modem, your wifi access point, or similar), and open up for traffic on TCP and UDP ports 5228. That&amp;#8217;s all I had to do, and I hope this will solve it for others as well.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Please add comments if none of these suggestions are helping, or if you have other solutions to this problem.&lt;/p&gt;&lt;/div&gt;</description>
	<pubDate>Tue, 03 Aug 2010 18:53:51 +0000</pubDate>
</item>
<item>
	<title>Kristian Lyngstol: Varnish backend selection through DNS</title>
	<guid>http://kristianlyng.wordpress.com/?p=294</guid>
	<link>http://kristianlyng.wordpress.com/2010/08/02/varnish-backend-selection-through-dns/</link>
	<description>&lt;p&gt;A common challenge to using a cache is maintaining a mapping between public site names and actual web servers (backends). If you only have one type of web server (or maybe two?), and it&amp;#8217;s fairly static, this isn&amp;#8217;t a big deal. However, if your infrastructure spans tens of different types of web servers, then it starts getting iffy. Here&amp;#8217;s an example of how this could look:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;director sports round-robin {
    { .backend = { .host = &quot;sports1.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;sports2.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;sports3.internal.example.net&quot;; .port = &quot;80&quot;; } }
}
director shop round-robin {
    { .backend = { .host = &quot;shop1.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;shop2.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;shop3.internal.example.net&quot;; .port = &quot;80&quot;; } }
}
director economy round-robin {
    { .backend = { .host = &quot;economy1.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;economy2.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;economy3.internal.example.net&quot;; .port = &quot;80&quot;; } }
}
director main round-robin {
    { .backend = { .host = &quot;main1.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;main2.internal.example.net&quot;; .port = &quot;80&quot;; } }
    { .backend = { .host = &quot;main3.internal.example.net&quot;; .port = &quot;80&quot;; } }
}
sub vcl_fetch {
    if (req.http.host ~ &quot;sports.example.net$&quot;) {
        set req.backend = sports;
    } elsif (req.http.host ~ &quot;shop.example.net$&quot;) {
        set req.backend = shop;
    } elsif (req.http.host ~ &quot;economy.example.net$&quot;) {
        set req.backend = economy;
    } else {
        set req.backend = main;
    }
}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is obviously a bit of a drag, and so far we only added four sites.&lt;/p&gt;
&lt;h2&gt;Enter the DNS director&lt;/h2&gt;
&lt;p&gt;The DNS director allows you to define a single director containing one or more backends, just like any other backend director, but uses DNS to decide which one to pick. Simply put, it does a DNS lookup on the Host header and sees if it has a backend that matches.&lt;/p&gt;
&lt;p&gt;Notice that it does NOT automatically try whatever IP the Host header resolves to. It has to know about the backend in advance. This might sound like a bit of a major flaw, but I choose to look at it as a safety net.&lt;/p&gt;
&lt;p&gt;The DNS director also allow you to add a postfix to the host-name before it is looked up, so www.example.com could become www.example.com.internal.example.net. It has rudimentary DNS round-robin support and caches the DNS lookups (both successful lookups and misses). Since there isn&amp;#8217;t a practical way of obtaining the TTL of a DNS result except apparently hand-coding the resolver or possibly adding some obscure dependency, the life-time of the DNS cache is defined by a setting in the director, cleverly named .ttl.&lt;/p&gt;
&lt;p&gt;As a last added bonus, I also added a really easy way to shoot yourself in the leg. With the DNS director, you can specify a range of backends using .list and a acl-like syntax. However, &lt;strong&gt;remember that adding 10.0.0.0/8 means Varnish will internally generate 16 million backends.&lt;/strong&gt; That&amp;#8217;s PROBABLY not a good idea. So do use some moderation. A /24 or two shouldn&amp;#8217;t be a big deal, but I&amp;#8217;d try to narrow it down as much as possible.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s the above example, except using FOO.example.net.internal.example.net instead of FOO&amp;lt;N&amp;gt;.internal.example.net, and assuming that the web servers are all in the 192.168.0.0/24 range or 172.16.0.0/24&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;director mydir dns {
    .list = {
        .port = &quot;80&quot;;
        .connection_timeout = 0.4;
        &quot;192.168.0.0&quot;/24;
        &quot;172.16.0.0&quot;/24;
    }
    .ttl = 5m;
    .suffix = &quot;internal.example.net&quot;
}
sub vcl_recv {
    set req.backend = mydir;
}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Specifying connection timeout and similar attributes is optional in .list, but has to be before the list of IPs. You do not have to use .list, you can also add backends the same way you would with the random or round-robin director.&lt;/p&gt;
&lt;p&gt;The above examples caches the DNS results for 5 minutes. I&amp;#8217;ve also added some counters (visible through varnishstat): Number of DNS lookups, DNS cache hits, failed DNS lookups and how often the DNS cache is full. You may still want to do some basic sanitizing of domain names so as to reduce DNS spam, but now you can probably just use one regsub to match a number of sites.&lt;/p&gt;
&lt;h2&gt;Availability&lt;/h2&gt;
&lt;p&gt;The DNS director was committed to Varnish development trunk yesterday (Sunday, August 1st 2010) and I expect it to be available in Varnish 2.1.4. It has already been used in production at a few customer sites, with good results. Like any non-trivial piece of code, there are certain aspects of it I want to improve, but I do not foresee that as a blocker for including it in a release. It does not affect the rest of Varnish at all if it not used (unless you count adding 4 counters to varnishstat).&lt;/p&gt;
&lt;p&gt;If you want to test it, you&amp;#8217;ll have to use Varnish trunk. Alternatively, you can check out my &lt;a href=&quot;http://github.com/KristianLyng/varnish&quot;&gt;github repo&lt;/a&gt; which is currently sitting at Varnish 2.1.2 + DNS director + return(refresh). It does look like you&amp;#8217;ll have to compile from source, though. Unless, of course, you&amp;#8217;re a &lt;a href=&quot;http://www.varnish-software.com&quot;&gt;Varnish Software&lt;/a&gt; customer, then you just drop us a mail and you&amp;#8217;ll get your rpms or .debs shortly. (My marketing hat is currently firmly planted on my head).&lt;/p&gt;
&lt;p&gt;The development of this feature was sponsored by Globo and Mercado Libre and implemented by myself/&lt;a href=&quot;http://www.varnish-software.com&quot;&gt;Varnish Software&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/kristianlyng.wordpress.com/294/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/kristianlyng.wordpress.com/294/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=kristianlyng.wordpress.com&amp;amp;blog=13096927&amp;amp;post=294&amp;amp;subd=kristianlyng&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Mon, 02 Aug 2010 20:19:25 +0000</pubDate>
</item>
<item>
	<title>Shervin Asgari: Migrating from JODConverter 2 to JODConverter 3</title>
	<guid>tag:blogger.com,1999:blog-2429877696364208688.post-7330609962089287695</guid>
	<link>http://shervinasgari.blogspot.com/2010/08/migrating-from-jodconverter-2-to.html</link>
	<description>In the previous &lt;a href=&quot;http://shervinasgari.blogspot.com/2010/05/automate-converting-of-documents-to-pdf.html&quot;&gt;posting&lt;/a&gt; I showed you how you could automate conversions of documents to PDF &amp;amp; PDF/A using JODConverter 2.&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://code.google.com/p/jodconverter/&quot;&gt;JODConverter 3.0.beta&lt;/a&gt; has been out for some time, and even though it is still beta, it is very stable. Maybe even more stable than JODConverter 2. &lt;br /&gt;&lt;br /&gt;In this blog posting I will highlight the benefits of JODConverter 3 compared to its predecessor and show you how you can modify your code to create PDF/A documents with JODConverter 3.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;JODConverter 2 versus 3&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;JODConverter 3 still uses OpenOffice.org to perform its conversion. It is still a wrapper to the OOo API. It is only a complete rewrite of the JODConverter core library which is much cleaner and easier to use.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;u&gt;&lt;b&gt;Whats new?&lt;/b&gt;&lt;/u&gt;&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;No more init script(!)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;You don't have to manually start OpenOffice.org as a service anymore. This will be handled automatic.&lt;/li&gt;&lt;li&gt;You can even create multiple processes which is useful for multi-core CPU's. Best practise is one process for each CPU core.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Automatically restart an OOo instance if it crashes.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;If for some reason your process crashes, JODConverter will detect this, and restart the process automatic. This was a hassle with JODConverter 2, as you needed to manually do this in Linux.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Abort conversions that take too long (according to a configurable timeout parameter)&lt;/li&gt;&lt;li&gt;Automatically restart an OOo instance after n conversions (workaround for OOo memory leaks)&lt;/li&gt;&lt;/ul&gt;Additionally the new architecture will make it easier to use the core  JODConverter classes as a generic framework for working with OOo - not  just limited to document conversions.&lt;br /&gt;I am sure there will be more features when JODConverter 3 goes final.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Configuration&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;All you need to do do is point your OpenOffice.org installation to the OfficeManager, and you are good to go.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;OfficeManager officeManager = new DefaultOfficeManagerConfiguration()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setOfficeHome(&quot;/usr/lib/openoffice&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buildOfficeManager().start();&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This manager will use the default settings for &lt;i&gt;Task Queue Timeout, Task Execution Timeout, Port Number etc&lt;/i&gt; but you can easily change them&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;OfficeManager officeManager = new DefaultOfficeManagerConfiguration()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setOfficeHome(&quot;/usr/lib/openoffice&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setTaskExecutionTimeout(240000L)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setTaskQueueTimeout(60000L)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buildOfficeManager().start();&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;If you want to utilize piping (Recommended is one process per CPU-core), you will need to set VM argument and point &lt;i&gt;java.library.path&lt;/i&gt; to the location of &lt;i&gt;$URE_LIB&lt;/i&gt; which on my Ubuntu machine is&lt;i&gt;&lt;span class=&quot;str&quot;&gt; /usr/lib/ure/lib/&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;For instance: &lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class=&quot;str&quot;&gt;-Djava.library.path=&quot;/usr/lib/ure/lib&quot;&lt;/span&gt;&lt;/pre&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;And then you can change your OfficeManager.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;str&quot;&gt;OfficeManager officeManager = new DefaultOfficeManagerConfiguration()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setOfficeHome(&quot;/usr/lib/openoffice&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setConnectionProtocol(OfficeConnectionProtocol.PIPE)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setPipeNames(&quot;office1&quot;,&quot;office2&quot;) //two pipes&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setTaskExecutionTimeout(240000L) //4 minutes&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setTaskQueueTimeout(60000L)&amp;nbsp; // 1 minute&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buildOfficeManager().start();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;&lt;span class=&quot;str&quot;&gt;&lt;b&gt;ConverterService3Impl&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;b&gt; &lt;/b&gt;The following codes performs all the converting. It supports a &lt;i&gt;File or byte[]&lt;/i&gt; as input.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;This is how you use it:&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt; Lets say you have a PDF file as byte[], and you want to convert this byte to PDF/A as byte.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;All you would have to do is call method:&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;str&quot;&gt;byte[] pdfa = converterService.convertToPDFA(pdfFile);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;Similarly, if you have a Document (say a OpenOffice.org writer document) and you want to convert this to PDF you would call the method:&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;str&quot;&gt;File doc = new File(&quot;myDocument.odt&quot;);&lt;br /&gt;File pdfDocument = converterService.convert(doc, &quot;.pdf&quot;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;Note that you will always get a PDF/A compliant pdf. All you need to do is change the extension from &quot;.pdf&quot; to &quot;.html&quot; and the converter would do the magic.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;Here is the source. Please read the comments in the source code if you want to understand it, or just ask in the comment section below.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;str&quot;&gt;import java.io.BufferedInputStream;&lt;br /&gt;import java.io.BufferedOutputStream;&lt;br /&gt;import java.io.ByteArrayInputStream;&lt;br /&gt;import java.io.ByteArrayOutputStream;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.FileInputStream;&lt;br /&gt;import java.io.FileOutputStream;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import java.net.ConnectException;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.Map;&lt;br /&gt;import java.util.regex.Matcher;&lt;br /&gt;import java.util.regex.Pattern;&lt;br /&gt;&lt;br /&gt;import javax.ejb.Local;&lt;br /&gt;import javax.ejb.Stateless;&lt;br /&gt;&lt;br /&gt;import lombok.Cleanup;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.io.FilenameUtils;&lt;br /&gt;import org.apache.commons.io.IOUtils;&lt;br /&gt;import org.artofsolving.jodconverter.OfficeDocumentConverter;&lt;br /&gt;import org.artofsolving.jodconverter.document.DefaultDocumentFormatRegistry;&lt;br /&gt;import org.artofsolving.jodconverter.document.DocumentFamily;&lt;br /&gt;import org.artofsolving.jodconverter.document.DocumentFormat;&lt;br /&gt;import org.artofsolving.jodconverter.document.DocumentFormatRegistry;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;* This service converts files from one thing to another ie ODT to PDF, DOC to ODT etc&lt;br /&gt;&amp;nbsp;* @author Shervin Asgari&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;@Stateless&lt;br /&gt;@Local(ConverterService.class)&lt;br /&gt;public class ConverterService3Impl implements ConverterService {&lt;br /&gt;&lt;br /&gt;&amp;nbsp; private static final String PDF_EXTENSION = &quot;.pdf&quot;;&lt;br /&gt;&amp;nbsp; private static final String PDF = &quot;pdf&quot;;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&amp;nbsp; // Uncomment these when we want to use them&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // private final int PDFXNONE = 0;&lt;br /&gt;&amp;nbsp; private final int PDFX1A2001 = 1;&lt;br /&gt;&amp;nbsp; // private final int PDFX32002 = 2;&lt;br /&gt;&amp;nbsp; // private final int PDFA1A = 3;&lt;br /&gt;&amp;nbsp; // private final int PDFA1B = 4; &lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&amp;nbsp; @Logger //Your favourite logger (ie Log4J) could be injected here &lt;br /&gt;&amp;nbsp; private Log log;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; public File convert(File inputFile, String extension) throws IOException, ConnectException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (inputFile == null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new IOException(&quot;The document to be converted is null&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pattern p = Pattern.compile(&quot;^.?pdf$&quot;, Pattern.CASE_INSENSITIVE);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Matcher m = p.matcher(extension);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OfficeDocumentConverter converter;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //If inputfile is a PDF you will need to use another FormatRegistery, namely DRAWING&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(FilenameUtils.isExtension(inputFile.getName(), PDF) &amp;amp;&amp;amp; m.matches()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DocumentFormatRegistry formatRegistry = new DefaultDocumentFormatRegistry();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatRegistry.getFormatByExtension(PDF).setInputFamily(DocumentFamily.DRAWING);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; converter = new OfficeDocumentConverter(officeManager, formatRegistry);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; converter = new OfficeDocumentConverter(officeManager);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String inputExtension = FilenameUtils.getExtension(inputFile.getName());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File outputFile = File.createTempFile(FilenameUtils.getBaseName(inputFile.getName()), extension);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; long startTime = System.currentTimeMillis();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //If both input and output file is PDF&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (FilenameUtils.isExtension(inputFile.getName(), PDF) &amp;amp;&amp;amp; m.matches()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //We need to add the DocumentFormat with DRAW&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; converter.convert(inputFile, outputFile, toFormatPDFA_DRAW());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if(FilenameUtils.isExtension(outputFile.getName(), PDF)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; converter.convert(inputFile, outputFile, toFormatPDFA());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; converter.convert(inputFile, outputFile);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; long conversionTime = System.currentTimeMillis() - startTime;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.info(String.format(&quot;successful conversion: %s [%db] to %s in %dms&quot;, inputExtension, inputFile.length(), extension, conversionTime));&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return outputFile;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception exception) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.error(String.format(&quot;failed conversion: %s [%db] to %s; %s; input file: %s&quot;, inputExtension, inputFile.length(), extension, exception, inputFile.getName()));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exception.printStackTrace();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new IOException(&quot;Converting failed&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outputFile.deleteOnExit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inputFile.deleteOnExit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Convert pdf file to pdf/a&lt;br /&gt;&amp;nbsp;&amp;nbsp; * You will need to install OpenOffice extension (pdf viewer) to get it working&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @param pdf&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @return Byte array&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @throws IOException&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; public byte[] convertToPDFA(byte[] pdfByte) throws IOException, ConnectException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Cleanup InputStream is = new ByteArrayInputStream(pdfByte);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File pdf = createFile(is, PDF_EXTENSION);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.debug(&quot;PDF is: #0 #1&quot;, pdf.getName(), pdf.isFile());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convert(pdf);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Returns the content of the file as byte[]&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; public byte[] obtainByteData(File file) throws IOException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Cleanup ByteArrayOutputStream baStream = obtainStreamFromData(file);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Convert the contents of the output stream into a byte array&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] byteData = baStream.toByteArray();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return byteData;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Copy bytes from an InputStream to an OutputStream. &lt;br /&gt;&amp;nbsp;&amp;nbsp; * This method buffers the input internally, so there is no need to use a BufferedInputStream. Large streams (over 2GB) will&lt;br /&gt;&amp;nbsp;&amp;nbsp; * return a bytes copied value of -1 after the copy has completed since the correct number of bytes cannot be returned as an int. &lt;br /&gt;&amp;nbsp;&amp;nbsp; * &lt;br /&gt;&amp;nbsp;&amp;nbsp; * @param file&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @return ByteArrayOutputStream&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @throws IOException&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; private ByteArrayOutputStream obtainStreamFromData(java.io.File file) throws IOException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Cleanup final InputStream inputStream = new FileInputStream(file);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ByteArrayOutputStream outputStream = new ByteArrayOutputStream();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //For large streams use the copyLarge(InputStream, OutputStream) method. (Over 2GB)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int byteCopied = IOUtils.copy(inputStream, outputStream);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; log.debug(&quot;Copied #0 bytes&quot;, byteCopied);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(byteCopied == -1) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new IOException(&quot;The file is too big (over 2GB). Does not support so large files&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return outputStream;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; private byte[] convert(File pdf) throws IOException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pdf == null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new IOException(&quot;The document to be converted is null&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; File convertedPdfA = convert(pdf, PDF_EXTENSION);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Cleanup final InputStream inputStream = new BufferedInputStream(new FileInputStream(convertedPdfA));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] pdfa = IOUtils.toByteArray(inputStream);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return pdfa;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Creates a temp file and writes the content of InputStream to it. doesn't close input&lt;br /&gt;&amp;nbsp;&amp;nbsp; * &lt;br /&gt;&amp;nbsp;&amp;nbsp; * @return File&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; private java.io.File createFile(InputStream in, String extension) throws IOException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; java.io.File f = File.createTempFile(&quot;tmpFile&quot;, extension);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Cleanup BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(f));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IOUtils.copy(in, out);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return f;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * This DocumentFormat must be used when converting from document (not pdf) to pdf/a&lt;br /&gt;&amp;nbsp;&amp;nbsp; * For some reason &quot;PDF/A-1&quot; is called &quot;SelectPdfVersion&quot; internally; maybe they plan to add other PdfVersions later.&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; private DocumentFormat toFormatPDFA() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DocumentFormat format = new DocumentFormat(&quot;PDF/A&quot;, PDF, &quot;application/pdf&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; properties = new HashMap&amp;lt;String, Object&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(&quot;FilterName&quot;, &quot;writer_pdf_Export&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; filterData = new HashMap&amp;lt;String, Object&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterData.put(&quot;SelectPdfVersion&quot;, this.PDFX1A2001);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(&quot;FilterData&quot;, filterData);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.setStoreProperties(DocumentFamily.TEXT, properties);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return format;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * This DocumentFormat must be used when converting from pdf to pdf/a&lt;br /&gt;&amp;nbsp;&amp;nbsp; * For some reason &quot;PDF/A-1&quot; is called &quot;SelectPdfVersion&quot; internally; maybe they plan to add other PdfVersions later.&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; private DocumentFormat toFormatPDFA_DRAW() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DocumentFormat format = new DocumentFormat(&quot;PDF/A&quot;, PDF, &quot;application/pdf&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; properties = new HashMap&amp;lt;String, Object&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(&quot;FilterName&quot;, &quot;draw_pdf_Export&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; filterData = new HashMap&amp;lt;String, Object&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterData.put(&quot;SelectPdfVersion&quot;, this.PDFX1A2001);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; properties.put(&quot;FilterData&quot;, filterData);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.setStoreProperties(DocumentFamily.DRAWING, properties);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return format;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;str&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;str&quot;&gt;Remember to close the connection when your application is quit/shutdown&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/2429877696364208688-7330609962089287695?l=shervinasgari.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</description>
	<pubDate>Mon, 02 Aug 2010 14:44:00 +0000</pubDate>
	<author>noreply@blogger.com (Shervin Asgari)</author>
</item>
<item>
	<title>Kacper Wysocki: CPM: Reliable multiuser password management</title>
	<guid>http://kacper.blog.linpro.no/?p=135</guid>
	<link>http://kacper.blog.linpro.no/archives/135</link>
	<description>&lt;p&gt;Sup all,&lt;br /&gt;
summer is drawing to a close and vacation is definitely over, but I for one welcome the chance to think and act again. Some time ago our managed services department started complaining about various shoddy password management solutions. Truth be told we already had a good solution, CPM (&amp;#8221;Console Password Management&amp;#8221;) but the software had fallen into disrepair due to seldom and untidy updates from its author. A new maintainer was desired and a project to fix the software was decreed and the result fell into my lap so to speak. &lt;/p&gt;
&lt;p&gt;What sets CPM apart from other password management solutions is that it supports multiple users and goes to great lengths to keep your passwords secure while at the same time being very simple in its design: CPM locks its XML-formatted hierarchical password database in non-swappable private memory (so your passwords don&amp;#8217;t get written in cleartext to disk while swapping), and encrypts the database with an arbitrary amount of &lt;a href=&quot;http://www.gnupg.org/&quot; target=&quot;_gpg&quot;&gt;GnuPG&lt;/a&gt; public keys.&lt;/p&gt;
&lt;p&gt;All this makes CPM quite nice for storing and sharing secrets in a nice curses-based searchable console interface.&lt;/p&gt;
&lt;p&gt;For the longest time I&amp;#8217;ve been keeping the hundred-odd passwords I can&amp;#8217;t remember on notepads and in random text files, thinking that surely I should start employing some sort of password management before I go crazy or my passwords leak. The congruence of my wishes with the scope of this project, so I picked up CPM and gave it a little love, and the result can be found at &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/comotion/cpm&quot;&gt;GitHub CPM&lt;/a&gt; with &lt;a href=&quot;http://github.com/comotion/cpm/downloads&quot;&gt;CPM packages for debian in the downloads section&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CPM crash course&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Requirements: Gnu Privacy Guard, and a GPG keypair.&lt;/p&gt;
&lt;p&gt;First, install CPM:&lt;/p&gt;
&lt;pre&gt;
dpkg -i cpm_0.25~beta-2debian2_amd64.deb
&lt;/pre&gt;
&lt;p&gt;Then, create a password database, adding your key to the recipient list when prompted.&lt;/p&gt;
&lt;pre&gt;
create-cpmdb
&lt;/pre&gt;
&lt;p&gt;Then, use CPM from the console:&lt;/p&gt;
&lt;pre&gt;cpm&lt;/pre&gt;
&lt;p&gt;CPM should now ask you for you GPG key password and display an empty database.&lt;/p&gt;
&lt;p&gt;CPM is controlled with the arrow keys, Enter and some control keys.&lt;br /&gt;
Hitting &lt;code&gt;Control-H&lt;/code&gt; will bring you to the Help screen which explains the control keys. &lt;/p&gt;
&lt;p&gt;By default CPM organises your &lt;em&gt;passwords&lt;/em&gt; in a structure of &lt;em&gt;hosts&lt;/em&gt; that have several &lt;em&gt;services&lt;/em&gt; which may have one or more &lt;em&gt;users&lt;/em&gt;. Hosts, services, users and passwords are &lt;em&gt;nodes&lt;/em&gt; in the tree and a node is added by hitting &lt;code&gt;Control-A&lt;/code&gt; and given an appropriate name.&lt;/p&gt;
&lt;p&gt;For instance, if I were to add a password ch1ckens0up to user lolarun on the wiki service of host fragglepop.info, I would create the following node structure:&lt;/p&gt;
&lt;pre&gt;
  host:fragglepop.info
      \--&amp;gt;service:wiki
              \--&amp;gt;user:lolarun
                      \--&amp;gt;password:ch1ckens0up
&lt;/pre&gt;
&lt;p&gt;Of course there is no need to follow this anal layout, and you may even change the node structure by editing the template names in CPM by hitting &lt;code&gt;Control-N&lt;/code&gt; or modifying the /etc/cpmrc config file.&lt;/p&gt;
&lt;p&gt;To have CPM generate a random password for you, hit &lt;code&gt;Control-P&lt;/code&gt;.&lt;br /&gt;
Your changes are not saved unless you hit &lt;code&gt;Control-W&lt;/code&gt; or quit the program by hitting &lt;code&gt;ESC&lt;/code&gt; enough times. Quitting through &lt;code&gt;Control-C&lt;/code&gt; will &lt;em&gt;not&lt;/em&gt; save the database.&lt;/p&gt;
&lt;p&gt;Future work includes pushing the package into Debian.&lt;/p&gt;
&lt;p&gt;What you don&amp;#8217;t get (yet) is a GTK-based GUI, or a wrapper to pull the password database out of GIT and commit it again after modification nor integration with gpg-agent, probably (?) due to a bug in gpgme.&lt;/p&gt;
&lt;p&gt;Enjoy this lovely piece of software and leave a comment after testing it!&lt;/p&gt;</description>
	<pubDate>Mon, 02 Aug 2010 14:29:05 +0000</pubDate>
</item>
<item>
	<title>Kristian Lyngstol: Varnish 2.1.3  Use it!</title>
	<guid>http://kristianlyng.wordpress.com/?p=289</guid>
	<link>http://kristianlyng.wordpress.com/2010/07/30/varnish-2-1-3-use-it/</link>
	<description>&lt;p&gt;We just released Varnish 2.1.3. And it&amp;#8217;s good.&lt;/p&gt;
&lt;p&gt;I am a person who value stability, predictability and stability over pretty much everything else. I will gladly use 3-year old software over the latest version if it&amp;#8217;s working well. I only upgrade my desktop if I see a really good reason to do it. I rather wait 2 years for a new package to enter my favorite distribution than grab it from a source package to get a new feature.&lt;/p&gt;
&lt;p&gt;Why do I tell you this? Because I am now ready to truly whole-heartedly recommend Varnish 2.1.3. Varnish 2.0.6 was a great release. It was stable, it worked well, we know how to get the most of it. There were no un-knowns. When we released Varnish 2.1.0, we knew that it was going to take a release or two to get the 2.1 releases equally good. I finally believe we are there, and that using Varnish 2.1.3 is (almost) as safe as 2.0.6. This is the version I will be recommending to our customers.&lt;/p&gt;
&lt;h2&gt;Varnish 2.0.6 compared to 2.1&lt;/h2&gt;
&lt;p&gt;Varnish 2.1 represents two years of development. Roughly. The performance of Varnish 2.1.3 is roughly the same as that of Varnish 2.0.6, with a few exceptions.&lt;/p&gt;
&lt;p&gt;First, we now use the &amp;#8220;critbit&amp;#8221; hashing algorithm instead of &amp;#8220;classic&amp;#8221; as default. This switch revealed a few weaknesses in the implementation that we gradually resolved between Varnish 2.1.0 and 2.1.3. The benefit of critbit is that it requires far less locking to deliver content. It scales better with large data sets and is generally a nice thing to have.&lt;/p&gt;
&lt;p&gt;We have also re-factored much of the code that relates to directors, which allowed us to add multiple new directors. Including directors to pick a backend based on source-ip, URL hash etc.&lt;/p&gt;
&lt;p&gt;With Varnish 2.1.3 we also added a &amp;#8220;log&amp;#8221; command to VCL, which allows you to add generic log messages to the SHM-log through VCL, a much-requested feature.&lt;/p&gt;
&lt;p&gt;We have also added basic support for Range-headers. This is not the smartest version of it around, but it fits into the KISS-approach of Varnish. When Range-support is enabled, Varnish will fetch the entire object upon a Range request, but deliver only the range that the client requested. This allows Varnish to cache the entire object, but deliver it in smaller segments.&lt;/p&gt;
&lt;p&gt;An other important change between Varnish 2.0 and 2.1 is the removal of the object workspace. The most immediate effect of this is that you will have to write &amp;#8220;beresp&amp;#8221; instead of &amp;#8220;obj&amp;#8221; in the vcl_fetch part of your VCL. The bigger consequence is that you no longer have a obj_workspace parameter and all work previously done in obj_workspace is now done in sess_workspace, then Varnish allocates exactly as much space as it needs for the object once it&amp;#8217;s finished. This should save you some memory on large data sets.&lt;/p&gt;
&lt;p&gt;Now, there are several other changes, but most of them are internal. This is partly to make way for persistent storage, and also for general house-keeping. An other important reason why the perceived difference between Varnish 2.0.6 and 2.1 is not that big is that many of the features that were written for Varnish 2.1 were ported to Varnish 2.0. This includes new purging mechanisms, saint mode, resets in vcl_error and numerous bug fixes.&lt;/p&gt;
&lt;h2&gt;What&amp;#8217;s next?&lt;/h2&gt;
&lt;p&gt;We are still working on persistent storage. It is available in Varnish 2.1 as an experimental feature, but it is missing certain key aspects &amp;#8211; like LRU support. You can compare this to how critbit evolved: Critbit was available in Varnish 2.0, but not stable. We used the 2.0 release to fine tune critbit, and we will use 2.1 to improve persistent storage.&lt;/p&gt;
&lt;p&gt;For Varnish 2.1.4, I will be merging the DNS director, which has been ready for some time now. I wanted to investigate some reports of memory leaks before I merged it, and those seem to be debunked now.&lt;/p&gt;
&lt;p&gt;I will also be merging my return(refresh) code, which is fairly simple stuff. All it does is &amp;#8220;guarantee&amp;#8221; a cache miss, even if there is valid content in the cache. The use-case for this is when you update content and want to control who does the initial waiting. The typical example is when your front page updates, you send a script to it with a magic header (X-Refresh: Yes, for instance), then you look for that in VCL and make sure the client is coming from an allowed IP (if (client.ip ~ purgers), for example) and issue return(refresh), which will (oddly enough) refresh the content. Your clients wont have to wait and the front-page is updated immediately.&lt;/p&gt;
&lt;p&gt;In the longer run, we are also looking at proper support for gzip. For the uninitiated, it should be emphasized that for normal operation, Varnish doesn&amp;#8217;t need to support gzip. Normally, Varnish will simply forward the Accept-Encoding header to the web server, which will compress the content as it sees fit and return it with a Vary header. That way, Varnish can deliver compressed content without having to compress it itself. This works fine, until you introduce Edge Side Includes (ESI) into the mix. With ESI, Varnish has to parse the content returned to check for ESI commands, and it can&amp;#8217;t do that if the content is compressed. So today, Varnish only supports uncompressed ESI. We wish to solve that. Properly.&lt;/p&gt;
&lt;p&gt;I am sure I have forgotten some key elements, but this should hopefully be enough to make this a worth-while read.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/kristianlyng.wordpress.com/289/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/kristianlyng.wordpress.com/289/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=kristianlyng.wordpress.com&amp;amp;blog=13096927&amp;amp;post=289&amp;amp;subd=kristianlyng&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Fri, 30 Jul 2010 12:55:15 +0000</pubDate>
</item>
<item>
	<title>Kristian Lyngstol: Smart bans with Varnish</title>
	<guid>http://kristianlyng.wordpress.com/?p=283</guid>
	<link>http://kristianlyng.wordpress.com/2010/07/28/smart-bans-with-varnish/</link>
	<description>&lt;p&gt;Banning &amp;#8211; or what is commonly referred to as purging &amp;#8211; means adding an expression to the ban list. I wrote an introduction to purging a while back: &lt;a href=&quot;http://kristianlyng.wordpress.com/2010/02/02/varnish-purges/&quot;&gt;http://kristianlyng.wordpress.com/2010/02/02/varnish-purges/&lt;/a&gt;, and today I&amp;#8217;ll introduce you to the ban lurker.&lt;/p&gt;
&lt;p&gt;First, let me apologize for the name confusion. We&amp;#8217;ve realized that calling it &amp;#8220;purging&amp;#8221; seems to indicate that the objects are removed from the cache. As they are not, it&amp;#8217;s more reasonable to call it banning &amp;#8211; and that&amp;#8217;s what Varnish calls it internally. As far as VCL and CLI goes, it&amp;#8217;s still called purging.&lt;/p&gt;
&lt;h2&gt;A quick reminder on how Varnish bans objects&lt;/h2&gt;
&lt;p&gt;Varnish bans objects by adding an expression to a list, and then when an object is &amp;#8220;hit&amp;#8221;, it is tested against all expressions on the list since the last time it was hit. So only when an object is hit can it be evaluated.&lt;/p&gt;
&lt;p&gt;You can ban on both req.* and obj.* items. When you ban in VCL, there are THREE contexts involved:&lt;/p&gt;
&lt;p&gt;1. The VCL context that puts the ban on the ban-list.&lt;/p&gt;
&lt;p&gt;2. The context of the next request that hits the object&lt;/p&gt;
&lt;p&gt;3. The context of the object&lt;/p&gt;
&lt;p&gt;This means that a purge for:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;purge (&quot;req.url == &quot; req.url &quot; &amp;amp;&amp;amp; obj.http.magic == &quot; req.http.purge-magic)
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;all three purges are used. The &amp;#8220;req.url&amp;#8221; outside the quotations marks (the second one) is in the context of the VCL that triggered this purge() function. The &amp;#8220;req.url&amp;#8221; inside the quotation marks is in the context of the request that will hit the object next &amp;#8211; whatever that may be. The &amp;#8220;obj.http.magic&amp;#8221; variable will be in the context of the actual object on the cache, while the last &amp;#8220;req.http.purge-magic&amp;#8221; is in the current vcl-context.&lt;/p&gt;
&lt;p&gt;If that was confusing, it&amp;#8217;s ok. If it wasn&amp;#8217;t confusing, I&amp;#8217;m impressed.&lt;/p&gt;
&lt;h2&gt;Enter the ban-lurker&lt;/h2&gt;
&lt;p&gt;So the problem with Varnish bans is that not all objects are hit constantly. In fact, some objects are rarely ever hit. And they will linger even if they are banned. To solve this, the ban-lurker was created. Put simply, the ban-lurker will check older objects against the current ban-list to see if they are worth keeping around. This serves two functions: 1. Banned objects can be discarded. 2. The size ban-list can be reduced.&lt;/p&gt;
&lt;p&gt;Now, the problem with the ban-lurker is that it doesn&amp;#8217;t stem from a request. In other words, it doesn&amp;#8217;t HAVE a &amp;#8220;req.&amp;#8221; structure. It doesn&amp;#8217;t have a URL. So if your bans are for (&amp;#8220;req.url == &amp;#8221; req.url), the ban lurker can&amp;#8217;t help you, because it doesn&amp;#8217;t have a req.url to test against. It can ONLY test against obj.&lt;/p&gt;
&lt;p&gt;As most bans are for req.url, this means that the ban-lurker isn&amp;#8217;t very useful out-of-the-box. Unless you adapt your approach to bans a bit.&lt;/p&gt;
&lt;h2&gt;Writing ban-lurker-friendly bans&lt;/h2&gt;
&lt;p&gt;To utilize the ban-lurker, there are two things you need to do:&lt;/p&gt;
&lt;p&gt;1. Turn it on with &amp;#8220;param.set ban_lurker_sleep 0.1&amp;#8243; (for example. Any non-zero value enables it)&lt;/p&gt;
&lt;p&gt;2. Do not use req.* in your bans.&lt;/p&gt;
&lt;p&gt;Now, how to avoid using req? Well, the simples method is probably to store req.url on the object, and ban on that. Example:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;sub vcl_fetch {
    set obj.http.x-url = req.url;
}
sub vcl_deliver {
    unset resp.http.x-url; # Optional
}
sub vcl_recv {
    if (req.request == &quot;PURGE&quot;) {
          if (client.ip !~ purgers) {
              error 401 &quot;Not allowed&quot;;
           }
          purge(&quot;obj.http.x-url ~ &quot; req.url); # Assumes req.url is a regex. This might be a bit too simple
    }
}
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;The above code-snippet simply stores the URL on the object as a HTTP header called x-url, then uses that instead of req.url to ban. It also removes the x-url header before it&amp;#8217;s returned to the clients. It may not look as intuitive (&amp;#8230; because &amp;#8220;req.url == &amp;#8221; req.url is clearly intuitive), but it allows you to take advantage of the ban-lurker.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;We (&lt;a href=&quot;http://www.varnish-software.com&quot;&gt;Varnish Software&lt;/a&gt; and the general &lt;a href=&quot;http://www.varnish-cache.org&quot;&gt;Varnish community&lt;/a&gt;) don&amp;#8217;t know how useful the ban-lurker will prove to be, nor do we know what the best grace period for the ban_lurker_sleep parameter is. This is all fairly new, and not used much. We&amp;#8217;re confident in it&amp;#8217;s stability, but not the benefit.&lt;/p&gt;
&lt;p&gt;However, it&amp;#8217;s clear that if you have a possibly large data-set and you do frequent purges, using the ban-lurker can help keep the size of the ban-list within manageable limits, as well as help you throw banned content out faster. We can&amp;#8217;t really see the downside of it.&lt;/p&gt;
&lt;p&gt;However, using the ban-lurker without adjusting your approach to actual bans is pointless. It wont be able to do anything except wake up every second and discover it can&amp;#8217;t do anything.&lt;/p&gt;
&lt;p&gt;I hope this helped. Happing banning!&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/kristianlyng.wordpress.com/283/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/kristianlyng.wordpress.com/283/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=kristianlyng.wordpress.com&amp;amp;blog=13096927&amp;amp;post=283&amp;amp;subd=kristianlyng&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 28 Jul 2010 10:47:51 +0000</pubDate>
</item>
<item>
	<title>Roger Kind Kristiansen: Android: Map tiles not loading – and possible fixes</title>
	<guid>http://www.kind-kristiansen.no/?p=142</guid>
	<link>http://www.kind-kristiansen.no/2010/android-map-tiles-not-loading-and-possible-fixes/</link>
	<description>&lt;p&gt;I have encountered two reasons for the Google Maps tiles not loading. One is rather common, and the other one only seem to affect some phones:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Missing/wrong Google Maps API key &lt;/li&gt;
&lt;li&gt; Permissions placed after application tag in the AndroidManifest.xml&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Missing/wrong Google Maps API key&lt;/h2&gt;
&lt;p&gt;Usage of the Google Maps API key is properly documented many places, like in &lt;a href=&quot;http://mobiforge.com/developing/story/using-google-maps-android&quot;&gt;tutorials&lt;/a&gt;, &lt;a href=&quot;http://developer.android.com/guide/topics/location/index.html&quot;&gt;the official Android developer site&lt;/a&gt; and &lt;a href=&quot;http://code.google.com/intl/no/android/add-ons/google-apis/maps-overview.html&quot;&gt;the Google API project pages&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Wrong placement of permissions in the AndroidManifest.xml&lt;/h2&gt;
&lt;p&gt;The part about wrong placement of the permissions in the manifest file bit me when trying to get my map based app working on the Sony Ericsson Xperia X10 mini pro. The app was working like a charm in every configuration I tried, except on this little beauty. The configurations I tried included:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; HTC Desire running 2.1&lt;/li&gt;
&lt;li&gt;T-Mobile G1 running 1.6&lt;/li&gt;
&lt;li&gt; Various emulators running 1.5, 1.6, 2.1 and 2.2 with various screen sizes. Also one that matched the x10 mini pro screen size.&lt;/li&gt;
&lt;li&gt; Of course the X10 mini pro running 1.6&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I had defined my permissions below the application definition, and after a while I moved the  tags above the  tag, and this fixed it. &lt;/p&gt;
&lt;p&gt;So this is not OK on the X10 mini pro (AndroidManifest.xml):&lt;/p&gt;
&lt;pre class=&quot;brush: xml;&quot;&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;
      package=&amp;quot;com.test.myapp&amp;quot; android:versionCode=&amp;quot;1&amp;quot; android:versionName=&amp;quot;1.0&amp;quot;&amp;gt;
    &amp;lt;application android:label=&amp;quot;@string/app_name&amp;quot; android:icon=&amp;quot;@drawable/launcher_icon&amp;quot;&amp;gt;
    	&amp;lt;uses-library android:name=&amp;quot;com.google.android.maps&amp;quot; /&amp;gt;
        &amp;lt;activity android:label=&amp;quot;@string/app_name&amp;quot;
                  android:alwaysRetainTaskState=&amp;quot;true&amp;quot; android:name=&amp;quot;.views.Map&amp;quot;&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&amp;quot;android.intent.action.MAIN&amp;quot; /&amp;gt;
                &amp;lt;category android:name=&amp;quot;android.intent.category.LAUNCHER&amp;quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
        &amp;lt;/activity&amp;gt;
    &amp;lt;/application&amp;gt;

   &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;&amp;gt;&amp;lt;/uses&amp;gt;
&amp;lt;/manifest&amp;gt;
&lt;/pre&gt;
&lt;p&gt;While this works:&lt;/p&gt;
&lt;pre class=&quot;brush: xml;&quot;&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;
      package=&amp;quot;com.test.myapp&amp;quot; android:versionCode=&amp;quot;1&amp;quot; android:versionName=&amp;quot;1.0&amp;quot;&amp;gt;

    &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot;&amp;gt;&amp;lt;/uses&amp;gt;

    &amp;lt;application android:label=&amp;quot;@string/app_name&amp;quot; android:icon=&amp;quot;@drawable/launcher_icon&amp;quot;&amp;gt;
    	&amp;lt;uses-library android:name=&amp;quot;com.google.android.maps&amp;quot; /&amp;gt;
        &amp;lt;activity android:label=&amp;quot;@string/app_name&amp;quot;
                  android:alwaysRetainTaskState=&amp;quot;true&amp;quot; android:name=&amp;quot;.views.Map&amp;quot;&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&amp;quot;android.intent.action.MAIN&amp;quot; /&amp;gt;
                &amp;lt;category android:name=&amp;quot;android.intent.category.LAUNCHER&amp;quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
        &amp;lt;/activity&amp;gt;
    &amp;lt;/application&amp;gt;
&amp;lt;/manifest&amp;gt;
&lt;/pre&gt;
&lt;p&gt;If someone can tell me why defining permissions below the application tag works on most set-ups, but not on the X10 mini, please enlighten me.&lt;/p&gt;</description>
	<pubDate>Sun, 25 Jul 2010 10:12:25 +0000</pubDate>
</item>
<item>
	<title>Magnus Hagander: PGDay.EU announced and call for papers</title>
	<guid>http://blog.hagander.net/archives/173-guid.html</guid>
	<link>http://blog.hagander.net/archives/173-PGDay.EU-announced-and-call-for-papers.html</link>
	<description>&lt;div&gt;
                &lt;p&gt;&lt;a href=&quot;http://2010.pgday.eu/&quot;&gt;PGDay.EU 2010&lt;/a&gt; has finally been announced. It will be in Stuttgart, Germany, on December 6th to 8th. More details available on the &lt;a href=&quot;http://2010.pgday.eu/&quot;&gt;conference website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We have also sent out our &lt;a href=&quot;http://2010.pgday.eu/callforpapers&quot;&gt;call for papers&lt;/a&gt;. If you have done something interesting with PostgreSQL, please go ahead and submit a talk! We are currently looking for talks in both English and German!&lt;/p&gt;

 
            &lt;/div&gt;</description>
	<pubDate>Thu, 22 Jul 2010 17:57:00 +0000</pubDate>
</item>
<item>
	<title>Kristian Lyngstol: A Varnish Crash Course for aspiring sysadmins</title>
	<guid>http://kristianlyng.wordpress.com/?p=278</guid>
	<link>http://kristianlyng.wordpress.com/2010/07/15/varnish-crash-course-for-sysadmins/</link>
	<description>&lt;p&gt;Ok, so you&amp;#8217;ve just started working in a Big Sysadmin Department, and they use Varnish. You may have to deal with it, but are not going to be working on it on a daily basis. This is some of what you should know about varnish in case you have to extinguish some fires.&lt;/p&gt;
&lt;p&gt;This post is heavily inspired by my visit to Paris last week, and as such, I&amp;#8217;d like to say hello to Ludo and everyone else (this is mostly written on my plane ride back home).&lt;/p&gt;
&lt;h2&gt;1. What Varnish is, and how it fits into the web&lt;/h2&gt;
&lt;p&gt;Varnish is a reverse proxy. It operates on layer 7, unlike your typical load balancer (though some of them have layer 7 functionality, like basic health checks, they can hardly compare to Varnish). For all intents and purposes, Varnish is the first &amp;#8220;web server&amp;#8221; that a browser hits.&lt;/p&gt;
&lt;p&gt;Varnish has a simple, yet powerful configuration language &amp;#8211; the Varnish Configuration Language (VCL) &amp;#8211; which allows it to make intelligent decisions on what to cache, and how. It can rewrite urls, it can perform redirects and it can direct traffic at different web servers based on both the specific request it is dealing with (for example, if the request is for &amp;#8220;http://www.example.com/sports&amp;#8221;, it might go to a dedicated sport-server) and on the state of the web server.&lt;/p&gt;
&lt;p&gt;By default, Varnish should Just Work. It will only cache content it is certain can be safely cached. That means that it will only cache GET requests, and only content where no cookies are involved. This behavior can &amp;#8211; and most likely will &amp;#8211; be overridden by your VCL.&lt;/p&gt;
&lt;p&gt;In regards to the RFC2616 (The HTTP RFC), Varnish is not really what they are talking about when they refer to proxies and caches. Varnish belongs on the origin-server side of the equation, as the same people who control the web server can also control the cache. But not entirely, so you we have done some approximations using common sense to make Varnish fit into the RFC.&lt;/p&gt;
&lt;h2&gt;2. Configuration, stopping and starting.&lt;/h2&gt;
&lt;p&gt;Varnish has two separate types of configuration types. VCL defines policy, and only policy. It can be used to implement features that are otherwise not present (for example the ability to purge content simply by adding &amp;#8220;?purge=yes&amp;#8221; to the url, or any other scheme like that).&lt;/p&gt;
&lt;p&gt;The second type of configuration is program arguments &amp;#8211; or parameters. Parameters relate to how Varnish behaves on the machine it is running it. You can define the size of the cache, the user and group to run Varnish under, what ports are used by Varnish, where varnish will find its VCL, and so forth.&lt;/p&gt;
&lt;p&gt;On Debian-based systems (including Ubuntu), you will typically find the parameters defined in &lt;em&gt;/etc/default/varnish&lt;/em&gt;. Similarly, you will find them in &lt;em&gt;/etc/sysconfig/varnish&lt;/em&gt; on Red Hat.&lt;/p&gt;
&lt;p&gt;The VCL is often stored in /etc/varnish/, and typically &lt;em&gt;/etc/varnish/default.vcl&lt;/em&gt; &amp;#8211; but that is defined by a startup argument.&lt;/p&gt;
&lt;p&gt;Additionally, you can change MOST of the parameters while Varnish is running. There is only requirement for this: Varnish needs to be started with a -T argument, to enable the management interface.&lt;/p&gt;
&lt;p&gt;The best way to use the management interface is by telnetting to it. This gives you a nice and simple interface. With a &amp;#8220;help&amp;#8221; command. You can run the same commands with the &amp;#8220;varnishadm&amp;#8221; tool, but that will not give you as extensive error messages. The rule of thumb that I use is &amp;#8220;telnet for interactive commands, varnishadm for scripting purposes&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Parameters are changed by using &amp;#8220;param.set&amp;#8221; after reviewing them with &amp;#8220;param.show&amp;#8221;. Changes are applied immediately, but it might take some time for them to be visible. A good example of this delay is if you change the default ttl, as that applies to new objects in the cache from that point on.&lt;/p&gt;
&lt;p&gt;You can also load and use new VCL while Varnish is running. This does not introduce any (known) glitches or slowdowns or delays in Varnish, as it is a matter of switching 4 pointers around &amp;#8211; and varnish will still keep the old configurations around while they are still used (for instance if a backend is still in use).&lt;/p&gt;
&lt;p&gt;Loading VCL is done with the &amp;#8220;vcl.load  &amp;#8221; command. That will only _load_ the configuration, not actually use it. If your VCL has syntax errors, this is when they will show up. After it has loaded, you can switch to the new config with &amp;#8220;vcl.use &amp;#8220;. Alternatively use my varnish_reload script. Be very careful with &amp;#8220;reload&amp;#8221; arguments to init scripts, as they may be implemented using a restart.&lt;/p&gt;
&lt;p&gt;Starting Varnish is left as an exercise to the reader.&lt;/p&gt;
&lt;h2&gt;3. Quickly getting an overview of Varnish&lt;/h2&gt;
&lt;p&gt;varnishstat.&lt;/p&gt;
&lt;p&gt;Run it, look at it, and understand it. This previous blog post gives a quick introduction to varnishstat:  &lt;a href=&quot;http://kristianlyng.wordpress.com/2009/12/08/varnishstat-for-dummies/&quot;&gt;http://kristianlyng.wordpress.com/2009/12/08/varnishstat-for-dummies/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One thing you should always check is the uptime of varnish &amp;#8211; in varnishstat. Because Varnish will &amp;#8220;never&amp;#8221; crash permanently. It can &amp;#8211; however &amp;#8211; crash repeatedly. This is because Varnish has two processes: A management process and a &amp;#8220;everything else&amp;#8221; process. If you have a bug, it is likely to take down the &amp;#8220;everything else&amp;#8221; process, and the management process will notice this and restart it immediately. This is logged to syslog in detail.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;On Debian systems (including Ubuntu), /var/log/syslog is more extensive than plain /var/log/messages.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You also want to look out for disk activity. This is the number one killer of Varnish-performance. If you are seeing extensive disk activity, it might make sense to reduce the size of the cache so it fits in memory. And tune the caching scheme to make sure there are no duplicate objects (for instance a www.example.com/foo object and a separate example.com/foo object). Or buy more memory. Or make sure the disk is an SSD. (Hint: vmstat 5).&lt;/p&gt;
&lt;p&gt;One trick that is commonly applied to avoid disk activity is to put the shmlog on a tmpfs. This is generally not required, but doesn&amp;#8217;t hurt. The shmlog and the compiled VCL is typically stored at /usr/var/varnish/(hostname)/ or similar.&lt;/p&gt;
&lt;p&gt;Do not let the virtual memory usage of Varnish scare you. But do be afraid of the resident memory usage. It is not uncommon to see Varnish use 80G of virtual memory but only 28G resident on a machine with 32G.&lt;/p&gt;
&lt;p&gt;Lastly you have varnishlog. This will tell you exactly what varnish is doing with each request, but is extremely extensive. Keep in mind that varnishlog can filter. Here are some freebies, and I&amp;#8217;ll leave it to the reader to expand upon them (or a future blog post):&lt;/p&gt;
&lt;p&gt;&lt;em&gt;varnishlog -o RxUrl /some/url&lt;br /&gt;
&lt;/em&gt;List requests with &amp;#8220;/some/url&amp;#8221; in the url. Including /some/url, /some/url/blah and /blah/some/url/bla.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;varnishlog -b -o&lt;/em&gt;&lt;br /&gt;
Only list backend traffic.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;varnishlog -b -o -i TxURL&lt;/em&gt;&lt;br /&gt;
List URLS going to a backend.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;varnishlog -c -o RxHeader FireFox&lt;/em&gt;&lt;br /&gt;
List requests from clients with &amp;#8220;FireFox&amp;#8221; present in any of the HTTP headers supplied.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;varnishlog -o TxStatus 500&lt;/em&gt;&lt;br /&gt;
List all requests sent back to a client with status code 500.&lt;/p&gt;
&lt;h2&gt;4. Clear part of the cache&lt;/h2&gt;
&lt;p&gt;Let&amp;#8217;s say your web server misbehaved and your VCL wasn&amp;#8217;t smart enough to spot it, and you&amp;#8217;ve cached malformed data. The easiest way to clean that up is using the &amp;#8220;purge&amp;#8221; function through the management interface. It will not free up memory, but it will make sure the content is refreshed the next time someone asks for it.&lt;br /&gt;
This supports regular expressions similar to what you find in VCL. I wrote a detailed post about purging: &lt;a href=&quot;http://kristianlyng.wordpress.com/2010/02/02/varnish-purges/&quot;&gt;http://kristianlyng.wordpress.com/2010/02/02/varnish-purges/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some highlights:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;purge req.url == /some/specific/url &amp;amp;&amp;amp; req.http.host == &amp;#8220;www.example.com&amp;#8221;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;purge req.url ~ &amp;#8220;^/some/generic/prefix&amp;#8221; &amp;amp;&amp;amp; req.http.host ~ &amp;#8220;^(www\.)?example\.(com|org|net)&amp;#8221;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;purge obj.http.cache-control ~ &amp;#8220;max-age=2222222222222&amp;#8243;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;5. Final advice&lt;/h2&gt;
&lt;p&gt;Don&amp;#8217;t use 32 bit.&lt;/p&gt;
&lt;p&gt;Read my post on best practices: &lt;a href=&quot;http://kristianlyng.wordpress.com/2010/01/26/varnish-best-practices/&quot;&gt;http://kristianlyng.wordpress.com/2010/01/26/varnish-best-practices/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t over do it. KISS is king. Standard OS packages, as simple a VCL as you can, as little tuning of parameters as you can. Etc.&lt;/p&gt;
&lt;p&gt;Remember: If Varnish is told not to cache based on response from a web server, it will &lt;strong&gt;cache the decision not to cache&lt;/strong&gt;. This means that if your front page temporarily fails and varnish is told not to cache it, make sure the TTL is low, otherwise all traffic to the front page will go to a web server until the &lt;a href=&quot;http://kristianlyng.wordpress.com/2010/01/08/hitpass-objects-and-varnish/&quot;&gt;hitpass object&lt;/a&gt; has expired.&lt;/p&gt;
&lt;p&gt;Ask for advice early. It&amp;#8217;s much harder to fix a system that is deployed and in production than help you avoid problems. You can get commercial help from us at &lt;a href=&quot;http://www.varnish-software.com&quot;&gt;Varnish Software&lt;/a&gt; or the &lt;a href=&quot;http://www.varnish-cache.org&quot;&gt;Varnish community&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gocomments/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godelicious/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/delicious/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gofacebook/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/facebook/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gotwitter/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/twitter/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/gostumble/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/stumble/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/godigg/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/digg/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;a rel=&quot;nofollow&quot; href=&quot;http://feeds.wordpress.com/1.0/goreddit/kristianlyng.wordpress.com/278/&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/reddit/kristianlyng.wordpress.com/278/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=kristianlyng.wordpress.com&amp;amp;blog=13096927&amp;amp;post=278&amp;amp;subd=kristianlyng&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 15 Jul 2010 12:11:03 +0000</pubDate>
</item>
<item>
	<title>Roger Kind Kristiansen: Flattr: Mikrobetaling (mikrodonasjon) for nettinnhold</title>
	<guid>http://www.kind-kristiansen.no/?p=130</guid>
	<link>http://www.kind-kristiansen.no/2010/flattr-mikrobetaling-mikrodonasjon-for-nettinnhold/</link>
	<description>&lt;p&gt;Flattr er et ferskt system (i beta fra mars 2010) for mikrodonasjoner, som tar sikte på å gjøre det mye enklere å donere småpenger til innholdsprodusenter. Kort fortalt fungerer det slik:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Du setter inn en fast sum hver måned&lt;/li&gt;
&lt;li&gt;I løpet av måneden klikker du på flattr-knappene til de tingene du mener har gjort seg fortjent til en økonomisk påskjønnelse&lt;/li&gt;
&lt;li&gt;Ved månedens utløp blir din sum delt likt mellom alle tingene du har flattret i løpet av måneden&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Foreløpig bærer Flattr preg av at det fortsatt befinner seg på betastadiet; brukermassen er ikke er all verden og utvalget av ting som kan flattres/blir flattret er deretter. Det bedrer seg dog fortløpende. Er dette måten å tjene penger på nettinhold i fremtiden?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Flattr er i åpen beta, men er du utålmodig (og tidlig ute med å lese denne posten), kan du forsøke en av disse invitasjonskodene:&lt;/p&gt;
&lt;p&gt;288a1a706ac7a139b&lt;br /&gt;
0dd1624666273b5c3&lt;br /&gt;
66a27863d0a49c785&lt;/p&gt;</description>
	<pubDate>Wed, 14 Jul 2010 23:32:45 +0000</pubDate>
</item>
<item>
	<title>Jan Henning Thorsen: My x200 used to say &quot;beep&quot;</title>
	<guid>http://jhthorsen.github.com/tech/2010/07/13/x200-beep</guid>
	<link>http://jhthorsen.github.com/tech/2010/07/13/x200-beep.html</link>
	<description>&lt;p&gt;I&amp;#8217;ve been using my &lt;a href=&quot;http://www.google.com/search?q=thinkpad+x200&quot;&gt;Thinkpad x200&lt;/a&gt; for about a year now, and I&amp;#8217;m pretty sure it started beeping some time this winter: A short &amp;#8220;beep&amp;#8221; occurred each time it came back from suspend or the power cord was plugged in. It has been pretty annoying, but it has not been &lt;a href=&quot;http://www.google.com/images?q=annoying&quot;&gt;annoying&lt;/a&gt; enough for me to &amp;#8220;fix it&amp;#8221; until yesterday. So I started googling the issue, since it used to be the &amp;#8220;pcspkr&amp;#8221; module loaded by &lt;a href=&quot;http://ubuntu.com&quot;&gt;Ubuntu&lt;/a&gt; which resulted in the annoying beeping, but was not the case since it wasn&amp;#8217;t even loaded in 10.4.&lt;/p&gt;

&lt;p&gt;So I gave up on google after some time and decided to seek answer where no answer has been found before: I entered the &lt;a href=&quot;http://en.wikipedia.org/wiki/BIOS&quot;&gt;BIOS&lt;/a&gt;, (I haven&amp;#8217;t looked for this answer in the bios, it&amp;#8217;s just that I consider the BIOS to be pretty useless) poked around, disabled some features and the beep went away.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press Thinkvantage, and then F1 to enter the BIOS (right after the power is turned on)&lt;/li&gt;

&lt;li&gt;Then go to &amp;#8220;Config&amp;#8221; -&amp;gt; &amp;#8220;Beep and alarm&amp;#8221;&lt;/li&gt;

&lt;li&gt;Simply select DISABLE on each of the choices, if you dislike beeps as much as I do.&lt;/li&gt;

&lt;li&gt;Press F10 to save and exit the BIOS, and you&amp;#8217;re beep free!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&amp;#8217;m not going to investigate this any further, but I&amp;#8217;m still curious about when the beeping started&amp;#8230; Had it always been beeping or has there been some kernel updates, whick resulted in the beeping to start? I&amp;#8217;m guessing the &amp;#8220;kernel update&amp;#8221; is the right answer, but I have no idea how to disable it from &lt;a href=&quot;http://www.linux.org/&quot;&gt;Linux&lt;/a&gt;. Is it somewhere in /sys or /proc, or&amp;#8230;?&lt;/p&gt;</description>
	<pubDate>Tue, 13 Jul 2010 07:00:00 +0000</pubDate>
</item>
<item>
	<title>Roger Kind Kristiansen: HDD vs. SSD comparison</title>
	<guid>http://www.kind-kristiansen.no/?p=67</guid>
	<link>http://www.kind-kristiansen.no/2010/hdd-vs-ssd-comparison/</link>
	<description>&lt;p&gt;&lt;a title=&quot;Redpill Linpro&quot; href=&quot;http://www.redpill-linpro.com&quot;&gt;My employer&lt;/a&gt; was nice enough to give me an SSD for my laptop and wanted me to do a quick comparison between this and my previous drive, so here it is.&lt;/p&gt;
&lt;p&gt;All the benchmarks have been performed on my&lt;strong&gt; Lenovo X61s&lt;/strong&gt; running &lt;strong&gt;Ubuntu 10.4&lt;/strong&gt;. The SSD is an &lt;strong&gt;Intel X25-M 80GB SSD&lt;/strong&gt; while the HDD is an &lt;strong&gt;Hitatchi TravelStar 60GB 7200RPM&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The first impression after booting the laptop with a fresh install of Ubuntu 10.4 on the X25 was that everything seemed faster. Booting and loading apps was done in a snap and the entire user experience was more fluent.&lt;/p&gt;
&lt;h2&gt;Startup times&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;th&gt;HDD&lt;/th&gt;
&lt;th&gt;SDD&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;System boot&lt;/th&gt;
&lt;td&gt;1m 27s&lt;/td&gt;
&lt;td&gt;20s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Gnome&lt;/th&gt;
&lt;td&gt;44s&lt;/td&gt;
&lt;td&gt;8.3s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Firefox&lt;/th&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2.6s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Thunderbird 3&lt;/th&gt;
&lt;td&gt;11.9&lt;/td&gt;
&lt;td&gt;4.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;Eclipse&lt;/th&gt;
&lt;td&gt;29.4&lt;/td&gt;
&lt;td&gt;15.3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;File operations&lt;/h2&gt;
&lt;p&gt;My current project at work has a rather sizable subversion repository (XXXX MB). I performed a &amp;#8216;du -h&amp;#8217; on this repository to calculate its size, and also grepped for a word in the entire repository.&lt;/p&gt;
&lt;p&gt;Lastly I run postmark with all settings set to defaults, except files and transactions set to 50000. Postmark tests read/writes of lots of small files.&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;th&gt;HDD&lt;/th&gt;
&lt;th&gt;SSD&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;du -h&lt;/th&gt;
&lt;td&gt;11m 34s&lt;/td&gt;
&lt;td&gt;1m 56s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;grep -R&lt;/th&gt;
&lt;td&gt;13m 48s&lt;/td&gt;
&lt;td&gt;3m 18s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th&gt;postmark&lt;/th&gt;
&lt;td&gt;Time:&lt;br /&gt;
729 seconds total&lt;br /&gt;
514 seconds of transactions (97 per second)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Files:&lt;br /&gt;
75138 created (103 per second)&lt;br /&gt;
Creation alone: 50000 files (285 per second)&lt;br /&gt;
Mixed with transactions: 25138 files (48 per second)&lt;br /&gt;
24905 read (48 per second)&lt;br /&gt;
25084 appended (48 per second)&lt;br /&gt;
75138 deleted (103 per second)&lt;br /&gt;
Deletion alone: 50276 files (1256 per second)&lt;br /&gt;
Mixed with transactions: 24862 files (48 per second)&lt;/p&gt;
&lt;p&gt;Data:&lt;br /&gt;
136.54 megabytes read (191.79 kilobytes per second)&lt;br /&gt;
428.74 megabytes written (602.24 kilobytes per second)&lt;/p&gt;
&lt;td&gt;&amp;#8220;Time:&lt;br /&gt;
22 seconds total&lt;br /&gt;
16 seconds of transactions (3125 per second)&lt;/td&gt;
&lt;p&gt;Files:&lt;br /&gt;
75138 created (3415 per second)&lt;br /&gt;
Creation alone: 50000 files (12500 per second)&lt;br /&gt;
Mixed with transactions: 25138 files (1571 per second)&lt;br /&gt;
24905 read (1556 per second)&lt;br /&gt;
25084 appended (1567 per second)&lt;br /&gt;
75138 deleted (3415 per second)&lt;br /&gt;
Deletion alone: 50276 files (25138 per second)&lt;br /&gt;
Mixed with transactions: 24862 files (1553 per second)&lt;/p&gt;
&lt;p&gt;Data:&lt;br /&gt;
136.54 megabytes read (6.21 megabytes per second)&lt;br /&gt;
428.74 megabytes written (19.49 megabytes per second)&amp;#8221;&lt;/p&gt;



&lt;h2&gt;Battery lifetime&lt;/h2&gt;
&lt;p&gt;Peformed by letting the laptop run unattended and not performing any particular task. Time time given is the time laptop ran before the battery ran out.&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;HDD&lt;/th&gt;
&lt;th&gt;SSD&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4h 47m&lt;/td&gt;
&lt;td&gt;4h 53m&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Even though there&amp;#8217;s not much of an improvement to battery life, SSD rocks when it comes to overall system responsiveness and speed.&lt;/p&gt;
&lt;p&gt;No big surprises here, move along.&lt;/p&gt;</description>
	<pubDate>Mon, 12 Jul 2010 20:07:19 +0000</pubDate>
</item>
<item>
	<title>Jan Henning Thorsen: Xperia X10 mini</title>
	<guid>http://jhthorsen.github.com/tech/2010/07/12/x10-mini</guid>
	<link>http://jhthorsen.github.com/tech/2010/07/12/x10-mini.html</link>
	<description>&lt;p&gt;So I&amp;#8217;ve been using my &lt;a href=&quot;http://www.sonyericsson.com/cws/corporate/products/phoneportfolio/specification/xperiax10mini&quot;&gt;X10 mini&lt;/a&gt; for ten days now, and it has been quite a bumpy ride:&lt;/p&gt;

&lt;p&gt;Last weekend I had to charge it about every six/eight hour. I have to admit that I did use it a lot in the beginning, but i was still shocked to see how bad the battery was: I mean a mobile phone which requires a cord isn&amp;#8217;t really mobile :S&lt;/p&gt;

&lt;p&gt;After I got back from my weekend I decided to change back to my &lt;a href=&quot;http://en.wikipedia.org/wiki/Nokia_5800_XpressMusic&quot;&gt;Nokia 5800&lt;/a&gt;, just to have a phone I could use over night without charging it. At the same time I also sent an email to &lt;a href=&quot;http://cdon.com&quot;&gt;CDON&lt;/a&gt; telling them that I wanted to return the phone. (yeah, I know it&amp;#8217;s a bit strange to bue a phone from cdon&amp;#8230;) CDON was really nice and explained to me (without question) how I could return the phone. Even though I had given up on the battery, I really thought the phone was excellent, so the next day I decided to start reading &lt;a href=&quot;http://www.google.com/search?q=x10+mini+battery+life&quot;&gt;reviews and blogs&lt;/a&gt; to figure out if there where anything I could do to extend the battery life. I also asked a co-worker who gave me some information I found hard to believe&amp;#8230;.&lt;/p&gt;

&lt;p&gt;Even so, after a day of reading and charging the phone, I figured out that it wasn&amp;#8217;t all that crappy as expected and I&amp;#8217;ve now managed to get the lifespan from eight hours to more than two days! So this is what I did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Co-worker + blogs stated that the battery actually gets better over time! I have no idea what kind of crazy chemical reaction is involved, but it must be true: Swapping software just can&amp;#8217;t make such an improvement by it self (?)&lt;/li&gt;

&lt;li&gt;&amp;#8220;Supercharged it&amp;#8221;. Meaning I charged it to full and then simply kept on charging it. I pulled to cord out a couple of times, but plugged it in again when I saw that the battery indicator dropped instantly.&lt;/li&gt;

&lt;li&gt;Replaced whatever SE got pre-installed with &amp;#8221;&lt;a href=&quot;http://helixproject.ruqqq.sg/download.php?id=19&quot;&gt;helix&lt;/a&gt;&amp;#8221; launcher.&lt;/li&gt;

&lt;li&gt;Installed &amp;#8220;Advanced task killer&amp;#8221; and killed a lot of SE background processes I didn&amp;#8217;t need anyway. ATK also periodically kills background processes which is just idling.&lt;/li&gt;

&lt;li&gt;Installed &amp;#8220;BatteryTime&amp;#8221;. Doesn&amp;#8217;t do much for the battery time, but simply more detailed information about how much battery/time is left to use for various tasks.&lt;/li&gt;

&lt;li&gt;I got bluetooth, GPS and wireless turned off most of the time. I know this kind of sucks, but since I hardly ever use bluetooth, nor wireless anyway it&amp;#8217;s not so bad. I will try to use GPS more, just to see how it impacts the battery, but for now I got it turned off and use AGPS instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The crappy thing about the bullets above is that I did it all at once, so I cannot really tell which one worked, but at least doing them all works for me and I&amp;#8217;m now quite happy with the phone! Of course having a smart phone, battery lasting for days, big screen, small form factor&amp;#8230;. It&amp;#8217;s just not possible these days for me to achieve the ultimate phone, so I need to settle for something.&lt;/p&gt;

&lt;h2 id=&quot;other_usefulcool_applications&quot;&gt;Other useful/cool applications&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://bu.mp/&quot;&gt;Bump&lt;/a&gt; - Share data (pictures, apps, contacts++) by bumping two phones with &amp;#8220;bump&amp;#8221; installed&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/connectbot&quot;&gt;ConnectBot&lt;/a&gt; - SSH client. Pretty useless on x10, since of the screen size, but still a nice SSH client.&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.google.com/mobile/goggles&quot;&gt;Goggles&lt;/a&gt; - &amp;#8220;Use pictures to search the web&amp;#8221;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.google.com/sky/skymap/&quot;&gt;Google Sky Map&lt;/a&gt; - Move your phone around to see how the universe looks from your perspective.&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.google.com/search?q=gps+status+android&quot;&gt;GPS status&lt;/a&gt; - Digital compass and speedometer.&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.opera.com/mobile/&quot;&gt;Opera mini 5 beta&lt;/a&gt; - I would like to replace the &amp;#8220;internal browser&amp;#8221; with Opera, but I still don&amp;#8217;t know how. (TODO)&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.google.com/search?q=startup+manager+android&quot;&gt;Startup manager&lt;/a&gt; - Make sure not too many useless processes start when the phone boots.&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.google.com/search?q=syncmypix+android&quot;&gt;SyncMyPix&lt;/a&gt; - Sync between facebook and address book.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;todo&quot;&gt;Todo&lt;/h2&gt;

&lt;p&gt;Root the phone. Replace the rest of the crap with Android 2.x.&lt;/p&gt;

&lt;h2 id=&quot;sources&quot;&gt;Sources&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://gadgets.apnafundaz.com/2010/06/unleash-battery-power-in-xperia-x10-enhance-improve-battery-life-tips-tricks/&quot;&gt;Unleash Battery Power in Xperia X10-Enhance &amp;amp; Improve Battery Life » Gadgets | Technology Simplified&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://gadgets.apnafundaz.com/2010/02/phonebook-by-voxmobili-on-android-review-and-giveaway/&quot;&gt;Phonebook by Voxmobili on Android, ADC2 Winner-Review and Giveaway! » Gadgets | Technology Simplified&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.voxmobili.com/products/phonebook20/index.html&quot;&gt;Phonebook 2.0 &amp;#8211; Voxmobili.com&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://www.google.com/search?q=x10+mini+battery+life&quot;&gt;Reviews and blogs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
	<pubDate>Mon, 12 Jul 2010 07:00:00 +0000</pubDate>
</item>
<item>
	<title>Ingvar Hagelund: Changing a process’ file descriptor on the fly</title>
	<guid>http://ingvar.blog.linpro.no/?p=919</guid>
	<link>http://ingvar.blog.linpro.no/2010/07/10/changing-a-process-file-descriptor-on-the-fly/</link>
	<description>&lt;p&gt;I come back to a specific problem every once in a while: Changing a program&amp;#8217;s file descriptor while the same program is running. &lt;/p&gt;
&lt;p&gt;From time to time, we do stupid things, like running a very important shell command, and adding debug output to see that it works, then realizing that it will take hours to finish, and spitting gigabytes of debug to an xterm through ssh does not help.&lt;/p&gt;
&lt;p&gt;An other typical example could be a finding an ill managed system with some daemon without proper logfile handling. Restarting that process right now is just out of the question, copy-truncating that 16GB logfile will take too much time, and by the way, the disk is almost full.&lt;/p&gt;
&lt;p&gt;After a hint from the ever helping kjetilho, and a Google search, I ended up with what seems to be a well-known trick, but I did not know about it till now. Welcome to the dark side of gdb.&lt;/p&gt;
&lt;p&gt;With the power of gdb at your hand, you can hook into the inner parts of any running program, and change, well, virtually anything. Sounds insanely dangerous for systems in production, right? Yes I agree. Still, this hack is not that ugly. It does just what the doctor ordered: It changes a process&amp;#8217; fds for you while it&amp;#8217;s running.&lt;/p&gt;
&lt;p&gt;Google found this &lt;a href=&quot;http://bit.ly/cIk8F3&quot;&gt;hack&lt;/a&gt; by &lt;a href=&quot;http://bit.ly/cxr0tt&quot;&gt;Robert McKay&lt;/a&gt;, and I added a couple of lines for robustness. Here it is: &lt;a href=&quot;http://users.linpro.no/ingvar/fdswap.sh.txt&quot;&gt;fdswap.sh&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For a simple test, (yes, &lt;b&gt;do&lt;/b&gt; test this before smashing your production environment to pieces) make small shell script like this&lt;/p&gt;
&lt;pre&gt;
#!/bin/bash
n=0
while true; do ((n++)); echo $n; sleep 1; done
&lt;/pre&gt;
&lt;p&gt;Run that script in a separate window. Pick up the pid, and find out what vty is connected to that process&amp;#8217; standard output&lt;/p&gt;
&lt;pre&gt;
ls -l /proc/$pid/fd/0
&lt;/pre&gt;
&lt;p&gt;Then run the script, be really afraid of all that scary gdb output, but watch that number pumping magically stop.&lt;/p&gt;
&lt;pre&gt;
fdswap.sh /dev/pts/$vty /dev/null $pid
&lt;/pre&gt;
&lt;p&gt;Have a look at the fds again&lt;/p&gt;
&lt;pre&gt;
ls -l /proc/$pid/fd
&lt;/pre&gt;
&lt;p&gt;You can use strace to check that the process is still happily pumping numbers, but now to /dev/null&lt;/p&gt;
&lt;pre&gt;
strace -p $pid -e write
&lt;/pre&gt;</description>
	<pubDate>Sat, 10 Jul 2010 00:31:01 +0000</pubDate>
</item>
<item>
	<title>Magnus Hagander: Robotic moderation duties</title>
	<guid>http://blog.hagander.net/archives/172-guid.html</guid>
	<link>http://blog.hagander.net/archives/172-Robotic-moderation-duties.html</link>
	<description>&lt;div&gt;
                &lt;p&gt;Every now and then, the discussion about why it takes too long for messages to get approved when posted to some of the PostgreSQL mailinglists comes up, and it goes around a couple of laps. Maybe we get a new moderator. But eventually it comes back down to not enough people. Personally, I've usually just found myself not having the time to keep up with moderation. So when I needed a project to learn some &lt;a href=&quot;http://www.android.com/&quot;&gt;Android&lt;/a&gt; development on, I figured this could be an interesting (probably) and useful (maybe) topic.&lt;/p&gt;

&lt;p&gt;So, meet &lt;a href=&quot;http://github.com/mhagander/mailinglistmoderator&quot;&gt;Mailinglist Moderator&lt;/a&gt;. A tiny android application that helps with the daily moderation chores for anybody moderating Mailman or Majordomo2 mailinglists (should be easy enough to add more list managers if there is any that people actually use).&lt;/p&gt;

&lt;p&gt;The application will simply enumerate all unmoderated items and let you set them to accept or reject either one by one or in batch. Personally, I've found it makes it a *lot* more likely I will do moderation - it's literally down to 30 seconds while waiting for a bus or train, or something like that. And once the hurdle is gone, it's a lot more likely I'll end up actually moderating. I found it useful - hopefully others will as well.&lt;/p&gt;

&lt;p&gt;Here are a couple of screenshots showing what the application looks like.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://photos.smugmug.com/photos/927951521_j4Ri8-L.png&quot; width=&quot;360&quot; height=&quot;600&quot; alt=&quot;927951521_j4Ri8-L.png&quot; /&gt; &lt;img src=&quot;http://photos.smugmug.com/photos/927951506_ruNHt-L.png&quot; width=&quot;360&quot; height=&quot;600&quot; alt=&quot;927951506_ruNHt-L.png&quot; /&gt; &lt;img src=&quot;http://photos.smugmug.com/photos/928007508_KJHqf-L.png&quot; width=&quot;360&quot; height=&quot;600&quot; alt=&quot;928007508_KJHqf-L.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The app is available as an APK for download on my &lt;a href=&quot;http://github.com/mhagander/mailinglistmoderator/downloads&quot;&gt;github page&lt;/a&gt;. It hasn't been published to the market now, but I'll do that if enough people find it useful and ask me for it...&lt;/p&gt;

&lt;p&gt;And of course, this is all BSD licensed open source, so any contributions are welcome!&lt;/p&gt;

 
            &lt;/div&gt;</description>
	<pubDate>Thu, 08 Jul 2010 20:06:00 +0000</pubDate>
</item>
<item>
	<title>Magnus Hagander: PostgreSQL Europe Marchandise Store</title>
	<guid>http://blog.hagander.net/archives/171-guid.html</guid>
	<link>http://blog.hagander.net/archives/171-PostgreSQL-Europe-Marchandise-Store.html</link>
	<description>&lt;div&gt;
                &lt;p&gt;We've finally opened the merchandise store for &lt;a href=&quot;http://www.postgresql.eu/&quot;&gt;PostgreSQL Europe&lt;/a&gt;. It's a chance for everybody who haven't had the chance to attend one of the many PostgreSQL events where we've been selling mugs and shirts for a long time, as well as a chance to get some stuff that we haven't previously had available.&lt;/p&gt;

&lt;p&gt;There's close to zero earnings for PostgreSQL Europe off these purchases - we're trying to make it as cheap as we can for everybody. You are of course most welcome to &lt;a href=&quot;http://www.postgresql.eu/donate/&quot;&gt;donate&lt;/a&gt; some extra to the project, should you wish.&lt;/p&gt;

 
            &lt;/div&gt;</description>
	<pubDate>Sat, 03 Jul 2010 17:02:00 +0000</pubDate>
</item>

</channel>
</rss>
