<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Article RSS Feed</title>
    <link>http://www.snippety.org/rss/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The main blog feed for www.snippety.org.</description>
    
    
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/snippety" type="application/rss+xml" /><item>
          <title>Installing Passenger Nginx module on FreeBSD</title>
          <description>Currently (at least when I wrote this article) the FreeBSD ports system didn't contain a port for the Passenger Nginx module to deploy a Ruby on Rails application in the Nginx webserver, but it did contain all the necessary components. 

It is rather simple the use the nginx and rubygem-passenger from the port system and enable passenger support in Nginx.

</description>
          <pubDate>Sat, 16 May 2009 13:07:23 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2009/05/16/installing-passenger-nginx-module-on-freebsd/</guid>
          <link>http://www.snippety.org/articles/2009/05/16/installing-passenger-nginx-module-on-freebsd/</link>
        </item>
    
        <item>
          <title>Ubuntu Performance Tuning</title>
          <description>&lt;p&gt;The overall performance of Ubuntu Linux is fine but to further tune the following can be done :&lt;/p&gt;


	&lt;p&gt;1. If you are not using IPv6 it can be disabled as follows:&lt;/p&gt;


	&lt;p&gt;In &lt;strong&gt;/etc/modprobe.d/aliases&lt;/strong&gt; change the line &lt;strong&gt;alias net-pf-10 ipv6&lt;/strong&gt; into &lt;strong&gt;alias net-pf-10 off #ipv6&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;2. Start daemon/processes in parallel&lt;/p&gt;


	&lt;p&gt;Change /etc/init.d/rc from &lt;strong&gt;&lt;span class="caps"&gt;CONCURRENCY&lt;/span&gt;=none&lt;/strong&gt; in &lt;strong&gt;&lt;span class="caps"&gt;CONCURRENCY&lt;/span&gt;=shell&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;3. Add your hostname in the host file (default on hardy &amp;#38; intrepid).
If you add your host name to the &lt;strong&gt;/etc/hosts&lt;/strong&gt; file some apps will start quicker.
e.g. &lt;strong&gt;127.0.1.1 myhostname&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;4. Install &lt;strong&gt;preload&lt;/strong&gt;.
Startup times on apps. can be further improved by installing &lt;strong&gt;preload&lt;/strong&gt; (apt-get install preload)&lt;/p&gt;


	&lt;p&gt;5. Decrease Swappiness setting&lt;/p&gt;


	&lt;p&gt;If you got plenty of ram (&amp;gt;1GB) you can decrease the use of the swap file by changing the vm.swappiness sysctl entry from 60 to &lt;strong&gt;10&lt;/strong&gt;. If you like to further reduce swapfile usage you can set this value to &lt;strong&gt;0* which will not disable swapfile usage but will reduce it to the absolute minimum.
To change the sysctl entry *sysctl vm.swappiness=10&lt;/strong&gt; can be used, to let this setting survive a reboot &lt;strong&gt;vm.swapiness=10&lt;/strong&gt; can be added to the &lt;strong&gt;/etc/sysctl.conf&lt;/strong&gt; file.&lt;/p&gt;


	&lt;p&gt;I’ve found that the value of 5 works very good for my use and I have 2 GB of memory.&lt;/p&gt;


	&lt;p&gt;6. Use the profile option of grub to reduce startup time.&lt;/p&gt;


	&lt;p&gt;Hit the escape button when booting to get to the grub menu, select the default kernel and select edit, add the profile option to the end of the kernel line and boot your system.&lt;/p&gt;


	&lt;p&gt;8. Disable unused services.&lt;/p&gt;


	&lt;p&gt;9. Use the noatime mount option to disable updating the access time on files.&lt;/p&gt;


	&lt;p&gt;If you have additional tips I&amp;#8217;m more then willing to test/add them to this list.&lt;/p&gt;</description>
          <pubDate>Tue, 23 Sep 2008 13:06:18 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2008/09/23/ubuntu-performance-tuning/</guid>
          <link>http://www.snippety.org/articles/2008/09/23/ubuntu-performance-tuning/</link>
        </item>
    
        <item>
          <title>Internet: Javascript Techniques</title>
          <description>&lt;p&gt;Developers and designers are using more and more JavaScript in modern designs. Sometimes this can be a hindrance to the user and take away from the simplicity of the design, and other times it can add greatly to the user’s experience. The key is a) adding the right amount of JavaScript, and b) using the right JavaScript techniques.&lt;/p&gt;


	&lt;p&gt;More: &lt;a href="http://www.smashingmagazine.com/2008/09/11/75-really-useful-javascript-techniques/"&gt;continued here&lt;/a&gt;&lt;/p&gt;</description>
          <pubDate>Fri, 12 Sep 2008 14:02:12 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2008/09/12/internet-javascript-techniques/</guid>
          <link>http://www.snippety.org/articles/2008/09/12/internet-javascript-techniques/</link>
        </item>
    
        <item>
          <title>Programming: Regular Expressions tips and tricks</title>
          <description>&lt;p&gt;I knew it from the first glance, that regular expressions were very very beautiful. As of today, I feel that I have a pretty good grasp of regular expressions.&lt;/p&gt;


	&lt;p&gt;More: &lt;a href="http://www.blackhat-seo.com/2007/regex-tips-and-tricks/"&gt;continued here&lt;/a&gt;&lt;/p&gt;</description>
          <pubDate>Wed, 10 Sep 2008 06:26:46 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2008/09/10/programming-regular-expressions-tips-and-tricks/</guid>
          <link>http://www.snippety.org/articles/2008/09/10/programming-regular-expressions-tips-and-tricks/</link>
        </item>
    
        <item>
          <title>Internet: Tuning Apache for Maximum Performance</title>
          <description>&lt;p&gt;Apache is an open-source &lt;span class="caps"&gt;HTTP&lt;/span&gt; server implementation. It is the most popular web server on the Internet; the December 2005 Web Server Survey conducted by Netcraft [1] shows that about 70% of the web sites on Internet are using Apache.&lt;/p&gt;


	&lt;p&gt;Apache server performance can be improved by adding additional hardware resources such as &lt;span class="caps"&gt;RAM&lt;/span&gt;, faster &lt;span class="caps"&gt;CPU&lt;/span&gt;, etc. But most of the time, the same result can be achieved by custom configuration of the server. This article looks into getting maximum performance out of Apache with the existing hardware resources, specifically on Linux systems. Of course, it is assumed that there is enough hardware resources &amp;#8211; especially enough &lt;span class="caps"&gt;RAM&lt;/span&gt; that the server isn&amp;#8217;t swapping frequently. First two sections look into various Compile-Time and Run-Time configuration options. The Run-Time section assumes that Apache is compiled with prefork [1] &lt;span class="caps"&gt;MPM&lt;/span&gt;. HTTP compression and caching is discussed next. Finally, using separate servers for serving static and dynamic contents is covered. Basic knowledge of compiling and configuring Apache and Linux are assumed.&lt;/p&gt;</description>
          <pubDate>Mon, 03 Mar 2008 11:12:24 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2008/03/03/internet-tuning-apache-for-maximum-performance/</guid>
          <link>http://www.snippety.org/articles/2008/03/03/internet-tuning-apache-for-maximum-performance/</link>
        </item>
    
        <item>
          <title>Headless Compaq desktop (boot without a keyboard attached)</title>
          <description>&lt;p&gt;Searching for the old Compaq nof1.exe utility (A utility to change a Compaq Desktop to boot without a keyboard attached) I came across the following tip:&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;1. Set a power on password (under security in the &lt;span class="caps"&gt;BIOS&lt;/span&gt; settings)&lt;/em&gt;
&lt;em&gt;2. Go back into security menu and select the new item that appears just below power on password, it&amp;#8217;s called password settings or suchlike.&lt;/em&gt;
&lt;em&gt;3. Enable Network server mode&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Your machine will now boot happily without a keyboard, and in case you wonder also without asking for the password you just set.&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;The keyboard, if anyone does plug one in, is disabled except during power up when you can still press &lt;span class="caps"&gt;F10&lt;/span&gt; for setup. Doing so will then lead to a prompt for the password.&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;I tried the above tip and it works perfectly, for correctness: the &amp;#8220;password settings&amp;#8221; option in the &lt;span class="caps"&gt;BIOS&lt;/span&gt; is called &lt;strong&gt;password options&lt;/strong&gt; instead of &amp;#8220;password settings&amp;#8221;.&lt;/p&gt;</description>
          <pubDate>Mon, 14 Jan 2008 19:24:48 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2008/01/14/headless-compaq-desktop-boot-without-a-keyboard-attached/</guid>
          <link>http://www.snippety.org/articles/2008/01/14/headless-compaq-desktop-boot-without-a-keyboard-attached/</link>
        </item>
    
        <item>
          <title>Install FreeBSD 7.0 on a ZFS partition</title>
          <description>&lt;p&gt;&lt;span class="caps"&gt;ZFS&lt;/span&gt; is an exciting new file system developed by Sun and recently ported to FreeBSD. Many people are excited by the possibilities of &lt;span class="caps"&gt;ZFS&lt;/span&gt; (including us) as it promises to simplify a great many things. It offers:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;increased reliability through checksums, multiple copies of data and self-healing &lt;span class="caps"&gt;RAID&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;elimination of that dreaded “oh, if only I’d made the /var partition larger” feeling. Partitions can now be resized at any time and in fact can each be allocated up to the full size of the storage media.&lt;/li&gt;
		&lt;li&gt;built-in compression and encryption&lt;/li&gt;
		&lt;li&gt;built-in &lt;span class="caps"&gt;NFS&lt;/span&gt; file sharing&lt;/li&gt;
		&lt;li&gt;clean, easy to use toolset for creating storage pools, volumes and much more&lt;/li&gt;
		&lt;li&gt;snapshots and rollbacks for backups&lt;/li&gt;
	&lt;/ul&gt;</description>
          <pubDate>Tue, 01 Jan 2008 11:24:17 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2008/01/01/install-freebsd-7-0-on-a-zfs-partition/</guid>
          <link>http://www.snippety.org/articles/2008/01/01/install-freebsd-7-0-on-a-zfs-partition/</link>
        </item>
    
        <item>
          <title>Rotating Rails Log Files</title>
          <description>&lt;p&gt;taken from: &lt;a href="http://www.nullislove.com/"&gt;NullIsLove&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;One of the chores I dislike most is cleaning up and clearing out the log files in my Rails applications. On some of my higher profile sites, I get a lot of spiders probing my applications for security holes. They don’t succeed (knock on wood) but they do fill up my log files with errors.&lt;/p&gt;


	&lt;p&gt;I finally decided to get smart and get lazy (the two best traits a programmer can have), and I set up automatic log rotation on all of my Rails applications. The idea behind log rotation is simple: make a back up of the current log file, continue logging into a new or cleared log file, and discard log files that are older than a certain date.&lt;/p&gt;


	&lt;p&gt;Your webserver probably already rotates its own log files. For Apache, they are probably located in /etc/httpd/logs and they are probably rotated weekly. These logs store everything Apache does. Simple webserver stats and traffic analysis tools make use of these log files to show who visits a site when and what pages are viewed.&lt;/p&gt;


	&lt;p&gt;While it is possible to configure your Rails application to log to your Apache log files, I do not think it is a good practice. It’s much better to give each Rails application its own log file—it will be easier to find important Rails errors, it will keep your Apache logs cleaner and Rails is set up to keep its own logs by default. Fortunately, on a Linux server the built-in logrotate program will make the process super-easy. After the jump, I’ll walk you through the steps to get it set up.&lt;/p&gt;</description>
          <pubDate>Wed, 28 Nov 2007 19:39:20 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/11/28/rotating-rails-log-files/</guid>
          <link>http://www.snippety.org/articles/2007/11/28/rotating-rails-log-files/</link>
        </item>
    
        <item>
          <title>Network cloning a FreeBSD system</title>
          <description>&lt;p&gt;On this &lt;a href="http://tomclegg.net"&gt;website&lt;/a&gt; I found the following tip:&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Cloning a FreeBSD system&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Simplifying by assuming a single partition, a secure network, and ucspi-tcp already installed on &lt;span class="caps"&gt;ORIG&lt;/span&gt;&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Install fresh hard disk in &lt;span class="caps"&gt;CLONE&lt;/span&gt;, and boot from a FreeBSD rescue floppy.&lt;/p&gt;


	&lt;p&gt;Rather than installing, go to the &amp;#8220;configure&amp;#8221; submenu and do &amp;#8220;fdisk&amp;#8221; and &amp;#8220;slice.&amp;#8221; Use &lt;span class="caps"&gt;W Q&lt;/span&gt; instead of just Q to quit each one. Install a boot manager just as if you were building a new system.&lt;/p&gt;


	&lt;p&gt;Go back to the main menu and choose &amp;#8220;fixit,&amp;#8221; then &amp;#8220;live filesystem on CD-ROM.&amp;#8221;&lt;/p&gt;</description>
          <pubDate>Wed, 28 Nov 2007 16:06:59 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/11/28/network-cloning-a-freebsd-system/</guid>
          <link>http://www.snippety.org/articles/2007/11/28/network-cloning-a-freebsd-system/</link>
        </item>
    
        <item>
          <title>Internet: IPV6 and Thomson Speedtouch 500 series</title>
          <description>&lt;p&gt;In order to get a &lt;span class="caps"&gt;IPV6&lt;/span&gt; tunnel working with a Thomson Speedtouch 500 series &lt;span class="caps"&gt;ADSL&lt;/span&gt; modem like the Speedtouch 510. You will have to set the following option in your modem:&lt;/p&gt;


	&lt;p&gt;(connect via telnet)&lt;/p&gt;


&lt;code&gt;=&amp;gt; nat unbind application IP6TO4 port=1[ENTER]&lt;/code&gt;&lt;br /&gt;

	&lt;p&gt;Other IPv6 tunneling tips can be found on &lt;a href="http://tunnel-broker.singnet.com.sg/faq.html"&gt;this&lt;/a&gt; website.&lt;/p&gt;</description>
          <pubDate>Fri, 28 Sep 2007 18:16:27 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/09/28/internet-ipv6-and-thomson-speedtouch-500-series/</guid>
          <link>http://www.snippety.org/articles/2007/09/28/internet-ipv6-and-thomson-speedtouch-500-series/</link>
        </item>
    
        <item>
          <title>Howto enable compiz-fusion in Ubuntu Feisty</title>
          <description>&lt;p&gt;Linux desktop effects have come a long way. Over time we&amp;#8217;ve seen different implementations like compiz &amp;#38; beryl. These 2 projects have lead a life of their own but have now been merged back together again in a new project called: compiz-fusion. Compiz-fusion has got some awesome eye candy effects, but it&amp;#8217;s still a little bit tricky to get it to work though.&lt;/p&gt;</description>
          <pubDate>Fri, 21 Sep 2007 13:23:01 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/09/21/howto-enable-compiz-fusion-in-ubuntu-feisty/</guid>
          <link>http://www.snippety.org/articles/2007/09/21/howto-enable-compiz-fusion-in-ubuntu-feisty/</link>
        </item>
    
        <item>
          <title>How to create and use patch files in Linux, BSD and Unix</title>
          <description>&lt;p&gt;&lt;strong&gt;Creating a Patch File:&lt;/strong&gt; &lt;br /&gt;
diff -Naur oldfile newfile &amp;gt;patch_file&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Patching a File:&lt;/strong&gt;&lt;br /&gt;
patch -p0 &lt;patch_file&lt;/p&gt;


	&lt;p&gt;Note about patch levels (-p0, -p1, -p2, -p3, ..)&lt;/p&gt;


	&lt;p&gt;The -p option will optionally strip off directory levels from the patchfile. For Ex: if you have a patchfile with a header as such:&lt;/p&gt;


&lt;code&gt;--- old/modules/file         Mon Sep 10 08:02:57 2007&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;+++ new/modules/file            Tue Sep 11 14:25:13 2007&lt;/code&gt;&lt;br /&gt;

	&lt;p&gt;Using a -p0 will expect, from your current working directory, to find a subdirectory called &amp;#8220;new&amp;#8221;, then &amp;#8220;modules&amp;#8221; below that, then the &amp;#8220;pcitable&amp;#8221; file below that.&lt;/p&gt;


	&lt;p&gt;Using a -p1 will strip off the 1st level from the path and will expect to find (from your current working directory) a directory called &amp;#8220;modules&amp;#8221;, then a file called &amp;#8220;pcitable&amp;#8221;. Patch will ignore the &amp;#8220;new&amp;#8221; directory mentioned in the header of the patchfile.&lt;/p&gt;


	&lt;p&gt;Using a -p2 will strip of the first two levels from the path. Patch will expect to find &amp;#8220;file&amp;#8221; in the current working directory. Patch will ignore the &amp;#8220;new&amp;#8221; and &amp;#8220;modules&amp;#8221; directories mentioned in the header of the patchfile.&lt;/p&gt;


	&lt;p&gt;Using a -p3 in this example would not be a good thing. Patch probably wouldn&amp;#8217;t patch anything.&lt;/p&gt;</description>
          <pubDate>Thu, 13 Sep 2007 13:45:34 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/09/13/how-to-create-and-use-patch-files-in-linux-bsd-and-unix/</guid>
          <link>http://www.snippety.org/articles/2007/09/13/how-to-create-and-use-patch-files-in-linux-bsd-and-unix/</link>
        </item>
    
        <item>
          <title> Subversion + Rails In Five Minutes</title>
          <description>&lt;p&gt;&lt;a href="http://blog.mondragon.cc/articles/2006/11/05/subversion-rails-in-five-minutes"&gt;This&lt;/a&gt; is a quick set of subversion commands to create a repository for your Rails application. The repository is dedicated to your Rails app so the head of your source will be in the trunk, version releases will be in tags, and branches for you code base will be in branches.&lt;/p&gt;</description>
          <pubDate>Mon, 20 Aug 2007 21:09:41 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/08/20/subversion-rails-in-five-minutes/</guid>
          <link>http://www.snippety.org/articles/2007/08/20/subversion-rails-in-five-minutes/</link>
        </item>
    
        <item>
          <title>Unix: Useful Shell Shortcuts in Bash and (t)csh</title>
          <description>&lt;p&gt;The following website contains several very handy shortcuts and one-liners for both the bash and the (t)csh shells.&lt;/p&gt;</description>
          <pubDate>Wed, 06 Jun 2007 19:27:33 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/06/06/unix-useful-shell-shortcuts-in-bash-and-tcsh/</guid>
          <link>http://www.snippety.org/articles/2007/06/06/unix-useful-shell-shortcuts-in-bash-and-tcsh/</link>
        </item>
    
        <item>
          <title>Add Flash support to firefox without linux-compatibility installed. </title>
          <description>&lt;p&gt;&lt;a href="http://www.riondabsd.net/2007/05/23/flash-on-freebsd-using-gnash/"&gt;This&lt;/a&gt; weblog explains how to play flash on FreeBSD without Linux compatibility installed.&lt;/p&gt;</description>
          <pubDate>Wed, 30 May 2007 09:48:26 GMT</pubDate>
          <guid>http://www.snippety.org/articles/2007/05/30/add-flash-support-to-firefox-without-linux-compatibility-installed-/</guid>
          <link>http://www.snippety.org/articles/2007/05/30/add-flash-support-to-firefox-without-linux-compatibility-installed-/</link>
        </item>
    
    
  </channel>
</rss>
