<?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>//extrabright &#187; howto</title>
	<atom:link href="http://extrabright.com/blog/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://extrabright.com/blog</link>
	<description>//pat&#039;s blog</description>
	<lastBuildDate>Sat, 10 Jul 2010 19:11:13 +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>Sparse Files &#8211; Commands Overview</title>
		<link>http://extrabright.com/blog/2010/03/31/sparse-files-commands-overview/</link>
		<comments>http://extrabright.com/blog/2010/03/31/sparse-files-commands-overview/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:36:22 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sparse]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=228</guid>
		<description><![CDATA[I was just checking which commands are supporting sparse files. I post hereafter a short overview of what I found out (working on Linux).

Create a sparse file of 20 GiB:
        dd if=/dev/zero of=foo bs=1 count=1 seek=20G

Check that a file is sparse:
        [...]]]></description>
			<content:encoded><![CDATA[<p>I was just checking which commands are supporting sparse files. I post hereafter a short overview of what I found out (working on Linux).</p>
<ul>
<li>Create a sparse file of 20 GiB:<br />
        <code>dd if=/dev/zero of=foo bs=1 count=1 seek=20G</code></p>
</li>
<li>Check that a file is sparse:<br />
        <code>ls -alsh</code><br />
Compare the first versus second size column (the first one is the space taken on disk).</p>
</li>
<li>Copy a sparse file:<br />
        <code>cp foo bar</code><br />
Copy already detects and handles correctly sparse files.</p>
</li>
<li>Make a non-sparse file sparse (works only if it contains blocks filled with zeros):<br />
        <code>cp --sparse=always foo bar</code></p>
</li>
<li>Expand a sparse file to a non-sparse one:<br />
        <code>cp --sparse=never foo bar</code></p>
</li>
<li>Copy remotely a sparse file: scp does not support sparse files, it will expand them to non-sparse ones. Rsync does support them. Just use the <code>-S</code> or <code>--sparse</code> option. Example:<br />
        <code>rsync -vS foo root@someserver:/some/path/</code></li>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/03/31/sparse-files-commands-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Know if a File on Linux is Sparse?</title>
		<link>http://extrabright.com/blog/2010/03/30/how-to-know-if-a-file-on-linux-is-sparse/</link>
		<comments>http://extrabright.com/blog/2010/03/30/how-to-know-if-a-file-on-linux-is-sparse/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 19:44:34 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[sparse]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=221</guid>
		<description><![CDATA[A sparse file is a file which does not take more space on disk than needed. Such a file is usually used to store a partition image on disk, for instance with a virtualization solution like Xen.
It&#8217;s super easy, to know if a file is sparse or not. Just use the &#8217;s&#8217; option of ls.
ls [...]]]></description>
			<content:encoded><![CDATA[<p>A sparse file is a file which does not take more space on disk than needed. Such a file is usually used to store a partition image on disk, for instance with a virtualization solution like Xen.</p>
<p>It&#8217;s super easy, to know if a file is sparse or not. Just use the &#8217;s&#8217; option of ls.</p>
<p><code>ls -alsh</code></p>
<p>will yield:<br />
<code><br />
4.0K drwxr-xr-x  9 root root 4.0K 2010-03-23 18:22 .<br />
4.0K drwxr-xr-x 23 root root 4.0K 2009-01-09 19:47 ..<br />
 12G -rw-r-----  1 root root  24G 2007-01-10 19:55 dompat.data<br />
3.7G -rw-r--r--  1 root root 7.1G 2009-01-06 21:09 dompat-hardy.sys<br />
501M -rw-r-----  1 root root 501M 2007-01-07 16:40 dompat.swap<br />
</code></p>
<p>Where the first size column is the effective space taken on disk while the second size column is the max space of that file. We see that <code>dompat.data</code> is sparse, since its max size is 24 GB while it takes only 12 GB on disk.</p>
<p>References</p>
<ul>
<li>More information on command which can handle sparse files in <a href="http://administratosphere.wordpress.com/2008/05/23/sparse-files-what-why-and-how/">this article</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/03/30/how-to-know-if-a-file-on-linux-is-sparse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GPGMail Compatible with Snow Leopard</title>
		<link>http://extrabright.com/blog/2010/03/28/gpgmail-compatible-with-snow-leopard/</link>
		<comments>http://extrabright.com/blog/2010/03/28/gpgmail-compatible-with-snow-leopard/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 16:32:22 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[gpgmail]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=217</guid>
		<description><![CDATA[I had posted that some times ago on Twitter. There is a new version of the excellent GPGMail plug-in for Mail (OS X). Grab it, if you haven&#8217;t already.
GPGMail for OS X 10.6.2
Just put it inside ~/Library/Mail/Bundles and restart Mail. (More information on GPGMail&#8217;s web page.)
Edit: This is not an official version of GPGMail. There [...]]]></description>
			<content:encoded><![CDATA[<p>I had posted that some times ago on Twitter. There is a new version of the excellent GPGMail plug-in for Mail (OS X). Grab it, if you haven&#8217;t already.</p>
<p><a href="http://dl.dropbox.com/u/20215/GPGMail.mailbundle-10.6.2.zip">GPGMail for OS X 10.6.2</a></p>
<p>Just put it inside ~/Library/Mail/Bundles and restart Mail. (More information on <a href="http://www.sente.ch/software/GPGMail/English.lproj/GPGMail.html#Installation">GPGMail&#8217;s web page</a>.)</p>
<p>Edit: This is not an official version of GPGMail. There is still no official version of GPGMail compatible with Snow Leopard.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2010/03/28/gpgmail-compatible-with-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NFS Automount with Snow Leopard</title>
		<link>http://extrabright.com/blog/2009/11/15/nfs-automount-with-snow-leopard/</link>
		<comments>http://extrabright.com/blog/2009/11/15/nfs-automount-with-snow-leopard/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 16:57:54 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=203</guid>
		<description><![CDATA[Before upgrading to Snow Leopard, I was using the NFS automount capability of Mac OS X. It was a handy way for my laptop to connect to my home NAS server (a linux box running Ubuntu).
Unfortunately I had to redo the NFS config after upgrading and I noticed that Directory Utility was not present anymore [...]]]></description>
			<content:encoded><![CDATA[<p>Before upgrading to Snow Leopard, I was using the NFS automount capability of Mac OS X. It was a handy way for my laptop to connect to my home NAS server (a linux box running Ubuntu).</p>
<p>Unfortunately I had to redo the NFS config after upgrading and I noticed that Directory Utility was not present anymore in Snow Leopard.</p>
<p>Here is what I found out after some research:</p>
<li>the NFS automount configuration is now done directly in Disk Utility (under File > NFS Mounts&#8230;) and not in Directory Utility like in Leopard (which does not exist anymore).</li>
<li>the configuration that worked for me was the following one (for accessing a read-write NFS share):
<pre>
Remote NFS URL: nfs://[server]/[path]
Mount location: [path to local mount folder]
Advanced Mount Parameters: -i,-s,-w=32768,-r=32768
</pre>
</li>
<li> for automount to reload its configuration, I had to run the following command:
<pre>sudo automount -vc</pre>
</li>
<p>That&#8217;s it. The NFS share should now be accessible.</p>
<p>References:</p>
<li><a href="http://discussions.apple.com/thread.jspa?threadID=2137675">http://discussions.apple.com/thread.jspa?threadID=2137675</a></li>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2009/11/15/nfs-automount-with-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Machine: Handy but Bitchy!</title>
		<link>http://extrabright.com/blog/2009/06/30/time-machine-handy-but-bitchy/</link>
		<comments>http://extrabright.com/blog/2009/06/30/time-machine-handy-but-bitchy/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 21:10:12 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[timemachine]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=183</guid>
		<description><![CDATA[I have been spending the last couple of days of my spare time performing a simple operation with my mac, yet slightly more complicated than expected: merge the two partitions of my hard drive into one. This was necessary since I did a mapping, quite usual on Linux, where my system was sitting on the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been spending the last couple of days of my spare time performing a simple operation with my mac, yet slightly more complicated than expected: merge the two partitions of my hard drive into one. This was necessary since I did a mapping, quite usual on Linux, where my system was sitting on the first partition (50 GB) while my user data was on the second one (the rest of 300 GB). But this mapping was not making me happy, since the system partition was always almost full (Mac OS X is not well suited for a multi partition disk drive, I find).</p>
<p>Although you can resize a live partition with Disk Utility (great feature, even if you booted with it), you cannot move the base position of a partition. You can merely resize it, if more space is available. So I had to back my second partition up for later restoring it. I went for Time Machine, since I was already using it for backing up my laptop.</p>
<h3>Time Machine Caveats</h3>
<p>Unfortunetely I noticed a couple of caveats during the restore operation:</p>
<li>When using the Time Machine restore utility shipped with the OS X install DVD, you can only restore the partition where the system is, but not other ones. This was quite of a surpise to me. Although you can choose on which partition you want to restore your system (the target, not the source).</li>
<li>Although your data is actually sitting on the Time Machine backup drive, you cannot use it directly (i.e. copy it back using the Finder or a shell). The reason for that is the ACLs that Leopard is putting on each and every file and folder to protect changing the Time Machine backup. In addition the ACL system (which is a parralel access control to the Unix one, which I did not know the existence of beforehand) is deeply flawed: you cannot reliably remove recursively the ACLs from a directory structure (you will still find files scattered within the structure having ACLs) and you even cannot remove the ACL permissions on symbolic links (this seems to be a bug of chmod on Leopard, although ACLs on a symlink do not seem to have any effect)</li>
<h3>Solution for merging two partitions</h3>
<p>I finally found a solution to restore the second partition or to merge them: I had to fiddle directly with the Time Machine backup, copying manually the files I wanted from the second partition to the first, and did a restore of the first partition using Time Machine restore utility.</p>
<p>Here are the details of the steps I took:</p>
<li>Plug my external drive where I have my Time Machine backup, open a terminal and sudo as root:<br />
<code>sudo -s</code>
</li>
<li>Deactivate on that drive the ACL checks, so that I can modify directly the Time Machine backup:<br />
<code>fsaclctl -p /Volumes/[backup drive] -d</code>
</li>
<li>Move the folders from the second partition to the first one with<br />
<code>mv [from] [to]</code>
</li>
<li>Reactivate the ACL checks on the external drive:<br />
<code>fsaclctl -p /Volumes/[backup drive] -e</code>
</li>
<li>Do the restore of the first partition with the Time Machine restore utility (located on the Leopard install DVD).</li>
<p>This worked for me. You should now have a merged partition on your drive, the restore utility having removed the ACLs during the operation. Phew! This was not a straight forward action! I still cannot believe that Apple did not take into account that people can have more than 1 partition on their drive (I might still have missed the way to do it, did not find it so far though).</p>
<h3>Links/Info</h3>
<li><a href="http://www.macosxhints.com/article.php?story=20090213071015789">Macosxhint: reconnect Time Machine backup after a drive swap</a></li>
<li>Inspect the ACLs of your file with ls:<br />
<code>ls -le</code></p>
<p>For the record, this will yield the following listing when ACLs are present (pay attention to the lines starting with &#8216;0: &#8216; and &#8216;1: &#8216;:<br />
<code>drwxrwxr-x@ 138 root   admin  4692 Sep 13  2008 Applications<br />
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown<br />
 1: group:everyone deny delete<br />
drwxr-xr-x@   2 pat    staff    68 May  9 22:12 DeveloperSDK3<br />
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown<br />
drwxr-xr-x@   5 pat    staff   170 Oct 23  2008 VirtualBox<br />
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown</code></p>
<p>You can also do that recursively using the following command:<br />
<code>ls -lateR > filelist</code>
</li>
<li>You can remove ACLs on a file with this command (not working properly for a recursive operation with the option <code>-R</code>)<br />
<code>chmod -a# 0 [file]</code><br />
where 0 is the ACL entry to remove.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2009/06/30/time-machine-handy-but-bitchy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annoying &#8217;screen&#8217; Backspace Problem</title>
		<link>http://extrabright.com/blog/2009/02/21/annoying-screen-backspace-problem/</link>
		<comments>http://extrabright.com/blog/2009/02/21/annoying-screen-backspace-problem/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 23:28:30 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=168</guid>
		<description><![CDATA[Already a long time that this issue is bugging me. The great &#8217;screen&#8217; unix command has a problem, at least on ubuntu: the backspace key produces the same effect than delete (first char on the right of the cursor gets deleted). Very annoying. Hopefully the solution is easy. Edit your file &#8216;~/.bashrc&#8217; and add the [...]]]></description>
			<content:encoded><![CDATA[<p>Already a long time that this issue is bugging me. The great &#8217;screen&#8217; unix command has a problem, at least on ubuntu: the backspace key produces the same effect than delete (first char on the right of the cursor gets deleted). Very annoying. Hopefully the solution is easy. Edit your file &#8216;~/.bashrc&#8217; and add the following line:</p>
<pre>alias screen='TERM=screen screen'</pre>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2009/02/21/annoying-screen-backspace-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pidgin Status Update from Twitter</title>
		<link>http://extrabright.com/blog/2008/08/06/pidgin-status-update-from-twitter/</link>
		<comments>http://extrabright.com/blog/2008/08/06/pidgin-status-update-from-twitter/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 16:37:22 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>
		<category><![CDATA[twitter pidgin gtalk]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=133</guid>
		<description><![CDATA[Just figured out how to get Twitter update the pidgin status (e.g. GTalk, Jabber, ICQ, MSN, etc.). For that, you need to install a pidgin plug-in written in Perl. Here is a small howto about it (as the Perl stuff was a bit tricky):
Download and install the multi-network Pidgin client
Install Perl. On Windows (yeah, I [...]]]></description>
			<content:encoded><![CDATA[<p>Just figured out how to get Twitter update the pidgin status (e.g. GTalk, Jabber, ICQ, MSN, etc.). For that, you need to install a pidgin plug-in written in Perl. Here is a small howto about it (as the Perl stuff was a bit tricky):</p>
<li>Download and install the multi-network <a href="http://www.pidgin.im/">Pidgin</a> client</li>
<li>Install Perl. On Windows (yeah, I know. It&#8217;s at work. <img src='http://extrabright.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ), install <a href="http://www.activestate.com/downloads/index.mhtml">Active Perl</a> version 5.8.8.X. Don&#8217;t take the last one, the 5.10.0, as Pidgin does not support it yet.</li>
<li>Install the Package XML:XPath, either using the CPAN console (install XML:XPath) or using the package manager of Active Perl.</li>
<li>Restart Pidgin and check that Perl is enabled. (Help -> About -> at the bottom of the page, you should see &#8216;Perl: Enabled&#8217;).</li>
<li>Download the <a href="http://code.google.com/p/pidgin-twitterstatus/wiki/Installation">twitter plugin</a> and put it in the plugin folder of Pidgin. (For instance on Windows in &#8216;C:\Program Files\Pidgin\plugins&#8217;)</li>
<li>Configure the plug-in and enjoy!</li>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2008/08/06/pidgin-status-update-from-twitter/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tomato on WRT54GL: LED shows WIFI status</title>
		<link>http://extrabright.com/blog/2008/05/10/tomato-on-wrt54gl-led-shows-wifi-status/</link>
		<comments>http://extrabright.com/blog/2008/05/10/tomato-on-wrt54gl-led-shows-wifi-status/#comments</comments>
		<pubDate>Sat, 10 May 2008 16:00:52 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/?p=120</guid>
		<description><![CDATA[Something I wanted to do since ages. My wireless router WRT54GL running the Tomato firmware has a button on the front, which can be used to toggle WIFI on and off. The router has also a rather visible LED indicator, behind the button, that is unfortunately not used to show the WIFI status. (Originally, the [...]]]></description>
			<content:encoded><![CDATA[<p>Something I wanted to do since ages. My wireless router WRT54GL running the Tomato firmware has a button on the front, which can be used to toggle WIFI on and off. The router has also a rather visible LED indicator, behind the button, that is unfortunately not used to show the WIFI status. (Originally, the wifi status is just shown by a tiny LED, that is just visible when watching closely the device).</p>
<p>It’s easy to fix that. Using the web interface, go to the ‘Administration’ > ‘Buttons / LED’ page. Replace the custom script by the following code:</p>
<p><code><br />
# status: 1: wifi on, 0: wifi off<br />
status=$(wl -a eth1 dump | grep associated | cut -d " " -f 2);<br />
# toggle wifi &#038; amber led<br />
wl -a eth1 $([ $status -eq 0 ] &#038;&#038; echo up || echo down)<br />
led amber $([ $status -eq 0 ] &#038;&#038; echo on || echo off)<br />
</code></p>
<p>Then change the setting for ‘0 &#8211; 2 Seconds’ to ‘Run Custom Script’. That’s it. Now when we press the button, the wireless is toggled and the LED switches itself accordingly.</p>
<p>Tested with Tomato 1.19.</p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2008/05/10/tomato-on-wrt54gl-led-shows-wifi-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Green Server</title>
		<link>http://extrabright.com/blog/2007/11/04/green-server/</link>
		<comments>http://extrabright.com/blog/2007/11/04/green-server/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 15:02:26 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/2007/11/04/green-server/</guid>
		<description><![CDATA[Last week I bought a consumption measurement device for 20 bucks. I wanted to know how much current is needed for various electronic devices I use at home, some of them on a 24/7 basis. I have got a home server running Linux, that I use as a NAS, print server, slim server (for streaming [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I bought a consumption measurement device for 20 bucks. I wanted to know how much current is needed for various electronic devices I use at home, some of them on a 24/7 basis. I have got a home server running Linux, that I use as a NAS, print server, slim server (for streaming mp3 files to an mp3 device) and for experimenting a bit with Xen and Ubuntu. I have got also some other devices like a wireless access point (WRT54GL running <a target="_blank" href="http://www.polarcloud.com/tomato">Tomato</a>), a cable modem, an external backup hard disk, a b&#038;W laser printer and a few other electronic devices.</p>
<p>Of course, one of the most energy hungry device I have is the server, which is always switched on. I was expecting a consumption of about 60 W, because I tried to choose efficient components, some of which were listed on a <a href="http://www.tomshardware.com/2006/09/25/green_machine/">review regarding a green computer</a> consuming 54 W when idle. My hardware configuration is the following:</p>
<ul>
<li>Processor AMD 64 x2 EE 3800+, dual core and energy efficient version (which is actually quite cheap)</li>
<li>Micro-ATX Mainboard M2NPV-VM with AM2 socket</li>
<li>2 GB of  RAM (DDR2 PC4300)</li>
<li>2 Seagate 7200.8 250 GB hard disks used as a software RAID-1 array</li>
<li>Power supply ElanVital 500W, ATX, with 80% efficiency.</li>
<li>Plextor Plexwriter DVD burner</li>
</ul>
<p>So I shut downed my server, plugged it in the measurement device and booted it. The value I could read on the device, after the reboot was finished and the server was idle, was higher than expected: 85 W. I was not very happy with that value and began to try to optimize it.</p>
<ul>
<li>I first tried to remove the DVD burner, but I got just 2 W of reduction, which was not good enough.</li>
<li>Then yesterday I tried to install the last stable release of Ubuntu, which is Ubuntu 7.10 gutsy 32 bits version (I add previously Ubuntu feisty with a XEN enabled kernel). I was pleased to see that the server was only consuming about 68 W (DVD burner included). I then tried to re-install XEN and after rebooting saw that I was again at 85 W. So the XEN kernel had different options enabled that were not optimized for a good power management.</li>
<li>I got back to the stock kernel and tried to activate the automatic spin-down of the hard disks. I did this using the command
<pre>hdparm -S 60 /dev/sda
hdparm -S 60 /dev/sdb</pre>
<p>which spins down the two disks after being idle for 5 minutes. I was able to grab a few watts and get down to 60 W, which is not too bad. I added the two commands in /etc/rc.local so that it gets executed automatically on boot.</li>
<li>I then tried to activate the automatic CPU frequency scaling, so that when the processor has a low usage, its frequency gets automatically reduced, hence saving some energy as well. I was getting some problems using the module powernow-k8, so I updated the bios to the latest version (1201), which resolved that issue. I could then install correctly the cpu scaling daemon. I just had to run
<pre>apt-get install cpufreqd</pre>
<p>and then edit the file /etc/default/cpufreqd and insert &#8220;powernow-k8&#8243; in the option CPUFREQ_CPU_MODULE (you can check which module you need to use <a target="_blank" href="http://ubuntuforums.org/showthread.php?t=394911">here</a>). With these two operations, the BIOS upgrade and the cpu frequency scaling, I was able to grab a few watts, getting down, when the server is idle, to about 53 W, which is already a lot better than the 85 W I was getting without tuning.</li>
</ul>
<p>The options I might consider now are the following:</p>
<ul>
<li>I could reduce significantly the power consumption if I automatically switch off the server every night. I am using it also to do a distant backup of another computer, but I could setup the BIOS to switch it on every night to do that, if it is not already the case. The only thing I would need to do is just to switch the server on, whenever I want to print something or hear mp3&#8217;s, which is not too bad. The server would then switch itself off at night, after doing the backup.</li>
<li>If I want to use XEN, I should compile my own patched kernel (for XEN) and tune the power management options to get the same consumption as on the stock kernel.</li>
<li>I could try to tune further the kernel options, which I am not sure that I am going to do, as it is much more convenient to use the stock kernel than to use a self compiled one (e.g. for updates).</li>
<li>I could try to find a way to cut off the consumption of some other electrical devices, which are most of the time not used or in standby mode, but do consume power anyway. Like for instance the laser printer (standby 14 W), the external backup hard disk Seagate 500 GB 7200.10 (standby 12 W), the wireless access point WRT54GL (always on, 14 W) or the cable modem (always on, 12 W). Not sure how I can do that. Of course I could plug some of these devices in a multi socket with a switch, but I would need to turn it on each time I want to access the internet using my laptop and turn it off afterwards (in addition it&#8217;s not compatible with my automatic distant backup). Not very elegant. I guess I will have to think about that issue.</li>
</ul>
<p>Additional links:</p>
<ul>
<li><a target="_blank" href="http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption">How to reduce power consumption</a> Nice howto based on Linux with other options presented.</li>
<li><a target="_blank" href="http://ubuntuforums.org/showthread.php?t=394911">Ubuntu forum post</a> Use cpufreqd to tune CPU frequency</li>
<li><a target="_blank" href="http://ubuntuforums.org/showthread.php?t=248867">Ubuntu forum post</a> Which module to use for cpufreqd</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2007/11/04/green-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configuration of Linksys PAP2 VOIP Adapter</title>
		<link>http://extrabright.com/blog/2007/06/03/configuration-of-linksys-pap2-voip-adapter/</link>
		<comments>http://extrabright.com/blog/2007/06/03/configuration-of-linksys-pap2-voip-adapter/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 18:16:58 +0000</pubDate>
		<dc:creator>pajai</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pat]]></category>

		<guid isPermaLink="false">http://extrabright.com/blog/2007/06/03/configuration-of-linksys-pap2-voip-adapter/</guid>
		<description><![CDATA[I have written a small howto that explains how to configure a Linksys PAP2 VOIP adapter for a voip provider like voipbuster.
PAP2 Configuration for Voipbuster
]]></description>
			<content:encoded><![CDATA[<p>I have written a small howto that explains how to configure a Linksys PAP2 VOIP adapter for a voip provider like voipbuster.</p>
<p><a target="_blank" href="http://extrabright.com/mywiki/Pap2Voip">PAP2 Configuration for Voipbuster</a></p>
]]></content:encoded>
			<wfw:commentRss>http://extrabright.com/blog/2007/06/03/configuration-of-linksys-pap2-voip-adapter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
