<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The GNU of Life, the Universe and Everything</title>
	<atom:link href="http://freethegnu.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://freethegnu.wordpress.com</link>
	<description>Freeing the GNU from the daily amusements</description>
	<lastBuildDate>Mon, 03 Jun 2013 19:02:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='freethegnu.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The GNU of Life, the Universe and Everything</title>
		<link>http://freethegnu.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://freethegnu.wordpress.com/osd.xml" title="The GNU of Life, the Universe and Everything" />
	<atom:link rel='hub' href='http://freethegnu.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Xcom : Enemy Unknown Tech Tree plus Armor and Weapon Stats</title>
		<link>http://freethegnu.wordpress.com/2012/11/18/xcom-enemy-unknown-tech-tree-plus-armor-weapon-stats/</link>
		<comments>http://freethegnu.wordpress.com/2012/11/18/xcom-enemy-unknown-tech-tree-plus-armor-weapon-stats/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 11:41:15 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[armor stats]]></category>
		<category><![CDATA[free licence]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[tech tree]]></category>
		<category><![CDATA[weapon stats]]></category>
		<category><![CDATA[xcom]]></category>
		<category><![CDATA[xcom:eu]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=342</guid>
		<description><![CDATA[XCOM: Enemy Unknown is a great game but the tech tree left me terribly confused. The existing tech trees graphs ( on which i based mine ) helped a bit, but i thought there was plenty of room for improvements. It turned out like this. I hope it helps you! XCOM:EU &#8211; tech tree ( [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=342&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img src="http://freethegnu.files.wordpress.com/2012/11/xcom-tech-tree_post1.png?w=558&#038;h=423" alt="Xcom : Enemy Unknown Tech Tree" title="Xcom : Enemy Unknown Tech Tree" width="558" height="423" class="aligncenter size-full wp-image-348" /></p>
<p>XCOM: Enemy Unknown is a great game but the tech tree left me terribly confused. The existing tech trees graphs ( on which i based mine ) helped a bit, but i thought there was plenty of room for improvements.</p>
<p>It turned out like this. I hope it helps you! </p>
<p><a href="http://freethegnu.files.wordpress.com/2012/11/xcom-tech-tree_hires.png">XCOM:EU &#8211; tech tree ( High Resolution )</a></p>
<p><a href="http://freethegnu.files.wordpress.com/2012/11/xcom-tech-tree_lowres2.png">XCOM:EU &#8211; tech tree ( Low Resolution )</a></p>
<p>Also, here&#8217;s the SVG version for your immediate changes. Feel free to alter it. Let me know if there&#8217;s anything wrong with it.<br />
<a href="http://leitecarvalho.com/files_pub/xcom-tech-tree_v15.svg">XCOM:EU &#8211; tech tree ( SVG )</a></p>
<p>Fonts used:</p>
<p><a href="http://openfontlibrary.org/font/xolonium">xolonium by Severin Meyer</a> ( GNU General Public License )<br />
<a href="http://alexchavot.fr/lavoir.php">Lavoir by Alex Chavot</a> ( SIL Open Font License )<br />
<a href="http://www.google.com/webfonts/specimen/Tulpen+One">Tulpen One by Naima Ben Ayed</a> ( SIL Open Font License )</p>
<p>GL&amp;GG!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/342/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=342&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2012/11/18/xcom-enemy-unknown-tech-tree-plus-armor-weapon-stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/11/xcom-tech-tree_post1.png" medium="image">
			<media:title type="html">Xcom : Enemy Unknown Tech Tree</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript tests and results</title>
		<link>http://freethegnu.wordpress.com/2012/08/20/javascript-tests-and-results/</link>
		<comments>http://freethegnu.wordpress.com/2012/08/20/javascript-tests-and-results/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 06:26:33 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=285</guid>
		<description><![CDATA[I&#8217;ve been testing some basic javascript functions in the awesome jsperf.com. Some confirmations about the native browser code being faster, but strangely, there&#8217;s a huge difference in performance. I started wanting to know the difference between using a strange js code i found online. It used .html().html("&#60;img [...]") every cicle. Surely this wasn't the best [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=285&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been testing some basic javascript functions in the awesome jsperf.com. Some confirmations about the native browser code being faster, but strangely, there&#8217;s a huge difference in performance. I started wanting to know the difference between using a strange js code i found online. It used <code> .html().html("&lt;img [...]") every cicle. Surely this wasn't the best way to handle a photo gallery counter. </code></p>
<h2>getElementById vs jQuery id selector</h2>
<p>run the test: <a href="http://jsperf.com/id-vs-class-vs-tag-selectors/44">jquery id vs document.getElementById</a><br />
<strong>jQuery</strong> ID :  $(&#8220;#foo&#8221;);</p>
<p>result: 305,690 92% slower</p>
<p><strong>document.getElementById</strong> : document.getElementById(&#8220;foo&#8221;);</p>
<p>result: 3,824,633 fastest</p>
<p style="text-align:center;"><a href="http://freethegnu.files.wordpress.com/2012/08/jquery-id-vs-getelementbyid.png"><img class="aligncenter  wp-image-276" title="jquery id vs getElementById" src="http://freethegnu.files.wordpress.com/2012/08/jquery-id-vs-getelementbyid.png?w=566&#038;h=289" alt="jquery id vs getElementById" width="566" height="289" /></a></p>
<h3>Conclusion</h3>
<p>Unless i did something terribly wrong, native implementation is way faster. I would expect to be faster, but not in this order of magnitude.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>jQuery 1.8 selectors: id vs class vs tag vs pseudo vs. attribute</h2>
<p>run the test: <a href="http://jsperf.com/id-vs-class-vs-tag-selectors/2">id vs class vs tag vs pseudo vs. attribute selectors</a><br />
There&#8217;s a lot of results on this test, and almost every entry points to the <code>$("#foo")</code> selector being the fastest, class <code>$(".bar")</code> and tag <code>$("blockquote")</code> on the same range, and pseudo and attribute <code>$(":hidden") and $("[name='baz']")</code> are really slow.</p>
<p><a href="http://freethegnu.files.wordpress.com/2012/08/jquery_selectors.png"><img class="aligncenter size-full wp-image-293" title="jquery_selectors" src="http://freethegnu.files.wordpress.com/2012/08/jquery_selectors.png?w=946&#038;h=59" alt="" width="946" height="59" /></a></p>
<p><a href="http://freethegnu.files.wordpress.com/2012/08/jquery_selectors1.png"><img class="aligncenter size-full wp-image-294" title="jquery selectors 1" src="http://freethegnu.files.wordpress.com/2012/08/jquery_selectors1.png?w=944&#038;h=87" alt="jquery selectors 1" width="944" height="87" /></a></p>
<h2></h2>
<h2></h2>
<h2></h2>
<h2>appendChild VS jQuery appendTo</h2>
<p><a href="http://jsperf.com/createtextnode-vs-createelement/4">appendChild vs appendTo</a><br />
Next, i created a test for appending a child node to a html element. the element was created outside the test.</p>
<p><strong>appendChild</strong> :  document.getElementById(&#8216;testc1&#8242;).appendChild(newdiv);</p>
<p>result: 2,087,401 fastest</p>
<p><strong>appendTo</strong> : $(newdiv).appendTo(&#8216;#testc1&#8242;);</p>
<p>result: 8,250 100% slower</p>
<p style="text-align:center;"><a href="http://freethegnu.files.wordpress.com/2012/08/appendchild-vs-appendto1.png"><img class="aligncenter  wp-image-287" title="appendChild vs appendTo" src="http://freethegnu.files.wordpress.com/2012/08/appendchild-vs-appendto1.png?w=570&#038;h=290" alt="appendChild vs appendTo" width="570" height="290" /></a></p>
<h3>Conclusion</h3>
<p>Again, i wasn&#8217;t expecting such a huge difference between native and jQuery performance.</p>
<h2></h2>
<h2></h2>
<h2>Creating complex elements</h2>
<p>run the test: <a href="http://jsperf.com/creating-complex-elements">creating and appending elements (by WTK)</a></p>
<p>The following test tries to append several html elements<br />
<strong>Passing full html string to jQuery</strong></p>
<pre><code>var elements = "</code>&lt;div&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;";</pre>
<p>$(&#8220;body&#8221;).append($(elements));</p>
<p><strong>Create elements by hand but still using jQuery</strong></p>
<pre><code>function create() {
  return $("&lt;div&gt;").append($("&lt;table&gt;").append('tr').append('td'));
}
$("body").append(create());</code></pre>
<p><strong>Using innerHTML</strong></p>
<pre><code>var elements = "&lt;div&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;";
var div = document.createElement('div')
div.id = 'mycustomdiv'
document.getElementsByTagName('body')[0].appendChild(div);
div.innerHTML = elements;

<a href="http://freethegnu.files.wordpress.com/2012/08/insertelements.png"><img class="aligncenter  wp-image-290" title="insert elements" src="http://freethegnu.files.wordpress.com/2012/08/insertelements.png?w=566&#038;h=74" alt="insert elements" width="566" height="74" /></a><a href="http://freethegnu.files.wordpress.com/2012/08/insertelements1_firefox_ie_other.png"><img class="aligncenter  wp-image-291" title="insert elements firefox ie other" src="http://freethegnu.files.wordpress.com/2012/08/insertelements1_firefox_ie_other.png?w=566&#038;h=311" alt="insert elements firefox ie other" width="566" height="311" /></a>

</code></pre>
<h3>Conclusion</h3>
<p>Sadly, the browser implementation differs greatly from chrome to the rest, so innerHTML is still a bit and miss.</p>
<h2></h2>
<h2></h2>
<h2>Creating a image node with attributes</h2>
<p>What started as a simple gallery turned out as a great opportunity to do these performances tests. The source didn&#8217;t have a license and the code behave so badly, that isn&#8217;t wor</p>
<table>
<thead>
<tr>
<th colspan="2">Test</th>
<th colspan="2">Ops/sec</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row"> no jquery</td>
<td scope="row">
<pre><code>
var newimg = document.createElement("img");	 
newimg.alt = "Test Image";	 
newimg.src = 'http://leitecarvalho.com/files_pub/counter-sell.gif';	 
newimg.onclick = function(){ swapCase();  };	 
document.getElementById('testc1').appendChild(newimg);</code></pre>
</td>
<td>
<pre>14,255fastest</pre>
</td>
</tr>
<tr>
<td scope="row">
<div>jquery</div>
</td>
<td>
<pre><code>$('#testc2').append($('&lt;img&gt;', { 
    alt : "Test Image",
    src : 'http://leitecarvalho.com/files_pub/counter-sell.gif',
    click: function(){
        swapCase();
    }
}));</code></pre>
</td>
<td>8,575<span style="font-size:9px;"> </span>41% slower</td>
</tr>
<tr>
<td scope="row">
<div>jquery alternative</div>
</td>
<td>
<pre><code>$('#testc3').append( $(document.createElement("img"))
    .attr({ 
        src: 'http://leitecarvalho.com/files_pub/counter-sell.gif',
        alt: 'Test Image'
     })
    .click(function(){
        swapCase();
    })
 );</code></pre>
</td>
<td>7,950<span style="font-size:9px;">    </span>49% slower</td>
</tr>
</tbody>
</table>
<p><a href="http://freethegnu.files.wordpress.com/2012/08/create_image_with_attributes.png"><img class="aligncenter size-full wp-image-298" title="create_image_with_attributes" src="http://freethegnu.files.wordpress.com/2012/08/create_image_with_attributes.png?w=645&#038;h=480" alt="" width="645" height="480" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=285&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2012/08/20/javascript-tests-and-results/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/jquery-id-vs-getelementbyid.png" medium="image">
			<media:title type="html">jquery id vs getElementById</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/jquery_selectors.png" medium="image">
			<media:title type="html">jquery_selectors</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/jquery_selectors1.png" medium="image">
			<media:title type="html">jquery selectors 1</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/appendchild-vs-appendto1.png" medium="image">
			<media:title type="html">appendChild vs appendTo</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/insertelements.png" medium="image">
			<media:title type="html">insert elements</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/insertelements1_firefox_ie_other.png" medium="image">
			<media:title type="html">insert elements firefox ie other</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/08/create_image_with_attributes.png" medium="image">
			<media:title type="html">create_image_with_attributes</media:title>
		</media:content>
	</item>
		<item>
		<title>How to make Cucumber run faster</title>
		<link>http://freethegnu.wordpress.com/2012/03/16/how-to-make-cucumber-run-faster/</link>
		<comments>http://freethegnu.wordpress.com/2012/03/16/how-to-make-cucumber-run-faster/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 03:08:19 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[enterprise-it]]></category>
		<category><![CDATA[posix systems]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[software-development]]></category>
		<category><![CDATA[spork]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=213</guid>
		<description><![CDATA[Speed up the startup time of cucumber for TDD/BDD tests Getting started with Behaviour Driven Development with Cucumber and noticed that it takes more time to startup than actually run the scenarios. Compare this: 2 scenarios (2 passed) 4 steps (4 passed) 0m2.252s real 0m16.013s user 0m14.850s sys 0m0.814s Cucumber reports 0m2.252s but time says [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=213&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2>Speed up the startup time of cucumber for TDD/BDD tests</h2>
<p>Getting started with Behaviour Driven Development with Cucumber and noticed that it takes more time to startup than actually run the scenarios.</p>
<p>Compare this:<br />
<code></p>
<p>2 scenarios (2 passed)<br />
4 steps (4 passed)<br />
0m2.252s</p>
<p><strong>real    0m16.013s</strong><br />
<strong>user    0m14.850s</strong><br />
<strong>sys     0m0.814s</strong><br />
</code><br />
Cucumber reports <code>0m2.252s</code> but time says <code>0m16.013s</code>, thats ~~14seconds of difference.</p>
<blockquote><p><em>Remember: <strong>user</strong> time represents the time the application spent on user-mode, actually running the code, where as <strong>sys</strong> represents the time spent on kernel. <strong>real</strong> is the full time from start to finish</em> </p></blockquote>
<hr />
<h2>Using spork as a DRb server</h2>
<p>(DRb = Distributed Ruby server)<br />
Note from <a href="http://spork.rubyforge.org/" title="spork site" target="_blank">spork site</a></p>
<blockquote><p><em>Because Spork uses Kernel.fork, it only works on POSIX systems. This means Windows users are not invited to this party. Sorry :</em>(</p></blockquote>
<p>For your rails app, follow this procedure:</p>
<p>Add spork to your Gemfile</p>
<p>  <code>gem 'spork'</code></p>
<p>Run <code>bundle install</code></p>
<p>and <code>rails g cucumber:install --spork</code></p>
<p>Finally run spork server on the background:</p>
<p><code>bundle exec spork cuc &amp;</code></p>
<p>And happily run tests:</p>
<p><code>cucumber features/...</code></p>
<hr />
<h2>The conclusion: it works!</h2>
<p><code>2 scenarios (2 passed)<br />
4 steps (4 passed)<br />
0m2.956s<br />
Done.</p>
<p><strong>real    0m3.946s</strong><br />
user    0m0.658s<br />
sys     0m0.059s</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=213&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2012/03/16/how-to-make-cucumber-run-faster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>
	</item>
		<item>
		<title>Syntax hightlight theme for Ruby/Rails/Haml in Aptana</title>
		<link>http://freethegnu.wordpress.com/2012/03/08/syntax-hightlight-theme-for-ruby-rails-haml-in-aptana/</link>
		<comments>http://freethegnu.wordpress.com/2012/03/08/syntax-hightlight-theme-for-ruby-rails-haml-in-aptana/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 00:21:36 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[clouds]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software-development]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=186</guid>
		<description><![CDATA[I have a thing for code and colours. Let it be lolcode, lpsolve syntax for whatever the editor i&#8217;m using at the time, i have to tweak it. This time i&#8217;m learning Ruby/Rails/Haml and whatnot. My favorite editor for WebDev has been Aptana with the Clouds theme, (a bit edited already) but it didn&#8217;t support [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=186&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have a thing for code and colours. Let it be <a title="lolcode for nano" href="http://freethegnu.wordpress.com/2007/06/30/lolcode-syntax-highlight-for-nano/">lolcode</a>, <a title="lpsolve syntax in geany" href="http://freethegnu.wordpress.com/2011/12/17/lpsolve-syntax-highlight-for-geany-ide/">lpsolve syntax</a> for whatever the <a title="Nano syntax hightlight" href="http://freethegnu.wordpress.com/2007/06/23/nano-shortcuts-syntax-highlight-and-nanorc-config-file-pt1/">editor</a> i&#8217;m <a title="emacs fonts" href="http://freethegnu.wordpress.com/2010/08/07/make-emacs-pretty-with-beautiful-best-fonts/">using</a> at the <a title="more emacs modes" href="http://freethegnu.wordpress.com/2007/06/17/emacs-cvs-and-the-multi-major-modes/">time</a>, i have to tweak it.</p>
<p>This time i&#8217;m learning Ruby/Rails/Haml and whatnot. My favorite editor for WebDev has been <a href="http://aptana.com/">Aptana</a> with the <a href="http://fredhq.com/projects/clouds">Clouds</a> theme, (a bit edited already) but it didn&#8217;t support ruby. So here it is &#8220;Clouds of Ruby&#8221;.</p>
<h2>What does Clouds of Ruby look like?</h2>
<h3>Clouds of Ruby :: Ruby/Rails</h3>
<p><a href="http://freethegnu.files.wordpress.com/2012/03/ss_101.png"><img class="size-full wp-image-197 alignnone" title="Ruby/Rails Theme for Aptana" src="http://freethegnu.files.wordpress.com/2012/03/ss_101.png?w=650&#038;h=322" alt="Ruby/Rails Theme for Aptana" width="650" height="322" /></a></p>
<h3>Clouds of Ruby :: HAML</h3>
<p><a href="http://freethegnu.files.wordpress.com/2012/03/ss_112.png"><img class="alignnone size-full wp-image-203" title="HAML Theme for Aptana" src="http://freethegnu.files.wordpress.com/2012/03/ss_112.png?w=650&#038;h=295" alt="HAML Theme for Aptana" width="650" height="295" /></a></p>
<h2>Where to get Clouds of Ruby?</h2>
<p>download <a href="http://leitecarvalho.com/files_pub/Clouds%20of%20Ruby.tmTheme">Clouds of Ruby Theme</a>. I recommend the <a href="http://www.ms-studio.com/FontSales/anonymouspro.html">Anonymous Pro font</a> to go well with it.</p>
<p>To use, go to Preferences-&gt;Aptana Studio-&gt;Themes-&gt;Import. Change at will and have fun coding!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=186&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2012/03/08/syntax-hightlight-theme-for-ruby-rails-haml-in-aptana/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/03/ss_101.png" medium="image">
			<media:title type="html">Ruby/Rails Theme for Aptana</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/03/ss_112.png" medium="image">
			<media:title type="html">HAML Theme for Aptana</media:title>
		</media:content>
	</item>
		<item>
		<title>Stop internet censorship. Say no to PIPA and SOPA</title>
		<link>http://freethegnu.wordpress.com/2012/01/18/stop-internet-censorship-say-no-to-pipa-and-sopa/</link>
		<comments>http://freethegnu.wordpress.com/2012/01/18/stop-internet-censorship-say-no-to-pipa-and-sopa/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 13:36:29 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[Freedom]]></category>
		<category><![CDATA[public knowledge]]></category>
		<category><![CDATA[software freedom]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=170</guid>
		<description><![CDATA[Today&#8217;s the day of the world stood against the proposals that would create laws to censor the internet based on denounces without due process! Although you may have heard about SOPA, please take note that there&#8217;s a similar proposal called PIPA that is also being discussed but is not getting attention. If you live in [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=170&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today&#8217;s the day of the world stood against the proposals that would create laws to censor the internet based on denounces without due process!</p>
<p>Although you may have heard about SOPA, please take note that there&#8217;s a similar proposal called PIPA that is also being discussed but is not getting attention.</p>
<p>If you live in the USA,  please write or call your representatives, or use this form:  <a href="http://sopastrike.com/strike">sopastrike.com/strike</a> to stop PIPA and SOPA.</p>
<p>These proposals are also very dangerous for everyone outside the US. Although these are US based laws, don&#8217;t forget that many domains that have a .com, .org, or .net are considered as domestic to the USA, so they fall under these laws jurisdiction. We know that corporations have been influencing the European governments like the recent cases of France, Portugal and Spain, to push similar laws into our own civil codes.  A censored internet is the end of public sharing of knowledge and we all have been thankful for this. So thank you for taking action!</p>
<div id="attachment_171" class="wp-caption aligncenter" style="width: 970px"><a href="http://freethegnu.files.wordpress.com/2012/01/no-sopa_header.png"><img class="size-full wp-image-171" title="say no to PIPA and SOPA" src="http://freethegnu.files.wordpress.com/2012/01/no-sopa_header.png?w=960&#038;h=354" alt="say no to PIPA and SOPA" width="960" height="354" /></a><p class="wp-caption-text">say no to PIPA and SOPA</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=170&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2012/01/18/stop-internet-censorship-say-no-to-pipa-and-sopa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2012/01/no-sopa_header.png" medium="image">
			<media:title type="html">say no to PIPA and SOPA</media:title>
		</media:content>
	</item>
		<item>
		<title>Lpsolve Syntax Highlight for Geany IDE</title>
		<link>http://freethegnu.wordpress.com/2011/12/17/lpsolve-syntax-highlight-for-geany-ide/</link>
		<comments>http://freethegnu.wordpress.com/2011/12/17/lpsolve-syntax-highlight-for-geany-ide/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 00:50:20 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[Geany]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[geany]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lp solve]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[software-development]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[syntax hightlight]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=160</guid>
		<description><![CDATA[Add Lp Solve extension First, we need to add the extension file, so geany knows what file it can associate to lp solve files. Either go to:  Tools -&#62; Configuration Files -&#62; filetype_extensions.conf or:  edit directly the file in Linux: ~/.config/geany/filetype_extensions.conf Windows 7 :  c:\Users\username\AppData\Roaming\geany\filetype_extensions.conf and add a new line with Lpsolve=*.lp; Download Lp Solve [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=160&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2>Add Lp Solve extension</h2>
<div id="attachment_161" class="wp-caption alignright" style="width: 310px"><a href="http://freethegnu.files.wordpress.com/2011/12/ss_01.png"><img class="size-medium wp-image-161" title="Lp solve files Syntax highlight for Geany" src="http://freethegnu.files.wordpress.com/2011/12/ss_01.png?w=300&#038;h=259" alt="Lp solve files Syntax highlight for Geany" width="300" height="259" /></a><p class="wp-caption-text">An example of Lp solve files Syntax highlight in Geany</p></div>
<p>First, we need to add the extension file, so geany knows what file it can associate to lp solve files.</p>
<p>Either go to: <code> Tools -&gt; Configuration Files -&gt; filetype_extensions.conf</code></p>
<p>or:  edit directly the file in</p>
<p>Linux: <code>~/.config/geany/filetype_extensions.conf</code></p>
<p>Windows 7 : <code> c:\Users\username\AppData\Roaming\geany\filetype_extensions.conf</code></p>
<p>and add a new line with</p>
<p><code>Lpsolve=*.lp;</code></p>
<h2>Download Lp Solve syntax highlight file</h2>
<p>Next, download this syntax highlight file:  <a title="Lp solve files syntax hightlight" href="http://leitecarvalho.com/files_pub/filetypes.Lpsolve.conf" target="_blank">filetypes.Lpsolve.conf</a></p>
<p>and place it in <code>~/.config/geany/filedefs/</code> (Linux)</p>
<p>or<code> c:\Users\username\AppData\Roaming\geany\filedefs\ </code>(Windows 7)</p>
<h2>More information on syntax highlight</h2>
<p>Note:  if not bothered to download this file, you can add the extension to any existing filetypes, for example:</p>
<p><code>C=*.c;*.h;*.lp;</code></p>
<p>Many thanks to <a title="geanycolourscheme.xtreemhost.com" href="http://geanycolourscheme.xtreemhost.com/" target="_blank">geanycolourscheme.xtreemhost.com</a> editor.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=160&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2011/12/17/lpsolve-syntax-highlight-for-geany-ide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2011/12/ss_01.png?w=300" medium="image">
			<media:title type="html">Lp solve files Syntax highlight for Geany</media:title>
		</media:content>
	</item>
		<item>
		<title>how to open Visual paradigm projects directly from KDE</title>
		<link>http://freethegnu.wordpress.com/2011/11/29/how-to-open-visual-paradigm-projects-directly-from-kde/</link>
		<comments>http://freethegnu.wordpress.com/2011/11/29/how-to-open-visual-paradigm-projects-directly-from-kde/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 06:32:56 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[kde4]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[visual paradigm]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=154</guid>
		<description><![CDATA[oddly enough my installation of Visual Paradigm set its type to application/zip. When i try to open it, it uses the same applications that other .zip files use. Sure i could right-click + open with + Visual paradigm , but &#8230;. So instead we&#8217;re going to create a new file type for that .vpp extension. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=154&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>oddly enough my installation of Visual Paradigm set its type to application/zip.</p>
<p>When i try to open it, it uses the same applications that other .zip files use.</p>
<p>Sure i could right-click + open with + Visual paradigm , but &#8230;.</p>
<p>So instead we&#8217;re going to create a new file type for that .vpp extension.</p>
<p><a href="http://freethegnu.files.wordpress.com/2011/11/snapshot8.png"><img class="alignright size-medium wp-image-155" title="Add a filetype to KDE" src="http://freethegnu.files.wordpress.com/2011/11/snapshot8.png?w=300&#038;h=201" alt="" width="300" height="201" /></a></p>
<h2>Create a new filetype in KDE</h2>
<p>1 &#8211; Add a &#8220;x-vpp&#8221; type.</p>
<p>2 &#8211; select it (it down the list, inside the application category)</p>
<p>3 &#8211; Add a filename Pattern:<br />
*.vpp</p>
<p>4 &#8211; Add an Application<br />
* browse to your &#8220;Visual Paradigm for UML&#8221; binary file ( /path/vp/bin/Visual_Paradigm_for_UML_8.3 )</p>
<p>5 &#8211; Select an icon<br />
* check the &#8220;resources&#8221; directory in your VP installation ( path/vp/resources/vpuml.png )</p>
<p>6 &#8211; press OK</p>
<p>Ok, now we need to edit the culprit of this mess:</p>
<h2>Change the mimetype for Visual Paradigm for UML</h2>
<p>edit the <code>~/.local/share/applications/Visual_Paradigm_for_UML_8.3.desktop</code></p>
<p>and change the mimetype to:</p>
<p><code>MimeType=application/x-vpp;</code></p>
<h2>Restart your file manager</h2>
<p>and we&#8217;re done! re-open your konqi/dolphin and .vpp files will always open with VP and your .zip will never again<br />
be open with VP!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/154/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=154&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2011/11/29/how-to-open-visual-paradigm-projects-directly-from-kde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2011/11/snapshot8.png?w=300" medium="image">
			<media:title type="html">Add a filetype to KDE</media:title>
		</media:content>
	</item>
		<item>
		<title>Patch portage to be more quiet</title>
		<link>http://freethegnu.wordpress.com/2011/03/19/patch-portage-to-be-more-quiet/</link>
		<comments>http://freethegnu.wordpress.com/2011/03/19/patch-portage-to-be-more-quiet/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 20:20:40 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[portage]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=142</guid>
		<description><![CDATA[Gentoo linux is alive and well and just released a new Gentoo Linux Live.  It features Linux Kernel 2.6.37 (with Gentoo patches). It comes will all desktop environments. Especially if you are looking for KDE 4.6 SC here&#8217;s the best way to start. It also includes OpenOffice.org (3.2.1), GIMP (2.6.11), Inkscape (0.48.1), Blender (2.49b), and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=142&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://freethegnu.files.wordpress.com/2011/03/1024x600.jpg"><img class="aligncenter size-medium wp-image-148" title="1024x600" src="http://freethegnu.files.wordpress.com/2011/03/1024x600.jpg?w=300&#038;h=175" alt="Gentoo Live Linux 10.0" width="300" height="175" /></a><br />
<a href="http://www.gentoo.org/">Gentoo</a> linux is alive and well and just released a new Gentoo Linux Live.  It features Linux Kernel 2.6.37 (with Gentoo patches). It comes will all desktop environments. Especially if you are looking for KDE 4.6 SC here&#8217;s the best way to start.<br />
It also includes OpenOffice.org (3.2.1), GIMP (2.6.11), Inkscape (0.48.1), Blender (2.49b), and many more. They are all packed in either the x86/x86_64 or the x86_64. If you like it, you&#8217;ll need to install Gentoo with the Instalation CD.</p>
<p>So a few days after the <a href="http://planet.gentoo.org/">celebrated news of 11th release</a> here&#8217;s a patch for portage to make it quiet and nice.</p>
<p>Those extra verbose warnings really annoys me,  because emerging something keeps showing me all the licensed packages that are masked, broken packages or masked.  So i fixed the <strong>&#8220;<span style="color:#ffff00;">!!!</span> existing preserved libs:</strong><br />
<strong> &#8221; ,  &#8220;<span style="color:#ff0000;">!!!</span> The following installed packages are masked:&#8221;</strong> and <strong>&#8220;<span style="color:#ff0000;">!!!</span> There are updates currently masked by LICENSE changes.&#8221; </strong> messages.</p>
<p>You can revert to the verbose warnings with the new flag &#8220;&#8211;extra-verbose&#8221;.</p>
<p>All it does is remove the list of packages shown after doing a emerge, and improves the speed because it doesn&#8217;t calculate any of it (particular when figuring out the preserved libs) and only shows a single line warning about them.</p>
<p>The patch is for portage-2.2.0_alpha26 (which is totally a must so you can play around with @sets)</p>
<h2>Where to get the patch</h2>
<p><a href="http://leitecarvalho.com/files_pub/patch-2.2.0_alpha26">patch-2.2.0_alpha26</a></p>
<h2>How to apply the patch:</h2>
<p>on the <code>/usr/lib/portage/pym/</code> directory</p>
<blockquote><p><code>patch -p1 -i patch-2.2.0_alpha26</code></p></blockquote>
<p>The <a href="http://www.gentoo.org/doc/en/handbook/">handbook</a> is always a good idea to keep around ;)</p>
<p>(the image was taken from the <a href="http://www.gentoo.org/proj/en/pr/releases/10.0/graphics.xml">Gentoo Live 10.0</a>)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=142&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2011/03/19/patch-portage-to-be-more-quiet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2011/03/1024x600.jpg?w=300" medium="image">
			<media:title type="html">1024x600</media:title>
		</media:content>
	</item>
		<item>
		<title>How to format a usb pen or mp3 player the right way</title>
		<link>http://freethegnu.wordpress.com/2010/12/14/how-to-format-a-usb-pen-or-mp3-player-the-right-way/</link>
		<comments>http://freethegnu.wordpress.com/2010/12/14/how-to-format-a-usb-pen-or-mp3-player-the-right-way/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 01:11:29 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[console]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=133</guid>
		<description><![CDATA[In a short line: # mkfs.vfat -vc -F 32 -n &#8220;zen stone&#8221; -S 2048 /dev/yourdevice The explanation: -v Verbose execution. -c Check the device for bad blocks before creating the file system. -F FAT-size Specifies the type of file allocation tables used (12, 16 or 32 bit). If nothing is specified, mkdosfs will automatically select [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=133&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h3>In a short line:</h3>
<p style="padding-left:30px;"># mkfs.vfat -vc -F 32 -n &#8220;zen stone&#8221; -S 2048 /dev/yourdevice</p>
<h3>The explanation:</h3>
<h3>
<p><div id="attachment_137" class="wp-caption alignright" style="width: 273px"><img class="size-full wp-image-137 " title="free the gnu -  lego mp3 player" src="http://freethegnu.files.wordpress.com/2010/12/mp3_lego.jpg?w=263&#038;h=270" alt="free the gnu -  lego mp3 player" width="263" height="270" /><p class="wp-caption-text">free the gnu -  lego mp3 player</p></div></h3>
<p><strong>-v </strong> <em>Verbose execution.</em></p>
<p><strong>-c </strong> <em> Check the device for bad blocks before creating the file system.</em></p>
<p><strong>-F FAT-size</strong><br />
<em>Specifies the type of file allocation tables used (12, 16 or 32 bit).</em><br />
<em> If nothing is specified, mkdosfs will automatically select between 12</em> <em>and 16 bit, whatever fits better for the filesystem size.  32 bit FAT </em><em>(FAT32 format) must (still) be selected explicitly if you want it.</em></p>
<p><strong>-n volume-name</strong><br />
<em>Sets  the volume name (label) of the filesystem.  The volume name can</em> <em>be up to 11 characters long.  The default is no label.</em></p>
<p><strong>-S logical-sector-size</strong><br />
<em>Specify the number of bytes per logical sector.  Must be a power of 2 </em><em>and  greater  than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192, </em><em>16384, or 32768.</em></p>
<p>change &#8220;youdevice&#8221; for your own. Find out which is by checking your <strong>dmesg</strong> after plug-in the usb device for  something like:</p>
<ul>
<li>sde: sde1</li>
<li>sdb</li>
<li>etc&#8230;</li>
</ul>
<p>You might want to try this flag too:<em><br />
</em></p>
<p><strong>-I </strong> <em>Normally you are not allowed to use any &#8216;full&#8217;  fixed  disk  devices.</em><br />
<em> mkdosfs  will complain and tell you that it refuses to work.  This is</em> <em>different when usind MO disks.  One doesn&#8217;t always need partitions on</em><br />
<em> MO  disks.   The  filesytem can go directly to the whole disk.  Under </em><em>other OSes this is known as the &#8216;superfloppy&#8217; format.</em></p>
<p><em>This switch will force mkdosfs to work properly.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=133&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2010/12/14/how-to-format-a-usb-pen-or-mp3-player-the-right-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2010/12/mp3_lego.jpg" medium="image">
			<media:title type="html">free the gnu -  lego mp3 player</media:title>
		</media:content>
	</item>
		<item>
		<title>Yet another ssh brute force attack and how to protect against it with iptables and sshguard</title>
		<link>http://freethegnu.wordpress.com/2010/09/22/yet-another-ssh-brute-force-attack-and-how-to-protect-against-it-with-iptables-and-sshguard/</link>
		<comments>http://freethegnu.wordpress.com/2010/09/22/yet-another-ssh-brute-force-attack-and-how-to-protect-against-it-with-iptables-and-sshguard/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 21:20:09 +0000</pubDate>
		<dc:creator>Pedro Carvalho</dc:creator>
				<category><![CDATA[console]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[brute force]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshguard]]></category>

		<guid isPermaLink="false">http://freethegnu.wordpress.com/?p=117</guid>
		<description><![CDATA[By chance, i looked into syslog ( /var/log/syslog ) and saw a ssh attempt to login from a ip outside local network. It was a brute force attack that started 7 days ago.. See down the post how to protect ssh from further attacks. Looking at the logs ( tail -n 200000 /var/log/syslog ) noticed [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=117&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://freethegnu.files.wordpress.com/2010/09/ss_brute_force_attack1.png"><img class="alignleft size-medium wp-image-128" title="ssh brute force attack" src="http://freethegnu.files.wordpress.com/2010/09/ss_brute_force_attack1.png?w=259&#038;h=300" alt="ssh brute force attack" width="259" height="300" /></a></p>
<p>By chance, i looked into syslog (<code> /var/log/syslog</code> ) and saw a ssh attempt to login from a ip outside local network. It was a brute force attack that started 7 days ago.. See down the post <a href="#gettingstarted">how to protect ssh from further attacks.</a></p>
<p>Looking at the logs (<code> tail -n 200000 /var/log/syslog </code>) noticed that the attack started on:</p>
<blockquote><p>Sep 15 21:01:37 cerval sshd[13101]: Failed password for root from 114.80.94.183 port 42023 ssh2</p></blockquote>
<p>then the attack went on  &#8230;</p>
<p>I checked the logs and saw the attack. stopped ssh. no more fun for you :(</p>
<p>I decided finally, after 6 years of laziness to build up some security.</p>
<h2><a name="gettingstarted">Getting started with iptables</a></h2>
<p>The guys at <a href="http://www.netfilter.org/">netfilter</a> created, omnipresent on most of Linux machines, a packet filtering system called <a href="http://www.netfilter.org/projects/iptables/index.html">iptables</a>.</p>
<h3>The iptables Rules</h3>
<p>For creating a bash script to create all the rules need, i used this <a href="http://www.lowth.com/LinWiz/1.09/">online iptables wizard</a>. (don&#8217;t forget to remove &#8220;LINWIZ-&#8221; from the script created)</p>
<h3>Running iptables</h3>
<p>Next run the script <code>sh iptables.sh</code>, save it <code>/etc/init.d/iptables save</code>, and then start, stop and start iptables again ( <code>/etc/init.d/iptables start; /etc/init.d/iptables stop; /etc/init.d/iptables start </code> )</p>
<p>and check if the rules are active with <code>iptables -L -v</code></p>
<p>To get a better understanding check <a href="http://www.puschitz.com/FirewallAndRouters.shtml">Stateful Firewall and Masquerading on Linux</a></p>
<h2>Protecting ssh</h2>
<p>Luckly gentoo portage has <a href="http://www.sshguard.net/">sshguard</a>, which has lots of nice features!<br />
Unmasked it to use a decent version (portage has 1.0 as stable, 1.4 as latest, but sshguard is v1.5rc4, which is the last RC planned before 1.5 stable. )</p>
<p>and then, <code>emerge -av sshguard</code>.<br />
<a href="http://www.sshguard.net/docs/faqs/#sshguard-start-at-boot">Its FAQ has the script to use for booting</a> but the &#8220;<code>-l</code>&#8221; option wasn&#8217;t working on this version, so i used this instead</p>
<blockquote>
<pre>#! /bin/sh
case $1 in
start)
    tail -n0 -F /var/log/auth.log | /usr/local/sbin/sshguard &amp;
    ;;
stop)
    killall sshguard
;;
*)
    echo "Use start or stop"
    exit 1
;;
esac</pre>
</blockquote>
<p>Add to the rc levels to ensure it starts at every boot:</p>
<blockquote><p><code>rc-update add sshguard default</code></p></blockquote>
<h3>If you are using syslog-ng with sshguard</h3>
<p>On Gentoo, just add  this to <code>/etc/syslog-ng/syslog-ng.conf</code>:</p>
<blockquote>
<pre>#create a new destination for sshguard
destination sshguardproc {
    program("/usr/sbin/sshguard"
        template("$DATE $FULLHOST $MESSAGE\n"));
};
#creates a filter called f_sshlogs for auth and authpriv system logs
filter f_sshlogs { facility(auth, authpriv) and match("sshd"); }; # for sshguard

log { source(src); filter(f_sshlogs); destination(sshguardproc); };</pre>
</blockquote>
<h2>Restart sshd</h2>
<p>Start ssh again! <code>/etc/init.d/sshd start</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/freethegnu.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/freethegnu.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=freethegnu.wordpress.com&#038;blog=1249929&#038;post=117&#038;subd=freethegnu&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://freethegnu.wordpress.com/2010/09/22/yet-another-ssh-brute-force-attack-and-how-to-protect-against-it-with-iptables-and-sshguard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3068790f76eb2dcd8c434f88f9bfbb71?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pedrocarvalho</media:title>
		</media:content>

		<media:content url="http://freethegnu.files.wordpress.com/2010/09/ss_brute_force_attack1.png?w=259" medium="image">
			<media:title type="html">ssh brute force attack</media:title>
		</media:content>
	</item>
	</channel>
</rss>
