<?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>Guy Rutenberg &#187; Linux</title>
	<atom:link href="http://www.guyrutenberg.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Wed, 16 Jun 2010 19:53:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upgrading All QT Modules in Gentoo</title>
		<link>http://www.guyrutenberg.com/2009/11/21/upgrading-all-qt-modules-in-gentoo/</link>
		<comments>http://www.guyrutenberg.com/2009/11/21/upgrading-all-qt-modules-in-gentoo/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 20:01:06 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[QT]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=594</guid>
		<description><![CDATA[Upgrading minor versions QT seems to be a hassle, as each version blocks the previous and because of inter-dependencies, Gentoo can&#8217;t understand by itself how to solve them. The solution is to tell it to specifically upgrade all installed modules.


sudo emerge -avu1 $&#40;qlist -IvC /qt- &#124; grep 4. &#124; sed s/-4.*//&#41;

This will allow Gentoo to [...]]]></description>
			<content:encoded><![CDATA[<p>Upgrading minor versions QT seems to be a hassle, as each version blocks the previous and because of inter-dependencies, Gentoo can&#8217;t understand by itself how to solve them. The solution is to tell it to specifically upgrade all installed modules.<br />
<span id="more-594"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> emerge <span style="color: #660033;">-avu1</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>qlist <span style="color: #660033;">-IvC</span> <span style="color: #000000; font-weight: bold;">/</span>qt- <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> 4. <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> s<span style="color: #000000; font-weight: bold;">/</span>-4.<span style="color: #000000; font-weight: bold;">*//</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>This will allow Gentoo to solve the dependencies by uninstalling the old versions, unlike if you only try to upgrade a single package like <code>x11-libs/qt-core</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/11/21/upgrading-all-qt-modules-in-gentoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NVidia driver fails to initialize after X restart</title>
		<link>http://www.guyrutenberg.com/2009/11/14/nvidia-driver-fails-to-initialize-after-x-restart/</link>
		<comments>http://www.guyrutenberg.com/2009/11/14/nvidia-driver-fails-to-initialize-after-x-restart/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 15:19:14 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Errors]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=589</guid>
		<description><![CDATA[This is mainly a note to myself. Sometimes when the X server is restart it complains that nvidia driver couldn&#8217;t be initialized and that no screens were found. This may be a result of a version mismatch between X11&#8217;s and the kernel&#8217;s nvidia module. The solution is to

modprobe -r nvidia

before restarting the X server.
]]></description>
			<content:encoded><![CDATA[<p>This is mainly a note to myself. Sometimes when the X server is restart it complains that <code>nvidia</code> driver couldn&#8217;t be initialized and that no screens were found. This may be a result of a version mismatch between X11&#8217;s and the kernel&#8217;s <code>nvidia</code> module. The solution is to</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">modprobe -r nvidia</pre></div></div>

<p>before restarting the X server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/11/14/nvidia-driver-fails-to-initialize-after-x-restart/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Blocking IP Range using UFW</title>
		<link>http://www.guyrutenberg.com/2009/11/07/blocking-ip-range-using-ufw/</link>
		<comments>http://www.guyrutenberg.com/2009/11/07/blocking-ip-range-using-ufw/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 19:19:15 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ufw]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=584</guid>
		<description><![CDATA[Uncomplicated Firewall (ufw) is one of the greatest frontends to IPTables I&#8217;ve encountered. It is very simple to use and I just wish it was also available for Gentoo. Up until recently everything went smoothly for me and ufw, but we hit some rough waters when I&#8217;ve tried to block an IP range.
To block an [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://launchpad.net/ufw">Uncomplicated Firewall</a> (<code>ufw</code>) is one of the greatest frontends to IPTables I&#8217;ve encountered. It is very simple to use and I just wish it was also available for Gentoo. Up until recently everything went smoothly for me and <code>ufw</code>, but we hit some rough waters when I&#8217;ve tried to block an IP range.</p>
<p>To block an ip or I&#8217;p range in ufw you should do</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo ufw deny from 188.162.67.197/21</pre></div></div>

<p><span id="more-584"></span></p>
<p>But here is the catch. Only the recent versions of <code>ufw</code> (which the version that comes with Ubuntu 8.04 isn&#8217;t one of them) support inserting new rules. When you add a rule it gets appended. So if you had a rule before that allows everyone to connect to your server on port 80, it also allows the IP range you&#8217;re trying to block, to connect to your machine.</p>
<p>As it&#8217;s impossible to foresee all the rules you might use, one has to resort to deleting all the rules he has to override, then re-add them so they will be after the rule that blocks the IP range. However I disliked the idea and looked for a simpler solution.</p>
<p>The easiest method I&#8217;ve found was to manully edit <code>ufw</code>&#8217;s configurations:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo vim /var/lib/ufw/user.rules</pre></div></div>

<p>And then move the rule I&#8217;ve added, which looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">### tuple ### deny any any 0.0.0.0/0 any 188.162.67.197/21
-A ufw-user-input -s 188.162.67.197/21 -j DROP</pre></div></div>

<p>above any other rules in the configuration file.</p>
<p>Afterward, you&#8217;ll have to restart <code>ufw</code> so it will reload its configurations.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo ufw disable
sudo ufw enable</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/11/07/blocking-ip-range-using-ufw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Amarok Generated Playlists (m3u) on Sansa Clip</title>
		<link>http://www.guyrutenberg.com/2009/07/11/using-amarok-generated-playlists-m3u-on-sansa-clip/</link>
		<comments>http://www.guyrutenberg.com/2009/07/11/using-amarok-generated-playlists-m3u-on-sansa-clip/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 18:23:39 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Amarok]]></category>
		<category><![CDATA[Sansa Clip]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=405</guid>
		<description><![CDATA[Few days ago, for the first time, I&#8217;ve created a playlist using Amarok for files on my Sansa Clip player. To my surprise (and disappointment) when I&#8217;ve unplugged my Sansa Clip and powered it, the playlist showed up empty, unlike playlists which originated in Windows. As I keep my music collection organized in Amarok, the [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago, for the first time, I&#8217;ve created a playlist using Amarok for files on my Sansa Clip player. To my surprise (and disappointment) when I&#8217;ve unplugged my Sansa Clip and powered it, the playlist showed up empty, unlike playlists which originated in Windows. As I keep my music collection organized in Amarok, the situation seemed to be very uncomfortable.</p>
<p>I&#8217;ve decided to compare one of the working playlist files and the &#8220;empty&#8221; Amarok generated playlist. Two things were noticeable:</p>
<ol>
<li>Amarok uses forward slashes, like in a Linux environment, and the working playlist used backward slashes.</li>
<li>The working playlist used relative paths without any prefix &#8211; directly beginning with the path. Amarok prefixed the relative paths with a dot-slash (./).</li>
</ol>
<p>After noticing those things I&#8217;ve modified my Amarok generated playlist to look like the Windows generated one, and voila, it worked. I tried going through Amarok&#8217;s configuration dialogs to find some option controlling the format of generated m3u playlists, but couldn&#8217;t find any (I&#8217;m using Amarok 1.4.10). So with my newly found wits I&#8217;ve looked for a way to make using the playlists easier. I&#8217;ve came up with the following one-liner:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.m3u&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> -I<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/^\.\///;s/\//\\\\/g&quot;</span> <span style="color: #660033;">-i</span><span style="color: #ff0000;">''</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>The command should be run in the <code>MUSIC</code> directory of the Sansa Clip&#8217;s filesystem. It recursivey looks for m3u playlists and for each one strips any leading dot-slash and replaces forward slashes with backward ones. It can be used to easily convert all your playlists to the format understandable by Sansa Clip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/07/11/using-amarok-generated-playlists-m3u-on-sansa-clip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrading All KDE Related Packages in Gentoo</title>
		<link>http://www.guyrutenberg.com/2009/06/08/upgrading-all-kde-related-packages-in-gentoo/</link>
		<comments>http://www.guyrutenberg.com/2009/06/08/upgrading-all-kde-related-packages-in-gentoo/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 06:24:01 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=376</guid>
		<description><![CDATA[Yesterday, Gentoo marked KDE 3.5.10 as stable on amd64. I looked for a way to upgrade all of the KDE related packages, without manually specifying each one of them. Normally one could do

emerge -avu world

but I encountered some nasty conflicts that I didn&#8217;t have time, nor will, to resolve at that time. So I&#8217;ve looked [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, Gentoo marked KDE 3.5.10 as stable on amd64. I looked for a way to upgrade all of the KDE related packages, without manually specifying each one of them. Normally one could do</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">emerge -avu world</pre></div></div>

<p>but I encountered some nasty conflicts that I didn&#8217;t have time, nor will, to resolve at that time. So I&#8217;ve looked for a different solution. To my rescue came <code>qlist</code> for the great <code>app-portage/portage-utils</code> package. This package provides a set of very fast utilities to query <code>portage</code>. I&#8217;ve used <code>qlist</code> to list all of my installed packages, <code>grep</code>&#8216;ed the list and piped the result as arguments to <code>emerge</code> using <code>xargs</code>.<br />
<span id="more-376"></span></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> qlist -I --nocolor | grep kde | xargs emerge -pvu1</pre></div></div>

<p>Take a look at the package list that will be merged. If everything looks fine, then do the actual merging.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> qlist -I --nocolor | grep kde | xargs sudo emerge -vu1</pre></div></div>

<p>The <code>--nocolor</code> is important, or else <code>emerge</code> will complain about the benign looking atoms such as <code>dev-util/kdevelop</code>  because there are invisible terminal formating characters around them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/06/08/upgrading-all-kde-related-packages-in-gentoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Lighttpd-1.4.22 on Ubuntu 8.04</title>
		<link>http://www.guyrutenberg.com/2009/05/31/installing-lighttpd-1422-on-ubuntu-804/</link>
		<comments>http://www.guyrutenberg.com/2009/05/31/installing-lighttpd-1422-on-ubuntu-804/#comments</comments>
		<pubDate>Sun, 31 May 2009 19:43:19 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=371</guid>
		<description><![CDATA[I had some problems with the lighttpd-1.4.19 that comes with Ubuntu 8.04, mainly it&#8217;s problems of handling the HTTP header Expect: 100-continue (which older versions of Lighttpd return error 417). The problem was fixed in Lighttpd-1.4.21, but 1.4.22 is the newest version so I&#8217;ve decided to install it.
As I mentioned before, Ubuntu doesn&#8217;t have lighttpd-1.4.22 [...]]]></description>
			<content:encoded><![CDATA[<p>I had some problems with the lighttpd-1.4.19 that comes with Ubuntu 8.04, mainly it&#8217;s problems of handling the HTTP header <code>Expect: 100-continue</code> (which older versions of Lighttpd return error 417). The problem was fixed in Lighttpd-1.4.21, but 1.4.22 is the newest version so I&#8217;ve decided to install it.</p>
<p>As I mentioned before, Ubuntu doesn&#8217;t have lighttpd-1.4.22 for 8.04, and it&#8217;s also not available in the updates or backports repositories. Fortunately, I&#8217;ve found that the package is available from Debuian Sid (unstable). Here are some instructions on how to install it.<br />
<span id="more-371"></span><br />
Start By downloading the following packages.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">wget http://ftp.de.debian.org/debian/pool/main/l/lighttpd/lighttpd_1.4.22-1_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/p/pcre3/libpcre3_7.8-2_amd64.deb</pre></div></div>

<p>You can statisfy using the offical repositories all the dependencies of lighttpd-1.4.22 except the libpcre3, which is also available from Debian Sid. So start by installing it.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo dpkg -i libpcre3_7.8-2_amd64.deb
sudo aptitude markauto libpcre3</pre></div></div>

<p>You statisfy the rest of the dependencies by using <code>apt-get</code> and the official repositories. In case you encounter the following problem when starting lighttpd:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/usr/sbin/lighttpd: Symbol `FamErrlist' has different size in shared object, con
sider re-linking</pre></div></div>

<p>it can be solved easiliy by installing <code>libfam3</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo apt-get install libfam3</pre></div></div>

<p>(don&#8217;t worry if it complains about needing to remove <code>libgamin0</code>). You should be done now, and you can start enjoying your shining lighttpd-1.4.22.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/05/31/installing-lighttpd-1422-on-ubuntu-804/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iptables Cheatsheet</title>
		<link>http://www.guyrutenberg.com/2009/02/26/iptables-cheatsheet/</link>
		<comments>http://www.guyrutenberg.com/2009/02/26/iptables-cheatsheet/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 06:19:47 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=273</guid>
		<description><![CDATA[From time to time I find myself having to go through man pages and googling for some simple iptable rules. This post is meant as a cheatsheet for me, so I can concentrate here various rules and remarks.
I hope others will benefit from this cheatsheet as well. Intend to expand it over time as I [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time I find myself having to go through man pages and googling for some simple iptable rules. This post is meant as a cheatsheet for me, so I can concentrate here various rules and remarks.</p>
<p>I hope others will benefit from this cheatsheet as well. Intend to expand it over time as I gather more rules and tips, so bookmarking the post might be a good idea. Last but not least, if you have some useful iptables rules I&#8217;ve missed please send them using the comments.<br />
<span id="more-273"></span></p>
<h3>Blocking specific IPs</h3>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iptables -I INPUT -s &quot;207.58.140.12&quot; -j DROP</pre></div></div>

<h3>Blocking a range of IPs (IP block)</h3>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iptables -I INPUT -s &quot;207.58.140.0/24&quot; -j DROP</pre></div></div>

<p>The number after the slash (/) determines the number of bits (starting with the most significant one) considered when matching an IP address. For example the above rule will block any packets from 207.58.140.* . Other useful number of bits are 16 (for matching the first two octets) and 8 (only the first octet).</p>
<h3>Deleting rules</h3>
<p>Just specify the rule after a <code>-D</code> flag. E.g.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iptables -D INPUT -s &quot;207.58.140.12&quot; -j DROP</pre></div></div>

<h3>Saving new rules</h3>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/etc/init.d/iptables save</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/02/26/iptables-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting tracd without Root Privileges at Startup</title>
		<link>http://www.guyrutenberg.com/2009/02/17/starting-tracd-without-root-privileges-at-startup/</link>
		<comments>http://www.guyrutenberg.com/2009/02/17/starting-tracd-without-root-privileges-at-startup/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 17:28:20 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Trac]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=263</guid>
		<description><![CDATA[I use Trac for the Open Yahtzee website. I&#8217;ve decided to use tracd for serving the requests (due to a configuration issue I didn&#8217;t want to mess with), which required starting it each time the server restarts. I&#8217;ve already written one solution for it, in the form of an init.d script for tracd. However, it [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://trac.edgewall.org/">Trac</a> for the <a href="http://www.openyahtzee.org">Open Yahtzee</a> website. I&#8217;ve decided to use <code>tracd</code> for serving the requests (due to a configuration issue I didn&#8217;t want to mess with), which required starting it each time the server restarts. I&#8217;ve already written one solution for it, in the form of an <a href="/2008/06/04/start-trac-on-startup-initd-script-for-tracd/"><code>init.d</code> script for <code>tracd</code></a>. However, it bothered me that the <code>tracd</code> runs with root privileges which it doesn&#8217;t really requires.</p>
<p>After searching a bit I&#8217;ve found out that <code>cron</code> can run tasks on startup using the special <code>@reboot</code> keyword instead of the normal time fields. So edit your crontab and add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">@reboot /usr/bin/tracd --daemonize --pidfile=~/run/tracd.pid --port=PORT --hostname=HOSTNAME -s TRAC_ENV</pre></div></div>

<p>Just replace <code>PORT</code>, <code>HOSTNAME</code> and <code>TRAC_ENV</code> with the appropriate values for your environment, and make sure you got a <code>run/</code> sub-directory in your home folder (or change the pidfile value).</p>
<p>To stop the server just do:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">kill `cat ~/run/tracd.pid`</pre></div></div>

<p>While there is no straight way to restart the server (like <code>/etc/init.d/tracd restart</code>), it&#8217;s a good compromise for dropping root privileges.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/02/17/starting-tracd-without-root-privileges-at-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amarok Sleep &#8211; Stop Playback After Specified Amount of Time</title>
		<link>http://www.guyrutenberg.com/2009/02/04/amarok-sleep-stop-playback-after-specified-amount-of-time/</link>
		<comments>http://www.guyrutenberg.com/2009/02/04/amarok-sleep-stop-playback-after-specified-amount-of-time/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 07:13:39 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Amarok]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=265</guid>
		<description><![CDATA[Amarok is my favourite music player. I like to listen to music when I go a sleep, but I don&#8217;t want the music to keep playing all night long. This is why I&#8217;ve added a sleep feature to radio.py. Unfortunately Amarok doesn&#8217;t have a built-in sleep functionality, but the Amarok developers left open door for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://amarok.kde.org">Amarok</a> is my favourite music player. I like to listen to music when I go a sleep, but I don&#8217;t want the music to keep playing all night long. This is why I&#8217;ve added a sleep feature to <a href="/radiopy">radio.py</a>. Unfortunately Amarok doesn&#8217;t have a built-in sleep functionality, but the Amarok developers left open door for us to implement it with ease by means of interfaces allowing to control amarok from the command line.<br />
<span id="more-265"></span><br />
The first solution uses Amarok itself. The Amarok developers have provided means of controlling Amarok via the command-line. So we&#8217;ll combine this with the <code>sleep</code> command <code>sleep<code> command, and run the following in a console:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sleep 120m; amarok --stop</pre></div></div>

<p>This will cause Amarok to stop after 120 minutes. The <code>sleep</code> command takes a number and a suffix which can be one of s, m, h and d (for seconds, minutes, hours and days). You can use it to easily set the duration before the playback halts.</p>
<p>Another solution, a more general one, would be to use <a href="http://en.wikipedia.org/wiki/DCOP">DCOP</a>. Amarok provides a very extensive DCOP interface that allows to control most of its features, including of course stopping the playback. So we could also use</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sleep 1h; dcop amarok player stop</pre></div></div>

<p>To stop Amarok in one hour.</p>
<p>A little note about the last solution. This post is written for Amarok 1.4 and not 2.0 as I didn't switch yet to KDE 4. DCOP was replaced in KDE 4 by D-Bus and the last solution would probably not work. However you could probably easily adjust it to the new D-Bus interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/02/04/amarok-sleep-stop-playback-after-specified-amount-of-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpMyAdmin + Lighttpd in Gentoo</title>
		<link>http://www.guyrutenberg.com/2009/01/20/phpmyadmin-lighttpd-in-gentoo/</link>
		<comments>http://www.guyrutenberg.com/2009/01/20/phpmyadmin-lighttpd-in-gentoo/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 16:14:57 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[phpMyAdmin]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=248</guid>
		<description><![CDATA[Usually installing software in Gentoo is a piece of cake. Just emerge what you want and (with the right USE flags) and everything will be ready for you. However, as today I&#8217;ve found out today, installing phpMyAdmin with Lighttpd isn&#8217;t trivial as it should be.
In this post I&#8217;ll try to walk you through the necessary [...]]]></description>
			<content:encoded><![CDATA[<p>Usually installing software in Gentoo is a piece of cake. Just <code>emerge</code> what you want and (with the right USE flags) and everything will be ready for you. However, as today I&#8217;ve found out today, installing phpMyAdmin with Lighttpd isn&#8217;t trivial as it should be.</p>
<p>In this post I&#8217;ll try to walk you through the necessary steps to install phpMyAdmin with Lighttpd in Gentoo.<br />
<span id="more-248"></span></p>
<h3>Installing Lighttpd and PHP</h3>
<p>Before installing Lighttpd and PHP you&#8217;ll need to enable some USE flags. For Lighttpd you&#8217;ll need to at least enable the <code>php</code> and <code>fastcgi</code> USE flags. For PHP enable the <code>cgi</code>, <code>crypt</code>, <code>ctype</code>, <code>pcre</code>, <code>session</code>, <code>unicode</code>. The first one is required for working with Lighttpd, while the others are required for phpMyAdmin.</p>
<p>See the <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&#038;chap=2">handbook</a> for information about enabling USE flags.</p>
<p>Now install the packages</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">emerge -av lighttpd php</pre></div></div>

<p>After installation is complete, start the Lighttpd process</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/etc/init.d/lighttpd start</pre></div></div>

<p>and you should have a working Lighttpd server with PHP support.</p>
<h3>Installing phpMyAdmin</h3>
<p>phpMyAdmin depends on a package called <code>webapp-config</code>. While usually we let Portage take care of dependencies, this time we&#8217;ll have to install <code>webapp-config</code> manually before we install phpMyAdmin, so we can change its configuration for suit Lighttpd.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">emerge -av --oneshot webapp-config</pre></div></div>

<p>After installation is done edit using your favourite editor the <code>/etc/vhosts/webapp-config</code> and change the line:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">vhost_server=&quot;apache&quot;</pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">vhost_server=&quot;lighttpd&quot;</pre></div></div>

<p>Now we are ready to install phpMyAdmin.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">emerge -av phpmyadmin</pre></div></div>

<p>After installation is complete, you&#8217;ll need to create a phpMyAdmin configuration file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cp /var/www/localhost/htdocs/phpmyadmin/config.sample.inc.php /var/www/localhost/htdocs/phpmyadmin/config.inc.php</pre></div></div>

<p>Now open the newly created configuration file and edit the line with the <code>blowfish_secret</code> (at the top of the file) as explained in it. An easy way to generate the password would be to use <a href="http://www.guyrutenberg.com/2008/05/04/spass-11-secure-password-generator/"><code>spass</code></a>.</p>
<p>Now if you use the default Lighttpd configurations you&#8217;re done. You can access the phpMyAdmin via <code>http://localhost/phpmyadmin</code>. If however you&#8217;ve changed the document root, there is one more step for you. Enable the <code>mod_alias</code> module in <code>/etc/lighttpd/lighttpd.conf</code> and append to the file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">alias.url += (&quot;/phpmyadmin&quot; =&gt; &quot;/var/www/localhost/htdocs/phpmyadmin&quot;)</pre></div></div>

<p>and don&#8217;t forget to restart the Lighttpd server after making the changes.</p>
<p>You should have by now everything installed and configured to work. If you have any further questions don&#8217;t hesitate to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2009/01/20/phpmyadmin-lighttpd-in-gentoo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.730 seconds -->
