<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ruby, Rails, OSX and Linux fun &#187; Uncategorized</title>
	<atom:link href="http://www.frederico-araujo.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.frederico-araujo.com</link>
	<description>Ruby, Rails, OSX and linux sysadmin</description>
	<lastBuildDate>Thu, 02 Sep 2010 08:13:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stop http Pipeline from overloading your server, using connlimit iptables</title>
		<link>http://www.frederico-araujo.com/2009/01/25/stop-http-pipeline-from-overloading-your-server-with-iptables/</link>
		<comments>http://www.frederico-araujo.com/2009/01/25/stop-http-pipeline-from-overloading-your-server-with-iptables/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 08:31:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.frederico-araujo.com/?p=79</guid>
		<description><![CDATA[Have you edited or tweaked your pipeline settings in Firefox?
You can do it by typing about:config in your firefox url tab.
Most blogs and tutorial will tell you to set high values to improve the speed, such as this one: www.mydigitallife.info/2007/10/16/speed-up-your-firefox-by-adjusting-your-http-pipelining/
Many people will go crazy and make values even higher such as:
network.http.pipelining.maxrequests 32
network.http.max-persistent-connections-per-proxy 128
network.http.max-persistent-connections-per-server 128
network.http.max-connections-per-server 256
These [...]]]></description>
			<content:encoded><![CDATA[<p>Have you edited or tweaked your pipeline settings in Firefox?</p>
<p>You can do it by typing about:config in your firefox url tab.</p>
<p>Most blogs and tutorial will tell you to set high values to improve the speed, such as this one: <a href="http://www.mydigitallife.info/2007/10/16/speed-up-your-firefox-by-adjusting-your-http-pipelining/">www.mydigitallife.info/2007/10/16/speed-up-your-firefox-by-adjusting-your-http-pipelining/</a></p>
<p>Many people will go crazy and make values even higher such as:</p>
<p>network.http.pipelining.maxrequests 32<br />
network.http.max-persistent-connections-per-proxy 128<br />
network.http.max-persistent-connections-per-server 128<br />
network.http.max-connections-per-server 256</p>
<p>These settings are very high and will create at least 32 connections to your server.</p>
<p>if you have many images and SSI includes, it could overload your apache webserver.<br />
If you use apache2.2 with worker_mpm it will create 1 thread for each connection, thus you will have 32 new threads forked within just a few seconds.</p>
<p>Of course if you have a quad-core server with lots of ram you should not bother to read this.<br />
But for most cheap vps and single core servers, it can really help.</p>
<p>so how you do it? simple, just use iptables conn_limit module</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-I</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--syn</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-m</span> connlimit <span style="color: #660033;">--connlimit-above</span>  <span style="color: #000000;">8</span> <span style="color: #660033;">-j</span> REJECT</pre></div></div>

<p>you may need to adjust the order or to insert or append like</p>
<p># to apped to the end of the INPUT chain:<br />
iptables -A input &#8230;<br />
or<br />
# to insert at position 10 of the input chain:<br />
iptables -I input 10 &#8230;</p>
<p>I have tested this schema and work very well with firefox pipeline freaks.</p>
<p>the server will only then take up to 8 simultaneously connections per IP</p>
<p>to test the established connections you can try with netstat from the server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">netstat</span> <span style="color: #660033;">-na</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> esta <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> 127.0.0.1 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-n</span> -t. <span style="color: #660033;">-k2</span></pre></div></div>

<p>Any comments, suggestions are welcome &#8230;</p>
<p>Update:</p>
<p>This can be not so good to legit users behind a proxy or firewall, because the the IP will be unique to all users behind the proxy/firewall.</p>
<p>in this case, you would increase the limit value.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frederico-araujo.com/2009/01/25/stop-http-pipeline-from-overloading-your-server-with-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ruby-mysql now Ruby 1.9 compatible</title>
		<link>http://www.frederico-araujo.com/2008/03/07/ruby-mysql-now-ruby-19-compatible/</link>
		<comments>http://www.frederico-araujo.com/2008/03/07/ruby-mysql-now-ruby-19-compatible/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 05:16:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.frederico-araujo.com/?p=37</guid>
		<description><![CDATA[Tommy has just released an new mysql-ruby package.
Actually 2 of them:
mysql-ruby-2.7.5 and mysql-ruby-2.8pre2
They are Ruby 1.9 compatible
Requirements
* MySQL 5.0.51a
* Ruby 1.8.6, 1.9.0
here is the link http://tmtm.org/en/mysql/ruby/
Great Job
]]></description>
			<content:encoded><![CDATA[<p>Tommy has just released an new mysql-ruby package.</p>
<p>Actually 2 of them:</p>
<p>mysql-ruby-2.7.5 and mysql-ruby-2.8pre2</p>
<p>They are Ruby 1.9 compatible<br />
Requirements</p>
<p>* MySQL 5.0.51a<br />
* Ruby 1.8.6, 1.9.0</p>
<p>here is the link http://tmtm.org/en/mysql/ruby/</p>
<p>Great Job</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frederico-araujo.com/2008/03/07/ruby-mysql-now-ruby-19-compatible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypt folders in Mac OSX with encfs</title>
		<link>http://www.frederico-araujo.com/2007/12/17/encrypt-folders-in-mac-osx-with-encfs/</link>
		<comments>http://www.frederico-araujo.com/2007/12/17/encrypt-folders-in-mac-osx-with-encfs/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 05:01:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[encfs]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.frederico-araujo.com/?p=25</guid>
		<description><![CDATA[Encrypt folders in Mac OSX with encfs
OSX already include the File Vault functionality that allows you to encrypt your whole Home Folder.
Thou the storage overhead is so small, the time to encrypt it the first time is very very long.
if you have Videos, and big files, it takes even longer.
What if I don&#8217;t want to [...]]]></description>
			<content:encoded><![CDATA[<p>Encrypt folders in Mac OSX with encfs</p>
<p>OSX already include the File Vault functionality that allows you to encrypt your whole Home Folder.<br />
Thou the storage overhead is so small, the time to encrypt it the first time is very very long.<br />
if you have Videos, and big files, it takes even longer.</p>
<p>What if I don&#8217;t want to encrypt my big folders like Movies, Music, Pictures, Pdfs?</p>
<p>I only want to encrypt my Documents folder.<br />
Be aware that VMWARE stored the virtual machine files under this folder, you should move it to outside Documents.</p>
<p><strong> WARNING: </strong></p>
<p>Be careful with this tutorial,<br />
Write down your password somewhere and BACKUP your data before going further these steps.</p>
<p>if you forget your password, say good bye to your data.</p>
<p>THERE IS NO WAY TO GET YOUR DATA BACK!!!</p>
<p><strong>TOOLS required: </strong></p>
<p><code><br />
# update your ports to get the latest encfs that runs ok on OSX10.5<br />
$ sudo port selfupdate</code></p>
<p># install encfs<br />
$ sudo port install encfs<br />
</code></p>
<p>or Download macfuse and encfs from google:</p>
<p>http://code.google.com/p/macfuse/</p>
<p>and</p>
<p>http://code.google.com/p/encfs/</p>
<p><strong>Lets move The Documents folder contents to another folder:</strong></p>
<p><code><br />
$ cd<br />
$ mkdir temp_documents<br />
$ mv Documents/* temp_documents/<br />
</code></p>
<p><strong>Create the directory to hold the encrypted files, it can be any name.</strong></p>
<p>Run this only one time. The first time to setup the folder...<br />
<code><br />
$ mkdir .documents<br />
</code></p>
<p><strong> Setup the encryption </strong><br />
<code><br />
$ encfs ~/.documents/ ~/Documents/<br />
</code></p>
<p>you will see this:</p>
<pre>
fred@Macintosh ~ $ encfs ~/.documents/ ~/Documents/
Creating new encrypted volume.
Please choose from one of the following options:
enter "x" for expert configuration mode,
enter "p" for pre-configured paranoia mode,
anything else, or an empty line will select standard mode.
</pre>
<p>now, after you pass this step, the file system will be mounted as well.</p>
<p>encfs uses FuseFS, so it behaves just like a mount point</p>
<p>to unmount it you do</p>
<p><code><br />
$ unmount ~/Documents<br />
</code></p>
<p>to mount it again issue this command:<br />
<code><br />
$ encfs ~/.documents/ ~/Documents/<br />
# or this way, which will look with better names and a folder icon on Desktop:<br />
$ encfs ~/.documents/ ~/Documents/ -- -o fsname=Documents -o volname=Documents -o local<br />
</code></p>
<p>to check mounted filesystems</p>
<p><code><br />
$ mount<br />
</code></p>
<p>you should be able to see:</p>
<p><code><br />
encfs@fuse2 on /Users/fred/Documents (fusefs, nodev, nosuid, synchronous, mounted by fred)<br />
</code></p>
<p>or this if you used the longer command.<br />
<code><br />
Documents on /Users/fred/Documents (fusefs, local, nodev, nosuid, synchronous, mounted by fred)<br />
</code></p>
<p>Now, with the encrypted folder "mounted", mv the data from that temp folder to the new encrypted folder:</p>
<p><strong> WARNING: be carefull here </strong></p>
<p><code><br />
$ cp temp_documents/* Documents/<br />
$ rm -rf temp_documents/<br />
</code></p>
<p>that's it folks.</p>
<p>Final overview:</p>
<p><code><br />
# to create the encrypted folder:<br />
$ encfs ~/.documents/ ~/Documents/<br />
#to Mount it (enable)<br />
$ encfs ~/.documents/ ~/Documents/<br />
#or<br />
$ encfs ~/.documents/ ~/Documents/ -- -o fsname=Documents -o volname=Documents -o local<br />
#to Umount it (disable)<br />
$ umount ~/Documents<br />
</code></p>
<p><b> don't change anything inside .documents</b><br />
remember the dot in the front means the folder is invisible<br />
you won't see it in Finder.</p>
<p>This also should work for Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.frederico-araujo.com/2007/12/17/encrypt-folders-in-mac-osx-with-encfs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
