<?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>Critical Exponent &#187; Programming &amp; configuration</title>
	<atom:link href="http://www.criticalexponent.org/blog/category/science-and-technology/technology/computer/5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.criticalexponent.org/blog</link>
	<description>A progressive scale</description>
	<lastBuildDate>Wed, 12 Oct 2011 21:59:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>A colorful top</title>
		<link>http://www.criticalexponent.org/blog/2010/09/25/a-colorful-top/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-colorful-top</link>
		<comments>http://www.criticalexponent.org/blog/2010/09/25/a-colorful-top/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 17:14:13 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[atop]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[process monitoring]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1489</guid>
		<description><![CDATA[I mentioned atop earlier. I just found out about htop, which seems even easier to grok.]]></description>
			<content:encoded><![CDATA[<p>I mentioned <a href="http://www.criticalexponent.org/blog/2010/06/25/a-better-top/">atop</a> earlier. I just found out about <a href="http://htop.sourceforge.net/index.php?page=main">htop</a>, which seems even easier to grok.
<a href="http://htop.sourceforge.net/index.php?page=main"><img alt="htop screenshot" src="http://htop.sourceforge.net/htop-0.5.png" title="htop" class="aligncenter" width="797" height="538" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2010/09/25/a-colorful-top/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Persistent emacs server sessions</title>
		<link>http://www.criticalexponent.org/blog/2010/09/05/persistent-emacs-server-sessions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=persistent-emacs-server-sessions</link>
		<comments>http://www.criticalexponent.org/blog/2010/09/05/persistent-emacs-server-sessions/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 01:25:04 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[autocompletion]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[desktop-autosave]]></category>
		<category><![CDATA[ee]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[emacs-lisp]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[shell-scripting]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1471</guid>
		<description><![CDATA[In my spare time, I&#8217;ve been working on two tools to make emacs more useful to me by leveraging two key features: the ability to save the desktop state and the ability to have emacs clients connect to an emacs &#8230; <a href="http://www.criticalexponent.org/blog/2010/09/05/persistent-emacs-server-sessions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><center><img src="http://www.gnu.org/software/emacs/tour/images/splash-small.png" alt="emacs" /></center></p>

<p>In my spare time, I&#8217;ve been working on two tools to make
<a href="http://www.gnu.org/software/emacs/">emacs</a> more useful to me by
leveraging two key features: the ability to save the desktop state and
the ability to have emacs clients connect to an emacs server.</p>

<p>For the former, I wrote an emacs-lisp package called
<a href="http://github.com/vchudnov/desktop-autosave"><code>desktop-autosave</code></a>. Once
initiated, the package will periodically save the desktop under the
name of your choice. The benefit of this is that you do not have to
remember to save the desktop explictly yourself before you exit emacs
or before you experience an emacs or system crash. Moreover, the next
time you start <code>desktop-autosave</code> with that same name, the
corresponding desktop is automatically loaded into your emacs
workspace.</p>

<p>For the latter, I wrote a bash shell script called
<a href="http://github.com/vchudnov/ee"><code>ee</code></a> that will allow you to connect
to a named emacs server (bringing up the server if it is not already
running). The value of this package is that you can now invoke <code>ee</code>
wherever you would normally have invoked emacs, and by just specifying
the name of the desired server, you can easily set up as many emacs
sessions as you have concurrent projects.</p>

<p>The real benefit comes when you use both packages together. In this
case, you can use <code>ee</code> to bring up a named emacs server, and that
server will save its desktop to disk periodically. As long as emacs
stays running, you can keep connecting to the same server from as many
clients as you wish. After your emacs server terminates (by exiting
normally, by crashing, or by the machine being reset), you can use
<code>ee</code> to once again bring up a server with the same name. In this case,
emacs will load the automatically-saved desktop file from disk and you
will have in memory all the files that you were working on previously
on that particular emacs server. Nifty, no?</p>

<p>Feel fry to try these packages out. They are available on
<a href="http://github.com">GitHub</a>. If you find them useful or if you find
bugs, let me know. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2010/09/05/persistent-emacs-server-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A better top</title>
		<link>http://www.criticalexponent.org/blog/2010/06/25/a-better-top/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-better-top</link>
		<comments>http://www.criticalexponent.org/blog/2010/06/25/a-better-top/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 05:13:33 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[atop]]></category>
		<category><![CDATA[process monitoring]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1444</guid>
		<description><![CDATA[I just found out about atop. I like it.]]></description>
			<content:encoded><![CDATA[<p>I just found out about <a href="http://www.atoptool.nl/index.php">atop</a>. I like it.</p>

<p><a href="http://www.atoptool.nl/index.php"><img src="http://www.atoptool.nl/images/screenshots/memoryw.png" alt="atop screenshot" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2010/06/25/a-better-top/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fedora 13: Solving nss-softokn version issues</title>
		<link>http://www.criticalexponent.org/blog/2010/06/19/fc13-nss/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fc13-nss</link>
		<comments>http://www.criticalexponent.org/blog/2010/06/19/fc13-nss/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 00:10:31 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[Fedora 13]]></category>
		<category><![CDATA[nss-softokn]]></category>
		<category><![CDATA[Picasa]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1427</guid>
		<description><![CDATA[Since my Fedora 13 upgrade, I kept getting errors when installing Picasa: Transaction Check Error: package nss-softokn-3.12.4-19.fc13.x86_64 (which is newer than nss-softokn-3.12.4-17.fc13.i686) is already installed The solution, which I found here, is to first do sudo yum downgrade nss-softokn]]></description>
			<content:encoded><![CDATA[<p>Since my <a href="http://www.criticalexponent.org/blog/2010/05/31/painful-upgrade/">Fedora 13 upgrade</a>, I kept getting errors when installing Picasa:</p>

<pre><code>Transaction Check Error:
   package nss-softokn-3.12.4-19.fc13.x86_64 (which is newer than
   nss-softokn-3.12.4-17.fc13.i686) is already installed
</code></pre>

<p>The solution, which I found <a href="http://forums.fedoraforum.org/showthread.php?p=1373216#post1373216">here</a>, is to first do</p>

<pre><code>sudo yum downgrade nss-softokn
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2010/06/19/fc13-nss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Painful upgrade</title>
		<link>http://www.criticalexponent.org/blog/2010/05/31/painful-upgrade/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=painful-upgrade</link>
		<comments>http://www.criticalexponent.org/blog/2010/05/31/painful-upgrade/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 03:37:40 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[Fedora 12]]></category>
		<category><![CDATA[Fedora 13]]></category>
		<category><![CDATA[rpm upgrade problem]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1409</guid>
		<description><![CDATA[For the past couple of months, I&#8217;ve been trying to upgrade to Fedora 12, but the process has not been working. The chkconfig package, in particular, has been refusing to install. This left my system in a not quite perfect &#8230; <a href="http://www.criticalexponent.org/blog/2010/05/31/painful-upgrade/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the past couple of months, I&#8217;ve been trying to upgrade to Fedora 12, but the process has not been working. The <code>chkconfig</code> package, in particular, has been refusing to install. This left my system in a not quite perfect state, where occasionally all programs would begin to crash until I rebooted in rescue mode and did a <code>chroot /mnt/sysimage /usr/sbin/prelink -ua</code>. A major pain. I could not find a solution online.</p>

<p>I was eagerly awaiting Fedora 13, hoping that installing <em>that</em> would go off without a hitch. No such luck. The solution, as it turned out, was to try to install the problematic rpm directly and resolve the issues manually (in my case, a directory was supposed to become a symlink). But then a couple of other packages had issues, and I just decided to bite the bullet and reinstall. Luckily, my <code>/home</code> was in a different partition than <code>/</code>, so it wasn&#8217;t excruciating.</p>

<p>Things I needed to restore upon successful installation were</p>

<ul>
<li><code>/etc/{passwd,shadow,group,sudoers}</code></li>
<li>mount points listed in fstabs, and links to same</li>
<li>fonts</li>
<li>printer, samba</li>
<li>Chrome</li>
<li>NX</li>
<li>Picasa (still in progress due to a package dependency conflict)</li>
<li>crontabs</li>
</ul>

<p>I still like Fedora alright, but this upgrade process was painful (though possibly my fault for not cleaning around properly after mucking around in my system). I&#8217;m glad I&#8217;m on FC13; I got some cool customizations finally done, about which I&#8217;ll write later. I am, however, starting to wonder whether any of these would be easier on Ubuntu. Stay tuned&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2010/05/31/painful-upgrade/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Always-on-top shortcut</title>
		<link>http://www.criticalexponent.org/blog/2010/04/10/always-on-top-shortcut/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=always-on-top-shortcut</link>
		<comments>http://www.criticalexponent.org/blog/2010/04/10/always-on-top-shortcut/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 20:11:59 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[always-on-top]]></category>
		<category><![CDATA[compiz]]></category>
		<category><![CDATA[keyboard shortcut]]></category>
		<category><![CDATA[metacity]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1406</guid>
		<description><![CDATA[It&#8217;s useful to sometimes always have a window be on top of all others. In my windowing systems, there is a window frame option for this. Usually, though, I prefer keyboard shortcuts. A friend told me how to set one &#8230; <a href="http://www.criticalexponent.org/blog/2010/04/10/always-on-top-shortcut/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s useful to sometimes always have a window be on top of all others. In my windowing systems, there is a window frame option for this. Usually, though, I prefer keyboard shortcuts. A friend told me how to set one up in compiz, but I was still mystified about setting one up in metacity. Then I found this <a href="http://linux.byexamples.com/archives/306/makes-your-windows-stay-on-top-toggle-it/">guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2010/04/10/always-on-top-shortcut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome for Linux: enabling Flash</title>
		<link>http://www.criticalexponent.org/blog/2009/12/19/google-chrome-for-linux-enabling-flash/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-chrome-for-linux-enabling-flash</link>
		<comments>http://www.criticalexponent.org/blog/2009/12/19/google-chrome-for-linux-enabling-flash/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 00:28:28 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1366</guid>
		<description><![CDATA[An official beta build of Google Chrome for Linux has been out for a couple of weeks now; I&#8217;m loving it! To get Flash to work on it, refer to the directions here.]]></description>
			<content:encoded><![CDATA[<p>An official beta build of <a href="http://www.google.com/chrome">Google Chrome</a> for Linux has been out for a couple of weeks now; I&#8217;m loving it! To get Flash to work on it, refer to the directions <a href="http://www.google.com/support/forum/p/Chrome/thread?tid=44d92f598530003a&amp;hl=en">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2009/12/19/google-chrome-for-linux-enabling-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Execute-Notify</title>
		<link>http://www.criticalexponent.org/blog/2009/12/13/execute-notify/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=execute-notify</link>
		<comments>http://www.criticalexponent.org/blog/2009/12/13/execute-notify/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 16:00:41 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[compiling]]></category>
		<category><![CDATA[libnotify]]></category>
		<category><![CDATA[multi-tasking]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[notify-send]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1344</guid>
		<description><![CDATA[Multitasking in the right manner helps one be productive. Do it too much, and quality declines as you get more stressed. Do it too little, and, well, you get less done. I think the crucial element is minimizing significant context &#8230; <a href="http://www.criticalexponent.org/blog/2009/12/13/execute-notify/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Multitasking in the right manner helps one be productive. Do it too
much, and quality declines as you get more stressed. Do it too little,
and, well, you get less done. I think the crucial element is
minimizing significant context switches while allowing as many things
to proceed on automatic pilot as possible.</p>

<p>In particular, when executing long commands on the computer (like,
say, compiling a binary), it is better to switch to a different
activity (preferably with lower intellectual demands, so as to keep
the coding context in one&#8217;s working memory) than to sit idly twiddling
your thumbs. My problem when I do this, especially since I have a
different virtual desktop for each context, is that I may forget to go
back and check whether my compilation succeeded and my tests passed.</p>

<p>I recently found out (on
<a href="http://emacs-fu.blogspot.com/2009/11/showing-pop-ups.html">emacsfoo</a>) about
<code>notify-send</code>, a useful command-line interface to <code>libnotify</code> that
lets alerts pop up on the desktop. As <a href="http://wagiaalla.com/blog/?p=28">is the case for many
others</a>, I like the idea of using
this tool to notify me that my long-running jobs are finished, so I
can switch back to my main context. Thus, I wrote <a href="http://www.criticalexponent.org/blog/?page_id=1341">a simple
command-line
utility</a> (<code>en</code>,
for &#8220;execute-notify&#8221;) that you can use to wrap an arbitrary command
and be notified when it exits. I strove to make it fairly general and
customizable, and may add more features to it as needed.</p>

<p>The simplest invocation is simply to prefix your command with <code>en</code>:</p>

<pre><code>en  gcc -o myprogram myprogram.cc
</code></pre>

<p><code></code></p>

<p>If the compilation failed, you would see a message like this:
<style type="text/css"> .centeredImage { text-align:center;
margin-top:0px; margin-bottom:0px; padding:0px; } </style></p>

<p class="centeredImage"><img src="http://www.criticalexponent.org/blog/wp-content/uploads/en_simple_failure.jpg" alt="A typical failure message conveyed by &#039;en&#039; without any options" title="A typical failure message conveyed by &#039;en&#039; without any options" width="432" height="138" class="aligncenter size-full wp-image-1354" />
</p>

<p>There are options to control the notification parameters, like so:</p>

<pre><code>en --expiration 0 --title Compilation \
   --command_label "the usual gcc command" \
   --icon_success /usr/share/icons/gnome/32x32/status/info.png \
   gcc -o myprogram myprogram.cc
</code></pre>

<p><code></code></p>

<p class="centeredImage"><img src="http://www.criticalexponent.org/blog/wp-content/uploads/en_custom_success_icon.jpg" alt="A customized &#039;en&#039; notification when the underlying command succeeded" title="A customized &#039;en&#039; notification when the underlying command succeeded" width="433" height="135" class="aligncenter size-full wp-image-1353" /></p>

<p>Here&#8217;s the help text for the command:</p>

<pre><code>$ en --help
en Execute a command and notify when finished
Usage: en [FLAGS...] COMMAND [ARGS...]
   executes COMMAND ARGS... and sends a notification to the status
   panel upon completion, indicating the result of COMMAND. The
   exit code of COMMAND is the exit of en.

Each flag to en begins with "--"; flags take zero or one
arguments. The first argument to en that is not interpreted as
a flag or value is taken to be the command to execute.

Possible no-argument flags are:
  --help  Show this message
  --debug Print debugging information about en

Possible one-argument flags are:
  --title Prefix to the "Success" or "Failure" title of the
notification

  --command_label Description of the command to be used in the
notification text in place of the command itself. Useful for
succinctly describing a long command, or for use with --exit_code
flag

  --exit_code Simulated exit code from COMMAND to use when generating
the notification, Setting this flag causes COMMAND to not actually
execute, and is useful for testing that the notification is
formatted as desired without actually invoking COMMAND or of the
form

  --PROPERTY_OUTCOME where PROPERTY is one of "icon", "urgency", or
"expiration" and OUTCOME is one of "success" or "failure".
All the properties are used in creating and dispatching the
notification, but the outcome used depends on the exit code of the
command being run.
   icon: the icon to be used in the notification
   expiration: the duration of the notification (ms)
   urgency: the notification urgency, as defined by send-notify

Example:
  en --icon_success /usr/share/icons/gnome/32x32/emblems/emblem-default.png \
    --expiration 600000 --title "Directory listing" ls
</code></pre>

<p><code></code></p>

<p><a href="http://www.criticalexponent.org/blog/?page_id=1341">Enjoy it</a> and let
me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2009/12/13/execute-notify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bad BIOS!</title>
		<link>http://www.criticalexponent.org/blog/2009/10/27/bad-bios/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bad-bios</link>
		<comments>http://www.criticalexponent.org/blog/2009/10/27/bad-bios/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 04:00:01 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[Gigabyte]]></category>
		<category><![CDATA[motherboard]]></category>
		<category><![CDATA[resetting]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1298</guid>
		<description><![CDATA[In my quest to get my motherboard (Gigabyte S-series GA-MA790FX-DS5) to wake-on-LAN, I tried upgrading the BIOS from Gigabyte&#8217;s download site from version F6 to version F8F. Bad idea! After the upgrade, the system would sometimes reboot spontaneously. This seemed &#8230; <a href="http://www.criticalexponent.org/blog/2009/10/27/bad-bios/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my quest to get my motherboard (Gigabyte S-series GA-MA790FX-DS5)
<a href="http://www.criticalexponent.org/blog/2009/09/22/stir-on-lan/">to
wake-on-LAN</a>,
I tried upgrading the BIOS from Gigabyte&#8217;s <a href="http://www.gigabyte.com.tw/Support/Motherboard/BIOS_Model.aspx?ProductID=2694">download
site</a>
from version F6 to version F8F. Bad idea! After the upgrade, the
system would sometimes reboot spontaneously. This seemed to happen
with more resource-intensive processes. The Gigabyte support folks
were not really helpful (they just told me to check the cables), and,
indeed, I am still working with them to fully enable the wake-on-LAN
feature, which they claim is fully tested.</p>

<p>Since reverting the BIOS back to F6, the spontaneous reboot problems
seem to have gone away.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2009/10/27/bad-bios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stir-on-LAN</title>
		<link>http://www.criticalexponent.org/blog/2009/09/22/stir-on-lan/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=stir-on-lan</link>
		<comments>http://www.criticalexponent.org/blog/2009/09/22/stir-on-lan/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:00:39 +0000</pubDate>
		<dc:creator>Victor Chudnovsky</dc:creator>
				<category><![CDATA[Programming & configuration]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[aWol]]></category>
		<category><![CDATA[ethtool]]></category>
		<category><![CDATA[GA-MA790FX-DS5]]></category>
		<category><![CDATA[Gigabyte]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[Magic Packet]]></category>
		<category><![CDATA[motherboard]]></category>
		<category><![CDATA[PCI]]></category>
		<category><![CDATA[PME Event]]></category>
		<category><![CDATA[r8168]]></category>
		<category><![CDATA[r8169]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[wake-on-LAN]]></category>
		<category><![CDATA[wol]]></category>

		<guid isPermaLink="false">http://www.criticalexponent.org/blog/?p=1239</guid>
		<description><![CDATA[I got Wake-on-LAN almost working on my desktop computer. It took some trial and error, but here are the essential steps: I configured my Gigabyte S-series GA-MA790FX-DS5 motherboard BIOS to have PME Event set to enabled; this enables wake-on-LAN which &#8230; <a href="http://www.criticalexponent.org/blog/2009/09/22/stir-on-lan/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I got <a href="http://en.wikipedia.org/wiki/Wake-on-LAN">Wake-on-LAN</a> <em>almost</em>
working on my desktop computer. It took some trial and error, but here
are the essential steps:</p>

<ul>
<li><p>I configured my Gigabyte S-series GA-MA790FX-DS5 motherboard BIOS to
have <code>PME Event</code> set to <code>enabled</code>; this enables wake-on-LAN which
means, apparently, that the NIC still receives a little bit of power
in order to check for the Magic Packet.  I also tweaked the <a href="http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface">ACPI</a> configuration by setting the <code>ACPI
Suspend Type</code> to be <code>S3(STR)</code>, so that when I do a suspend (rather
than hibernate or power-off), only RAM gets power and not the CPU.</p></li>
<li><p>I changed <code>/etc/rc./init.d/halt</code> so that it ends with:</p>

<pre><code># Wakeup-on-LAN

/usr/sbin/ethtool -s eth0 wol g
sleep 5 # one source claims this matters

exec $command $HALTARGS
</code></pre></li>
<li><p>I created <code>/etc/pm/sleep.d/99network</code>:</p>

<pre><code># Restart the network interfaces after suspending
# Author: Victor Chudnovsky (victor dot chudnovsky at g m a i l  dot c o m)

case "$1" in
    thaw|resume)
        service network restart
        ;;
    suspend|hibernate)
        /usr/sbin/ethtool -s eth0 wol g
    sleep 5 # one source claims this matters
        ;;
    *)
        ;;
esac

exit $?
</code></pre></li>
<li><p>To allow waking up my desktop from the outside, I made sure my router allows WOL packets to reach the machine. One can do this either by setting the machine to be the DMZ server or by explictly configuring these packets to be routed through (typically on port 9)</p></li>
<li><p>Possibly unnecessary but it can&#8217;t hurt: Disabled the standard r8169 driver and instead installed the <a href="http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&amp;PNid=13&amp;PFid=5&amp;Level=5&amp;Conn=4&amp;DownTypeID=3&amp;GetDown=false">official r8168 RealTek driver</a> for my onboard Realtek 8111B ethernet chip. I followed the directionsin the README, which essentially amount to the steps <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/208012">here</a>.</p></li>
<li><p>Possibly unnecessary: I created <code>/etc/pm/config.d/config</code> with contents:</p>

<pre><code>SUSPEND_MODULES="r8168"
</code></pre></li>
</ul>

<p>That was enough to enable suspend-to-LAN. To actually wake the computer, one needs a client that can send the Magic Packet to the wakeable machine. These clients thus need the IP address of the machine (or a broadcast address) and the MAC address of the NIC that is a wol-able.</p>

<ul>
<li><p>I got an Android app for my phone, <a href="http://androideka.com/android-apps/tools/android-wake-on-lan/">aWOL</a> that allows multiple profies for various machines that can be woken up remotely.</p></li>
<li><p>I installed <code>ether-wake</code> and <code>wol</code> clients on various computers from which I want to wake up my desktop.</p></li>
</ul>

<p>This set-up seems to work pretty well. There are some occasional issues I&#8217;m encountering that I&#8217;m still trying to debug:</p>

<ul>
<li><p>Rarely, I&#8217;ve noticed that if I suspend or hibernate and resume too
many times too quickly, these operations start failing with a
<code>Device or resource busy</code> message in <code>/var/log/pm-suspend/log</code>, but
if I wait for a while and try again, it starts working.</p></li>
<li><p><strong>The remaining problem</strong> is this: if I&#8217;m powered off for too long, the card
does not respond to the Magic Packet. This defeats the whole purpose
of this feature, obviously, so I&#8217;m trying to figure out under what
conditions this happens. I found this problem <a href="http://forums.tweaktown.com/f69/wake-lan-problem-ga-ma770-ds3-rev1-33745/">mentioned
elsewhere</a>,
but no solution as of yet. I asked Gigabyte customer support, but have not heard back from them yet.</p></li>
</ul>

<p>For more information, refer to the <a href="http://xlife.zuavra.net/index.php/60/">Xlife wol</a> guide or the <a href="http://gsd.di.uminho.pt/jpo/software/wakeonlan/mini-howto/">Wake-on-LAN mini-HOWTO </a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.criticalexponent.org/blog/2009/09/22/stir-on-lan/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

