<?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>nerdnotes.org &#187; linux</title>
	<atom:link href="http://nerdnotes.org/category/nerdnotes/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdnotes.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 17 Dec 2010 22:55:49 +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>Limit bandwidth needed for system updates</title>
		<link>http://nerdnotes.org/2010/12/limit-bandwidth-needed-for-system-updates/</link>
		<comments>http://nerdnotes.org/2010/12/limit-bandwidth-needed-for-system-updates/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 22:52:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=148</guid>
		<description><![CDATA[Watching movies online and updating my Ubuntu laptop at the same time doesn&#8217;t go well together with my DSL internet connection. This apt configuration snippet, makes sure apt will not consume your bandwith: It should be placed in a file in /etc/apt/apt-conf.d/. For more info, consult the apt.conf man page.]]></description>
			<content:encoded><![CDATA[<p>Watching movies online and updating my Ubuntu laptop at the same time doesn&#8217;t go well together with my DSL internet connection. This apt configuration snippet, makes sure apt will not consume your bandwith:</p>
<pre class="brush: bash; title: ; notranslate">
Acquire
{
        Queue-mode &quot;access&quot;;
        http
        {
                Dl-Limit &quot;20&quot;;
        };
};
</pre>
<p>It should be placed in a file in /etc/apt/apt-conf.d/. For more info, consult the apt.conf man page.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2010/12/limit-bandwidth-needed-for-system-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mt-daapd</title>
		<link>http://nerdnotes.org/2010/01/mt-daapd/</link>
		<comments>http://nerdnotes.org/2010/01/mt-daapd/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 23:07:15 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[logfile]]></category>
		<category><![CDATA[mt-daapd]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/?p=128</guid>
		<description><![CDATA[Mt-daapd is an &#8216;iTunes&#8217; server that you can run on a linux system holding your music collection. When fiddling around with configuration, I came accros the following error message in the syslog: Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load I was trying to setup a custom transcoding script. That required to load the &#8216;ssc-script.so&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Mt-daapd is an &#8216;iTunes&#8217; server that you can run on a linux system holding your music collection.<br />
When fiddling around with configuration, I came accros the following error message in the syslog:</p>
<blockquote><p>Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
</p></blockquote>
<p>I was trying to setup a custom transcoding script. That required to load the &#8216;ssc-script.so&#8217; plugin first.<br />
When increasing the log level, it gave a more descriptive hint to what is going on:</p>
<blockquote><p>No codectypes specified for script transcoder.<br />
Error loading plugin /usr/lib/mt-daapd/plugins/ssc-script.so: plugin declined to load
</p></blockquote>
<p>After uncommenting the following line in /etc/mt-daapd.conf:</p>
<pre class="brush: plain; title: ; notranslate">ssc_codectypes = ogg,flac,alac
</pre>
<p>&#8230;it showed no error messages anymore:</p>
<blockquote><p>Loaded plugin /usr/lib/mt-daapd/plugins/ssc-script.so (ssc-script/svn-1696)
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2010/01/mt-daapd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cakephp, user_dir and mod_rewrite</title>
		<link>http://nerdnotes.org/2009/04/cakephp-user_dir-and-mod_rewrite/</link>
		<comments>http://nerdnotes.org/2009/04/cakephp-user_dir-and-mod_rewrite/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 08:53:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/04/02/cakephp-user_dir-and-mod_rewrite/</guid>
		<description><![CDATA[Here&#8217;s a little note on getting a cakephp app working in your public_html directory. In order to get the mod_rewrite configuration working, add a RewriteBase rule to the .htaccess files in the cakephp source. If your app is located in /home/me/public_html/cakesite/ and the URL to the site is http://host/~me/cakesite you&#8217;ll need to change the following [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little note on getting a cakephp app working in your public_html directory. In order to get the mod_rewrite configuration working, add a RewriteBase rule to the .htaccess files in the cakephp source. If your app is located in /home/me/public_html/cakesite/ and the URL to the site is http://host/~me/cakesite you&#8217;ll need to change the following .htaccess files:</p>
<blockquote><p>
/home/me/public_html/cakesite/.htaccess<br />
/home/me/public_html/cakesite/app/webroot/.htaccess
</p></blockquote>
<p>Add the following line to these files, just below the line stating &#8220;RewriteEnginge On&#8221;:</p>
<pre class="brush: css; title: ; notranslate">
RewriteBase /~me/cakesite/
</pre>
<p>For example, the first .htaccess file will look like:</p>
<pre class="brush: css; title: ; notranslate">
&lt;ifModule mod_rewrite.c&gt;
	RewriteEngine on
	RewriteBase /~me/cakesite/
	RewriteRule    ^$ app/webroot/    [L]
	RewriteRule    (.*) app/webroot/$1 [L]
&lt;/ifModule&gt;
</pre>
<p><strong>Bonus notes with instructions for Debian/Ubuntu systems</strong><br />
You should have mod_rewrite enabled:</p>
<blockquote><p>
$ sudo a2enmod rewrite<br />
$ sudo /etc/init.d/apache2 force-reload
</p></blockquote>
<p>To make sure the use of .htaccess files is actually allowed. In the Directory section of your apache configuration, there should be a line like:</p>
<blockquote><p>
AllowOverride FileInfo
</p></blockquote>
<p>Also, be sure to force-reload Apache after making this change.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/04/cakephp-user_dir-and-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Two ways of generating white noise</title>
		<link>http://nerdnotes.org/2009/01/two-ways-of-generating-white-noise/</link>
		<comments>http://nerdnotes.org/2009/01/two-ways-of-generating-white-noise/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 11:46:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/01/14/two-ways-of-generating-white-noise/</guid>
		<description><![CDATA[Goal: generate a white noise .wav fille of 1.5 hours In matlab: % create a matrix with random values: >> noise = 2 * rand(90 * 60 * 44100, 2, 'double') - 1; % write the wav file with a sample frequency o 44.1kHz >> wavwrite(noise, 44100, 16, 'noise.wav'); This process takes a while and [...]]]></description>
			<content:encoded><![CDATA[<p>Goal: generate a white noise .wav fille of 1.5 hours<br />
In matlab:</p>
<p><code><br />
% create a matrix with random values:<br />
>> noise = 2 * rand(90 * 60 * 44100, 2, 'double') - 1;</p>
<p>% write the wav file with a sample frequency o 44.1kHz<br />
>> wavwrite(noise, 44100, 16, 'noise.wav');<br />
</code><br />
This process takes a while and it consumes quite some of your system RAM.</p>
<p>More efficient, in bash:<br />
<code><br />
$ dd if=/dev/urandom count=5400 bs=176400 | sox -s -c 2 -r 44100 -t raw -w - noise.wav<br />
</code><br />
This took only 2 minutes!</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/01/two-ways-of-generating-white-noise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vmcp</title>
		<link>http://nerdnotes.org/2007/12/vmcp/</link>
		<comments>http://nerdnotes.org/2007/12/vmcp/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 19:55:17 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://45</guid>
		<description><![CDATA[Vmcp (vm-copy) is a simple script that allows you to copy/clone a VMware virtual computer image. Just specify the source directory and the destination directory. It will first just copy the wmware directory recursively en then change the configuration option &#8216;displayName&#8217; in the vmx file.]]></description>
			<content:encoded><![CDATA[<p>Vmcp (vm-copy) is a simple script that allows you to copy/clone a VMware virtual computer image. Just specify the source directory and the destination directory. It will first just copy the wmware directory recursively en then change the configuration option &#8216;displayName&#8217; in the vmx file.</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/sh

source=$1
dest=$2

echo copying virtual machine
cp -rv $source $dest

vmxsourcefile=`ls $source/*.vmx`
vmxdestfile=`ls $dest/*.vmx`

grep -v displayName $vmxsourcefile &gt; $vmxdestfile
echo displayName = \&quot;$dest\&quot; &gt;&gt; $vmxdestfile

exit 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/12/vmcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reminder: Local documentation!</title>
		<link>http://nerdnotes.org/2007/09/reminder-local-documentation/</link>
		<comments>http://nerdnotes.org/2007/09/reminder-local-documentation/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 19:23:01 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://89</guid>
		<description><![CDATA[I&#8217;ve been searching for some &#8216;getopt&#8217; examples on the internet. Many tutorials show the same basic tricks. I completely looked over the local documentation, which in fact has very nice examles for bash and tcsh:]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been searching for some &#8216;getopt&#8217; examples on the internet. Many tutorials show the same basic tricks. I completely looked over the local documentation, which in fact has very nice examles for bash and tcsh:</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/bash

# A small example program for using the new getopt(1) program.
# This program will only work with bash(1)
# An similar program using the tcsh(1) script language can be found
# as parse.tcsh

# Example input and output (from the bash prompt):
# ./parse.bash -a par1 'another arg' --c-long 'wow!*\?' -cmore -b &quot; very long &quot;
# Option a
# Option c, no argument
# Option c, argument `more'
# Option b, argument ` very long '
# Remaining arguments:
# --&gt; `par1'
# --&gt; `another arg'
# --&gt; `wow!*\?'

# Note that we use `&quot;$@&quot;' to let each command-line parameter expand to a
# separate word. The quotes around `$@' are essential!
# We need TEMP as the `eval set --' would nuke the return value of getopt.
TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
     -n 'example.bash' -- &quot;$@&quot;`

if [ $? != 0 ] ; then echo &quot;Terminating...&quot; &gt;&amp;2 ; exit 1 ; fi

# Note the quotes around `$TEMP': they are essential!
eval set -- &quot;$TEMP&quot;

while true ; do
        case &quot;$1&quot; in
                -a|--a-long) echo &quot;Option a&quot; ; shift ;;
                -b|--b-long) echo &quot;Option b, argument \`$2'&quot; ; shift 2 ;;
                -c|--c-long)
                        # c has an optional argument. As we are in quoted mode,
                        # an empty parameter will be generated if its optional
                        # argument is not found.
                        case &quot;$2&quot; in
                                &quot;&quot;) echo &quot;Option c, no argument&quot;; shift 2 ;;
                                *)  echo &quot;Option c, argument \`$2'&quot; ; shift 2 ;;
                        esac ;;
                --) shift ; break ;;
                *) echo &quot;Internal error!&quot; ; exit 1 ;;
        esac
done
echo &quot;Remaining arguments:&quot;
for arg do echo '--&gt; '&quot;\`$arg'&quot; ; done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/09/reminder-local-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL re-installation</title>
		<link>http://nerdnotes.org/2007/08/mysql-re-installation/</link>
		<comments>http://nerdnotes.org/2007/08/mysql-re-installation/#comments</comments>
		<pubDate>Sat, 04 Aug 2007 13:17:33 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://87</guid>
		<description><![CDATA[De-installation is sometimes not so easy with APT. For example when you screwed up your mysql installation or lost mysql passwords you may want to reinstall mysql and start from scratch again. You probably installed mysql server using: Then you might think that you need this command for removal: However, this is not the case. [...]]]></description>
			<content:encoded><![CDATA[<p>De-installation is sometimes not so easy with APT. For example when you screwed up your mysql installation or lost mysql passwords you may want to reinstall mysql and start from scratch again. You probably installed mysql server using:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get install mysql-server
</pre>
<p>Then you might think that you need this command for removal:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get remove mysql-server
</pre>
<p>However, this is not the case. The mysql-server package is a sort of meta-package that makes sure that the latest (and greatest) available mysql server version will be installed. Currently, this means that you actually installed mysql-server version 5.0. Above command will only remove the meta-package, while mysql server 5 happily continues running on your system. To de-install the mysql-server, remove the package, the meta package pulled in:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get remove mysql-server-5.0
</pre>
<p>To also remove the configuration and the binary data, use instead:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get remove --purge mysql-server-5.0
# and for ubuntu Gutsy:
$ sudo apt-get purge mysql-server-5.0
</pre>
<p>Now that mysql server is &#8216;really&#8217; gone, you can start over and install the mysql-server package:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get install mysql-server
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/08/mysql-re-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8216;Compact&#8217; bash prompt</title>
		<link>http://nerdnotes.org/2007/07/compact-bash-prompt/</link>
		<comments>http://nerdnotes.org/2007/07/compact-bash-prompt/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 20:47:25 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://86</guid>
		<description><![CDATA[Especially when working with cakephp, the following line in your .bash_profile script might come in handy: It will print out the current working directory on the first line and the actual bash prompt on the second line. Making it less likely that your command will wrap lines after the first few typed characters. It changes [...]]]></description>
			<content:encoded><![CDATA[<p>Especially when working with cakephp, the following line in your .bash_profile script might come in handy:</p>
<pre class="brush: css; title: ; notranslate">
HOSTCOLOR=&quot;31m&quot;
PS1=&quot;\u@\[\e[${HOSTCOLOR}\]\h\[\e[0m\]:\w\n\[\e[33m\]\!\[\e[0m\] \$ &quot;
</pre>
<p>It will print out the current working directory on the first line and the actual bash prompt on the second line. Making it less likely that your command will wrap lines after the first few typed characters.<br />
It changes the command prompt from:</p>
<p><img id="image112" src="http://nerdnotes.org/wp-content/uploads/2007/07/cmdline-long.png" alt="command line long" /></p>
<p>&#8230;.into:</p>
<p><img id="image110" src="http://nerdnotes.org/wp-content/uploads/2007/07/cmdline-short.png" alt="command line 'short'" /></p>
<p>The login prompt now shows the following info:</p>
<ul>
<li>username</li>
<li>hostname in red (in my bash script, it will print red for one group of servers and blue for other servers)</li>
<li>current working directory</li>
<li>command history number, ie: use !520 to execute the previous command</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/07/compact-bash-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extracting layers from a XCF (gimp) file</title>
		<link>http://nerdnotes.org/2007/07/extracting-layers-from-a-xcf-gimp-file/</link>
		<comments>http://nerdnotes.org/2007/07/extracting-layers-from-a-xcf-gimp-file/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 22:15:05 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://83</guid>
		<description><![CDATA[This is a script that extracts the layers of a XCF file to individual PNG files. It uses xcftools (debian/ubuntu package):]]></description>
			<content:encoded><![CDATA[<p>This is a <a href="http://nerdnotes.org/scripts/xtractlayers.sh.php">script</a> that extracts the layers of a XCF file to individual PNG files. It uses xcftools (debian/ubuntu package):</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/bash

xcffile=$1

layers=`xcfinfo $xcffile  | awk '{ print $NF }'`

destdir=`dirname $xcffile`/layers
mkdir $destdir

for layer in $layers
do
        echo saving $layer to $destdir/$layer.png
        xcf2png -o $destdir/$layer.png $xcffile $layer
done

exit 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/07/extracting-layers-from-a-xcf-gimp-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless setup</title>
		<link>http://nerdnotes.org/2006/12/wireless-setup/</link>
		<comments>http://nerdnotes.org/2006/12/wireless-setup/#comments</comments>
		<pubDate>Tue, 26 Dec 2006 21:25:43 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://76</guid>
		<description><![CDATA[For some reason, I couldn&#8217;t get my wireless card (Linksys WMP54G pci) working under Ubuntu 6.10. Another attempt today. First without encryption: Hey! it works!. Then WEP &#8216;encryption&#8217;: no luck. WPA: on my access point (asus wl530g) it&#8217;s called WPA-PSK with TKIP encryption. OS X calls it &#8220;WPA personal&#8221;. Under Linux, adapting the /etc/networking/interfaces file [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, I couldn&#8217;t get my wireless card (Linksys WMP54G pci) working under Ubuntu 6.10. Another attempt today. First without encryption: Hey! it works!. Then WEP &#8216;encryption&#8217;: no luck. WPA: on my access point (asus wl530g) it&#8217;s called WPA-PSK with TKIP encryption. OS X calls it &#8220;WPA personal&#8221;. Under Linux, adapting the /etc/networking/interfaces file was sufficient:</p>
<pre class="brush: css; title: ; notranslate">
$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

iface ra0 inet dhcp
pre-up iwconfig ra0 essid default
pre-up iwconfig ra0 mode managed
pre-up iwconfig ra0 channel 1
pre-up iwpriv ra0 set AuthMode=WPAPSK
pre-up iwpriv ra0 set EncrypType=TKIP
pre-up iwpriv ra0 set WPAPSK=&quot;mysecretpassphrase&quot;

auto ra0
</pre>
<p>So, no additional drivers / modules, just choosing the right encryption was the trick to get this card working. <a href="http://ubuntuforums.org/showpost.php?p=432663&#038;postcount=7">This</a> was one of the posts that where very helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/12/wireless-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

