<?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>ANDREW PENG &#187; compootin&#8217;</title>
	<atom:link href="http://andrewpeng.net/posts/tag/compootin/feed" rel="self" type="application/rss+xml" />
	<link>http://andrewpeng.net</link>
	<description>Unattended children will be given an espresso and a free puppy</description>
	<lastBuildDate>Fri, 18 May 2012 18:53:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Disable the camera shutter sound in the Google Nexus S 4G</title>
		<link>http://andrewpeng.net/posts/2012/01/311444-disable-the-camera-shutter-sound-in-the-google-nexus-s-4g.html</link>
		<comments>http://andrewpeng.net/posts/2012/01/311444-disable-the-camera-shutter-sound-in-the-google-nexus-s-4g.html#comments</comments>
		<pubDate>Tue, 31 Jan 2012 22:05:10 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[NexusS/How-to]]></category>
		<category><![CDATA[compootin']]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1444</guid>
		<description><![CDATA[Just wrote up a short how-to on how to disable the camera shutter sound in the Google Nexus S 4G &#8211; this requires superuser / root but otherwise is a 5 minute procedure.]]></description>
			<content:encoded><![CDATA[<p>Just wrote up <a href="http://andrewpeng.net/gadgets/google-nexus-s-4g-sprint/disable-camera-shutter-sound" target="_blank">a short how-to</a> on how to disable the camera shutter sound in the Google Nexus S 4G &#8211; this <em><strong>requires superuser / root</strong></em> but otherwise is a 5 minute procedure.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2012/01/311444-disable-the-camera-shutter-sound-in-the-google-nexus-s-4g.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imperial March</title>
		<link>http://andrewpeng.net/posts/2011/09/291367-imperial-march.html</link>
		<comments>http://andrewpeng.net/posts/2011/09/291367-imperial-march.html#comments</comments>
		<pubDate>Thu, 29 Sep 2011 15:49:10 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Video]]></category>
		<category><![CDATA[compootin']]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1367</guid>
		<description><![CDATA[http://www.youtube.com/watch?v=yHJOz_y9rZE &#160; I thought it was appropriate.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<p><a href="http://www.youtube.com/watch?v=yHJOz_y9rZE">http://www.youtube.com/watch?v=yHJOz_y9rZE</a></p>
</p>
<p>&nbsp;</p>
<p>I thought it was appropriate.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/09/291367-imperial-march.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Network Interface Channel Bonding and DHCP</title>
		<link>http://andrewpeng.net/posts/2011/08/031345-linux-network-interface-channel-bonding-and-dhcp.html</link>
		<comments>http://andrewpeng.net/posts/2011/08/031345-linux-network-interface-channel-bonding-and-dhcp.html#comments</comments>
		<pubDate>Wed, 03 Aug 2011 11:40:06 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Linux/Command Line Hero]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[compootin']]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1345</guid>
		<description><![CDATA[While configuring a few servers I noticed some strange behavior with mode 4 channel bonding (LACP / 802.3ad) and DHCP. You might get the following error message, no matter what you do: Determining IP information for bond0&#8230; failed; no link present. Check cable? The problem appears to exist in how the interface responds to link [...]]]></description>
			<content:encoded><![CDATA[<p>While configuring a few servers I noticed some strange behavior with mode 4 <a href="http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding" target="_blank">channel bonding</a> (<a href="http://en.wikipedia.org/wiki/802.3ad" target="_blank">LACP / 802.3ad</a>) and DHCP. You might get the following error message, no matter what you do:</p>
<blockquote><p>Determining IP information for bond0&#8230; failed; no link present. Check cable?</p></blockquote>
<p>The problem appears to exist in how the interface responds to link status on LACP / 802.3ad ports. The computer is trying to send DHCP packets when the interface itself isn&#8217;t ready, causing Linux to think the interface isn&#8217;t configured or has no network cable plugged in. This appears to <em>only</em> happen when you use mode 4 channel bonding. Mode 6 works fine. The (band-aid) solution appears to be to trick the system into thinking the interface is already configured. This enables Linux to continue sending DHCP packets until the interface is configured and negotiated successfully with 802.3ad, at which point everything works as planned. Simply insert this at the end of <em>/etc/sysconfig/network-scripts/ifcfg-bond0</em> - I should note this particular example is for <em><a href="http://www.centos.org/" target="_blank">CentOS</a></em> and <em><a href="http://www.redhat.com/" target="_blank">RHEL</a></em> so I haven&#8217;t confirmed if this workaround works for <em><a href="http://www.debian.org/" target="_blank">Debian</a></em> based distributions.</p>
<blockquote><p>check_link_down () { return 1; }</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/08/031345-linux-network-interface-channel-bonding-and-dhcp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2^128 is a really big number</title>
		<link>http://andrewpeng.net/posts/2011/08/021340-2128-is-a-really-big-number.html</link>
		<comments>http://andrewpeng.net/posts/2011/08/021340-2128-is-a-really-big-number.html#comments</comments>
		<pubDate>Tue, 02 Aug 2011 10:04:15 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[compootin']]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1340</guid>
		<description><![CDATA[~ $ dig andrewpeng.net aaaa +short 2607:f298:1:104::a53:ecdd ~ $ What the hell is that? It&#8217;s my shiny new IPv6 address! Dreamhost makes it stupid easy to assign a IPv6 address to your account; just log into your panel, click on your domain, then just click Add IP Address and that&#8217;s it. I also added an [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>~ $ dig andrewpeng.net aaaa +short<br />
2607:f298:1:104::a53:ecdd</p>
<p>~ $</p></blockquote>
<p>What the <em>hell</em> is that? It&#8217;s my shiny new IPv6 address! Dreamhost makes it <em>stupid</em> easy to assign a IPv6 address to your account; just log into your panel, click on your domain, then just click <em>Add IP Address</em> and that&#8217;s it.</p>
<p>I also added an <em>AAAA</em> record for <em>ipv6.andrewpeng.net</em> to make sure to make the distinction for the IPv6 only subdomain, similar to ipv6.google.com and such. If you have IPv6 connectivity, go ahead and give it a try!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/08/021340-2128-is-a-really-big-number.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crisis Averted</title>
		<link>http://andrewpeng.net/posts/2011/07/221327-1327.html</link>
		<comments>http://andrewpeng.net/posts/2011/07/221327-1327.html#comments</comments>
		<pubDate>Sat, 23 Jul 2011 00:45:41 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Linux/Command Line Hero]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[compootin']]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1327</guid>
		<description><![CDATA[Really thought I lost the LVM share. There might actually be a bug in the PowerPC Debian kernel that causes it to kernel panic on large LVM partitions. Ever since I switched to an Athlon MP server from my old PowerMac, it hasn&#8217;t kernel panicked since. Nice to have a large network drive at home [...]]]></description>
			<content:encoded><![CDATA[<p>Really thought I lost the <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)" target="_blank">LVM</a> share. There might actually be a bug in the PowerPC Debian kernel that causes it to kernel panic on large LVM partitions. Ever since I switched to an Athlon MP server from my old PowerMac, it hasn&#8217;t kernel panicked since. Nice to have a large network drive at home again. Gonna take the plunge and convert the partition to <em><a href="http://en.wikipedia.org/wiki/Ext4" target="_blank">ext4</a></em> while I&#8217;m at it.</p>
<blockquote><p>pengc99@zeus:~$ sudo fsck.ext4 -fvy -C 0 /dev/mapper/MASS_STORAGE-STORAGE_LV<br />
e2fsck 1.41.12 (17-May-2010)<br />
Pass 1: Checking inodes, blocks, and sizes<br />
Pass 2: Checking directory structure<br />
Pass 3: Checking directory connectivity<br />
Pass 4: Checking reference counts<br />
Pass 5: Checking group summary information</p>
<p>342541 inodes used (0.19%)<br />
1892 non-contiguous files (0.6%)<br />
178 non-contiguous directories (0.1%)<br />
# of inodes with ind/dind/tind blocks: 57159/9867/16<br />
333728343 blocks used (91.11%)<br />
0 bad blocks<br />
57 large files</p>
<p>321274 regular files<br />
21258 directories<br />
0 character device files<br />
0 block device files<br />
0 fifos<br />
0 links<br />
0 symbolic links (0 fast symbolic links)<br />
0 sockets<br />
&#8212;&#8212;&#8211;<br />
342532 files<br />
pengc99@zeus:~$</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/07/221327-1327.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be nice to your servers</title>
		<link>http://andrewpeng.net/posts/2011/07/011294-be-nice-to-your-servers.html</link>
		<comments>http://andrewpeng.net/posts/2011/07/011294-be-nice-to-your-servers.html#comments</comments>
		<pubDate>Fri, 01 Jul 2011 14:00:16 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Cool!]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Wait]]></category>
		<category><![CDATA[what?]]></category>
		<category><![CDATA[compootin']]></category>
		<category><![CDATA[neato]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1294</guid>
		<description><![CDATA[http://www.youtube.com/watch?v=tDacjrSCeq4 Yelling at your servers can measurably negatively affect their performance. No joke. Make sure to treat your servers with respect, and keep it quiet in the datacenter! Perhaps there is a &#8220;brown note&#8221; for disks (&#8220;rust note&#8221;?) &#8211; some harmonic that destroys their performance; although based on what we think is happening (disk heads [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=tDacjrSCeq4">http://www.youtube.com/watch?v=tDacjrSCeq4</a></p>
<p>Yelling at your servers can measurably <em>negatively</em> affect their performance. No joke. Make sure to treat your servers with respect, and keep it quiet in the datacenter!</p>
<blockquote><p>Perhaps there is a &#8220;brown note&#8221; for disks (&#8220;rust note&#8221;?) &#8211; some harmonic that destroys their performance; although based on what we think is happening (disk heads being thrown off track), we think this has more to do with shock force than resonance. I&#8217;m sure there are disk vendor engineers out there who know all about this (Bryan links to a good reference in his blog entry).</p></blockquote>
<p>[Source: <a href="http://blogs.oracle.com/brendan/entry/unusual_disk_latency" target="_blank">Sun Microsystems Blog (now Oracle)</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/07/011294-be-nice-to-your-servers.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>memcached + WordPress + DreamHost Shared Hosting</title>
		<link>http://andrewpeng.net/posts/2011/06/271273-memcached-and-dreamhost-shared-tutorial.html</link>
		<comments>http://andrewpeng.net/posts/2011/06/271273-memcached-and-dreamhost-shared-tutorial.html#comments</comments>
		<pubDate>Mon, 27 Jun 2011 13:47:27 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Linux/Command Line Hero]]></category>
		<category><![CDATA[compootin']]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1273</guid>
		<description><![CDATA[The idea of using memcached on my shared hosting account had been bouncing around my head for a while; especially on my DreamHost shared hosting account. There are periods when the performance would suffer because of other users on the server, and I was also looking for a general increase in performance without having to [...]]]></description>
			<content:encoded><![CDATA[<p>The idea of using <a href="http://memcached.org/" target="_blank">memcached </a>on my shared hosting account had been bouncing around my head for a while; especially on my <a href="http://www.dreamhost.com" target="_blank">DreamHost</a> shared hosting account. There are periods when the performance would suffer because of other users on the server, and I was also looking for a general increase in performance without having to pay for an expensive dedicated server. I should start off by saying that <strong>what I&#8217;m about to explain only works if you have a VPS or Dedicated server that you can access already</strong>. It may seem redundant for a tutorial or howto guide on how to get memcached working in a shared environment if you already have a VPS available, but the practice and procedures will be useful to allow you to run other customer PHP modules on DreamHost shared hosting. In my case, I already had a VPS server I use for <a href="http://irssi.org/" target="_blank">Irssi</a> but was not configured to be a web server. It&#8217;s a stripped bare DreamHost VPS with sudo / root access, and a handful of IRC applications running in screen. I had stumbled across this deal, for $5/month (on top of your regular DreamHost bill) when they were beta testing VPS servers and I had volunteered for an account; somehow my account got tagged with the discount, so I decided why not and added one to the account. Not only that, I didn&#8217;t want to deal with the migration of switching my accounts over from the shared server to the VPS; the &#8220;seamless&#8221; transition they have setup is fairly deceiving; I find that it usually borks up the websites in the transfer and requires a fair bit of mucking to get everything working again.</p>
<p>The first obvious problem, even before you go about installing memcached support modules for your web application, is that DreamHost&#8217;s default PHP modules for their shared hosting environments do not include memcached. Later I found out that they also don&#8217;t have a build of <a href="http://www.imagemagick.org/script/index.php" target="_blank">Imagemagick</a>, but the procedures in this guide will apply to also allow you to install Imagemagick on your own.</p>
<p>Before we dive in and get our hands dirty, here&#8217;s a little background about memcached and why we want it. Memcached&#8217;s website <a href="http://memcached.org/about" target="_blank">says this</a> about what it is:</p>
<blockquote><p>memcached is a high-performance, distributed memory object caching system, generic in nature, but originally intended for use in speeding up dynamic web applications by alleviating database load.</p></blockquote>
<p>The gist of the issue is that PHP is a dynamically interpreted language. Unlike traditional languages like C or Java, you don&#8217;t &#8220;compile&#8221; it, you leave it as source. When someone stumbles on your website, the request for the page pulls the source code into the PHP interpreter, which then compiles it and executes the code before sending the result to your happy web visitor. Because the code is pulled, compiled, and ran each time someone visits your website, there is usually a pretty significant overhead as your PHP slowly stumbles through the compiler. This effect is especially bad for intensive CMS systems like <a href="http://www.wordpress.org" target="_blank">WordPress</a>, which is being used on this very website.</p>
<p>Memcached aims to speed the process up by caching frequently used <em>objects</em> that your PHP code uses &#8211; in the case of WordPress, this is achieved through the use of a plugin that queries the memcached server for a cached version of the object before recreating and recompiling the object from scratch. Even with the overhead of checking before creating the object, this results in a significant savings in compilation and execution time. The tradeoff is higher memory usage (<a href="http://en.wikipedia.org/wiki/Space-time_tradeoff" target="_blank">space-time tradeoff</a>). The memory usage isn&#8217;t really significant for a single user, but can easily balloon if there&#8217;s high-traffic website that is hitting the cache often. For this application, I&#8217;m just using memcached with the default cache size of 64mb.</p>
<p><span id="more-1273"></span>The first thing you&#8217;ll want to do is head on over to the PECL page and download the module of choice &#8211; since I&#8217;m working with memcached, <a href="http://pecl.php.net/package/memcache" target="_blank">this is the link for the PECL module</a>. I grabbed the latest stable version, which is 2.2.6 at the time of this writing. You&#8217;ll need to download and extract the archive on the DreamHost shared server into a temporary working directory.</p>
<blockquote><p>exodus:~/.php/5.3/src$ wget -nv http://pecl.php.net/get/memcache-2.2.6.tgz; tar -zxvf memcache-2.2.6.tgz<br />
2011-06-27 06:21:39 URL:http://pecl.php.net/get/memcache-2.2.6.tgz [35957/35957] -&gt; &#8220;memcache-2.2.6.tgz&#8221; [1]<br />
package.xml<br />
memcache-2.2.6/config.m4<br />
memcache-2.2.6/config9.m4<br />
memcache-2.2.6/config.w32<br />
memcache-2.2.6/CREDITS<br />
memcache-2.2.6/example.php<br />
memcache-2.2.6/memcache.c<br />
memcache-2.2.6/memcache_queue.c<br />
memcache-2.2.6/memcache_session.c<br />
memcache-2.2.6/memcache_standard_hash.c<br />
memcache-2.2.6/memcache_consistent_hash.c<br />
memcache-2.2.6/memcache.dsp<br />
memcache-2.2.6/php_memcache.h<br />
memcache-2.2.6/memcache_queue.h<br />
memcache-2.2.6/README<br />
memcache-2.2.6/memcache.php<br />
atomicfire@exodus:~/.php/5.3/src$</p></blockquote>
<p>Now that you have extracted the source, we can follow <a href="http://wiki.dreamhost.com/PHP.ini#Compiling_PHP_5.3_extensions" target="_blank">DreamHosts&#8217;s procedure</a> on building and installing custom modules:</p>
<blockquote><p>exodus:~/.php/5.3/src$ cd memcache-2.2.6<br />
exodus:~/.php/5.3/src/memcache-2.2.6$ /usr/local/php53/bin/phpize<br />
Configuring for:<br />
PHP Api Version:         20090626<br />
Zend Module Api No:      20090626<br />
Zend Extension Api No:   220090626<br />
exodus:~/.php/5.3/src/memcache-2.2.6$ ./configure &#8211;with-php-config=/usr/local/php53/bin/php-config &amp;&amp; make<br />
<em>&lt;lots of configure and build information here&gt;<br />
</em>exodus:~/.php/5.3/src/memcache-2.2.6$ cd modules<br />
exodus:~/.php/5.3/src/memcache-2.2.6/modules$ ls<br />
memcache.la  memcache.so<br />
exodus:~/.php/5.3/src/memcache-2.2.6/modules$</p></blockquote>
<p>With the build (hopefully) successfully finished, all we need to do now is move them to a folder where we can point our new PHP configuration file, and add the line into our <a href="http://wiki.dreamhost.com/PHP.ini#PHP_5.3" target="_blank">phprc file</a>:</p>
<blockquote><p>exodus:~/.php/5.3/src/memcache-2.2.6/modules$ mv * ../../../lib/<br />
exodus:~/.php/5.3/src/memcache-2.2.6/modules$ cd ../../../<br />
exodus:~/.php/5.3$ cat phprc<br />
extension = /home/username/.php/5.3/lib/imagick.so<br />
extension = /home/username/.php/5.3/lib/memcache.so</p></blockquote>
<p>Now all you have to do is log into your <a href="http://panel.dreamhost.com" target="_blank">DreamHost control panel</a> and make sure your hostname is running PHP 5.3 (since you compiled the PECL module against 5.3), and your Memcache PECL extension should be good to go!</p>
<p>Lets install memcached on our VPS:</p>
<blockquote><p>~$ sudo apt-get install memcached<br />
Reading package lists&#8230; Done<br />
<em> &lt;lots of install-ish stuff here&gt;</em><br />
~$</p></blockquote>
<p>I do love Debian-based distributions so, so much. Next, lets get it setup and configured.</p>
<p><strong>Take note; because DreamHost&#8217;s VPS servers do NOT have the capability for <em>iptables</em>, you can&#8217;t firewall off controlled access to the memcached daemon. </strong>By itself, memcached does <em>not</em> have much in the way for access control, and you certainly don&#8217;t want it exposed to the Internet. Memcached stores, writes, returns, and can communicate data in <em>clear-text</em>, and is indiscriminate about who accesses the daemon or what the client does to the data. This means any average Joe Bob SquirrelPants can just <em>netcat</em> / <em>telnet </em>/ <em>whatever</em> their way into your object cache and read and modify information at will. <strong><span style="text-decoration: underline;">Not good</span><span style="text-decoration: underline;">.</span></strong> If <em>HTML</em> had a tag for &#8220;reach out and slap the reader&#8221; I would use it here to make sure you understand the risk.</p>
<p>What I wound up doing here is something that I lucked out on. Dreamhost VPS have a private and a public interface:</p>
<blockquote><p>~$ sudo ifconfig<br />
eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:151727415 errors:0 dropped:1871 overruns:0 frame:0<br />
TX packets:236389135 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:100<br />
RX bytes:31861835451 (29.6 GiB)  TX bytes:341275420981 (317.8 GiB)<br />
Memory:fb5e0000-fb600000</p>
<p>eth1      Link encap:Ethernet  HWaddr 00:00:00:00:00:00<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:3282435188 errors:0 dropped:5610 overruns:0 frame:0<br />
TX packets:3138743657 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:100<br />
RX bytes:2913519728599 (2.6 TiB)  TX bytes:2137298062221 (1.9 TiB)<br />
Memory:fb6e0000-fb700000</p>
<p>eth0:ps358441 Link encap:Ethernet  HWaddr 00:25:90:34:c7:4a<br />
inet addr:10.xxx.xxx.xxx  Bcast:xxx.xxx.xxx.255  Mask:255.255.128.0<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
Memory:fb5e0000-fb600000</p>
<p>eth1:ps358440 Link encap:Ethernet  HWaddr 00:25:90:34:c7:4b<br />
inet addr:173.xxx.xxx.xxx  Bcast:xxx.xxx.xxx.255  Mask:255.255.252.0<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
Memory:fb6e0000-fb700000</p>
<p>lo        Link encap:Local Loopback<br />
inet addr:127.0.0.1  Mask:255.0.0.0<br />
UP LOOPBACK RUNNING  MTU:16436  Metric:1<br />
RX packets:234405240 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:234405240 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0<br />
RX bytes:874649533641 (814.5 GiB)  TX bytes:874649533641 (814.5 GiB)</p>
<p>~$</p></blockquote>
<p>See that 10.x.x.x interface? It&#8217;s private and only accessible from inside the datacenter; as it turns out I can also access it from my shared server Exodus &#8211; perfect. Edit the <em>/etc/memcached.conf</em> configuration file to make the daemon listen only on the private interface:</p>
<blockquote><p># Specify which IP address to listen on. The default is to listen on all IP addresses<br />
# This parameter is one of the only security measures that memcached has, so make sure<br />
# it&#8217;s listening on a firewalled interface.<br />
-l 10.xxx.xxx.xxx</p></blockquote>
<p>Obviously you want to use <em>your</em> private interface here instead of the x&#8217;s. :wq and go start the daemon:</p>
<blockquote><p>~$ sudo /etc/init.d/memcached start<br />
Starting memcached: memcached.<br />
~$</p></blockquote>
<p>You now have a functional and running memcached setup on your VPS server, accessible only from it&#8217;s private interface. Now lets concentrate on our WordPress installation. I was using the <a href="http://wordpress.org/extend/plugins/memcached/" target="_blank">Memcached Object Cache</a> plugin to enable my websites to utilize memcached. A side-note when you use this plugin; there&#8217;s no need to have the directory in your /wp-content/plugins/ directory. When you download the zip file, the only file you need is the <em>object-cache.php </em>file, which you place in the <em>wp-content</em> directory. It activates automatically, and there is no configuration required beyond setting the location of your memcached server your <em>wp-config.php</em> file:</p>
<blockquote><p>//memcached plugin settings<br />
global $memcached_servers;<br />
$memcached_servers = array(&#8216;default&#8217; =&gt; array(&#8217;10.xxx.xxx.xxx:11211&#8242;));</p></blockquote>
<p>I have several WordPress sites that I want to use with memcached but one of the things you&#8217;ll find out quick is that you will run into <em>key collisions</em> where WordPress will use the same <em>object names</em> in queries to memcached, even across several different installations. This eventually lead to some hilarity as I started working on my sites; I would log into one, while reviewing content another. Pretty soon I was seeing myself logged into the wrong instances of WordPress, and seeing content grafted from one site to another. <strong>No bueno!</strong></p>
<p>The problem lies in the fact that the plugin was designed to be used with either <strong>one instance of WordPress -&gt; once instance of memcached</strong> or with a <strong>WordPress MU </strong>installation. This wasn&#8217;t really what I wanted. I wanted multiple instances of WordPress to be able to hit the same memcached server, so I didn&#8217;t have to spawn a separate memcached process for each website I intend to use with WordPress. More research and digging revealed that this particular plugin was more exclusively designed to work with <a href="http://mu.wordpress.org/" target="_blank">WordPress MU</a> installations, not standard single-seat WordPress installations. Some Google searching and I came upon <a href="http://mohanjith.net/blog/2009/03/wordpress-object-cache-with-memcached-backend-for-vanilla-wordpress.html" target="_blank">this blog</a> where Mr. Mohanjith had a <a href="http://cdn.mohanjith.net/blog/wp-content/uploads/2009/03/object-cachephp.txt" target="_blank">modified and patched version of <em>object-cache.php</em></a> that can be used to allow multiple instances of standard WordPress installations to hit the same memcached server without key collisions. His innovation relies in the use of the <em>$blog_id</em> variable that you can define in the <em>wp-config.php</em> file &#8211; thereby prepending each key query to the server with a blog ID unique to that particular instance, eliminating the data key collision problem. In each of my <em>wp-config.php</em> files for my sites, I have this defined now:</p>
<blockquote><p>//blog_id settings &#8211; REQUIRED for memcached<br />
global $blog_id;<br />
$blog_id = &#8216;andrewpeng_net&#8217;;</p></blockquote>
<p>With this modification in effect along with the patched and updated <em>object-cache.php</em> &#8211; all my WordPress sites are now hitting the same memcached server, with a healthy performance boost as well. Great results so far!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/06/271273-memcached-and-dreamhost-shared-tutorial.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disabling console blanking in Debian Linux</title>
		<link>http://andrewpeng.net/posts/2011/06/071257-disabling-console-blanking-in-debian-linux.html</link>
		<comments>http://andrewpeng.net/posts/2011/06/071257-disabling-console-blanking-in-debian-linux.html#comments</comments>
		<pubDate>Tue, 07 Jun 2011 07:25:37 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Linux/Command Line Hero]]></category>
		<category><![CDATA[compootin']]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1257</guid>
		<description><![CDATA[I find it particularly annoying that the default settings in a stock base Debian install blanks the monitor after about 30 minutes of inactivity. There are a few servers that I have logged in and running htop 24&#215;7 and it&#8217;s inconvenient to have to hit the keyboard every time I need to check in on [...]]]></description>
			<content:encoded><![CDATA[<p>I find it particularly annoying that the default settings in a stock base Debian install blanks the monitor after about 30 minutes of inactivity. There are a few servers that I have logged in and running <a href="http://htop.sourceforge.net/" target="_blank"><em>htop</em></a> 24&#215;7 and it&#8217;s inconvenient to have to hit the keyboard every time I need to check in on the system.</p>
<p>I did a quick search on Google, but the only results were hack-ish <em>setterm</em> commands crammed into the <em>rc.local</em> or <em>.bashrc</em> files &#8211; sure that would work, but instead of setting it at bootup, then setting it again at login, wouldn&#8217;t there be a direct way to change the default behavior of the screen blanking? Go dig in <em>/etc</em> and lets see what we find:</p>
<blockquote><p>pengc99@janus:~$ sudo grep -r setterm /etc/*<br />
grep: /etc/fonts/conf.d/30-defoma.conf: No such file or directory<br />
/etc/init.d/kbd:    setterm_args=&#8221;"<br />
/etc/init.d/kbd:        setterm_args=&#8221;$setterm_args -blank $BLANK_TIME&#8221;<br />
/etc/init.d/kbd:        setterm_args=&#8221;$setterm_args -powersave $BLANK_DPMS&#8221;<br />
/etc/init.d/kbd:        setterm_args=&#8221;$setterm_args -powerdown $POWERDOWN_TIME&#8221;<br />
/etc/init.d/kbd:    if [ "$setterm_args" ]; then<br />
/etc/init.d/kbd:        setterm $setterm_args<br />
/etc/rcS.d/S16kbd:    setterm_args=&#8221;"<br />
/etc/rcS.d/S16kbd:        setterm_args=&#8221;$setterm_args -blank $BLANK_TIME&#8221;<br />
/etc/rcS.d/S16kbd:        setterm_args=&#8221;$setterm_args -powersave $BLANK_DPMS&#8221;<br />
/etc/rcS.d/S16kbd:        setterm_args=&#8221;$setterm_args -powerdown $POWERDOWN_TIME&#8221;<br />
/etc/rcS.d/S16kbd:    if [ "$setterm_args" ]; then<br />
/etc/rcS.d/S16kbd:        setterm $setterm_args<br />
pengc99@janus:~$</p></blockquote>
<p>Hm, /etc/init.d/kbd looks interesting, so lets take a look in there:</p>
<blockquote><p># This is the boot script for the `kbd&#8217; package.<br />
# It loads parameters from /etc/kbd/config and maybe loads<br />
# default font and map.<br />
# (c) 1997 Yann Dirson<br />
&lt; 8&lt; &#8212;&#8212;&#8212;&#8212;- snip &#8212;&#8212;&#8212;&#8212;- &gt;8 &gt;<br />
# screensaver stuff<br />
setterm_args=&#8221;"<br />
if [ "$BLANK_TIME" ]; then<br />
setterm_args=&#8221;$setterm_args -blank $BLANK_TIME&#8221;<br />
fi<br />
if [ "$BLANK_DPMS" ]; then<br />
setterm_args=&#8221;$setterm_args -powersave $BLANK_DPMS&#8221;<br />
fi<br />
if [ "$POWERDOWN_TIME" ]; then<br />
setterm_args=&#8221;$setterm_args -powerdown $POWERDOWN_TIME&#8221;<br />
fi<br />
if [ "$setterm_args" ]; then<br />
setterm $setterm_args<br />
fi</p></blockquote>
<p>Hm, it looks like it&#8217;s looking for the variable <em>BLANK_TIME</em> and <em>POWERDOWN_TIME</em> in the config file <em>/etc/kbd/config</em> &#8211; lets take a look in there:</p>
<blockquote><p># screen blanking timeout.  monitor remains on, but the screen is cleared to<br />
# range: 0-60 min (0==never)  kernels I&#8217;ve looked at default to 10 minutes.<br />
# (see linux/drivers/char/console.c)<br />
BLANK_TIME=15<br />
&lt; 8&lt; &#8212;&#8212;&#8212;&#8212;- snip &#8212;&#8212;&#8212;&#8212;- &gt;8 &gt;<br />
# Powerdown time.  The console will go to DPMS Off mode POWERDOWN_TIME<br />
# minutes _after_ blanking.  (POWERDOWN_TIME + BLANK_TIME after the last input)<br />
POWERDOWN_TIME=30</p></blockquote>
<p>Perfect! Change these from their respective values to 0 and it will effectively disable the screen blanking:</p>
<blockquote><p>BLANK_TIME=0<br />
POWERDOWN_TIME=0</p></blockquote>
<p>Restart <em>kbd</em> and you&#8217;re good to go:</p>
<blockquote><p>pengc99@janus:~$ sudo /etc/init.d/kbd restart<br />
Setting console screen modes.<br />
Skipping font and keymap setup (handled by console-setup).<br />
pengc99@janus:~$</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/06/071257-disabling-console-blanking-in-debian-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerMac G4 Debian Linux SMP Support</title>
		<link>http://andrewpeng.net/posts/2011/05/171244-powermac-g4-debian-linux-smp-support.html</link>
		<comments>http://andrewpeng.net/posts/2011/05/171244-powermac-g4-debian-linux-smp-support.html#comments</comments>
		<pubDate>Tue, 17 May 2011 23:01:40 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Linux/Command Line Hero]]></category>
		<category><![CDATA[compootin']]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1244</guid>
		<description><![CDATA[Update 6/9/2011: I have put in a bug report (#629492) with the Debian developers to notify them of this issue. It looks like there is a bug in the installer for Debian Lenny/PPC that causes the installation to improperly detect SMP configurations. I have a Quicksilver PowerMac G4 dual 800 &#8211; after I finished installing [...]]]></description>
			<content:encoded><![CDATA[<p><em>Update 6/9/2011:</em> I have put in a bug report (<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629492" target="_blank">#629492</a>) with the Debian developers to notify them of this issue.</p>
<p>It looks like there is a bug in the installer for <a href="http://www.debian.org/ports/powerpc/" target="_blank">Debian Lenny/PPC</a> that causes the installation to improperly detect SMP configurations. I have a <a href="http://lowendmac.com/ppc/quicksilver-power-mac-g4.html" target="_blank">Quicksilver PowerMac G4 dual 800</a> &#8211; after I finished installing Debian I noticed that the server was only seeing one processor:</p>
<blockquote><p>pengc99@baccus:~$ uname -r<br />
2.6.32-5-powerpc<br />
pengc99@baccus:~$</p></blockquote>
<p>Not to panic, the solution is actually rather simple. Just install the SMP kernel meta-package:</p>
<blockquote><p>root@baccus:~# apt-get install linux-image-powerpc-smp<br />
&lt;!&#8211; lots of installing stuff here &#8211;!&gt;<br />
root@baccus:~#</p></blockquote>
<p>Reboot the server, and then check the kernel again:</p>
<blockquote><p>root@baccus:~# uname -r<br />
2.6.32-5-powerpc-smp<br />
root@baccus:~#</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/05/171244-powermac-g4-debian-linux-smp-support.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen within a screen within a screen</title>
		<link>http://andrewpeng.net/posts/2011/01/281035-screen-within-a-screen-within-a-screen.html</link>
		<comments>http://andrewpeng.net/posts/2011/01/281035-screen-within-a-screen-within-a-screen.html#comments</comments>
		<pubDate>Fri, 28 Jan 2011 13:36:37 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Linux/Command Line Hero]]></category>
		<category><![CDATA[compootin']]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://andrewpeng.net/?p=1035</guid>
		<description><![CDATA[If you have nested screen sessions, and you need to get out of the innermost screen session, I found the following command particularly useful: CTRL-a, a, d]]></description>
			<content:encoded><![CDATA[<p>If you have nested <a href="http://www.linux.com/learn/tutorials/285795-taking-command-of-the-terminal-with-gnu-screen-" target="_blank">screen sessions</a>, and you need to get out of the <em>innermost</em> screen session, I found the following command particularly useful:</p>
<blockquote><p>CTRL-a, a, d</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewpeng.net/posts/2011/01/281035-screen-within-a-screen-within-a-screen.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

