Article RSS Feed
http://www.snippety.org/rss/
en-us40The main blog feed for www.snippety.org.Internet: Tuning Apache for Maximum Performance<p>Apache is an open-source <span class="caps">HTTP</span> 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.</p>
<p>Apache server performance can be improved by adding additional hardware resources such as <span class="caps">RAM</span>, faster <span class="caps">CPU</span>, 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 – especially enough <span class="caps">RAM</span> that the server isn’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] <span class="caps">MPM</span>. 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.</p>Mon, 03 Mar 2008 11:12:24 GMThttp://www.snippety.org/articles/2008/03/03/internet-tuning-apache-for-maximum-performance/
http://www.snippety.org/articles/2008/03/03/internet-tuning-apache-for-maximum-performance/
Headless Compaq desktop (boot without a keyboard attached)<p>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:</p>
<p><em>1. Set a power on password (under security in the <span class="caps">BIOS</span> settings)</em>
<em>2. Go back into security menu and select the new item that appears just below power on password, it’s called password settings or suchlike.</em>
<em>3. Enable Network server mode</em></p>
<p><em>Your machine will now boot happily without a keyboard, and in case you wonder also without asking for the password you just set.</em></p>
<p><em>The keyboard, if anyone does plug one in, is disabled except during power up when you can still press <span class="caps">F10</span> for setup. Doing so will then lead to a prompt for the password.</em></p>
<p>I tried the above tip and it works perfectly, for correctness: the “password settings” option in the <span class="caps">BIOS</span> is called <strong>password options</strong> instead of “password settings”.</p>Mon, 14 Jan 2008 19:24:48 GMThttp://www.snippety.org/articles/2008/01/14/headless-compaq-desktop-boot-without-a-keyboard-attached/
http://www.snippety.org/articles/2008/01/14/headless-compaq-desktop-boot-without-a-keyboard-attached/
Install FreeBSD 7.0 on a ZFS partition<p><span class="caps">ZFS</span> is an exciting new file system developed by Sun and recently ported to FreeBSD. Many people are excited by the possibilities of <span class="caps">ZFS</span> (including us) as it promises to simplify a great many things. It offers:</p>
<ul>
<li>increased reliability through checksums, multiple copies of data and self-healing <span class="caps">RAID</span></li>
<li>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.</li>
<li>built-in compression and encryption</li>
<li>built-in <span class="caps">NFS</span> file sharing</li>
<li>clean, easy to use toolset for creating storage pools, volumes and much more</li>
<li>snapshots and rollbacks for backups</li>
</ul>Tue, 01 Jan 2008 11:24:17 GMThttp://www.snippety.org/articles/2008/01/01/install-freebsd-7-0-on-a-zfs-partition/
http://www.snippety.org/articles/2008/01/01/install-freebsd-7-0-on-a-zfs-partition/
Rotating Rails Log Files<p>taken from: <a href="http://www.nullislove.com/">NullIsLove</a></p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>Wed, 28 Nov 2007 19:39:20 GMThttp://www.snippety.org/articles/2007/11/28/rotating-rails-log-files/
http://www.snippety.org/articles/2007/11/28/rotating-rails-log-files/
Network cloning a FreeBSD system<p>On this <a href="http://tomclegg.net">website</a> I found the following tip:</p>
<p><strong>Cloning a FreeBSD system</strong></p>
<p>Simplifying by assuming a single partition, a secure network, and ucspi-tcp already installed on <span class="caps">ORIG</span>…</p>
<p>Install fresh hard disk in <span class="caps">CLONE</span>, and boot from a FreeBSD rescue floppy.</p>
<p>Rather than installing, go to the “configure” submenu and do “fdisk” and “slice.” Use <span class="caps">W Q</span> instead of just Q to quit each one. Install a boot manager just as if you were building a new system.</p>
<p>Go back to the main menu and choose “fixit,” then “live filesystem on CD-ROM.”</p>Wed, 28 Nov 2007 16:06:59 GMThttp://www.snippety.org/articles/2007/11/28/network-cloning-a-freebsd-system/
http://www.snippety.org/articles/2007/11/28/network-cloning-a-freebsd-system/
Internet: IPV6 and Thomson Speedtouch 500 series<p>In order to get a <span class="caps">IPV6</span> tunnel working with a Thomson Speedtouch 500 series <span class="caps">ADSL</span> modem like the Speedtouch 510. You will have to set the following option in your modem:</p>
<p>(connect via telnet)</p>
<code>=> nat unbind application IP6TO4 port=1[ENTER]</code><br />
<p>Other IPv6 tunneling tips can be found on <a href="http://tunnel-broker.singnet.com.sg/faq.html">this</a> website.</p>Fri, 28 Sep 2007 18:16:27 GMThttp://www.snippety.org/articles/2007/09/28/internet-ipv6-and-thomson-speedtouch-500-series/
http://www.snippety.org/articles/2007/09/28/internet-ipv6-and-thomson-speedtouch-500-series/
Howto enable compiz-fusion in Ubuntu Feisty<p>Linux desktop effects have come a long way. Over time we’ve seen different implementations like compiz & 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’s still a little bit tricky to get it to work though.</p>Fri, 21 Sep 2007 13:23:01 GMThttp://www.snippety.org/articles/2007/09/21/howto-enable-compiz-fusion-in-ubuntu-feisty/
http://www.snippety.org/articles/2007/09/21/howto-enable-compiz-fusion-in-ubuntu-feisty/
How to create and use patch files in Linux, BSD and Unix<p><strong>Creating a Patch File:</strong> <br />
diff -Naur oldfile newfile >patch_file</p>
<p><strong>Patching a File:</strong><br />
patch -p0 <patch_file</p>
<p>Note about patch levels (-p0, -p1, -p2, -p3, ..)</p>
<p>The -p option will optionally strip off directory levels from the patchfile. For Ex: if you have a patchfile with a header as such:</p>
<code>--- old/modules/file Mon Sep 10 08:02:57 2007</code><br />
<code>+++ new/modules/file Tue Sep 11 14:25:13 2007</code><br />
<p>Using a -p0 will expect, from your current working directory, to find a subdirectory called “new”, then “modules” below that, then the “pcitable” file below that.</p>
<p>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 “modules”, then a file called “pcitable”. Patch will ignore the “new” directory mentioned in the header of the patchfile.</p>
<p>Using a -p2 will strip of the first two levels from the path. Patch will expect to find “file” in the current working directory. Patch will ignore the “new” and “modules” directories mentioned in the header of the patchfile.</p>
<p>Using a -p3 in this example would not be a good thing. Patch probably wouldn’t patch anything.</p>Thu, 13 Sep 2007 13:45:34 GMThttp://www.snippety.org/articles/2007/09/13/how-to-create-and-use-patch-files-in-linux-bsd-and-unix/
http://www.snippety.org/articles/2007/09/13/how-to-create-and-use-patch-files-in-linux-bsd-and-unix/
Subversion + Rails In Five Minutes<p><a href="http://blog.mondragon.cc/articles/2006/11/05/subversion-rails-in-five-minutes">This</a> 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.</p>Mon, 20 Aug 2007 21:09:41 GMThttp://www.snippety.org/articles/2007/08/20/subversion-rails-in-five-minutes/
http://www.snippety.org/articles/2007/08/20/subversion-rails-in-five-minutes/
Unix: Useful Shell Shortcuts in Bash and (t)csh<p>The following website contains several very handy shortcuts and one-liners for both the bash and the (t)csh shells.</p>Wed, 06 Jun 2007 19:27:33 GMThttp://www.snippety.org/articles/2007/06/06/unix-useful-shell-shortcuts-in-bash-and-tcsh/
http://www.snippety.org/articles/2007/06/06/unix-useful-shell-shortcuts-in-bash-and-tcsh/
Add Flash support to firefox without linux-compatibility installed. <p><a href="http://www.riondabsd.net/2007/05/23/flash-on-freebsd-using-gnash/">This</a> weblog explains how to play flash on FreeBSD without Linux compatibility installed.</p>Wed, 30 May 2007 09:48:26 GMThttp://www.snippety.org/articles/2007/05/30/add-flash-support-to-firefox-without-linux-compatibility-installed-/
http://www.snippety.org/articles/2007/05/30/add-flash-support-to-firefox-without-linux-compatibility-installed-/
OpenBSD: Squid proxy server<p>I found a nice howto to setup a OpenBSD box as a Webproxy server including clam anti-virus.</p>
<p>You can find the howto <a href="http://www.kernel-panic.it/openbsd/proxy/index.html">here</a></p>Mon, 21 May 2007 21:43:52 GMThttp://www.snippety.org/articles/2007/05/21/openbsd-squid-proxy-server/
http://www.snippety.org/articles/2007/05/21/openbsd-squid-proxy-server/
Checking Memory Usage on FreeBSDYou can check the installed memory in a FreeBSD box with the following one liner:
<code>sysctl vm.vmtotal</code>Thu, 19 Apr 2007 08:04:17 GMThttp://www.snippety.org/articles/2007/04/19/checking-memory-usage-on-freebsd/
http://www.snippety.org/articles/2007/04/19/checking-memory-usage-on-freebsd/
Internet: Speedup Google Analytics<p>Ever notice that sometimes your sites take a while to load all the way because google’s urchin.js file is taking forever?</p>
<p>You may recognize this problem when you see something similar to this in your browsers status bar “Transferring data from google-analytics.com…”</p>Tue, 17 Apr 2007 19:59:18 GMThttp://www.snippety.org/articles/2007/04/17/speedup-google-analytics/
http://www.snippety.org/articles/2007/04/17/speedup-google-analytics/
Backing up an entire hard drive under UNIX<p><a href="http://www.builderau.com.au/program/unix/soa/Backing_up_an_entire_hard_drive_under_UNIX_/0,339024638,339274490,00.htm">This</a> article walks you through the process needed to create an identical copy of an entire disk under <span class="caps">UNIX</span>. It is useful to create a system image for installation or backup purposes. You will need a second hard drive of the same or larger size as a destination for the backup. The disk created will be full bootable; in the event of a drive failure, this backup drive can be swapped in for the previous drive and the system will boot and be in the same state that it was in when the backup was made. While booting off a drive that believes that it is a powered-on system is not ideal, it can get you back into operation quickly. In addition, the backup disk can be used as a perfect copy of the file structure, in case of permissions problems or data corruption.</p>Thu, 29 Mar 2007 09:39:50 GMThttp://www.snippety.org/articles/2007/03/29/backing_up_an_entire_hard_drive_under_unix.html/
http://www.snippety.org/articles/2007/03/29/backing_up_an_entire_hard_drive_under_unix.html/