<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<feed xmlns="http://www.w3.org/2005/Atom">

	<title>Planet Redpill Linpro</title>
	<link rel="self" href="http://planet.redpill-linpro.com/atom.xml"/>
	<link href="http://planet.redpill-linpro.com/"/>
	<id>http://planet.redpill-linpro.com/atom.xml</id>
	<updated>2012-05-17T02:40:49+00:00</updated>
	<generator uri="http://www.planetplanet.org/">Planet/2.0 +http://www.planetplanet.org</generator>

	<entry xml:lang="en">
		<title type="html">Call for Papers - PostgreSQL Conference Europe 2012</title>
		<link href="http://blog.hagander.net/archives/205-Call-for-Papers-PostgreSQL-Conference-Europe-2012.html"/>
		<id>http://blog.hagander.net/archives/205-guid.html</id>
		<updated>2012-05-15T19:49:00+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;The &lt;a href=&quot;http://2012.pgconf.eu/callforpapers/&quot;&gt;call for papers&lt;/a&gt; for PostgreSQL Conference Europe 2012 in Prague, the Czech Republic has now been posted. As usual, we are looking for talks on all topics related to PostgreSQL. At this point, we are looking for submissions for regular conference sessions - we will post a separate call for papers for lightning talks at a later time.&lt;/p&gt;

&lt;p&gt;We are also still looking for sponsors - please see &lt;a href=&quot;http://2012.pgconf.eu/becomesponsor/&quot;&gt;our website&lt;/a&gt; for details about the sponsor benefits and the costs.&lt;/p&gt;

&lt;p&gt;Follow the news feed on our site, or our &lt;a href=&quot;https://twitter.com/pgconfeu&quot;&gt;Twitter feed&lt;/a&gt;, for news updates!&lt;/p&gt;

 
            &lt;/div&gt;</content>
		<author>
			<name>Magnus Hagander</name>
			<uri>http://blog.hagander.net/</uri>
		</author>
		<source>
			<title type="html">Magnus Hagander's PostgreSQL blog</title>
			<link rel="self" href="http://blog.hagander.net/feeds/atom.xml"/>
			<id>http://blog.hagander.net/</id>
			<updated>2012-05-17T02:40:37+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">CSS crazy – or why we haven’t learnt anything from IE6 (part 1)</title>
		<link href="http://elephpants.blog.redpill-linpro.com/2012/05/07/css-crazy-or-why-we-havent-learnt-anything-from-ie6-pat1/"/>
		<id>http://elephpants.blog.redpill-linpro.com/2012/05/07/</id>
		<updated>2012-05-07T08:12:10+00:00</updated>
		<content type="html">&lt;p&gt;Disclaimer: This isn&amp;#8217;t going to be about php, so if that doesn&amp;#8217;t tickly your fancy feel free to skip this entry. It&amp;#8217;s also a bit of a rant.&lt;/p&gt;
&lt;p&gt;Every now and then you figure out you want to do some cool css trick or update some css or markup that&amp;#8217;s been lagging behind. Last friday I was in total weekend mode so I figured I&amp;#8217;d update some of the old markup and css in the project I&amp;#8217;m currently working on. The header area in that project was one of the first pieces of html and css created when we started developing it, and it has been left largely untouched since those early days in 2009. It was in desperate need of some tender CSS love.&lt;/p&gt;
&lt;p&gt;The first thing I wanted to fix was the header background. It&amp;#8217;s got a gradient background image, with a logo that has the gradient as background color. Depending on which browser you&amp;#8217;re using, the background image and the logo is always one or two pixels off, because that&amp;#8217;s just the way the markup is. We still have to support relatively old and obscure browsers like IE7, so keeping backwards compatibility is important to not unnecessarily annoy our customer(s). So, since we&amp;#8217;re living in 2012 nowadays it should be as easy as adding a css background gradient with a fallback to the background image:&lt;/p&gt;
&lt;pre class=&quot;brush: css; title: ;&quot;&gt;
background: url(&amp;quot;/images/navbar_top.png&amp;quot;) repeat-x; /* legacy background image */
background: linear-gradient(to bottom, #434A50 0%,#2B3036 80%); /* W3C */
&lt;/pre&gt;
&lt;p&gt;Yeah, not so much. The CSS level 3 specification for background gradients is still not finished and all browsers that has implemented it so far has done so based on early drafts, their own interpretation of the specification as well as their own desires about how the specification should work. According to the &lt;a href=&quot;https://developer.mozilla.org/en/CSS/linear-gradient#Specifications&quot;&gt;MDN page about CSS linear gradients&lt;/a&gt;, achieving this effect across all browsers is not at all trivial. &lt;/p&gt;
&lt;p&gt;First of all: &lt;a href=&quot;http://dev.w3.org/csswg/css3-images/#repeating-gradients&quot;&gt;the background gradient CSS3 specification&lt;/a&gt; is of course not yet final and it is still subject to changes. Also, every browser on the planet has its own way of specifying background gradients, and they&amp;#8217;re all non-compatible as well as wildly different. If that wasn&amp;#8217;t enough to completely turn you off CSS gradients, bear in mind that each browser also has different browser-/vendor-specific implementations depending on the browser version, as the recommended implementation has been changed quite a lot since &lt;a href=&quot;http://www.webkit.org/blog/175/introducing-css-gradients/&quot;&gt;Apple introduced this feature back in 2008&lt;/a&gt;. To end it all, the currently final version of the CSS3 recommended standard has switched around one of the keywords &amp;#8211; instead of specifying where you want the gradient to start (&amp;#8220;top&amp;#8221;), you specify the direction (&amp;#8220;to bottom&amp;#8221;) &amp;#8211; making the final recommendation inversely compatible with the currently available browser-specific implementations. So, to implement something as trivial as a background gradient you need to take into consideration several different versions of a multitude of browsers, as well as a totally moving specification. With that in mind, here is the bit of CSS I ended up using for that header background gradient:&lt;/p&gt;
&lt;pre class=&quot;brush: css; title: ;&quot;&gt;
background: url(&amp;quot;/images/navbar_top.png&amp;quot;) repeat-x; /* legacy background image */
background: -moz-linear-gradient(top, #434A50 0%, #2B3036 80%); /* FF3.6+ */
background: -khtml-gradient(linear, left top, left bottom, color-stop(0%,#434A50), color-stop(80%,#2B3036)); /* KHTML */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#434A50), color-stop(80%,#2B3036)); /* Chrome, Safari4+ */
background: -webkit-linear-gradient(top, #434A50 0%,#2B3036 80%); /* Chrome10+, Safari5.1+ */
background: -o-linear-gradient(top, #434A50 0%,#2B3036 80%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #434A50 0%,#2B3036 80%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#434A50', endColorstr='#2B3036',GradientType=0 ); /* IE6-9 */
background: linear-gradient(to bottom, #434A50 0%,#2B3036 80%); /* Current W3C recommendation */
&lt;/pre&gt;
&lt;p&gt;I kid you not.&lt;br /&gt;
Luckily, with this blob of CSS we&amp;#8217;re able to support pretty much all browsers in use today. Yay for us! Only marginally smaller than the byte size of the image we&amp;#8217;re currently using!&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll follow up with a new post soon, with more juicy CSS fun. Comments are much appreciated!&lt;/p&gt;</content>
		<author>
			<name>Faggruppe PHP</name>
			<uri>http://elephpants.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">Redpill Linpro PHP Competence Group</title>
			<subtitle type="html">Monkeys and elephpants take on the world</subtitle>
			<link rel="self" href="http://elephpants.blog.redpill-linpro.com/feed/"/>
			<id>http://elephpants.blog.redpill-linpro.com/feed/</id>
			<updated>2012-05-17T02:40:33+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Using a mysql replicate for backup: Remember to set log_slave_updates</title>
		<link href="http://ingvar.blog.redpill-linpro.com/2012/05/07/using-a-mysql-replicate-for-backup-remember-to-set-log_slave_updates/"/>
		<id>http://ingvar.blog.redpill-linpro.com/2012/05/07/</id>
		<updated>2012-05-07T07:51:05+00:00</updated>
		<content type="html">&lt;p&gt;The other day I was setting up a mysql slave in a an application where we needed to daisy-chain one slave from another. With just adding the slave the standard way, the first slave kept happily replicating, but we got no updates on the second slave. After a bit of debugging, we found log_slave_updates in &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html#sysvar_log_slave_updates&quot;&gt;the documentation&lt;/a&gt;. This makes the slave actually binlog changes from the master. Without this, only &lt;i&gt;changes done one the slave&lt;/i&gt; is added to the binlog. Adding log_slave_updates to my.cnf on the first slave, the second in the chain started replicating as well.&lt;/p&gt;
&lt;p&gt;So far, so good. But considering using replication for backup purposes, which is something I guess is quite common, the binlog of changes to the database is necessary to be able to do a point in time recovery. To get that binlog, you &lt;i&gt;have to add log_slave_updates&lt;/i&gt;. Unless you have backup of the binlog files from the master, of course, but the point was using the replicate for backup, wasn&amp;#8217;t it?&lt;/p&gt;
&lt;p&gt;If you are unsure, compare the size of the binlog files on the master and the backup replicate slave.&lt;/p&gt;</content>
		<author>
			<name>Ingvar Hagelund</name>
			<uri>http://ingvar.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">On the third side » comp</title>
			<subtitle type="html">Lamentation and praise - almost never in rhyme</subtitle>
			<link rel="self" href="http://ingvar.blog.redpill-linpro.com/category/comp/feed/"/>
			<id>http://ingvar.blog.redpill-linpro.com/category/comp/feed/</id>
			<updated>2012-05-17T02:40:39+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">How to Google more efficiently</title>
		<link href="http://jorge.fbarr.net/2012/05/01/how-to-google-more-efficiently/"/>
		<id>http://jorge.fbarr.net/2012/05/01/how-to-google-more-efficiently</id>
		<updated>2012-05-01T14:37:00+00:00</updated>
		<content type="html">&lt;p&gt;Most people these days use google.com as their preferred search engine, and most times a regular search will bring you the results you are looking for. But what if you want a more complex search? Or want to filter out some results? Well, here's a few pointers on how to Google a bit more efficiently, and some other neat tricks.&lt;/p&gt;

&lt;h2&gt;A regular search&lt;/h2&gt;

&lt;p&gt;Say that I want to search for a review for the cellphone HTC Desire Z. I could
always use the string &quot;HTC Desire Z review&quot;. Or, we could do a more efficient
search.&lt;/p&gt;

&lt;p&gt;Take the following search string as an example:&lt;/p&gt;

&lt;pre&gt;
site:engadget.com ~review &quot;htc desire z&quot; -amazon 2010..2012
&lt;/pre&gt;


&lt;p&gt;Let's break it down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;site:engadget:com&lt;/strong&gt; - Only searches the pages of the site engadget.com&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;~review&lt;/strong&gt; - Also searches related words, such as &quot;check, examine, opinion&quot;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;htc desire z&lt;/strong&gt; - Searches for the exact phrase, and not each word separately.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-amazon&lt;/strong&gt; - Excludes this term from the search.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;2010..2012&lt;/strong&gt; - Shows all results from within the specified timerange.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The last element above not only works with a time-range, but also with any other type of range. For instance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;$100..$200&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;..gives you results based on a range from $100 to $200.&lt;/p&gt;

&lt;h2&gt;Searching for filetypes&lt;/h2&gt;

&lt;p&gt;In certain cases you want to search for specific types of file. For instance,&lt;/p&gt;

&lt;pre&gt;
filetype:pdf linux intitle:best *distribution
&lt;/pre&gt;


&lt;p&gt;Again, let's break this down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;filetype:pdf&lt;/strong&gt; - Searches only results of the file type you specify. .doc, .jpg, .torrent, the options are endless. Close to, anyway.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;linux&lt;/strong&gt; - Just a regular search string.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;intitle:best&lt;/strong&gt; - Only shows results with that word in the title (in this case, 'best')&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;*distribution&lt;/strong&gt; - Replaces itself with common terms in your search (in this case 'Arch Linux distribution', 'Red Hat distribution', will both be searched, among many others)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Definitions&lt;/h2&gt;

&lt;p&gt;To find the definition of a word, use:&lt;/p&gt;

&lt;pre&gt;
define: exquisite
&lt;/pre&gt;


&lt;h2&gt;Unit converter&lt;/h2&gt;

&lt;p&gt;Converting from one unit to another made easy:&lt;/p&gt;

&lt;p&gt;Distance&lt;/p&gt;

&lt;pre&gt;
54 km to miles
&lt;/pre&gt;


&lt;p&gt;Weight&lt;/p&gt;

&lt;pre&gt;
2 kg to lbs
&lt;/pre&gt;


&lt;p&gt;Currency&lt;/p&gt;

&lt;pre&gt;
150 NOK to USD
&lt;/pre&gt;


&lt;h2&gt;Calculator&lt;/h2&gt;

&lt;p&gt;Also works great as a calculator:&lt;/p&gt;

&lt;pre&gt;
20*(2+4)/5-1
&lt;/pre&gt;


&lt;h2&gt;Time&lt;/h2&gt;

&lt;p&gt;Check out what the time is in another part of the world:&lt;/p&gt;

&lt;pre&gt;
time Hong Kong
&lt;/pre&gt;


&lt;h2&gt;Weather&lt;/h2&gt;

&lt;p&gt;Also handy for checking the weather:&lt;/p&gt;

&lt;pre&gt;
weather Oslo
&lt;/pre&gt;


&lt;p&gt;Just a few of the things one can do with the Google search engine!&lt;/p&gt;</content>
		<author>
			<name>Jorge Enrique Barrera</name>
			<uri>http://jorge.fbarr.net/</uri>
		</author>
		<source>
			<title type="html">Category: Linux | The Road to Elysium</title>
			<link rel="self" href="http://jorge.fbarr.net/blog/categories/linux/atom.xml"/>
			<id>http://jorge.fbarr.net/</id>
			<updated>2012-05-17T02:40:32+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">FreeRADIUS and CRLs</title>
		<link href="http://useofwords.blogspot.com/2012/04/freeradius-and-crls.html"/>
		<id>tag:blogger.com,1999:blog-660024223227219722.post-5694638833123877709</id>
		<updated>2012-04-26T17:44:00+00:00</updated>
		<content type="html">Deploying FreeRADIUS, you may want to use a Certificate Revocation List (CRL) to revoke access to users that has been issued a valid certificate at some point.&lt;br /&gt;&lt;br /&gt;How to actually do this isn't completely self-evident. Less so if you use multiple sub-CAs.&lt;br /&gt;&lt;br /&gt;FreeRADIUS basically uses OpenSSL's routines and options for this. And OpenSSL doesn't currently refresh CRLs in a running process, so after updating a CRL you need to restart the freeradius daemon (easily scripted).&lt;br /&gt;&lt;br /&gt;The important point in freeradius is in /etc/freeradius/eap.conf, specifically check_crl and CA_path in the tls section. Also, comment out CA_file, since CA_path and CA_file are intended for the same purposes, but CRLs only work with the CA_path method. &lt;br /&gt;&lt;pre&gt;   #  Check the Certificate Revocation List&lt;br /&gt;   #&lt;br /&gt;   #  1) Copy CA certificates and CRLs to same directory.&lt;br /&gt;   #  2) Execute 'c_rehash '.&lt;br /&gt;   #    'c_rehash' is OpenSSL's command.&lt;br /&gt;   #  3) uncomment the line below.&lt;br /&gt;   #  5) Restart radiusd&lt;br /&gt;   check_crl = yes&lt;br /&gt;   CA_path = /etc/freeradius/certs/CA/&lt;br /&gt;&lt;/pre&gt;Be sure not to concatenate certificates in your CA_path. One CA, one file. Then, after the c_rehash, your directory should look something like this: &lt;br /&gt;&lt;pre&gt;root@radius:~# ls -l /etc/freeradius/certs/CA/&lt;br /&gt;lrwxrwxrwx 1 root freerad    9 2012-04-26 03:15 12345678.0 -&amp;gt; local-sub-ca-1.pem&lt;br /&gt;lrwxrwxrwx 1 root freerad   13 2012-04-26 03:15 12345678.r0 -&amp;gt; sub-ca-1-crl.pem&lt;br /&gt;lrwxrwxrwx 1 root freerad   11 2012-04-26 03:15 23456789.0 -&amp;gt; local-root-ca.pem&lt;br /&gt;lrwxrwxrwx 1 root freerad    8 2012-04-26 03:15 3456789a.0 -&amp;gt; local-sub-ca-2.pem&lt;br /&gt;lrwxrwxrwx 1 root freerad   12 2012-04-26 03:15 3456789a.r0 -&amp;gt; sub-ca-2-crl.pem&lt;br /&gt;-rw-r--r-- 1 root freerad 1360 2012-04-24 15:04 local-root-ca.pem&lt;br /&gt;-rw-r--r-- 1 root freerad 1360 2012-04-24 15:06 local-sub-ca-1.pem&lt;br /&gt;-rw-r--r-- 1 root freerad 1384 2012-04-24 14:58 local-sub-ca-2.pem&lt;br /&gt;-rw-r--r-- 1 root freerad 1251 2012-04-26 03:15 sub-ca-1-crl.pem&lt;br /&gt;-rw-r--r-- 1 root freerad  739 2012-04-26 03:15 sub-ca-2-crl.pem&lt;br /&gt;&lt;/pre&gt;Thanks to &lt;a href=&quot;http://yasu-2.blogspot.com/2010/02/freeradiuscrl.html&quot;&gt;Yasuhiro ABE&lt;/a&gt; for pointing me in the right direction. ありがとうございました、あべさん！それはよかったよ！&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/660024223227219722-5694638833123877709?l=useofwords.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Erik Inge Bolsø</name>
			<email>noreply@blogger.com</email>
			<uri>http://useofwords.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">Use of words</title>
			<link rel="self" href="http://useofwords.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-660024223227219722</id>
			<updated>2012-05-17T02:40:40+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">BASH autocomplete for SSH</title>
		<link href="http://jorge.fbarr.net/2012/04/18/bash-autocomplete-for-ssh/"/>
		<id>http://jorge.fbarr.net/2012/04/18/bash-autocomplete-for-ssh</id>
		<updated>2012-04-18T08:48:00+00:00</updated>
		<content type="html">&lt;p&gt;If you, like me, find yourself SSH'ing all day long, this little piece of code
will do wonders. Well, it'll save you some keystrokes at least. This line parses
your &lt;strong&gt;.bash_history&lt;/strong&gt;-file and tries to autocomplete the host you are trying to
SSH to, given that you've already used SSH to access the host in question at
least once before.&lt;/p&gt;

&lt;p&gt;So, to make this work, place the following in your &lt;strong&gt;.bashrc&lt;/strong&gt; or
&lt;strong&gt;.bash_profile&lt;/strong&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb&quot;&gt;complete&lt;/span&gt; -W &lt;span class=&quot;s2&quot;&gt;&amp;quot;$(echo $(grep '&amp;lt;sup&amp;gt;ssh&amp;lt;/sup&amp;gt; ' .bash_history | sort -u | sed 's/&amp;lt;sup&amp;gt;ssh&amp;lt;/sup&amp;gt; //'))&amp;quot;&lt;/span&gt; ssh
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Once that's done, either log out, and in again, or type:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; .bashrc
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;..to apply the change made to your &lt;strong&gt;.bashrc&lt;/strong&gt;, if that's the file you've made
the change to. You should now be able to autocomplete hosts when SSH'ing with
&lt;strong&gt;TAB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I am also (now) aware of, thanks to my colleagues, that you have to
tweak and sometimes install additional packages to have a similar functionality
provided by your system's package manager. I find the solution above the easiest
one, as it's only a single line that needs to be included in a file, without any
additional tweaks or packages necessary. But in the end, it's your call!&lt;/p&gt;</content>
		<author>
			<name>Jorge Enrique Barrera</name>
			<uri>http://jorge.fbarr.net/</uri>
		</author>
		<source>
			<title type="html">Category: Linux | The Road to Elysium</title>
			<link rel="self" href="http://jorge.fbarr.net/blog/categories/linux/atom.xml"/>
			<id>http://jorge.fbarr.net/</id>
			<updated>2012-05-17T02:40:32+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">CentOS/RHEL/SL 6: root filesystem on tmpfs</title>
		<link href="http://braastad.org/blog/2012/04/centosrhelsl-6-root-filesystem-on-tmpfs/"/>
		<id>http://braastad.org/blog/?p=160</id>
		<updated>2012-04-15T19:44:29+00:00</updated>
		<content type="html">&lt;p&gt;There are several scenarios where conventional hard drives are not really needed. Examples are HPC cluster nodes, virtualization nodes, home theater streaming PCs, silent desktops, internet cafés and embedded systems. Hard drives tend to fail, they are slow, they consume power, they generate heat and noise, and they are quite expensive if you need/want something faster and more reliable than SATA.&lt;/p&gt;
&lt;p&gt;This post will show how to run CentOS 6 directly from tmpfs backed by memory, without using the (standard) 512 MB writable overlay. The procedure should be similar for RHEL and Scientific Linux 6.&lt;/p&gt;
&lt;p&gt;The resulting boot process will be:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Boot a node off a PXE enabled DHCP server.&lt;/li&gt;
&lt;li&gt;Chainload into &lt;a href=&quot;http://braastad.org/blog/2011/09/kvm-with-ipxe-in-rhel-6/&quot;&gt;iPXE&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Download vmlinuz and a rather large initrd containing the entire filesystem over ftp/http(s). Try to avoid &lt;a href=&quot;http://braastad.org/blog/feed/en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol&quot;&gt;tftp&lt;/a&gt; when downloading the initrd because of its file size limitation and slow transfer speeds.&lt;/li&gt;
&lt;li&gt;Once downloaded, the kernel will start and the initrd will be mounted.&lt;/li&gt;
&lt;li&gt;The modified dracut scripts in the initrd will create a tmpfs partition in memory with the same size as your filesystem image included in the initrd.&lt;/li&gt;
&lt;li&gt;Your entire filesystem image will be copied to the tmpfs partition and attached to a loop device.&lt;/li&gt;
&lt;li&gt;This loop device will be used as the new root device, and the boot process continues as usual.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is a screenshot from an ongoing boot process:&lt;br /&gt;
&lt;a href=&quot;http://braastad.org/blog/wp-content/uploads/2012/04/centos6-from-tmpfs1.png&quot;&gt;&lt;img src=&quot;http://braastad.org/blog/wp-content/uploads/2012/04/centos6-from-tmpfs1-300x166.png&quot; alt=&quot;&quot; title=&quot;centos6-from-tmpfs&quot; width=&quot;300&quot; height=&quot;166&quot; class=&quot;alignnone size-medium wp-image-166&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now to the procedure:&lt;/p&gt;
&lt;p&gt;First, create a custom kickstart file. I&amp;#8217;ve included the specialties below:&lt;/p&gt;
&lt;pre&gt;
bootloader --location=mbr --append=&quot;toram&quot;
clearpart --all
firstboot --disabled
install
lang en_US.UTF-8
network --bootproto dhcp --device eth0 --onboot yes
part / --fstype=ext4 --size=2048
reboot
zerombr

%packages
patch

%post
cat &amp;gt; /etc/fstab &amp;lt;&amp;lt; END
tmpfs      /         tmpfs   defaults         0 0
devpts     /dev/pts  devpts  gid=5,mode=620   0 0
tmpfs      /dev/shm  tmpfs   defaults         0 0
proc       /proc     proc    defaults         0 0
sysfs      /sys      sysfs   defaults         0 0
END

# The patch is base64 encoded to avoid having to escape it manually.
cat &amp;gt; /root/dmsquash-live-root.base64 &amp;lt;&amp;lt; EOF_patch
MjFhMjIKPiBnZXRhcmcgdG9yYW0gJiYgdG9yYW09InllcyIKMTM0YzEzNSwxMzgKPCAgICAgZG9f
bGl2ZV9mcm9tX2Jhc2VfbG9vcAotLS0KPiAgICAgIyBDcmVhdGUgb3ZlcmxheSBvbmx5IGlmIHRv
cmFtIGlzIG5vdCBzZXQKPiAgICAgaWYgWyAteiAiJHRvcmFtIiBdIDsgdGhlbgo+ICAgICAgICAg
ZG9fbGl2ZV9mcm9tX2Jhc2VfbG9vcAo+ICAgICBmaQoxNjNjMTY3LDIxMwo8ICAgICBkb19saXZl
X2Zyb21fYmFzZV9sb29wCi0tLQo+ICAgICAjIENyZWF0ZSBvdmVybGF5IG9ubHkgaWYgdG9yYW0g
aXMgbm90IHNldAo+ICAgICBpZiBbIC16ICIkdG9yYW0iIF0gOyB0aGVuCj4gICAgICAgICBkb19s
aXZlX2Zyb21fYmFzZV9sb29wCj4gICAgIGZpCj4gZmkKPiAKPiAjIEkgdGhlIGtlcm5lbCBwYXJh
bWV0ZXIgdG9yYW0gaXMgc2V0LCBjcmVhdGUgYSB0bXBmcyBkZXZpY2UgYW5kIGNvcHkgdGhlIAo+
ICMgZmlsZXN5c3RlbSB0byBpdC4gQ29udGludWUgdGhlIGJvb3QgcHJvY2VzcyB3aXRoIHRoaXMg
dG1wZnMgZGV2aWNlIGFzCj4gIyBhIHdyaXRhYmxlIHJvb3QgZGV2aWNlLgo+IGlmIFsgLW4gIiR0
b3JhbSIgXSA7IHRoZW4KPiAgICAgYmxvY2tzPSQoIGJsb2NrZGV2IC0tZ2V0c3ogJEJBU0VfTE9P
UERFViApCj4gCj4gICAgIGVjaG8gIkNyZWF0ZSB0bXBmcyAoJGJsb2NrcyBibG9ja3MpIGZvciB0
aGUgcm9vdCBmaWxlc3lzdGVtLi4uIgo+ICAgICBta2RpciAtcCAvaW1hZ2UKPiAgICAgbW91bnQg
LW4gLXQgdG1wZnMgLW8gbnJfYmxvY2tzPSRibG9ja3MgdG1wZnMgL2ltYWdlCj4gCj4gICAgIGVj
aG8gIkNvcHkgZmlsZXN5c3RlbSBpbWFnZSB0byB0bXBmcy4uLiAodGhpcyBtYXkgdGFrZSBhIGZl
dyBtaW51dGVzKSIKPiAgICAgZGQgaWY9JEJBU0VfTE9PUERFViBvZj0vaW1hZ2Uvcm9vdGZzLmlt
Zwo+IAo+ICAgICBST09URlNfTE9PUERFVj0kKCBsb3NldHVwIC1mICkKPiAgICAgZWNobyAiQ3Jl
YXRlIGxvb3AgZGV2aWNlIGZvciB0aGUgcm9vdCBmaWxlc3lzdGVtOiAkUk9PVEZTX0xPT1BERVYi
Cj4gICAgIGxvc2V0dXAgJFJPT1RGU19MT09QREVWIC9pbWFnZS9yb290ZnMuaW1nCj4gCj4gICAg
IGVjaG8gIkl0J3MgdGltZSB0byBjbGVhbiB1cC4uICIKPiAKPiAgICAgZWNobyAiID4gVW1vdW50
aW5nIGltYWdlcyIKPiAgICAgdW1vdW50IC1sIC9pbWFnZQo+ICAgICB1bW91bnQgLWwgL2Rldi8u
aW5pdHJhbWZzL2xpdmUKPiAKPiAgICAgZWNobyAiID4gRGV0YWNoICRPU01JTl9MT09QREVWIgo+
ICAgICBsb3NldHVwIC1kICRPU01JTl9MT09QREVWCj4gCj4gICAgIGVjaG8gIiA+IERldGFjaCAk
T1NNSU5fU1FVQVNIRURfTE9PUERFViIKPiAgICAgbG9zZXR1cCAtZCAkT1NNSU5fU1FVQVNIRURf
TE9PUERFVgo+ICAgICAKPiAgICAgZWNobyAiID4gRGV0YWNoICRCQVNFX0xPT1BERVYiCj4gICAg
IGxvc2V0dXAgLWQgJEJBU0VfTE9PUERFVgo+ICAgICAKPiAgICAgZWNobyAiID4gRGV0YWNoICRT
UVVBU0hFRF9MT09QREVWIgo+ICAgICBsb3NldHVwIC1kICRTUVVBU0hFRF9MT09QREVWCj4gCj4g
ICAgIGVjaG8gIlJvb3QgZmlsZXN5c3RlbSBpcyBub3cgb24gJFJPT1RGU19MT09QREVWLiIKPiAg
ICAgZWNobwo+IAo+ICAgICBsbiAtcyAkUk9PVEZTX0xPT1BERVYgL2Rldi9yb290Cj4gICAgIHBy
aW50ZiAnL2Jpbi9tb3VudCAtbyBydyAlcyAlc1xuJyAiJFJPT1RGU19MT09QREVWIiAiJE5FV1JP
T1QiID4gL21vdW50LzAxLSQkLWxpdmUuc2gKPiAgICAgZXhpdCAwCjE2OWMyMTksMjIxCjwgICAg
IGVjaG8gIjAgJCggYmxvY2tkZXYgLS1nZXRzeiAkQkFTRV9MT09QREVWICkgc25hcHNob3QgJEJB
U0VfTE9PUERFViAkT1NNSU5fTE9PUERFViBwIDgiIHwgZG1zZXR1cCBjcmVhdGUgLS1yZWFkb25s
eSBsaXZlLW9zaW1nLW1pbgotLS0KPiAgICAgaWYgWyAteiAiJHRvcmFtIiBdIDsgdGhlbgo+ICAg
ICAgICAgZWNobyAiMCAkKCBibG9ja2RldiAtLWdldHN6ICRCQVNFX0xPT1BERVYgKSBzbmFwc2hv
dCAkQkFTRV9MT09QREVWICRPU01JTl9MT09QREVWIHAgOCIgfCBkbXNldHVwIGNyZWF0ZSAtLXJl
YWRvbmx5IGxpdmUtb3NpbWctbWluCj4gICAgIGZpCg==
EOF_patch

cat /root/dmsquash-live-root.base64 | base64 -d &amp;gt; /root/dmsquash-live-root.patch

patch /usr/share/dracut/modules.d/90dmsquash-live/dmsquash-live-root /root/dmsquash-live-root.patch

ls /lib/modules | while read kernel; do
  echo &quot; &gt; Update initramfs for kernel ${kernel}&quot;
  initrdfile=&quot;/boot/initramfs-${kernel}.img&quot;

  /sbin/dracut -f $initrdfile $kernel
done
%end

%post --nochroot

echo &quot;Copy initramfs outside the chroot:&quot;
ls $INSTALL_ROOT/lib/modules | while read kernel; do
  src=&quot;$INSTALL_ROOT/boot/initramfs-${kernel}.img&quot;
  dst=&quot;$LIVE_ROOT/isolinux/initrd0.img&quot;
  echo &quot; &amp;gt; $src -&amp;gt; $dst&quot;
  cp -f $src $dst
done
%end
&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Explaination:&lt;/b&gt; The post script will apply a patch to &lt;i&gt;/usr/share/dracut/modules.d/90dmsquash-live/dmsquash-live-root&lt;/i&gt; before regenerating the initramfs. This patch will add support for the &amp;#8216;toram&amp;#8217; boot parameter. Then, the initramfs is being copied to the isolinux directory outside the filesystem image.&lt;/p&gt;
&lt;p&gt;Second, use &lt;i&gt;livecd-creator&lt;/i&gt; and &lt;i&gt;livecd-iso-to-pxeboot&lt;/i&gt; from the &lt;i&gt;livecd-tools&lt;/i&gt; package to convert the kickstart file into a bootable vmlinuz and initrd:&lt;/p&gt;
&lt;pre&gt;
$ sudo livecd-creator --config=centos6.ks fslabel=centos6
$ sudo livecd-iso-to-pxeboot centos6.iso
&lt;/pre&gt;
&lt;p&gt;The commands above will create &lt;i&gt;tftpboot/vmlinuz0&lt;/i&gt; and &lt;i&gt;tftpboot/initrd0.img&lt;/i&gt;. Put these files on your boot server and create a suitable PXE configuration. &lt;i&gt;livecd-iso-to-pxeboot&lt;/i&gt; will create &lt;i&gt;tftpboot/pxelinux.cfg/default&lt;/i&gt; which can be used as a template.&lt;/p&gt;
&lt;p&gt;Now you are ready to boot one or multiple CentOS 6 in-memory instances over the network!&lt;/p&gt;
&lt;p&gt;Another screenshot:&lt;br /&gt;
&lt;a href=&quot;http://braastad.org/blog/wp-content/uploads/2012/04/centos6-from-tmpfs-details.png&quot;&gt;&lt;img src=&quot;http://braastad.org/blog/wp-content/uploads/2012/04/centos6-from-tmpfs-details-300x166.png&quot; alt=&quot;&quot; title=&quot;centos6-from-tmpfs-details&quot; width=&quot;300&quot; height=&quot;166&quot; class=&quot;alignnone size-medium wp-image-165&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Feature request &lt;a href=&quot;http://article.gmane.org/gmane.linux.kernel.initramfs/2588&quot;&gt;upstream&lt;/a&gt;.&lt;/p&gt;</content>
		<author>
			<name>Espen Braastad</name>
			<uri>http://braastad.org/blog</uri>
		</author>
		<source>
			<title type="html">golb</title>
			<subtitle type="html">Espen Braastad</subtitle>
			<link rel="self" href="http://braastad.org/blog/feed/"/>
			<id>http://braastad.org/blog/feed/</id>
			<updated>2012-05-17T02:40:39+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">P4 nettradio på Linux</title>
		<link href="http://jorge.fbarr.net/2012/04/13/p4-nettradio-pa-linux/"/>
		<id>http://jorge.fbarr.net/2012/04/13/p4-nettradio-pa-linux</id>
		<updated>2012-04-13T07:19:00+00:00</updated>
		<content type="html">&lt;p&gt;Skulle du ønske å høre på P4 sin nettradio uten å måtte ha et nettleservindu
åpen, kan du bare peke din mediaspiller (som f.eks. &lt;strong&gt;vlc&lt;/strong&gt; eller &lt;strong&gt;mplayer&lt;/strong&gt;)
direkte til strømmen. Hvis vi bruker &lt;strong&gt;mplayer&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;For P4:
&lt;div class=&quot;bogus-wrapper&quot;&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;mplayer mms://mms-cluster2.nextra.no/P4_Norge
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;For P4 Bandit
&lt;div class=&quot;bogus-wrapper&quot;&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;mplayer mms://mms-cluster2.nextra.no/P4_bandit
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Bare erstatt &lt;strong&gt;mplayer&lt;/strong&gt; med &lt;strong&gt;vlc&lt;/strong&gt;, eller noe annet, skulle du ønske å endre mediaspiller som benyttes.&lt;/p&gt;</content>
		<author>
			<name>Jorge Enrique Barrera</name>
			<uri>http://jorge.fbarr.net/</uri>
		</author>
		<source>
			<title type="html">Category: Linux | The Road to Elysium</title>
			<link rel="self" href="http://jorge.fbarr.net/blog/categories/linux/atom.xml"/>
			<id>http://jorge.fbarr.net/</id>
			<updated>2012-05-17T02:40:32+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Ubuntu, Citrix, and SSL-error 61</title>
		<link href="http://jorge.fbarr.net/2012/04/03/ubuntu-citrix-and-ssl-error-61/"/>
		<id>http://jorge.fbarr.net/2012/04/03/ubuntu-citrix-and-ssl-error-61</id>
		<updated>2012-04-03T08:01:00+00:00</updated>
		<content type="html">&lt;p&gt;I just attempted to install the newest Linux Citrix ICA client for a colleague, on Ubuntu, and upon a successful install, an error similar to this one popped up when trying to run the client from Firefox:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;SSL error
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;Contact your help desk with the following information:
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;You have not chosen to trust&quot;/C=US/ST=/L=/O=Equifax/OU=Equifax Secure Certificate Authority/CN=&quot;,
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;the issuer of the server's security certificate ((SSL error 61).&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;The solution to this? Make Firefox's certificates accessible to Citrix, like so:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt; &lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;That should do the trick!&lt;/p&gt;</content>
		<author>
			<name>Jorge Enrique Barrera</name>
			<uri>http://jorge.fbarr.net/</uri>
		</author>
		<source>
			<title type="html">Category: Linux | The Road to Elysium</title>
			<link rel="self" href="http://jorge.fbarr.net/blog/categories/linux/atom.xml"/>
			<id>http://jorge.fbarr.net/</id>
			<updated>2012-05-17T02:40:32+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Simple video streaming with apache to Samsung Galaxy Tab</title>
		<link href="http://burningbroccoli.se/post/20186549327"/>
		<id>http://burningbroccoli.se/post/20186549327</id>
		<updated>2012-03-30T21:15:18+00:00</updated>
		<content type="html">&lt;p&gt;Ok, so I&amp;#8217;d like to watch videos on my Samsung Galaxy Tab without the hassle of copying them from my computer. I thought streaming with VLC would be a nice option. It probably is, but I didn&amp;#8217;t get it to work. The tab has great support for media formats which means I only need streaming - no converting, so I thought why not use plain old apache? And it worked pretty well, playback is smooth and I can jump around nearly instantaneously.  This is my setup:&lt;/p&gt;

&lt;p&gt;First if you don&amp;#8217;t have it install apache2 and symlink your video folder into /var/www. Then check your servers ip adress with ifconfig&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ sudo apt-get install apache2
$ sudo ln -s /home/bb/Video /var/www/video
$ ifconfig
&lt;/pre&gt;

&lt;p&gt;After that just open up the browser in the tab (with your servers ip adress of course)&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
&lt;a href=&quot;http://192.168.1.100/video&quot; target=&quot;_blank&quot;&gt;http://192.168.1.100/video&lt;/a&gt;
&lt;/pre&gt;

&lt;p&gt;Depending on file type I get a choice of programs to handle the file, for some reason .mp4 files triggers a dialog with just &lt;em&gt;Android-system&lt;/em&gt; and &lt;em&gt;Browser&lt;/em&gt;, just choose &lt;em&gt;Android-system&lt;/em&gt; and you&amp;#8217;ll get a proper dialog of choices. One problem I got was that the standard video player can&amp;#8217;t handle all the formats, I use &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.inisoft.mediaplayer.trial&amp;amp;feature=search_result&quot; target=&quot;_blank&quot;&gt;Dice Player&lt;/a&gt; which works very well for me.&lt;/p&gt;</content>
		<author>
			<name>David Jensen</name>
			<uri>http://burningbroccoli.se/</uri>
		</author>
		<source>
			<title type="html">burning broccoli</title>
			<subtitle type="html">random ramblings, mostly about programming by David Jensen</subtitle>
			<link rel="self" href="http://burningbroccoli.se/rss"/>
			<id>http://burningbroccoli.se/rss</id>
			<updated>2012-05-17T02:40:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">PassiveDNS 0.5.0</title>
		<link href="http://www.gamelinux.org/?p=543"/>
		<id>http://www.gamelinux.org/?p=543</id>
		<updated>2012-03-29T15:18:45+00:00</updated>
		<content type="html">&lt;p&gt;I have pushed &lt;strong&gt;PassiveDNS version 0.5.0&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;According to the &lt;a href=&quot;https://raw.github.com/gamelinux/passivedns/master/doc/ROADMAP&quot;&gt;roadmap&lt;/a&gt;, I have been at 0.5.0 for a while, and even started to implement stuff for the 1.5.0 version. But my real aim is the 1.0.0 release, and I have started all the activities for the 1.0.0 release, but I lack the statistics that I set in the roadmap when PassiveDNS ends. I have played it against pcaps with DNS attacks, Im fuzzing pcaps being read by PassiveDNS etc. so a 1.0.0 is hopefully not that far away &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;Some of the changes since my last blog post (v0.2.9):&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
* Logging of NXDOMAINs (-Xx -L nxdomain.log)&lt;br /&gt;
* DNS over UDP/TCP on IPv4 and IPv6 (Used to be just IPv4+UDP)&lt;br /&gt;
* Logging to stdout (-L &amp;#8211; / -l -), both for NXDOMAINS and other DNS records.&lt;br /&gt;
* Implemented some hardening, including checking that client TID match server TID etc.&lt;br /&gt;
* Other small optimization and fixing a small memleak etc.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The way I implemented NXDOMAINS in PassiveDNS for now, makes it compete with the memory pool from &amp;#8220;normal&amp;#8221; domains/records. So if you have a fastflux or someone just querying for generated b0gus domains on your network, you might push out valid domains from the cache in favor for a NXDOMAIN. The reason I did this, is that it was faster than implementing an own memory pool for the NXDOMAINS and it give the possibility to log NXDOMAINS in current version with out to much hassle. If this way of implementing NXDOMAINS turns out to fight for memory more aggressively than one would like, one can always start two instances of PassiveDNS, one just looking for NXDOMAINS, and the other one looking for the regular domains. As I gain more experience with NXDOMAINS in PassiveDNS and get more feedback, Ill reconsider the implementation if needed &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;One note, the current logfile format will be stable until the 1.5.0 release (that is my intention at least), After that, my plan is to implement a customizable log format, and also more fields of interest will be available. If you have any additional data that you want to output and thoughts about how the output for those data should be, don&amp;#8217;t hesitate to let me know &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 ran into a security related bug on my Ubuntu 10.04 which might be triggered running PassiveDNS. I have emailed the Debian package maintainer and reported the bug to security@ubuntu.com and also filed a bug report. The bug is fixed upstream in ldns long time ago, so hopefully it will be fixed soon in Ubuntu 10.04 too &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;For reporting issues or making feature request, please do so &lt;a href=&quot;https://github.com/gamelinux/passivedns/issues&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Happy DNS Archiving &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;</content>
		<author>
			<name>Edward Bjarte Fjellskål</name>
			<uri>http://www.gamelinux.org</uri>
		</author>
		<source>
			<title type="html">Work Together For The Benefit Of All ManKind... » OpenSourceSoftware</title>
			<subtitle type="html">OSS and Security @ WORK</subtitle>
			<link rel="self" href="http://www.gamelinux.org/?feed=rss2&amp;cat=3"/>
			<id>http://www.gamelinux.org/?feed=rss2&amp;cat=3</id>
			<updated>2012-05-17T02:40:27+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">PGConf.EU 2012 - announcement and call for sponsors</title>
		<link href="http://blog.hagander.net/archives/204-PGConf.EU-2012-announcement-and-call-for-sponsors.html"/>
		<id>http://blog.hagander.net/archives/204-guid.html</id>
		<updated>2012-03-27T14:59:00+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;It's time to mark your calendars - &lt;a href=&quot;http://2012.pgconf.eu/&quot;&gt;PostgreSQL Conference Europe 2012&lt;/a&gt; will be held at the Corinthia Hotel in Prague, the Czech Republic, on October 23-26 2012. As previous years there will be one day of professional training (Tuesday 23rd) and then three days of regular talks.&lt;/p&gt;

&lt;p&gt;At this point, we are also opening our sponsorship program. We are looking for sponsors at all levels, from Bronze to Platinum. Please see &lt;a href=&quot;http://2012.pgconf.eu/becomesponsor/&quot;&gt;our website&lt;/a&gt; for details about the sponsor benefits and the costs.&lt;/p&gt;

&lt;p&gt;Follow the news feed on our site, or our &lt;a href=&quot;https://twitter.com/pgconfeu&quot;&gt;Twitter feed&lt;/a&gt;, for further information as we finalize details.&lt;/p&gt;

 
            &lt;/div&gt;</content>
		<author>
			<name>Magnus Hagander</name>
			<uri>http://blog.hagander.net/</uri>
		</author>
		<source>
			<title type="html">Magnus Hagander's PostgreSQL blog</title>
			<link rel="self" href="http://blog.hagander.net/feeds/atom.xml"/>
			<id>http://blog.hagander.net/</id>
			<updated>2012-05-17T02:40:37+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Cucumber testing with Kyuri in a browser</title>
		<link href="http://burningbroccoli.se/post/19572039439"/>
		<id>http://burningbroccoli.se/post/19572039439</id>
		<updated>2012-03-19T14:01:56+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://cukes.info/&quot; target=&quot;_blank&quot;&gt;Cucumber&lt;/a&gt; is a really nice testing framework, but I dislike having to implement the step definitions in ruby when the project itself is not in ruby, but what (web) project use javascript so why not do cucumber testing with javascript?&lt;/p&gt;

&lt;p&gt;There are a couple of solutions for this, &lt;a href=&quot;https://github.com/cucumber/cucumber-jvm&quot; target=&quot;_blank&quot;&gt;Cucumber JVM&lt;/a&gt; (former cuke4duke) is an official java based version of cucumber that let&amp;#8217;s you use any jvm language. That&amp;#8217;s cool, and probably a good way to go, but not fun enough for me. It messes with my mojo to start the jvm for something like this. And besides, there is no documentation on defining steps in javascript. &lt;a href=&quot;https://github.com/cucumber/cucumber-js&quot; target=&quot;_blank&quot;&gt;Cucumer-js&lt;/a&gt; is a pure javascript alternative that looks good, uses node  and seems very cool. But it lacks i18n support, it seems to be actively developed on so this is certainly something to keep an eye on. Cucumber-js also has support for running it in the browser via &lt;a href=&quot;https://github.com/substack/node-browserify&quot; target=&quot;_blank&quot;&gt;browserify&lt;/a&gt;. A third cool alternative is &lt;a href=&quot;https://github.com/nodejitsu/kyuri&quot; target=&quot;_blank&quot;&gt;Kyuri&lt;/a&gt;, another pure javascript implementation, and it has support for i18n! Kyuri is also node based, can it be used in a browser? This is the steps that I took to get it running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;
Install browserify and kyuri with npm.&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ sudo npm --global browserify
$ npm install kyuri
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Browserify&lt;/strong&gt;
Kyuri actually has two ways to define steps, as &amp;#8220;cucumber&amp;#8221; and  &lt;a href=&quot;http://vowsjs.org/&quot; target=&quot;_blank&quot;&gt;vows&lt;/a&gt;, vows seems to be the main target, but it doesn&amp;#8217;t translate well to the browser. It has dependencies that browserify can&amp;#8217;t handle. So we cut it out, which means a little bit of tweaking:&lt;/p&gt;

&lt;pre class=&quot;sh_sh&quot;&gt;
$ browserify -r kyuri  -i /node_modules/kyuri/node_modules/vows/lib/vows.js -i ./kyuri/runners/vows -o kyuri-bundle.js
&lt;/pre&gt;

&lt;p&gt;This will give you a kyuri-bundle.js, it lacks vows.js and its runner but it still tries to require it so we need to edit it a bit. Remove this line (it&amp;#8217;s line 375)&lt;/p&gt;

&lt;pre class=&quot;sh_javascript&quot;&gt;
kyuri.runners.vows = require('./kyuri/runners/vows');
&lt;/pre&gt;

&lt;p&gt;And these just below:&lt;/p&gt;

&lt;pre class=&quot;sh_javascript&quot;&gt;
// Set default runner to vows
kyuri.runner = kyuri.runners.vows;
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Browser&lt;/strong&gt;
This is a sample html page to test it:&lt;/p&gt;

&lt;pre class=&quot;sh_javascript&quot;&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;
    &amp;lt;title&amp;gt;Kyuri&amp;lt;/title&amp;gt;
    &amp;lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&quot; type=&quot;text/javascript&quot; language=&quot;javascript&quot; charset=&quot;utf-8&quot; &amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;kyuri-bundle.js&quot; type=&quot;text/javascript&quot; language=&quot;javascript&quot; charset=&quot;utf-8&quot; &amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; charset=&quot;utf-8&quot;&amp;gt;
        var kyuri = require('kyuri');
        
        var Runner = kyuri.runners.cucumber;

        Runner.on('beforeTest', function (done) {
          console.log('beforeTest event');
          done();
        });

        Runner.on('beforeBackground', function (done) {
          console.log('beforeBackground event');
          done();
        });

        Runner.on('afterTest', function (done) {
          console.log('afterTest event');
          done();
        });
        
        $(document).ready(function(){
            
            //features
            var features = [];
            $('.feature').each(function(){
                console.log(kyuri.parse($(this).text()));
                features.push(kyuri.parse($(this).text()));
            });
            
            //step defitions
            var Steps = require('kyuri').Steps;

            Steps.Given(/^I have entered (\d+) into the calculator$/, function (step, num) {
              console.log('Calculator: ' + num);
              step.done();
            });
            
            var module = {};
            Steps.export(module);
            
            var steps  = module.exports;
            
            //run it
            kyuri.runners.cucumber.run(features, steps, function () {
                console.log(&quot;Done!&quot;);
            });
            
        });
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    
&amp;lt;pre class=&quot;feature&quot;&amp;gt;
Feature: Addition
    In order to avoid silly mistakes
    As a math idiot
    I want to be told the sum of two numbers

    Scenario: Add two numbers
        Given I have entered 50 into the calculator
        And I have entered 70 into the calculator
        When I press add
        Then the result should be 120 on the screen
&amp;lt;/pre&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Caveats&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;This only works in Firefox for me, Chrome has a minor error (probably easy to fix).&lt;/li&gt;
&lt;li&gt;It logs console color codes&amp;#8230; looks weird&lt;/li&gt;
&lt;/ul&gt;</content>
		<author>
			<name>David Jensen</name>
			<uri>http://burningbroccoli.se/</uri>
		</author>
		<source>
			<title type="html">burning broccoli</title>
			<subtitle type="html">random ramblings, mostly about programming by David Jensen</subtitle>
			<link rel="self" href="http://burningbroccoli.se/rss"/>
			<id>http://burningbroccoli.se/rss</id>
			<updated>2012-05-17T02:40:06+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Private repositories in Sonatype Nexus</title>
		<link href="http://minibiti.blogspot.com/2012/03/private-repositories-in-sonatype-nexus.html"/>
		<id>tag:blogger.com,1999:blog-5508944150741454216.post-3825556140597178642</id>
		<updated>2012-03-14T16:36:00+00:00</updated>
		<content type="html">Sonatype Nexus is an artifact repository manager very much used when maven is your build tool for a java project. You can use it as a proxy for other repositories but also to host your own artifacts. &lt;br /&gt;&lt;br /&gt;By default in Nexus, all repositories are reachable via the anonymous user.&lt;br /&gt;&lt;br /&gt;Here is what to do to configure your Nexus server so that (at least) some of your repositories will require credentials to access them.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;First you have to prevent the anonymous user to have access to all the repositories:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a new Privilege that gives access to you public group (or individual repositories) &lt;b&gt;NOTE:&lt;/b&gt; Assigning access to a group is equivalent to assigning these privileges to all of the repositories in the group.  &lt;ol&gt;&lt;li&gt;Login to nexus as an administrator.&lt;/li&gt;&lt;li&gt;Click on Privileges in the left menu.&lt;/li&gt;&lt;li&gt;Click Add.&lt;/li&gt;&lt;li&gt;Use the following values:   &lt;ol&gt;&lt;li&gt;Name: M2 Public Repositories (Group)&lt;/li&gt;&lt;li&gt;Description: Access to Public Repositories (Group)&lt;/li&gt;&lt;li&gt;Repository: Public Repositories (Group)&lt;/li&gt;&lt;li&gt;Repository Target: All (Maven2)&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Save.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Repeat the previous step for all you public groups and/or respositories.&lt;/li&gt;&lt;li&gt;Create a new Role and assign this new privilege to it.  &lt;ol&gt;&lt;li&gt;Click on Roles in the left menu.&lt;/li&gt;&lt;li&gt;Click Add.&lt;/li&gt;&lt;li&gt;User the following values:   &lt;ol&gt;&lt;li&gt;Role Id: repo-public-read&lt;/li&gt;&lt;li&gt;Name: Repo: All Public Repositories (read)&lt;/li&gt;&lt;li&gt;Description: Read only access to all public repositories.&lt;/li&gt;&lt;li&gt;Session Timeout: 60&lt;/li&gt;&lt;li&gt;Selected Roles / Privileges: M2 Public Repositories (Group) - (read)&lt;/li&gt;&lt;li&gt;&lt;b&gt;NOTE&lt;/b&gt;: Include all of the roles you created in the first step.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Save.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Remove the Grant Read all role from the Anonymous user and add the new role.  &lt;ol&gt;&lt;li&gt;Click on Users in the left menu.&lt;/li&gt;&lt;li&gt;Click on the anonymous user.&lt;/li&gt;&lt;li&gt;Remove the role 'Repo: All Repositories (read)'&lt;/li&gt;&lt;li&gt;Add the role 'All Public Repositories (read)'&lt;/li&gt;&lt;li&gt;Save.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;Once you have done this, you need to create users to access all the non public repositories.&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You first create a privilege for your given repo (Security-&amp;gt;Privileges then Add)&lt;/li&gt;&lt;li&gt;Then a role (add the view and read part of the privilege created above)&lt;/li&gt;&lt;li&gt;And finally a user and assign him the role just create&lt;/li&gt;&lt;li&gt;Repeat this for as many times as you have repos. If you want to have several users for one repo, then just repeat 3.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The final step is to configure the client side with the proper settings in .m2/settings.xml and in the project pom.xml. like this:&lt;/b&gt;&lt;br /&gt;settings.xml &lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;servers&amp;gt;&lt;br /&gt;   &amp;lt;server&amp;gt;&lt;br /&gt;       &amp;lt;id&amp;gt;myserver&amp;lt;/id&amp;gt;&lt;br /&gt;       &amp;lt;username&amp;gt;mrx&amp;lt;/username&amp;gt;&lt;br /&gt;       &amp;lt;password&amp;gt;pwd&amp;lt;/password&amp;gt;&lt;br /&gt;   &amp;lt;/server&amp;gt;&lt;br /&gt;&amp;lt;servers&amp;gt;&lt;br /&gt;&lt;/pre&gt;pom.xml &lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;repositories&amp;gt;&lt;br /&gt;   &amp;lt;repository&amp;gt;&lt;br /&gt;       &amp;lt;id&amp;gt;myserver&amp;lt;/id&amp;gt;&lt;br /&gt;       &amp;lt;name&amp;gt;myserver&amp;lt;/name&amp;gt;&lt;br /&gt;       &amp;lt;url&amp;gt;http://server:8081/nexus/content/repositories/your_repo&amp;lt;/url&amp;gt;&lt;br /&gt;   &amp;lt;/repository&amp;gt;&lt;br /&gt;&amp;lt;/repositories&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now your repository should be accessible with user and password only.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Some links:&lt;br /&gt;&lt;a href=&quot;http://www.sonatype.com/books/nexus-book/reference/confignx-sect-managing-security.html&quot;&gt;Managing Security with Nexus&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://matthewhindle.co.uk/wordpress/?p=5&quot;&gt;Depend on a password protected nexus repository&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://docs.sonatype.com/display/SPRTNXOSS/Nexus+FAQ#NexusFAQ-Q.CanImakearepositoryprivatewithoutdisablinganonymousaccess%3F&quot;&gt;Can I make a repository private without disabling anonymous access?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&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/5508944150741454216-3825556140597178642?l=minibiti.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Bambitroll</name>
			<email>noreply@blogger.com</email>
			<uri>http://minibiti.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">Tech and Tips</title>
			<subtitle type="html">This is my notepad to remember what I did so I can reuse it later.</subtitle>
			<link rel="self" href="http://minibiti.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5508944150741454216</id>
			<updated>2012-05-17T02:40:38+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">varnish-3.0.2 for fedora</title>
		<link href="http://ingvar.blog.redpill-linpro.com/2012/03/08/varnish-3-0-2-for-fedora/"/>
		<id>http://ingvar.blog.redpill-linpro.com/2012/03/08/</id>
		<updated>2012-03-08T08:22:08+00:00</updated>
		<content type="html">&lt;p&gt;I finally got around to wrap up varnish-3.0.2 for fedora 17 and rawhide. Please test and &lt;a href=&quot;https://admin.fedoraproject.org/updates/FEDORA-2012-3246/varnish-3.0.2-1.fc17&quot;&gt;report karma&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this release, I have merged changes from the upstream rpm, and added native systemd support for f17 and rawhide. It also builds nicely for epel5  and epel6, providing packages quite similar to those available from the &lt;a href=&quot;https://www.varnish-cache.org/installation/redhat&quot;&gt;varnish project repo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As epel does not allow changes in a package API after release, varnish-3.0.2 won&amp;#8217;t be available through epel5 or epel6, so use the &lt;a href=&quot;https://www.varnish-cache.org/installation/redhat&quot;&gt;varnish project repo&lt;/a&gt;, or my precompiled packages for epel 4, 5 and 6 &lt;a href=&quot;http://users.linpro.no/ingvar/varnish/3.0.2/&quot;&gt;available here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As always, feedback is very welcome.&lt;/p&gt;</content>
		<author>
			<name>Ingvar Hagelund</name>
			<uri>http://ingvar.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">On the third side » comp</title>
			<subtitle type="html">Lamentation and praise - almost never in rhyme</subtitle>
			<link rel="self" href="http://ingvar.blog.redpill-linpro.com/category/comp/feed/"/>
			<id>http://ingvar.blog.redpill-linpro.com/category/comp/feed/</id>
			<updated>2012-05-17T02:40:39+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Bridging between JMS and RabbitMQ (AMQP) using Spring Integration</title>
		<link href="http://integrationsphere.blogspot.com/2012/03/bridging-between-jms-and-rabbitmq-amqp.html"/>
		<id>tag:blogger.com,1999:blog-7292537168542978537.post-3581857100388188808</id>
		<updated>2012-03-08T05:48:00+00:00</updated>
		<content type="html">An old customer recently asked me if I had a solution for how to integrate between their existing JMS infrastructure on Websphere MQ with RabbitMQ.&lt;br /&gt;&lt;br /&gt;Although I know that RabbitMQ has the shovel plugin which can bridge between Rabbit instances I've yet not found a good plugin for JMS -&gt; AMQP forwarding.&lt;br /&gt;The first thing that came to my mind was to utilize a Spring Integration mediation as SI has excellent support for both JMS and Rabbit.&lt;br /&gt;&lt;br /&gt;Curious as I am I started a PoC and this is the result. It takes messages of a JMS queue and forwards to an AMQP exchange that is bound to a queue the consumer application is supposed to listen to. I used an external HornetQ instance in JBoss 6.1 as the JMS Provider, but I am 100% secure that the same setup would work for Websphere MQ as they both implement JMS.&lt;br /&gt;&lt;br /&gt;Be aware that I've done no performance tweaking or QoS setup yet as this is just a proof-of-concept. For a real setup you'd probably have to think about delivery guarantees versus performance and etc...&lt;br /&gt;&lt;br /&gt;The code will be available at a GitHub repository near you soon..&lt;br /&gt;&lt;br /&gt;SpringContext in XML:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;beans:beans xmlns=&amp;quot;http://www.springframework.org/schema/integration&amp;quot;&lt;br /&gt;    xmlns:beans=&amp;quot;http://www.springframework.org/schema/beans&amp;quot;&lt;br /&gt;    xmlns:aop=&amp;quot;http://www.springframework.org/schema/aop&amp;quot;&lt;br /&gt;    xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;br /&gt;    xmlns:int-amqp=&amp;quot;http://www.springframework.org/schema/integration/amqp&amp;quot;&lt;br /&gt;    xmlns:rabbit=&amp;quot;http://www.springframework.org/schema/rabbit&amp;quot;&lt;br /&gt;    xmlns:int-jms=&amp;quot;http://www.springframework.org/schema/integration/jms&amp;quot;&lt;br /&gt;    xmlns:int=&amp;quot;http://www.springframework.org/schema/integration&amp;quot;&lt;br /&gt;    xsi:schemaLocation=&amp;quot;http://www.springframework.org/schema/integration/amqp http://www.springframework.org/schema/integration/amqp/spring-integration-amqp-2.1.xsd&lt;br /&gt;        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd&lt;br /&gt;        http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd&lt;br /&gt;        http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.1.xsd&lt;br /&gt;        http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd&lt;br /&gt;        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&amp;quot;&amp;gt;&lt;br /&gt;        &lt;br /&gt;    &amp;lt;beans:bean id=&amp;quot;jndiTemplate&amp;quot; class=&amp;quot;org.springframework.jndi.JndiTemplate&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;beans:property name=&amp;quot;environment&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;beans:props&amp;gt;&lt;br /&gt;                &amp;lt;beans:prop key=&amp;quot;java.naming.factory.initial&amp;quot;&amp;gt;org.jnp.interfaces.NamingContextFactory&amp;lt;/beans:prop&amp;gt;&lt;br /&gt;                &amp;lt;beans:prop key=&amp;quot;java.naming.provider.url&amp;quot;&amp;gt;jnp://localhost:1099&amp;lt;/beans:prop&amp;gt;&lt;br /&gt;                &amp;lt;beans:prop key=&amp;quot;java.naming.factory.url.pkgs&amp;quot;&amp;gt;org.jnp.interfaces:org.jboss.naming&amp;lt;/beans:prop&amp;gt;&lt;br /&gt;            &amp;lt;/beans:props&amp;gt;&lt;br /&gt;        &amp;lt;/beans:property&amp;gt;&lt;br /&gt;    &amp;lt;/beans:bean&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;beans:bean id=&amp;quot;jmsQueueConnectionFactory&amp;quot;&lt;br /&gt;      class=&amp;quot;org.springframework.jndi.JndiObjectFactoryBean&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;beans:property name=&amp;quot;jndiTemplate&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;beans:ref bean=&amp;quot;jndiTemplate&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/beans:property&amp;gt;&lt;br /&gt;        &amp;lt;beans:property name=&amp;quot;jndiName&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;beans:value&amp;gt;ConnectionFactory&amp;lt;/beans:value&amp;gt;&lt;br /&gt;        &amp;lt;/beans:property&amp;gt;&lt;br /&gt;    &amp;lt;/beans:bean&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!-- Channels and adapters for SI --&amp;gt;&lt;br /&gt;    &amp;lt;int-jms:message-driven-channel-adapter connection-factory=&amp;quot;jmsQueueConnectionFactory&amp;quot; destination-name=&amp;quot;myJmsQueue&amp;quot; channel=&amp;quot;rabbitChannel&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;channel id=&amp;quot;rabbitChannel&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;int-amqp:outbound-channel-adapter channel=&amp;quot;rabbitChannel&amp;quot; exchange-name=&amp;quot;fromJmsExchange&amp;quot; amqp-template=&amp;quot;rabbitTemplate&amp;quot;/&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;!-- Connectivity to Rabbit --&amp;gt;&lt;br /&gt;    &amp;lt;rabbit:template id=&amp;quot;rabbitTemplate&amp;quot; connection-factory=&amp;quot;cf&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;rabbit:connection-factory id=&amp;quot;cf&amp;quot; host=&amp;quot;localhost&amp;quot;/&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;!-- Rabbit entities, to be created at context startup --&amp;gt;&lt;br /&gt;    &amp;lt;rabbit:admin connection-factory=&amp;quot;cf&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;rabbit:queue name=&amp;quot;fromJMS&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;rabbit:direct-exchange name=&amp;quot;fromJmsExchange&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;rabbit:bindings&amp;gt;&lt;br /&gt;            &amp;lt;rabbit:binding queue=&amp;quot;fromJMS&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/rabbit:bindings&amp;gt;&lt;br /&gt;    &amp;lt;/rabbit:direct-exchange&amp;gt;&lt;br /&gt;&amp;lt;/beans:beans&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Maven POM:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;project xmlns=&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;br /&gt;    xsi:schemaLocation=&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;org.rl&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;si.jmstorabbit&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;name&amp;gt;si.jmstorabbit&amp;lt;/name&amp;gt;&lt;br /&gt;    &amp;lt;url&amp;gt;http://maven.apache.org&amp;lt;/url&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;properties&amp;gt;&lt;br /&gt;        &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;&lt;br /&gt;        &amp;lt;hornet.version&amp;gt;2.2.5.Final&amp;lt;/hornet.version&amp;gt;&lt;br /&gt;        &amp;lt;spring.integration.version&amp;gt;2.1.0.RELEASE&amp;lt;/spring.integration.version&amp;gt;&lt;br /&gt;    &amp;lt;/properties&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;repositories&amp;gt;&lt;br /&gt;        &amp;lt;repository&amp;gt;&lt;br /&gt;            &amp;lt;id&amp;gt;springsource-release&amp;lt;/id&amp;gt;&lt;br /&gt;            &amp;lt;url&amp;gt;http://repository.springsource.com/maven/bundles/release&amp;lt;/url&amp;gt;&lt;br /&gt;            &amp;lt;snapshots&amp;gt;&lt;br /&gt;                &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;&lt;br /&gt;            &amp;lt;/snapshots&amp;gt;&lt;br /&gt;        &amp;lt;/repository&amp;gt;&lt;br /&gt;        &amp;lt;repository&amp;gt;&lt;br /&gt;            &amp;lt;id&amp;gt;springsource-external&amp;lt;/id&amp;gt;&lt;br /&gt;            &amp;lt;url&amp;gt;http://repository.springsource.com/maven/bundles/external&amp;lt;/url&amp;gt;&lt;br /&gt;            &amp;lt;snapshots&amp;gt;&lt;br /&gt;                &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;&lt;br /&gt;            &amp;lt;/snapshots&amp;gt;&lt;br /&gt;        &amp;lt;/repository&amp;gt;&lt;br /&gt;    &amp;lt;/repositories&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;dependencies&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;       &amp;lt;groupId&amp;gt;org.springframework.integration&amp;lt;/groupId&amp;gt;&lt;br /&gt;       &amp;lt;artifactId&amp;gt;spring-integration-core&amp;lt;/artifactId&amp;gt;&lt;br /&gt;       &amp;lt;version&amp;gt;${spring.integration.version}&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;       &amp;lt;groupId&amp;gt;org.springframework.integration&amp;lt;/groupId&amp;gt;&lt;br /&gt;       &amp;lt;artifactId&amp;gt;spring-integration-file&amp;lt;/artifactId&amp;gt;&lt;br /&gt;       &amp;lt;version&amp;gt;${spring.integration.version}&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;       &amp;lt;groupId&amp;gt;org.springframework.integration&amp;lt;/groupId&amp;gt;&lt;br /&gt;       &amp;lt;artifactId&amp;gt;spring-integration-amqp&amp;lt;/artifactId&amp;gt;&lt;br /&gt;       &amp;lt;version&amp;gt;${spring.integration.version}&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;       &amp;lt;groupId&amp;gt;org.springframework.integration&amp;lt;/groupId&amp;gt;&lt;br /&gt;       &amp;lt;artifactId&amp;gt;spring-integration-jms&amp;lt;/artifactId&amp;gt;&lt;br /&gt;       &amp;lt;version&amp;gt;${spring.integration.version}&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;      &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;&lt;br /&gt;      &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;&lt;br /&gt;      &amp;lt;version&amp;gt;3.8.1&amp;lt;/version&amp;gt;&lt;br /&gt;      &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;        &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;&lt;br /&gt;        &amp;lt;artifactId&amp;gt;spring-context&amp;lt;/artifactId&amp;gt;&lt;br /&gt;        &amp;lt;version&amp;gt;3.0.7.RELEASE&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;        &amp;lt;groupId&amp;gt;jboss&amp;lt;/groupId&amp;gt;&lt;br /&gt;        &amp;lt;artifactId&amp;gt;jnp-client&amp;lt;/artifactId&amp;gt;&lt;br /&gt;        &amp;lt;version&amp;gt;4.2.2.GA&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;            &lt;br /&gt;    &lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;org.hornetq&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;hornetq-core-client&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;${hornet.version}&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;org.hornetq&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;hornetq-jms-client&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;${hornet.version}&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;org.hornetq&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;hornetq-jms&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;${hornet.version}&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;           &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;jboss&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;jboss-common-client&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;3.2.3&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;org.jboss.netty&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;netty&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;3.2.7.Final&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;javax.jms&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;jms&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;1.1&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;/dependencies&amp;gt;&lt;br /&gt;  &lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&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/7292537168542978537-3581857100388188808?l=integrationsphere.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Billy Sjöberg</name>
			<email>noreply@blogger.com</email>
			<uri>http://integrationsphere.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">IntegrationSphere</title>
			<subtitle type="html">Confessions of an integration consultant</subtitle>
			<link rel="self" href="http://integrationsphere.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-7292537168542978537</id>
			<updated>2012-05-17T02:40:35+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Practicing the fundamentals: Timezone handling</title>
		<link href="http://elephpants.blog.redpill-linpro.com/2012/02/28/practicing-the-fundamentals-timezone-handling/"/>
		<id>http://elephpants.blog.redpill-linpro.com/2012/02/28/</id>
		<updated>2012-02-28T15:00:49+00:00</updated>
		<content type="html">&lt;p&gt;Timezone handling can sometimes be a bitch. Turns out, using a couple of PHPs classes and functions, it&amp;#8217;s quite easy.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s say you have a web application with the following scenario:&lt;br /&gt;
Users from around the planet, and your server is located in the UK.&lt;/p&gt;
&lt;p&gt;You would initialize your DateTime object like this:&lt;/p&gt;
&lt;pre class=&quot;brush: php; title: ;&quot;&gt;
$timezoneUTC = new DateTimeZone('UTC');
$dateTime = new DateTime('2012-02-23 10:22', $timezoneUTC);

echo $dateTime-&amp;gt;format('Y-m-d H:i e').'&amp;lt;br/&amp;gt;';
&lt;/pre&gt;
&lt;p&gt;This should output:&lt;br /&gt;
2012-02-23 10:22 UTC&lt;/p&gt;
&lt;p&gt;For an international user, seeing his or her local time would be nice.&lt;br /&gt;
To do this, simply change the timezone of the existing DateTime object, like this:&lt;/p&gt;
&lt;pre class=&quot;brush: php; title: ;&quot;&gt;
$timeZoneSweden = new DateTimeZone('Europe/Stockholm');
$dateTime-&amp;gt;setTimeZone($timeZoneSweden);
echo $dateTime-&amp;gt;format('Y-m-d H:i e').'&amp;lt;br/&amp;gt;';

$timeZoneNY = new DateTimeZone('America/New_York');
$dateTime-&amp;gt;setTimeZone($timeZoneNY);
echo $dateTime-&amp;gt;format('Y-m-d H:i e').'&amp;lt;br/&amp;gt;';

$timeZoneBKK = new DateTimeZone('Asia/Bangkok');
$dateTime-&amp;gt;setTimeZone($timeZoneBKK);
echo $dateTime-&amp;gt;format('Y-m-d H:i e').'&amp;lt;br/&amp;gt;';
&lt;/pre&gt;
&lt;p&gt;This should output:&lt;br /&gt;
2012-02-23 11:22 Europe/Stockholm&lt;br /&gt;
2012-02-23 05:22 America/New_York&lt;br /&gt;
2012-02-23 17:22 Asia/Bangkok&lt;/p&gt;
&lt;p&gt;The final code should look something like this:&lt;/p&gt;
&lt;pre class=&quot;brush: php; title: ;&quot;&gt;
$timezoneUTC = new DateTimeZone('UTC');
$timeZoneSweden = new DateTimeZone('Europe/Stockholm');
$dateTime = new DateTime('2012-02-23 10:22', $timezoneUTC);
$dateTime-&amp;gt;setTimeZone($timeZoneSweden);
&lt;/pre&gt;
&lt;p&gt;This will leave a DateTime object set with the users timezone.&lt;/p&gt;
&lt;p&gt;And that&amp;#8217;s it.&lt;/p&gt;</content>
		<author>
			<name>Faggruppe PHP</name>
			<uri>http://elephpants.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">Redpill Linpro PHP Competence Group</title>
			<subtitle type="html">Monkeys and elephpants take on the world</subtitle>
			<link rel="self" href="http://elephpants.blog.redpill-linpro.com/feed/"/>
			<id>http://elephpants.blog.redpill-linpro.com/feed/</id>
			<updated>2012-05-17T02:40:33+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">New Munin-plugin for HP P2000 StorageWorks</title>
		<link href="http://trygvevea.com/2012/02/20/new-munin-plugin-for-hp-p2000-storageworks/"/>
		<id>http://trygvevea.com/?p=520</id>
		<updated>2012-02-20T13:09:23+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://munin-monitoring.org/browser/trunk/plugins/node.d/hp2000_.in&quot;&gt;I committed a new Munin-plugin for HP P2000 StorageWorks&lt;/a&gt;. It monitors through the HTTP XML-RPC interface.  It detects all disks, vdisks and controllers automatically – all you need to provide is the username/password, IP-address, and set up some symlinks.&lt;/p&gt;
&lt;p&gt;It produces 10 graphs, + subgraphs.&lt;/p&gt;
&lt;p&gt;Graph-gallery:&lt;/p&gt;
&lt;p&gt;VDISK:&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/vdisk_bandwidth-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/vdisk_bandwidth-day.png&quot; alt=&quot;&quot; title=&quot;vdisk_bandwidth-day&quot; width=&quot;497&quot; height=&quot;335&quot; class=&quot;alignnone size-full wp-image-530&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/vdisk_iops-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/vdisk_iops-day.png&quot; alt=&quot;&quot; title=&quot;vdisk_iops-day&quot; width=&quot;497&quot; height=&quot;335&quot; class=&quot;alignnone size-full wp-image-521&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Disk bandwidth and iops (rootgraphs provides enclosures, subgraphs provides disks): &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/disk_iops-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/disk_iops-day.png&quot; alt=&quot;&quot; title=&quot;disk_iops-day&quot; width=&quot;497&quot; height=&quot;299&quot; class=&quot;alignnone size-full wp-image-528&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/disk_bandwidth-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/disk_bandwidth-day.png&quot; alt=&quot;&quot; title=&quot;disk_bandwidth-day&quot; width=&quot;497&quot; height=&quot;299&quot; class=&quot;alignnone size-full wp-image-527&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Controller bandwidth and iops:&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_bandwidth-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_bandwidth-day.png&quot; alt=&quot;&quot; title=&quot;controller_bandwidth-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignnone size-full wp-image-524&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_iops-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_iops-day.png&quot; alt=&quot;&quot; title=&quot;controller_iops-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignnone size-full wp-image-525&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Controller Cache:&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_cache_misses-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_cache_misses-day.png&quot; alt=&quot;&quot; title=&quot;controller_cache_misses-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignnone size-full wp-image-523&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_cache_hits-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/controller_cache_hits-day.png&quot; alt=&quot;&quot; title=&quot;controller_cache_hits-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignnone size-full wp-image-522&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Controller CPU-load:&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/cpu_load-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/cpu_load-day.png&quot; alt=&quot;&quot; title=&quot;cpu_load-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignnone size-full wp-image-526&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A sawtooth-graph to indicate uptime statistics for the controllers:&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/02/uptime-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/02/uptime-day.png&quot; alt=&quot;&quot; title=&quot;uptime-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignnone size-full wp-image-529&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use Munin? Got a HP P2000 StorageWorks SAN?  &lt;a href=&quot;http://munin-monitoring.org/browser/trunk/plugins/node.d/hp2000_.in&quot;&gt;Why don&amp;#8217;t you give it a try&lt;/a&gt;? &lt;img src=&quot;http://trygvevea.com/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;wp-smiley&quot; /&gt; &lt;/p&gt;</content>
		<author>
			<name>Trygve Vea</name>
			<uri>http://trygvevea.com</uri>
		</author>
		<source>
			<title type="html">Trygve Vea is happy hacking :) » Planet Redpill-Linpro</title>
			<link rel="self" href="http://trygvevea.com/category/planet-redpill-linpro/feed/"/>
			<id>http://trygvevea.com/category/planet-redpill-linpro/feed/</id>
			<updated>2012-05-17T02:40:31+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">hackeriet festival</title>
		<link href="http://kacper.blog.redpill-linpro.com/archives/429"/>
		<id>http://kacper.blog.redpill-linpro.com/archives/429</id>
		<updated>2012-02-10T11:02:44+00:00</updated>
		<content type="html">&lt;p&gt;If you haven&amp;#8217;t heard already, Hackeriet &amp;#8211; the Oslo Hackerspace &amp;#8211; is hosting a full day of talks and workshops and party tomorrow Saturday. Come on by from 11:00am!&lt;br /&gt;
Check out the program at&lt;br /&gt;
&lt;a href=&quot;http://events.hackeriet.no/timeline&quot;&gt; http://events.hackeriet.no&lt;/a&gt;,&lt;br /&gt;
keywords to look out for are: arduinos, mesh networks, crypto, cyberwar, datalove and chipmusic :-))&lt;/p&gt;</content>
		<author>
			<name>Kacper Wysocki</name>
			<uri>http://kacper.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">thefastestwaytobreakamachine</title>
			<subtitle type="html">purely for fun and profit</subtitle>
			<link rel="self" href="http://kacper.blog.redpill-linpro.com/feed"/>
			<id>http://kacper.blog.redpill-linpro.com/feed</id>
			<updated>2012-05-17T02:40:03+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Adventures in bash - catching several exit values in a piped set of commands</title>
		<link href="http://grandtidbits.blogspot.com/2012/02/adventures-in-bash-catching-several.html"/>
		<id>tag:blogger.com,1999:blog-5442528832816583898.post-1573695140001675065</id>
		<updated>2012-02-08T15:53:00+00:00</updated>
		<content type="html">&lt;i&gt;&quot;All in all, very odd, bash continues to be the most bizarre of languages, convoluted, twisted, but with strange solutions thrown in just when you are about to give up hope entirely.&quot;&lt;/i&gt; (&lt;a href=&quot;http://techpatterns.com/forums/about868.html&quot;&gt;forum post at Techpatterns&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Yesterday I was re-working a database backup script at one of my customers and stumbled onto a problem when I wanted to have both proper error handling and at the same time avoid filling the disk.&lt;br /&gt;&lt;br /&gt;The code providing the challenge was this&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;$MYSQLDUMP $MYSQLDUMP_OPTS $DB | gzip -9 &amp;gt; $BACKUP_FILE&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;I need to pipe the output of mysqldump to gzip, because otherwise I run into problems with the disk filling up. And yes, having to it like this also means that doing restores are quite a pain, but that is another problem.&lt;br /&gt;&lt;br /&gt;Normally I do error handling in scripts by evaluating $?, but to have proper error handling in here I need to capture the exit value of both mysqldump and gzip. &amp;nbsp;And $? only gives med the exit value of gzip - the least important of the two.&lt;br /&gt;&lt;br /&gt;Luckily, and as expected, I'm not the first person to run into this problem, ad by way of googling I found that Bash actually have a built-in way of giving me both exit values - the array $PIPESTATUS. $PIPESTATUS is an array with all the exit values from you last command line. $PIPESTATUS[0] contains the first exit value, $PIPESTATUS[1] the second and so on&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;sigurdur@ifconfig:~$ true | false&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;sigurdur@ifconfig:~$ echo ${PIPESTATUS[0]}&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;0&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;sigurdur@ifconfig:~$ true | false&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;sigurdur@ifconfig:~$ echo ${PIPESTATUS[1]}&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;1&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;You can also get the entire array&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span&gt;sigurdur@ifconfig:~$ true | false |false |true&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sigurdur@ifconfig:~$ echo ${PIPESTATUS[@]}&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0 1 1 0&lt;/span&gt;&lt;/blockquote&gt;A single, non-piped command is considered to be a &quot;pipe of one&quot;, thus leaving you with a $PIPESTATUS array with one value. Since $PIPESTATUS is updated after every command line I had to copy the array before extracting the exit values.&lt;br /&gt;&lt;div&gt;So my code ended up like this:&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;$MYSQLDUMP $MYSQLDUMP_OPTS $DB | gzip -9&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;# We want the exit values of both mysqldump and gzip&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;exitarray=(&quot;${PIPESTATUS[@]}&quot;)&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;mydumpexitcode=${exitarray[0]}&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span&gt;gzipexitcode=${exitarray[1]}&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;PIPESTATUS have probably been part of Bash since forever, but to me it was new - and it solved my problem. Fun stuff:-)&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/5442528832816583898-1573695140001675065?l=grandtidbits.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Sigurd Urdahl</name>
			<email>noreply@blogger.com</email>
			<uri>http://grandtidbits.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">Grand tidbits</title>
			<subtitle type="html">Here I'll stuff stuff I want to share.</subtitle>
			<link rel="self" href="http://grandtidbits.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-5442528832816583898</id>
			<updated>2012-05-17T02:40:40+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">dnstool - curses-based DNS zone administration</title>
		<link href="http://useofwords.blogspot.com/2012/02/dnstool-curses-based-dns-zone.html"/>
		<id>tag:blogger.com,1999:blog-660024223227219722.post-3443240555251026690</id>
		<updated>2012-02-06T15:27:00+00:00</updated>
		<content type="html">Out now! Get it while the bits are still hot!&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/Redpill-Linpro/dnstool&quot;&gt;https://github.com/Redpill-Linpro/dnstool&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Fine Manual is plain text and even has screenshots, perfect for the old-school lynx enthusiast ;)&lt;br /&gt;&lt;br /&gt;If your dns server supports RFC2136 dynamic updates, you might want to look at this. BIND9 does.&lt;br /&gt;&lt;br /&gt;Patches always welcome!&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/660024223227219722-3443240555251026690?l=useofwords.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content>
		<author>
			<name>Erik Inge Bolsø</name>
			<email>noreply@blogger.com</email>
			<uri>http://useofwords.blogspot.com/</uri>
		</author>
		<source>
			<title type="html">Use of words</title>
			<link rel="self" href="http://useofwords.blogspot.com/feeds/posts/default"/>
			<id>tag:blogger.com,1999:blog-660024223227219722</id>
			<updated>2012-05-17T02:40:40+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">pixie dust</title>
		<link href="http://kacper.blog.redpill-linpro.com/archives/420"/>
		<id>http://kacper.blog.redpill-linpro.com/archives/420</id>
		<updated>2012-02-02T00:20:13+00:00</updated>
		<content type="html">&lt;p&gt;we&amp;#8217;ve booted backtrack off usb before, now that&amp;#8217;s kinda&lt;br /&gt;
boring and installing backtrack onto the usb with unetbootin&lt;br /&gt;
is painfully slow and not the same as bootin strait off the&lt;br /&gt;
usb which is what we want in this case; not an install&lt;br /&gt;
but a fresh copy every boot&lt;/p&gt;
&lt;p&gt;there is someone disagreeing in the back of the room, now&lt;br /&gt;
wouldn&amp;#8217;t this be a lot more complicated? No sir. on the contrary&lt;br /&gt;
booting fresh every time makes work a lot simpler; you gain a&lt;br /&gt;
direct relationship to what you store where, and where you&lt;br /&gt;
access your data from&lt;/p&gt;
&lt;p&gt;but there is another one in the front;you sir, you feel that&lt;br /&gt;
one would have to sacrifice many of the comforts such as all&lt;br /&gt;
any tools of the trade at hand and permanent local storage -&lt;br /&gt;
but at best this is a lazy roadblock to salvation; by booting&lt;br /&gt;
off of local storage we have local storage at hand in a more&lt;br /&gt;
practical format, be that even a microscopic carrier can be&lt;br /&gt;
removed and replaced with sufficient storage for everything&lt;br /&gt;
and then some&lt;/p&gt;
&lt;p&gt;the medium can be embedded, destroyed or ingested, so&lt;br /&gt;
the impermiableness of accidentally recorded data and the&lt;br /&gt;
robustness, accessability and portability of removable storage&lt;br /&gt;
comes very much in hand upon situations that either require&lt;br /&gt;
inconspiciousness, anonymity, covertness, plausible deniability&lt;br /&gt;
or a high degree of reliability in day-to-day computing&lt;/p&gt;
&lt;p&gt;the totalality of the system given to remaining only in memory&lt;br /&gt;
causes it to be independent of other storage for operations, and when&lt;br /&gt;
operations cease from loss of any exterior preconditions, the&lt;br /&gt;
system simply ceases. when preconditions reoccur &amp;#8211; by powering on&lt;br /&gt;
and executing the first block &amp;#8211; the system can be relied upon to&lt;br /&gt;
simply starts afresh, completely unperturbed by any previous history&lt;/p&gt;
&lt;p&gt;should the need arise to patch the system; say some new app or&lt;br /&gt;
capability is called for where there is no time to rebuild,&lt;br /&gt;
a patch should be scripted always when there is certanity that&lt;br /&gt;
the capability will require a repeat performance. It is advised&lt;br /&gt;
to devise a patch which includes all dependencies.&lt;/p&gt;
&lt;p&gt;thus the fresh system becomes more capable and more accessible&lt;br /&gt;
over time, just like an install. patches can then easily be&lt;br /&gt;
rolled into the system should they proove useful to others.&lt;/p&gt;
&lt;p&gt;But how does one do it? Well, it&amp;#8217;s easy but unfortunately&lt;br /&gt;
not as easy as overwriting the boot device; it&amp;#8217;s just not&lt;br /&gt;
practical because partitioning is always an individual consideration&lt;/p&gt;
&lt;li&gt; . there are often other files on the block device&lt;/li&gt;
&lt;li&gt; . choice of filesystem and memory technology has much bearing&lt;/li&gt;
&lt;li&gt; . the block device is larger or smaller than expected&lt;/li&gt;
&lt;p&gt;instead, we allow any bootable partition scheme and any&lt;br /&gt;
filesystem and memory technology, as long as the storage&lt;br /&gt;
requirements of the system are met;&lt;/p&gt;
&lt;p&gt;here&amp;#8217;s to clone how:&lt;/p&gt;
&lt;pre&gt;cp -a boot/ apt/ casper/ gone/ preseed/ syslinux/
syslinux /dev/partition
mbr /dev/device
&lt;/pre&gt;
&lt;p&gt;but that&amp;#8217;s fine, it&amp;#8217;s been done and all, but even the ability to&lt;br /&gt;
boot the system with precisely zilch local storage comes in&lt;br /&gt;
handy, and for that we have pixie dust.&lt;/p&gt;
&lt;p&gt;pixie daemon and tiny ftp should be pointing a path&lt;br /&gt;
exactly matching the dhcp-provided patch.. otherwise&lt;br /&gt;
you will have worries!&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/pxe.conf:&lt;br /&gt;
&lt;/code&gt;
&lt;pre&gt;
interface=eth1
service=X86PC,0,0,local,Local boot
service=X86PC,0,0,pxelinux,PXELinux
tftpdbase=/var/lib/tftpboot
domain=truly.yours
&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;/etc/default/tftpd-hpa:&lt;br /&gt;
&lt;/code&gt;TFTP_DIRECTORY=&amp;#8221;/var/lib/tftpboot/&amp;#8221;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/dnsmasq.conf:&lt;br /&gt;
&lt;/code&gt;
&lt;pre&gt;
dhcp-boot=/var/lib/tftpboot/pxelinux,vulcano,10.10.10.86
&lt;/pre&gt;
&lt;p&gt;&amp;#8220;high speed&amp;#8221; tftp daemons and multicast can be found but it is&lt;br /&gt;
advised to stick to tftpd-hpa and dnsmasq with no esoterics due&lt;br /&gt;
to the sheer amount of variables introduced.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/var/lib/tftpboot/pxelinux.cfg/default:&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;
# not strictly necessary but makes the menu pretty
menu hshift 13
menu width 49
menu margin 8

menu title BackTrackBoot
default vesamenu.c32
display f.txt
timeout 600

label local
menu label Local Harddisk
localboot 0

menu begin bt
menu title BackTrack 5
# ok here comes the real shit
label backtrack5
menu label BackTrack R1
kernel bt5/vmlinuz
append boot=casper netboot=nfs nfsroot=vulcano:/mnt/bt5 initrd=bt5/initrd.gz text splash vga=791 file=/cdrom/preseed/custom.seed --
menu end
&lt;/pre&gt;
&lt;p&gt;you&amp;#8217;ll need to copy to tftpboot/bt5 the &lt;code&gt;initrd.gz&lt;/code&gt; and &lt;code&gt;vmlinuz&lt;/code&gt; from the backtrack ISO &lt;code&gt;/casper&lt;/code&gt; folder (which you can &lt;code&gt;mount -o loop -t iso9660 bt5.iso /mnt/bt5&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;the rest of the files you provide to the bootee over NFS&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/exports:&lt;br /&gt;
&lt;/code&gt;
&lt;pre&gt;
/mnt/bt5 10.10.3.0/24(rw,sync,no_subtree_check) 10.10.10.0/24(rw,sync,no_subtree_check)
mount -t iso9660 -o loop BT5R1-GNOME-32.iso /mnt/bt5
&lt;/pre&gt;
&lt;p&gt;add a http server with kickstart / preseed files for an ever more powerful setup,&lt;br /&gt;
in which case you replace the &lt;code&gt;file=&lt;/code&gt; stanza in the append line with&lt;br /&gt;
&lt;code&gt;url=http://host/path/to/preseed&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
more on preseeds&amp;#8230; maybe later.&lt;/p&gt;
&lt;p&gt;Now restart all dependent services:&lt;/p&gt;
&lt;pre&gt;
/etc/init.d/nfs-kernel-server restart
/etc/init.d/tftpd-hpa restart
/etc/init.d/apache2 restart
/etc/init.d/pxe restart
&lt;/pre&gt;
&lt;p&gt;debugging this setup usually requires tracing the process that is failing, so:&lt;br /&gt;
- dhcp options tracing (dnsmasq verbose and &lt;code&gt;tcpdump&lt;/code&gt; / wireshark)&lt;br /&gt;
- verbose pxe&lt;br /&gt;
- verbose foreground tftpd-hpa : &lt;code&gt;in.tftpd -v -v -L /var/lib/tftpboot&lt;/code&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</content>
		<author>
			<name>Kacper Wysocki</name>
			<uri>http://kacper.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">thefastestwaytobreakamachine</title>
			<subtitle type="html">purely for fun and profit</subtitle>
			<link rel="self" href="http://kacper.blog.redpill-linpro.com/feed"/>
			<id>http://kacper.blog.redpill-linpro.com/feed</id>
			<updated>2012-05-17T02:40:03+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Presentation: Writing modules for nginx</title>
		<link href="http://trygvevea.com/2012/02/01/presentation-writing-modules-for-nginx/"/>
		<id>http://trygvevea.com/?p=514</id>
		<updated>2012-02-01T08:55:09+00:00</updated>
		<content type="html">&lt;p&gt;I held a presentation at Redpill Linpros &amp;#8220;C / C++ / Embedded&amp;#8221; Competence Group-meeting yesterday.&lt;/p&gt;
&lt;p&gt;It was about writing modules for nginx.  It contains a lot of source code.  I believe it&amp;#8217;s an OK primer.&lt;/p&gt;
&lt;div id=&quot;__ss_11363830&quot;&gt; &lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/trygvevea/extending-functionality-in-nginx-with-modules&quot; title=&quot;Extending functionality in nginx, with modules!&quot; target=&quot;_blank&quot;&gt;Extending functionality in nginx, with modules!&lt;/a&gt;&lt;/strong&gt; 
&lt;div&gt; View more &lt;a href=&quot;http://www.slideshare.net/&quot; target=&quot;_blank&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/trygvevea&quot; target=&quot;_blank&quot;&gt;Trygve Vea&lt;/a&gt; &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The example code can be found on github.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/kvisle/nginx_module_samples&quot;&gt;https://github.com/kvisle/nginx_module_samples&lt;/a&gt;&lt;/p&gt;</content>
		<author>
			<name>Trygve Vea</name>
			<uri>http://trygvevea.com</uri>
		</author>
		<source>
			<title type="html">Trygve Vea is happy hacking :) » Planet Redpill-Linpro</title>
			<link rel="self" href="http://trygvevea.com/category/planet-redpill-linpro/feed/"/>
			<id>http://trygvevea.com/category/planet-redpill-linpro/feed/</id>
			<updated>2012-05-17T02:40:31+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Finding gaps in partitioned sequences</title>
		<link href="http://blog.hagander.net/archives/203-Finding-gaps-in-partitioned-sequences.html"/>
		<id>http://blog.hagander.net/archives/203-guid.html</id>
		<updated>2012-01-27T16:53:52+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;There are an almost unlimited number of articles on the web about how to find gaps in sequences in SQL. And it doesn't have to be very hard. Doing it in a &quot;partitioned sequence&quot; makes it a bit harder, but still not very hard. But when I turned to a window aggregate to do that, I was immediately told &quot;hey, that's a good example of a window aggregate to solve your daily chores, you should blog about that&quot;. So here we go - yet another example of finding a gap in a sequence using SQL.&lt;/p&gt;

&lt;p&gt;I have a database that is very simply structured - it's got a primary key made out of &lt;i&gt;(groupid, year, month, seq)&lt;/i&gt;, all integers. On top of that it has a couple of largish text fields and an fti field for full text search. (Initiated people will know right away which database this is). The sequence in the seq column resets to zero for each combination of &lt;i&gt;(groupid, year, month)&lt;/i&gt;. And I wanted to find out where there were gaps in it, and how big they were, to debug the tool that wrote the data into the database. This is really easy with a window aggregate:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;&lt;div class=&quot;geshi&quot;&gt;&lt;br /&gt;&lt;span&gt;SELECT&lt;/span&gt; * &lt;span&gt;FROM&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;br /&gt;   &lt;span&gt;SELECT&lt;/span&gt;&lt;br /&gt;      groupid,&lt;br /&gt;      year,&lt;br /&gt;      month,&lt;br /&gt;      seq, &lt;br /&gt;      seq-lag&lt;span&gt;(&lt;/span&gt;seq,&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; OVER &lt;span&gt;(&lt;/span&gt;PARTITION &lt;span&gt;BY&lt;/span&gt; groupid, year, month &lt;span&gt;ORDER&lt;/span&gt; &lt;span&gt;BY&lt;/span&gt; seq&lt;span&gt;)&lt;/span&gt; &lt;span&gt;AS&lt;/span&gt; gap &lt;span&gt;FROM&lt;/span&gt; mytable&lt;br /&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;AS&lt;/span&gt; t&lt;br /&gt;&lt;span&gt;WHERE&lt;/span&gt; &lt;span&gt;NOT&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;t.gap=&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;ORDER&lt;/span&gt; &lt;span&gt;BY&lt;/span&gt; groupid, year, month, seq&lt;br /&gt; &lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;One advantage to using a window aggregate for this is that we actually get the whole row back, and not just the primary key - so it's easy enough to include all the data you need to figure something out.&lt;/p&gt;

&lt;p&gt;What about performance? I don't really have a big database to test this on, so I can't say for sure. It's going to be a sequential scan, since I look at the &lt;i&gt;whole&lt;/i&gt; table,and not just parts of it. It takes about 4 seconds to run over a table of about a million rows, 2.7Gb, on a modest VM with no actual I/O capacity to speak of and a very limited amount of memory, returning about 100 rows. It's certainly by far fast enough for me in this case.&lt;/p&gt;

&lt;p&gt;And as a bonus, it found me two bugs in the loading script and at least one bug in somebody elses code that I'm now waiting on to get fixed...&lt;/p&gt;

 
            &lt;/div&gt;</content>
		<author>
			<name>Magnus Hagander</name>
			<uri>http://blog.hagander.net/</uri>
		</author>
		<source>
			<title type="html">Magnus Hagander's PostgreSQL blog</title>
			<link rel="self" href="http://blog.hagander.net/feeds/atom.xml"/>
			<id>http://blog.hagander.net/</id>
			<updated>2012-05-17T02:40:37+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">New Munin-plugin for HAProxy</title>
		<link href="http://trygvevea.com/2012/01/23/new-munin-plugin-for-haproxy/"/>
		<id>http://trygvevea.com/?p=499</id>
		<updated>2012-01-23T06:00:44+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://munin-monitoring.org/browser/trunk/plugins/node.d/haproxy_ng.in&quot;&gt;I committed a new Munin-plugin for HAProxy&lt;/a&gt;.  It&amp;#8217;s a multigraph plugin, it discovers all the configured frontends and backends automatically &amp;#8211; all you need to provide is the username/password for the haproxy status page.&lt;/p&gt;
&lt;p&gt;It produces 8 graphs, + subgraphs for some of the backends, where it presents the same graphs, but with server-specific metrics.&lt;/p&gt;
&lt;p&gt;Some of the root-graphs:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPActive-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPActive-day.png&quot; alt=&quot;&quot; title=&quot;HAPActive-day&quot; width=&quot;497&quot; height=&quot;311&quot; class=&quot;alignleft size-full wp-image-507&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPUptime-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPUptime-day.png&quot; alt=&quot;&quot; title=&quot;HAPUptime-day&quot; width=&quot;497&quot; height=&quot;311&quot; class=&quot;alignleft size-full wp-image-506&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPSessionsBack-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPSessionsBack-day.png&quot; alt=&quot;&quot; title=&quot;HAPSessionsBack-day&quot; width=&quot;497&quot; height=&quot;311&quot; class=&quot;alignleft size-full wp-image-505&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPErrorsBack-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPErrorsBack-day.png&quot; alt=&quot;&quot; title=&quot;HAPErrorsBack-day&quot; width=&quot;497&quot; height=&quot;311&quot; class=&quot;alignleft size-full wp-image-504&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPErrorsFront-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPErrorsFront-day.png&quot; alt=&quot;&quot; title=&quot;HAPErrorsFront-day&quot; width=&quot;497&quot; height=&quot;275&quot; class=&quot;alignleft size-full wp-image-503&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPBandwidthBack-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPBandwidthBack-day.png&quot; alt=&quot;&quot; title=&quot;HAPBandwidthBack-day&quot; width=&quot;497&quot; height=&quot;359&quot; class=&quot;alignleft size-full wp-image-502&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPBandwidthFront-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPBandwidthFront-day.png&quot; alt=&quot;&quot; title=&quot;HAPBandwidthFront-day&quot; width=&quot;497&quot; height=&quot;287&quot; class=&quot;alignleft size-full wp-image-501&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPSessionsFront-day.png&quot;&gt;&lt;img src=&quot;http://trygvevea.com/wp-content/uploads/2012/01/HAPSessionsFront-day.png&quot; alt=&quot;&quot; title=&quot;HAPSessionsFront-day&quot; width=&quot;497&quot; height=&quot;275&quot; class=&quot;alignleft size-full wp-image-500&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Do you use HAProxy and Munin? &lt;a href=&quot;http://munin-monitoring.org/browser/trunk/plugins/node.d/haproxy_ng.in&quot;&gt;Check it out&lt;/a&gt;! &lt;/p&gt;</content>
		<author>
			<name>Trygve Vea</name>
			<uri>http://trygvevea.com</uri>
		</author>
		<source>
			<title type="html">Trygve Vea is happy hacking :) » Planet Redpill-Linpro</title>
			<link rel="self" href="http://trygvevea.com/category/planet-redpill-linpro/feed/"/>
			<id>http://trygvevea.com/category/planet-redpill-linpro/feed/</id>
			<updated>2012-05-17T02:40:31+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Finding what binaries to restart</title>
		<link href="http://ingvar.blog.redpill-linpro.com/2012/01/19/finding-what-binaries-to-restart/"/>
		<id>http://ingvar.blog.redpill-linpro.com/2012/01/19/</id>
		<updated>2012-01-19T21:39:06+00:00</updated>
		<content type="html">&lt;p&gt;When I started working with Linux system administration a few years ago, restarting services after a package upgrade was fairly easy. If the package didn&amp;#8217;t restart itself, one could always ask lsof for help:&lt;/p&gt;
&lt;pre&gt;
lsof +L1 | egrep 'bin/|lib/'
&lt;/pre&gt;
&lt;p&gt;Now, on later Linux distributions, the usage of &lt;a href=&quot;http://en.wikipedia.org/wiki/Prelink&quot;&gt;prelink&lt;/a&gt; has changed this, so one usually gets a lot of false positives, and could never trust the result of that good old lsof output.&lt;/p&gt;
&lt;p&gt;Finding running executables is possible using some perl magic (Yes, I&amp;#8217;m pretty sure you perl guys can write this more compressed) along the lines of this, at least on RHEL5:&lt;/p&gt;
&lt;pre&gt;
perl -e ' for $i (glob &quot;/proc/[1-9]*/exe&quot;) { $f=readlink $i; if ( $f=~ /([^&amp;#092;0]+)&amp;#092;0.*deleted/ ) { print &quot;$1\n&quot; }} ' | sort | uniq
&lt;/pre&gt;
&lt;p&gt;But this won&amp;#8217;t help us finding what service to restart after a dependency library was updated. So I finally wrote this script to help me. My boxes are mostly Fedora and RHEL, so it uses the fact that installed binaries on Red Hat based systems have installation time stored in the rpm database (rpm tag %{INSTALLTIME} ). This script abuses rpm heavily, and may use some time to finish on a busy system.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://users.linpro.no/ingvar/check_newlibs&quot;&gt;http://users.linpro.no/ingvar/check_newlibs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Test run:&lt;/p&gt;
&lt;pre&gt;
[root]# /home/ingvar/check_newlibs
Warning: Needs restart: /sbin/agetty, pids 6067
Warning: Needs restart: /usr/bin/tail, pids 7315
Warning: Needs restart: /usr/bin/vim, pids 19759
Warning: Needs restart: /usr/sbin/sendmail.sendmail, pids 10645 10637
Warning: Needs restart: /usr/sbin/acpid, pids 5259
Warning: Needs restart: /usr/sbin/crond, pids 5567
Warning: Needs restart: /bin/bash, pids 26074 17731 16848 15718 30753 6120 32704
Warning: Needs restart: /sbin/mingetty, pids 6071 6069 6076 6068 6072 6070
Warning: Needs restart: /sbin/portmap, pids 5082
Warning: Needs restart: /usr/sbin/smartd, pids 20948
Warning: Needs restart: /sbin/multipathd, pids 20170
Warning: Needs restart: /usr/sbin/atd, pids 5969
Warning: Needs restart: /usr/sbin/sshd, pids 19863
Warning: Needs restart: /usr/libexec/mysqld, pids 17775
&lt;/pre&gt;</content>
		<author>
			<name>Ingvar Hagelund</name>
			<uri>http://ingvar.blog.redpill-linpro.com</uri>
		</author>
		<source>
			<title type="html">On the third side » comp</title>
			<subtitle type="html">Lamentation and praise - almost never in rhyme</subtitle>
			<link rel="self" href="http://ingvar.blog.redpill-linpro.com/category/comp/feed/"/>
			<id>http://ingvar.blog.redpill-linpro.com/category/comp/feed/</id>
			<updated>2012-05-17T02:40:39+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">PassiveDNS 0.2.9</title>
		<link href="http://www.gamelinux.org/?p=519"/>
		<id>http://www.gamelinux.org/?p=519</id>
		<updated>2012-01-17T15:17:07+00:00</updated>
		<content type="html">&lt;p&gt;I added some features and changes to PassiveDNS. The most important change is that the output now contains the &lt;strong&gt;TTL&lt;/strong&gt; value, so you &lt;strong&gt;need&lt;/strong&gt; to use the current tools/* (if you use them) as they are also changed to work with this new output format (or update your own tools).&lt;/p&gt;
&lt;p&gt;I also added the ability to specify the DNS record types that you want to log from the command line and I added support for more record types. PassiveDNS now should be able to track:  &lt;strong&gt;A, AAAA, CNAME, DNAME, NAPTR, SOA, PTR, RP, SRV, TXT, MX and NS.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Support for &lt;strong&gt;chroot&lt;/strong&gt; and &lt;strong&gt;dropping privileges&lt;/strong&gt; are also added.&lt;/p&gt;
&lt;p&gt;I also added some features to &lt;strong&gt;tools/pdns2db.pl&lt;/strong&gt; while I was at it:&lt;br /&gt;
&lt;strong&gt;1)&lt;/strong&gt; You can now process a passivedns.log file in &amp;#8220;batch&amp;#8221; mode, exiting when finished.&lt;br /&gt;
&lt;strong&gt;2)&lt;/strong&gt; You can now specify a file with a list of domains or IPs to skip insertion to the DB.&lt;br /&gt;
&lt;strong&gt;3)&lt;/strong&gt; You can now specify a file with a list of PCRE (Perl Compatible Regular Expressions) of &amp;#8220;domains/IPs&amp;#8221; to skip insertion to the DB.&lt;br /&gt;
&lt;strong&gt;4)&lt;/strong&gt; You can now specify a file with a list of domains or IPs to alert on!&lt;br /&gt;
&lt;strong&gt;5)&lt;/strong&gt; You can now specify a file with a list of PCRE of &amp;#8220;domains/IPs&amp;#8221; to alert on!&lt;br /&gt;
&lt;strong&gt;6)&lt;/strong&gt; You can now specify a file with a list of domains to whitelist and not alert on.&lt;br /&gt;
&lt;strong&gt;7)&lt;/strong&gt; You can now specify a file with a list of PCRE of &amp;#8220;domains/IPs&amp;#8221; to whitelist and not alert on.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;skiplists&lt;/strong&gt; will be checked first, and if the domain/IP is found/matched there, whitelist and blacklist will be ignored and insertion to DB will be ignored.&lt;/p&gt;
&lt;p&gt;Next the &lt;strong&gt;whitelists&lt;/strong&gt; will be checked, and if a domain/IP is found there or match a PCRE that you have defined it will not be checked by the blacklist.&lt;/p&gt;
&lt;p&gt;Last the &lt;strong&gt;blacklists&lt;/strong&gt; is checked, and if a domain/IP is found there or match a PCRE that you have defined, it will write the PassiveDNS record to the alert file that you specify (Default: /var/log/passivedns-alert.log).&lt;/p&gt;
&lt;p&gt;There are different sources for getting lists of known bad domains. Here is one if you want to test the blacklist functionality: &lt;a href=&quot;http://isc.sans.edu/feeds/suspiciousdomains_High.txt&quot;&gt;http://isc.sans.edu/feeds/suspiciousdomains_High.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Im pretty far as what it comes to planed features at this stage. Please try out PassiveDNS and beat the crap out of it &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;  I will probably &amp;#8220;up&amp;#8221; the version to &lt;strong&gt;0.5.0&lt;/strong&gt; soon and from there on, it is just testing and testing and more testing before it will be a &amp;#8220;&lt;strong&gt;one dot O&lt;/strong&gt;&amp;#8221; release.&lt;/p&gt;
&lt;p&gt;If you have any issues with PassiveDNS, please submit them &lt;a href=&quot;https://github.com/gamelinux/passivedns/issues&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content>
		<author>
			<name>Edward Bjarte Fjellskål</name>
			<uri>http://www.gamelinux.org</uri>
		</author>
		<source>
			<title type="html">Work Together For The Benefit Of All ManKind... » OpenSourceSoftware</title>
			<subtitle type="html">OSS and Security @ WORK</subtitle>
			<link rel="self" href="http://www.gamelinux.org/?feed=rss2&amp;cat=3"/>
			<id>http://www.gamelinux.org/?feed=rss2&amp;cat=3</id>
			<updated>2012-05-17T02:40:27+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">PRADS, and how it compares to pads and p0fv2 and p0fv3</title>
		<link href="http://www.gamelinux.org/?p=485"/>
		<id>http://www.gamelinux.org/?p=485</id>
		<updated>2012-01-12T10:49:01+00:00</updated>
		<content type="html">&lt;p&gt;The question was brought up to me late last night on IRC, as &lt;a href=&quot;http://lcamtuf.coredump.cx/p0f3/&quot;&gt;p0fv3&lt;/a&gt; RC was recently &lt;a href=&quot;http://www.securityfocus.com/archive/1/521169&quot;&gt;announced&lt;/a&gt;.  This is a short answer to that question:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;#8220;People that find the PRADS page and already know p0f or pads may be interested in a comparison or essentially arguments why you would use one over the other.&amp;#8221;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;First off, its exiting to see Michal Zalewski back with p0fv3 &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;  I quickly read through his code yesterday and tested it out, and its rather interesting how he solves things. The fingerprint database at the moment is limited, but expect that to grow in the near future. I also love his non formal output in his applications &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;&lt;strong&gt;[PRADS vs PADS]&lt;/strong&gt;&lt;br /&gt;
So, back to the questions. First off, pads &amp;#8220;Passive Asset Detection System&amp;#8221; uses regexp syntax to look for common bytes in payload to identify server application. So if the server says &amp;#8221; Server: Apache/2.2.3 (Linux/SUSE)&amp;#8221; that is collected as what service is running on the server port where this was detected. The &amp;#8220;rules&amp;#8221; can be written more specifically for each server software, but are rather general and small today. Some pads &amp;#8220;rules&amp;#8221; look for ASCII strings, and some for different bytes in hex etc. to identify stuff like SSL/TLS. Pads is no longer actively developed by the original author, but I do maintain a &lt;a href=&quot;https://github.com/gamelinux/pads&quot;&gt;fork of the last version&lt;/a&gt; with enhancements added.&lt;/p&gt;
&lt;p&gt;PRADS extended the way pads does asset detection. We have build in IPv6 support in PRADS, so it also detects asset listening on IPv6 addresses. We also have build in connection tracking, so that we can cut off detection in a stream after an amount of packets or bytes seen from the client or server. This to drop trying to look for server/client assets in connections that transfers big files or are encrypted etc. Most &amp;#8220;banners/identifiers&amp;#8221; are in the first  packet etc. so limiting for how many packets in a stream to do detection on helps on performance etc.&lt;/p&gt;
&lt;p&gt;To extend pads a bit, we also added detection for client applications using the same method as for detecting server applications.&lt;/p&gt;
&lt;p&gt;My future thoughts on enhancing the pads/PRADS asset rules are to make them more like the Snort/Suricata rule language and use fast pattern matching before invoking the pcre method etc. Pads does no OS fingerprinting per say btw.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[PRADS vs p0f]&lt;/strong&gt;&lt;br /&gt;
PRADS tcp fingerprinting was based on the p0fv2 way as p0f had the fingerprint DB and we thought that reusing the fingerprints would make it easier for people to migrate if they wanted, instead of recollecting and adding fingerprints. PRADS also added some touches of its own (for IPv6 etc) and the way we match the fingerprints (and fuzzing). We have thought about extending the fingerprints and re-write them, but thats in the future. Right now they are doing a good job. We also added all the p0fv2 ways of fingerprinting to the whole tcp session, from the syn to the rst/fin. p0fv2 could just use one method at a time, depending on how you started p0fv2. PRADS outputs all the info it gathers, and leaves the final correlation to the end user/program etc. A good example on that is &lt;strong&gt;prads-asset-report&lt;/strong&gt; and &lt;strong&gt;prads2snort&lt;/strong&gt;, which ads wight to each type of fingerprints, ranging the syn and syn+ack higher than stray-ack, rst and fin etc. You can also base the final guess on client or server applications to, say if the User-Agent contains: &amp;#8220;Linux&amp;#8221; or &amp;#8220;Windows NT 6.1&amp;#8243; or &amp;#8220;Macintosh; Intel Mac OS X 10.7&amp;#8243; etc.&lt;br /&gt;
or if the Server string of the web server is: &amp;#8220;Microsoft-IIS 6.0&amp;#8243; or &amp;#8220;Apache 2.2.15 (FreeBSD)&amp;#8221; or &amp;#8220;Apache 2.2.3 (Red Hat)&amp;#8221; etc.&lt;/p&gt;
&lt;p&gt;The p0fv3 tcp fingerprints are new in the way they are written. A new fingerprint file format, that makes it easy to add different types of fingerprints into one and same file (TCP/HTTP/SMTP etc). The most significant enhancement in the TCP fingerprints that I see is the MSS and MTU multiplier field. p0fv3 also detects new quirks not measured in p0fv2. The rules are now also more human readable, Example:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
# RULE&lt;br /&gt;
label = s:unix:Linux:2.6.x&lt;br /&gt;
sig   = *:64:0:*:mss*4,6:mss,sok,ts,nop,ws:df,id+:0&lt;/p&gt;
&lt;p&gt;# Will match:&lt;br /&gt;
.-[ X.X.X.X/58435 -&gt; Y.Y.Y.Y/22 (syn) ]-&lt;br /&gt;
|&lt;br /&gt;
| client   = X.X.X.X/58435&lt;br /&gt;
| os       = Linux 2.6.x&lt;br /&gt;
| dist     = 9&lt;br /&gt;
| params   = none&lt;br /&gt;
| raw_sig  = 4:55+9:0:1460:mss*4,6:mss,sok,ts,nop,ws:df,id+:0&lt;br /&gt;
|&lt;br /&gt;
`&amp;#8212;-
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The way the tcp fingerprints are matched are also changed a bit, and I believe Michal Zalewski has done this for good reasons and that it will enhance the detection.&lt;/p&gt;
&lt;p&gt;Beside the new tcp fingerprint changes, p0fv3 also has application layer detection added. I looked at the HTTP stuff, and p0fv3 matches also on the HTTP header order and dont blindly trust the User-Agent, as we do in PRADS. We have thought about extending the &amp;#8220;rule/signature&amp;#8221; in PRADS to be more Snort/Suricata like, so you can have more content matches etc, but more accuracy can be achieved today using the pcre language, to verify header order etc, before blindly trusting the UA, but pcre is way too expensive used alone I think, so organizing the signatures/rules better internally and having something like a fast_pattern matcher would help alot. Quick pcre example for a User-Agent with specific HTTP header order:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
# Detects Firefox/3.6.X with HTTP header order to add confidence in the match.&lt;br /&gt;
# PRADS rule:&lt;br /&gt;
http,v/MFF 3.6.X/$1//,\r\nHost: .*\r\nUser-Agent: Mozilla\/5\.0 (.*Firefox\/3\.6\..*)\r\nAccept: .*\r\nAccept-Language: .*\r\nAccept-Encoding: .*\r\nAccept-Charset:
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Running it in PRADS on an old pcap gives me:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
# Client IPs deducted just to be kind&lt;br /&gt;
[client:MFF 3.6.X (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.:80:6],[distance:8]&lt;br /&gt;
[client:MFF 3.6.X (X11; U; Linux x86_64; en-GB; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.10 (maverick) Firefox:80:6],[distance:11]&lt;br /&gt;
[client:MFF 3.6.X (Windows; U; Windows NT 5.1; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.:80:6],[distance:10]&lt;br /&gt;
[client:MFF 3.6.X (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR :80:6],[distance:14]&lt;br /&gt;
[client:MFF 3.6.X (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Linux Mint/10 (Julia) Firefox/3:80:6],[distance:15]&lt;br /&gt;
[client:MFF 3.6.X (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.10 (maverick) Firefox:80:6],[distance:9]&lt;br /&gt;
[client:MFF 3.6.X (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12:80:6],[distance:6]&lt;br /&gt;
[client:MFF 3.6.X (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6:80:6],[distance:12]&lt;br /&gt;
[client:MFF 3.6.X (Windows; U; Windows NT 6.1; es-ES; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12:80:6],[distance:14]&lt;br /&gt;
[client:MFF 3.6.X (X11; U; Linux x86_64; en-US; rv:1.9.2.10) Gecko/20101005 Fedora/3.6.10-1.fc14 Firefox/3.:80:6],[distance:8]&lt;br /&gt;
[client:MFF 3.6.X (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.:80:6],[distance:12]
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Not the whole User-Agent is grabbed, and we need to extend that in the future. But the pcre language makes it possible to match on as much content as you want, to have the confidence you need in your signatures/rules for detecting assets. PRADS looks for client and server applications on all ports and both UDP and TCP and for IPv4 and IPv6.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[PRADS vs The World]&lt;/strong&gt;&lt;br /&gt;
Right now we are working on adding the DHCP OS fingerprinting and ICMP OS fingerprinting. DHCP is pushed to the git master on github but is not fully integrated into the PRADS core yet, but printing and matching is working, so you can help add fingerprints if you want &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; . The ICMP part is tricky as I want to fingerprint on the protocol layer, and also the payload, so I kind of have to combine the p0f way with the pads way of detecting and matching.&lt;/p&gt;
&lt;p&gt;PRADS has also lots of other stuff, like connection tracking/Flow gathering with output compatible with cxtracker and sancp. I have also been working on my &lt;a href=&quot;https://github.com/gamelinux/passivedns&quot;&gt;passivedns&lt;/a&gt; project, and I tend to port the relevant function over to PRADS, so we can have domain names mapped with assets to.&lt;/p&gt;
&lt;p&gt;p0fv3 has an API so you can talk to it, to fetch relevant info about the IPs it knows about. I see p0fv3 with this functionality aimed at mail and web servers etc, to determine if this is spam or ham stuff coming its way, but you can use it in lots of cool ways.&lt;br /&gt;
I know PRADS is used in much the same way from people I have talked too. An example that Kacper put up can be found on &lt;a href=&quot;http://prads.delta9.pl/&quot;&gt;http://prads.delta9.pl/&lt;/a&gt;. On the road map for upcoming PRADS releases, we have access to assets via shared memory. That will make it easier for extracting info from the running PRADS process that is current. PRADS also ships with &lt;strong&gt;prads2db.pl&lt;/strong&gt; which parses a prads asset log-file and inserts the info to a DB so you can query it for info.&lt;/p&gt;
&lt;p&gt;PRADS philosophy is something like: &amp;#8220;If it can be detect passively, PRADS should probably do it.&amp;#8221;&lt;/p&gt;
&lt;p&gt;So if you are comparing for deciding which application to go for, I would say use them all, and correlate the the knowledge that each tool gives you. You can even add the output from the active fingerprinting tool &lt;a href=&quot;http://nmap.org/&quot;&gt;nmap&lt;/a&gt; into the mix.&lt;/p&gt;
&lt;p&gt;That said, much of my view on PRADS comes from that I use it in my Network Security Monitoring setup and from my wish to &amp;#8220;know as much as possible about my assets&amp;#8221;. If you have any wishes or suggestions, god or bad etc, feel free to contact us.&lt;/p&gt;
&lt;p&gt;E&lt;/p&gt;</content>
		<author>
			<name>Edward Bjarte Fjellskål</name>
			<uri>http://www.gamelinux.org</uri>
		</author>
		<source>
			<title type="html">Work Together For The Benefit Of All ManKind... » OpenSourceSoftware</title>
			<subtitle type="html">OSS and Security @ WORK</subtitle>
			<link rel="self" href="http://www.gamelinux.org/?feed=rss2&amp;cat=3"/>
			<id>http://www.gamelinux.org/?feed=rss2&amp;cat=3</id>
			<updated>2012-05-17T02:40:27+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Suricata and some phun with flowints</title>
		<link href="http://www.gamelinux.org/?p=403"/>
		<id>http://www.gamelinux.org/?p=403</id>
		<updated>2012-01-09T07:09:06+00:00</updated>
		<content type="html">&lt;p&gt;I have been looking into malware traffic that is hard to make signatures for in a &amp;#8220;regular&amp;#8221; way. I&amp;#8217;m not a malware reverser, so I don&amp;#8217;t dig into a malware to determine byte-testes and jumps etc. in binary protocols. This lead me to use a lot of flowbits at first, for making my sigs, but the performance in &lt;a href=&quot;http://www.snort.org/&quot;&gt;Snort&lt;/a&gt; and &lt;a href=&quot;http://www.openinfosecfoundation.org/index.php/download-suricata&quot;&gt;Suricata&lt;/a&gt; was &amp;#8220;crap&amp;#8221; to say it nice. So I talked to &lt;em&gt;Victor Julien&lt;/em&gt;, lead programmer of Suricata, discussing implementing packet and byte counting in Suricata. I want to count each packet sent by a client and server and the total amount of bytes sent by client and server. Talking back and forth, Victor convinced me that I might be best to go for byte count  for reassembled streams. So I added a &lt;a href=&quot;https://redmine.openinfosecfoundation.org/issues/294&quot;&gt;feature request&lt;/a&gt; to Suricata. I since then updated the feature request to add the packet and byte counters, as I think they will do great use.&lt;/p&gt;
&lt;p&gt;Talking to &lt;em&gt;Matt Jonkman&lt;/em&gt; (&lt;a href=&quot;http://www.emergingthreatspro.com/&quot;&gt;Emerging Threats Pro&lt;/a&gt;), he pointed me to &lt;strong&gt;&lt;em&gt;&lt;a href=&quot;https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Flowint&quot;&gt;flowint&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt; in Suricata to try to solve my packet counting. So in &lt;strong&gt;Suricata 1.1.1&lt;/strong&gt;, you can do something like this to initialize the packet counters:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
# Initialize the packet counter (Suricata 1.1.1 and some older versions)&lt;br /&gt;
#alert ip $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;Generic Client Established Flow IP Packet Counter set&amp;#8221;; flow:established,from_client; &lt;strong&gt;flowint:client_packet,notset; flowint:client_packet,=,0; &lt;/strong&gt;flowbits:noalert; classtype:not-suspicious; sid:1; rev:1;)&lt;/p&gt;
&lt;p&gt;#alert ip $EXTERNAL_NET any -&gt; $HOME_NET any (msg:&amp;#8221;Generic Server Established Flow IP Packet Counter set&amp;#8221;; flow:established,from_server; &lt;strong&gt;flowint:server_packet,notset; flowint:server_packet,=,0;&lt;/strong&gt; flowbits:noalert; classtype:not-suspicious; sid:2; rev:1;)
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;In &lt;strong&gt;Suricata 1.2dev&lt;/strong&gt; (rev 4c1e417) (I did my test for the blog on this version) and newer, you dont need to initialize the counter, as it will &lt;em&gt;automagical&lt;/em&gt; be initialized to zero, so you don&amp;#8217;t need sid:1 and sid:2:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
## Generic packet counter: (This could be better done internally in Suricata/Snort? and not with rules?)&lt;br /&gt;
alert ip $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;Generic Client Established Flow IP Packet Counter&amp;#8221;; flow:established,from_client; &lt;strong&gt;flowint:client_packet,+,1;&lt;/strong&gt; flowbits:noalert; classtype:not-suspicious; sid:3; rev:1;)&lt;/p&gt;
&lt;p&gt;alert ip $EXTERNAL_NET any -&gt; $HOME_NET any (msg:&amp;#8221;Generic Server Established Flow IP Packet Counter&amp;#8221;; flow:established,from_server; &lt;strong&gt;flowint:server_packet,+,1;&lt;/strong&gt; flowbits:noalert; classtype:not-suspicious; sid:4; rev:1;)
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So, what can you do with packet counters?&lt;/p&gt;
&lt;p&gt;First off, lets look at some generic rules I made up to test with, which basically should limit the detections in streams to the first 29 packets from the client:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
# GENERiC GET&lt;br /&gt;
alert http $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;GENERIC GET (classic)&amp;#8221;; flow:from_client,established; content:&amp;#8221;GET &amp;#8220;; depth:4; content:!&amp;#8221;connection: keep-alive&amp;#8221;; nocase; http_header; classtype:not-suspicious; sid:5; rev:1;)&lt;/p&gt;
&lt;p&gt;alert http $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;GENERIC GET (&lt;strong&gt;flowint&lt;/strong&gt;)&amp;#8221;; flow:from_client,established; &lt;strong&gt;flowint:client_packet,,30;&lt;/strong&gt; content:&amp;#8221;GET &amp;#8220;; depth:4; content:!&amp;#8221;connection: keep-alive&amp;#8221;; nocase; http_header; classtype:not-suspicious; sid:6; rev:1;)&lt;/p&gt;
&lt;p&gt;# GENERiC UA&lt;br /&gt;
alert http $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;GENERIC User-Agent (classic)&amp;#8221;; flow:from_client,established; content:&amp;#8221;User-Agent: &amp;#8220;; http_header; content:!&amp;#8221;connection: keep-alive&amp;#8221;; nocase; http_header; classtype:not-suspicious; sid:7; rev:1;)&lt;/p&gt;
&lt;p&gt;alert http $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;GENERIC User-Agent (&lt;strong&gt;flowint&lt;/strong&gt;)&amp;#8221;; flow:from_client,established; &lt;strong&gt;flowint:client_packet,,30;&lt;/strong&gt; content:&amp;#8221;User-Agent: &amp;#8220;; http_header; content:!&amp;#8221;connection: keep-alive&amp;#8221;; nocase; http_header; classtype:not-suspicious; sid:8; rev:1;)
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Sid 5 and 6 looks for a HTTP GET request that is not a HTTP keep-alive. Sid 7 and 8 is looking for User-Agent in non HTTP keep-alive request. Common for the flowint versions of the rules, are that they are just limited to the first 29 packets in an established flow. So running Suricata against &lt;a href=&quot;http://www.itoc.usma.edu/research/dataset/data/2009-04-20-09-05-46.dmp&quot;&gt;2009-04-20-09-05-46.dmp&lt;/a&gt; etc. shows some interesting results:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
   Num      Rule         Gid      Rev      &lt;strong&gt;Ticks&lt;/strong&gt;        %      &lt;strong&gt;Checks   Matches&lt;/strong&gt;  Max Ticks   &lt;strong&gt;Avg Ticks&lt;/strong&gt;   Avg Match   Avg No Match&lt;br /&gt;
  &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;&lt;br /&gt;
  1        4            1        1        1695335708   67.74  510720   510720   6412616     3319.50     3319.50     0.00&lt;br /&gt;
  2        3            1        1        581354624    23.23  508970   82175    3602972     1142.22     3061.99     772.59&lt;br /&gt;
  3        7            1        1        135943292    5.43   7900     2352     499972      17208.01    16156.62    17653.74&lt;br /&gt;
  4        &lt;strong&gt;5&lt;/strong&gt;            1        1        &lt;strong&gt;43040648&lt;/strong&gt;     1.72    &lt;strong&gt;3313    2517&lt;/strong&gt;     199052      &lt;strong&gt;12991.44&lt;/strong&gt;    16247.74    2694.82&lt;br /&gt;
  5        8            1        1        29172972     1.17   7900     2352     434592      3692.78     6588.51     2465.18&lt;br /&gt;
  6        &lt;strong&gt;6&lt;/strong&gt;            1        1        &lt;strong&gt;17917112&lt;/strong&gt;     0.72   &lt;strong&gt;3313     2517&lt;/strong&gt;     353684      &lt;strong&gt;5408.12&lt;/strong&gt;     6528.93     1864.06
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Sorry for the formating &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;br /&gt;
First, if we look at sid 5 and 6, we see that they both where checked 3313 times, and matched 2517 times. If we look at total ticks, sid 5 uses 43040648 ticks and sid 6 (flowint) uses 17917112 ticks. Average ticks for sid 5 is 12991.44 ticks and 5408.12 ticks for sid 6 (flowint).&lt;/p&gt;
&lt;p&gt;Looking at sid 7 and 8, we see that they both where checked 7900 times, and matched 2352 times. If we look at total ticks, sid 7 uses 135943292 ticks and sid 8 (flowint) uses 29172972 ticks. Average ticks for sid 7 is 17208.01 ticks and 3692.78 ticks for sid 8 (flowint).&lt;/p&gt;
&lt;p&gt;A basic conclusion for &lt;em&gt;this&lt;/em&gt; test, is that the rules with the flowint check are faster and will give you the same alerts.&lt;br /&gt;
But if we look at the ticks sid 3 and 4 uses to count the all the packets, they are high in total, but low on average ticks. So they are not expensive for each check, but since they are checked (and possibly incremented) for each packet, the total ticks are relative high. Having this in the core of Suricata and Snort, would probably make them less expensive (hint hint).&lt;/p&gt;
&lt;p&gt;So what more c00l stuff can we do with packet counters?&lt;/p&gt;
&lt;p&gt;Some malware I stumbled upon will give you an example (Mostly used in the &lt;a href=&quot;http://www.techrepublic.com/blog/10things/the-top-10-spam-botnets-new-and-improved/1373&quot;&gt;Gheg Spam bot&lt;/a&gt;, aka Tofsee/Mondera)&lt;br /&gt;
&lt;a href=&quot;http://www.xandora.net/xangui/malware/view/b31e4624cdc45655b468921823e1b72b&quot;&gt;b31e4624cdc45655b468921823e1b72b&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.virustotal.com/file-scan/report.html?id=42bf415e9c76e36efad53fdda4b1fca704d6d0972a0f4800a0a6518f0f8bb52e-1295099162&quot;&gt;3c453e40ff63da3c2a914c29b6c62ee0&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.threatexpert.com/report.aspx?md5=e8034335afb724d8fe043166ba57cd23&quot;&gt;e8034335afb724d8fe043166ba57cd23&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It seems to communicate in a binary way (encrypted), but looking at 5 different pcaps I got, I saw a pattern and my flowint counters came to good use. It seems like the client and server sends packets with a specific payload size in different parts of the communication. I did not see any obvious content to match on, so content matches didn&amp;#8217;t seem trivial, and this is a great way to demonstrate my point: Flowint+packet counters to the rescue! Here is a tcpdump output of traffic on port 443 (not including the port 22050 traffic, which is much longer, but the start is the same), so you can see the packets sizes and in which order they do come in this short sessions:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
reading from file b31e4624cdc45655b468921823e1b72b.pcap, link-type EN10MB (Ethernet)&lt;br /&gt;
03:47:02.571111 IP 192.168.1.10.1031 &gt; 216.246.8.230.443: Flags [S], seq 910650996, win 65535, options [mss 1460,nop,nop,sackOK], length 0&lt;br /&gt;
03:47:02.608784 IP 216.246.8.230.443 &gt; 192.168.1.10.1031: Flags [S.], seq 442582883, ack 910650997, win 5840, options [mss 1380,nop,nop,sackOK], length 0&lt;br /&gt;
03:47:02.608977 IP 192.168.1.10.1031 &gt; 216.246.8.230.443: Flags [.], ack 1, win 65535, length 0&lt;br /&gt;
03:47:02.646959 IP 216.246.8.230.443 &gt; 192.168.1.10.1031: Flags [P.], seq 1:201, ack 1, win 5840, &lt;strong&gt;length 200&lt;/strong&gt;&lt;br /&gt;
03:47:02.647342 IP 192.168.1.10.1031 &gt; 216.246.8.230.443: Flags [P.], seq 1:142, ack 201, win 65335, &lt;strong&gt;length 141&lt;/strong&gt;&lt;br /&gt;
03:47:02.685098 IP 216.246.8.230.443 &gt; 192.168.1.10.1031: Flags [.], ack 142, win 6432, length 0&lt;br /&gt;
03:47:02.718986 IP 216.246.8.230.443 &gt; 192.168.1.10.1031: Flags [P.], seq 201:676, ack 142, win 6432, &lt;strong&gt;length 475&lt;/strong&gt;&lt;br /&gt;
03:47:02.718999 IP 216.246.8.230.443 &gt; 192.168.1.10.1031: Flags [F.], seq 676, ack 142, win 6432, length 0&lt;br /&gt;
03:47:02.719268 IP 192.168.1.10.1031 &gt; 216.246.8.230.443: Flags [.], ack 677, win 64860, length 0&lt;br /&gt;
03:47:02.719584 IP 192.168.1.10.1031 &gt; 216.246.8.230.443: Flags [F.], seq 142, ack 677, win 64860, length 0&lt;br /&gt;
03:47:02.757350 IP 216.246.8.230.443 &gt; 192.168.1.10.1031: Flags [.], ack 143, win 6432, length 0
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;And here is how I sigged it:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
# Backdoor:Win32/Tofsee (aka: Gheg / Mondera)&lt;br /&gt;
alert tcp $EXTERNAL_NET any -&gt; $HOME_NET any (msg:&amp;#8221;Possible Tofsee server Packet 2 (200 Bytes)&amp;#8221;; flow:established,from_server; &lt;strong&gt;flowint:server_packet,=,2; dsize:200; &lt;/strong&gt;flowbits:set,Tofsee_SERVER_200; flowbits:noalert; classtype:trojan-activity; sid:9; rev:1;)&lt;/p&gt;
&lt;p&gt;alert tcp $HOME_NET any -&gt; $EXTERNAL_NET any (msg:&amp;#8221;Possible Tofsee client Packet 3 (141 Bytes)&amp;#8221;; flow:established,from_client; &lt;strong&gt;flowint:client_packet,=,3; dsize:141;&lt;/strong&gt; flowbits:isset,Tofsee_SERVER_200; flowbits:set,Tofsee_CLIENT_141; flowbits:noalert; classtype:trojan-activity; sid:10; rev:1;)&lt;/p&gt;
&lt;p&gt;alert tcp $EXTERNAL_NET any -&gt; $HOME_NET any (msg:&amp;#8221;Possible Tofsee server Packet 4(475 Bytes)&amp;#8221;; flow:established,from_server; &lt;strong&gt;flowint:server_packet,=,4; dsize:475; &lt;/strong&gt;flowbits:isset,Tofsee_CLIENT_141; classtype:trojan-activity; sid:11; rev:1;)
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Sid 9 looks only for the 2. packet in an established flow from the Server (C&amp;#038;C) and the packet has to have payload size/dsize 200. It then sets the flowbit Tofsee_SERVER_200 if this hits and the rule has noalert, because this could easily trigger a false positive just this check. So we got to do some more checks. Sid 10 checks only Client packet 3, it has to have a payload size/dsize of 141 and flowbit Tofsee_SERVER_200 has to be set for this too match. Sid 10 is also no alert, as we still can check some more, to not be spammed by falses. So sid 11 checks if server packet 4 has payload size/dsize 475, and that flowbit Tofsee_CLIENT_141 is set. No we can give an alert, as this would probably be an unique set of conditions. So testing again with out 2009-04-20-09-05-46.dmp test pcap, we get:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
   Num      Rule         Gid      Rev      &lt;strong&gt;Ticks&lt;/strong&gt;        %      Checks   &lt;strong&gt;Matches&lt;/strong&gt;  Max Ticks   &lt;strong&gt;Avg Ticks&lt;/strong&gt;   Avg Match   Avg No Match&lt;br /&gt;
  &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;&lt;br /&gt;
  1        4            1        1        1727862376   63.39  510720   510720   14059784    3383.19     3383.19     0.00&lt;br /&gt;
  2        3            1        1        508719672    18.66  508970   82176    3689732     999.51      2830.58     646.95&lt;br /&gt;
  3        7            1        1        140271824    5.15   7900     2352     1013800     17755.93    18570.93    17410.42&lt;br /&gt;
  4        &lt;strong&gt;9&lt;/strong&gt;            1        1        &lt;strong&gt;101662288&lt;/strong&gt;    3.73   28419    &lt;strong&gt;0&lt;/strong&gt;        6625384     &lt;strong&gt;3577.26&lt;/strong&gt;     0.00        3577.26&lt;br /&gt;
  5        &lt;strong&gt;11&lt;/strong&gt;           1        1        &lt;strong&gt;84264720&lt;/strong&gt;     3.09   32938    &lt;strong&gt;0&lt;/strong&gt;        612848      &lt;strong&gt;2558.28&lt;/strong&gt;     0.00        2558.28&lt;br /&gt;
  6        &lt;strong&gt;10&lt;/strong&gt;           1        1        &lt;strong&gt;71553560&lt;/strong&gt;     2.62   32938    &lt;strong&gt;0&lt;/strong&gt;        576132      &lt;strong&gt;2172.37&lt;/strong&gt;     0.00        2172.37&lt;br /&gt;
  7        5            1        1        42053248     1.54   3313     2517     805736      12693.40    15831.10    2771.81&lt;br /&gt;
  8        8            1        1        31547660     1.16   7900     2352     153972      3993.37     7039.04     2702.21&lt;br /&gt;
  9        6            1        1        17944504     0.66   3313     2517     292508      5416.39     6476.95     2062.83
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Overall, sid 9, 10 and 11 did not do that bad here. And the best thing is, they all have 0 matches. I ran this on many of my test pcaps, and I&amp;#8217;ve not been close to false positives. Sid 10 seems to fire some times, but not the others, so rather unique combo of packets in a stream I guess and a way to sig malware like this. Also, we could add check for the TCP &amp;#8220;PUSH&amp;#8221; flag in sid 9, 10 and 11 etc to be more accurate if we need.&lt;/p&gt;
&lt;p&gt;So the proof of the pudding, running it against a pcap of the malware:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
   Num      Rule         Gid      Rev      Ticks        %      Checks   &lt;strong&gt;Matches&lt;/strong&gt;  Max Ticks   Avg Ticks   Avg Match   Avg No Match&lt;br /&gt;
  &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;&lt;br /&gt;
  1        3            1        1        443120       33.03  165      158      102108      2685.58     2731.72     1644.00&lt;br /&gt;
  2        &lt;strong&gt;11&lt;/strong&gt;           1        1        310420       23.14  259      &lt;strong&gt;2&lt;/strong&gt;        2860        1198.53     2478.00     1188.58&lt;br /&gt;
  3        4            1        1        302944       22.58  269      269      15376       1126.19     1126.19     0.00&lt;br /&gt;
  4        &lt;strong&gt;10&lt;/strong&gt;           1        1        257896       19.22  259      &lt;strong&gt;3&lt;/strong&gt;        16484       995.74      7446.67     920.14&lt;br /&gt;
  5        &lt;strong&gt;9&lt;/strong&gt;            1        1        27088        2.02   10       &lt;strong&gt;3&lt;/strong&gt;        7448        2708.80     5080.00     1692.57
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Events:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
[**] [1:&lt;strong&gt;11&lt;/strong&gt;:1] Possible Tofsee server Packet 4(475 Bytes) [**] {TCP} 216.246.8.230:443 -&gt; 192.168.1.10:1031&lt;br /&gt;
[**] [1:&lt;strong&gt;11&lt;/strong&gt;:1] Possible Tofsee server Packet 4(475 Bytes) [**] {TCP} 84.16.252.136:22050 -&gt; 192.168.1.10:1032
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;My Tofsee rules fire on all 5 pcaps I looked at initially (and lots more pcaps I tested after that), so hopefully it will fire on all current Tofsee traffic.&lt;/p&gt;
&lt;p&gt;I also &lt;a href=&quot;http://seclists.org/snort/2011/q4/250&quot;&gt;replied&lt;/a&gt; on an e-mail to the snort-user list 3. of November, making the same feature request as I did for Suricata. No one followed up :/ The email should probably be directed to the snort-devel list some time in the future&amp;#8230;&lt;/p&gt;
&lt;p&gt;I hope this post has been useful, and hopefully we can get some more flowint rules out there, and maybe even get native packet and byte counting in Snort and Suricata one day &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;</content>
		<author>
			<name>Edward Bjarte Fjellskål</name>
			<uri>http://www.gamelinux.org</uri>
		</author>
		<source>
			<title type="html">Work Together For The Benefit Of All ManKind... » OpenSourceSoftware</title>
			<subtitle type="html">OSS and Security @ WORK</subtitle>
			<link rel="self" href="http://www.gamelinux.org/?feed=rss2&amp;cat=3"/>
			<id>http://www.gamelinux.org/?feed=rss2&amp;cat=3</id>
			<updated>2012-05-17T02:40:27+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Security thoughts for 2012+</title>
		<link href="http://www.gamelinux.org/?p=384"/>
		<id>http://www.gamelinux.org/?p=384</id>
		<updated>2011-12-30T14:15:21+00:00</updated>
		<content type="html">&lt;p&gt;Quoting Richard Bejtlich: &amp;#8220;Prevention will eventually fail!&amp;#8221;&lt;/p&gt;
&lt;p&gt;And I have always agreed. Accidents do happen, the world is not perfect. So when companies that really spend time and money on security get breached (RSA, Lockheed, Google, [place your company here?]) then you could work out from the theory that you eventually will get breached too.&lt;/p&gt;
&lt;p&gt;When you realize and accept that, you may need to redefine the way you think of IT security. You should prepare for the worst, so identifying what would be &amp;#8220;the worst&amp;#8221; for you (your company) and then identifying you most critical assets should be on the top of your list, and you should start focusing your effort on securing them the most.&lt;/p&gt;
&lt;p&gt;Limit the users that have access to the most critical assets (and work on sensitive projects etc). The users also need special attention when it comes to awareness training and follow up. They should also have a good communication with the security staff making it easy to report anything that seems suspicious and get positive feedback no matter what. They are an important part of picking up security issues where your technology fails! So you need them.&lt;/p&gt;
&lt;p&gt;The most critical assets needs to be monitored as close to real-time as it gets. The time it takes for an incident detection and till your response should be a minimum, even outside working hours and weekends.&lt;/p&gt;
&lt;p&gt;Then the users who has access to theses critical systems should also have special attention/hardening on their OS&amp;#8217;s etc. Use a modern operating system and enabling the security functionality all ready there and making sure that executables cant be executed from temporary directory etc. When you got basic security features in place (Including Anti-Virus), you should start looking at centralized logging and alerting on suspicious activities from the logs.&lt;br /&gt;
You should also look into implementing different ways of monitoring anomalies for the users usage. When do they normally log on? From where do they normally log on? Are they fetching lots of documents from the file servers? etc. And did they access the &lt;strong&gt;fake&lt;/strong&gt;&lt;em&gt; &amp;#8220;secret document&amp;#8221;&lt;/em&gt; that is there just for catching any suspicious activity? (You need to define your own anomalies).&lt;/p&gt;
&lt;p&gt;When the inner core (most valued assets + its users) are &amp;#8220;secured&amp;#8221;, you should strive to maintain an acceptable level of security on the rest of the corporate office network and also importantly the public facing part. Compromises here can be used to escalate into the &amp;#8220;inner core&amp;#8221; or to damage your reputation and business affairs, so keeping an acceptable level of security here &amp;#8220;as always&amp;#8221; is good.&lt;/p&gt;
&lt;p&gt;As &amp;#8220;Prevention will eventually fail!&amp;#8221;, you need to have sufficient logging up and running. So when you do have an incident, the analyst has sufficient data to work with and this will also keep the cost down, as the time it takes to handle an incident will be lower. I&amp;#8217;m mostly into Network Security Monitoring, so for me, NetFlow type data, IDS events, full packet capture, proxy logs, and DNS queries logs are some key logs from network that will help me. On the more host side of logging, the more logging, the better&amp;#8230; web, email, proxy, spam, anti-virus, file-access, local client logs, syslogs/eventlogs, and so on&amp;#8230;.. &lt;/p&gt;
&lt;p&gt;And remember &amp;#8211; if you cant spot any badness, you are not looking hard enough &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;br /&gt;
I always work on the theory that something in my networks are p0wned. That keeps me on my toes and keeps me actively finding new ways to spot badness. &lt;/p&gt;
&lt;p&gt;With that &amp;#8211; I wish you all a hacky new year!&lt;/p&gt;</content>
		<author>
			<name>Edward Bjarte Fjellskål</name>
			<uri>http://www.gamelinux.org</uri>
		</author>
		<source>
			<title type="html">Work Together For The Benefit Of All ManKind... » OpenSourceSoftware</title>
			<subtitle type="html">OSS and Security @ WORK</subtitle>
			<link rel="self" href="http://www.gamelinux.org/?feed=rss2&amp;cat=3"/>
			<id>http://www.gamelinux.org/?feed=rss2&amp;cat=3</id>
			<updated>2012-05-17T02:40:27+00:00</updated>
		</source>
	</entry>

</feed>

