<?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>Martin Ankerl &#187; getsomesleep</title>
	<atom:link href="http://martin.ankerl.com/tag/getsomesleep/feed/" rel="self" type="application/rss+xml" />
	<link>http://martin.ankerl.com</link>
	<description>No movement is faster than no movement</description>
	<lastBuildDate>Tue, 13 Jul 2010 05:31:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Howto Get Enough Sleep Despite StumbleUpon with Ubuntu</title>
		<link>http://martin.ankerl.com/2008/01/24/howto-get-enough-sleep-despite-stumbleupon-with-ubuntu/</link>
		<comments>http://martin.ankerl.com/2008/01/24/howto-get-enough-sleep-despite-stumbleupon-with-ubuntu/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 22:06:44 +0000</pubDate>
		<dc:creator>Martin Ankerl</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[getsomesleep]]></category>
		<category><![CDATA[lifehack]]></category>

		<guid isPermaLink="false">http://martin.ankerl.com/2008/01/24/howto-get-enough-sleep-despite-stumbleupon-with-ubuntu/</guid>
		<description><![CDATA[What? I am a long-term StumbleUpon user, which means that I don&#8217;t get much sleep. Now, after almost 4 years of stumbling, I have decided to get my life back. Well, at least some sleep! What does this do? Every night when I have to work on the next day (Sunday night to Thursday night [...]]]></description>
			<content:encoded><![CDATA[<h2>What?</h2>
<p><a href='http://martin.ankerl.com/wp-content/uploads/2008/01/stumbling-insomnia.jpg'><img src="http://martin.ankerl.com/wp-content/uploads/2008/01/stumbling-insomnia.jpg" alt="" title="stumbleupon insomnia" width="150" height="104" style="float:right;" /></a>I am a long-term <a href="http://www.stumbleupon.com/">StumbleUpon</a> user, which means that I don&#8217;t get much sleep. Now, after <a href="http://martinus.stumbleupon.com/public/">almost 4 years of stumbling</a>, I have decided to get my life back. Well, at least some sleep! </p>
<h2>What does this do?</h2>
<p>Every night when I have to work on the next day (Sunday night to Thursday night ), at 23:25 my computer shows me this little warning message:<br />
<center><img src='http://martin.ankerl.com/wp-content/uploads/2008/01/screenshot-warning.png' alt='go to bed warning' /></center><br />
After the 5 minutes have passed, the computer shuts itself automatically down.</p>
<p>I use this little trick with <a href="http://www.ubuntu.com/">Ubuntu,</a> but it should work anywhere where <a href="http://www.gnome.org/">Gnome</a> is installed.</p>
<h2>How?</h2>
<p>Thanks to the power of Linux, this is not difficult to do for yourself, and configure it however you want it to behave:</p>
<ol>
<li>Open <tt>/etc/crontab</tt> with your favourite text editor (no need for <tt>crontab -e</tt> since this is the system wide crontab), e.g.
<pre>sudo gedit /etc/crontab</pre>
</li>
<li>Add the following lines (replace <tt>manker</tt> with your username!)
<pre>25 23 * * 0-4   manker  /usr/bin/zenity --display :0 --warning --text="Shutdown in 5 minutes. Go to bed."
25 23 * * 0-4   root    shutdown -h +5</pre>
<li>The first part of both lines <tt>25 23 * * 0-4</tt> means that the commands are executed at 23:25, but only Sunday (day 0) to Thursday (day 4). Read <tt>man 5 crontab</tt> for a detailed description of that format.</li>
<li>The first command uses <tt>zenity</tt> to show a warning message. You have to execute this as the same user that you use for working, or you will not see the message, so change <tt>manker</tt> to your username (root does not work either).
<li>The second command <tt>shutdown -h +5</tt> means that the computer will halt in 5 minutes.  This has to be run as root, and it also shows nice warning messages in all your open terminals so you can&#8217;t really miss it.</li>
<li>Save the file, and stumble until it is 23:25.</ul>
</ol>
<p>Sweet dreams!</p>
<div style='clear:both'></div><img src="http://martin.ankerl.com/?ak_action=api_record_view&id=106&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://martin.ankerl.com/2008/01/24/howto-get-enough-sleep-despite-stumbleupon-with-ubuntu/feed/</wfw:commentRss>
		<slash:comments>72</slash:comments>
		</item>
	</channel>
</rss>
