<?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>Cretaceous Labs &#187; GNU/Linux</title>
	<atom:link href="http://cretaceouslabs.com/blog/category/gnulinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://cretaceouslabs.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 10 Oct 2010 20:02:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PostgreSQL grants on all tables</title>
		<link>http://cretaceouslabs.com/blog/2010/09/postgresql-grants-tables/</link>
		<comments>http://cretaceouslabs.com/blog/2010/09/postgresql-grants-tables/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 15:39:09 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/?p=216</guid>
		<description><![CDATA[As much as I love PostgreSQL, its system of managing user privileges is a pain in the ass. PostgreSQL has no equivalent to MySQL&#8217;s method of granting a privilege on all of the tables in a database, including tables that you create in the future.
In MySQL, it&#8217;s as easy as:
GRANT SELECT ON db_name.* TO user@hostname;
The [...]]]></description>
			<content:encoded><![CDATA[<p>As much as I love PostgreSQL, its system of managing user privileges is a pain in the ass. PostgreSQL has no equivalent to MySQL&#8217;s method of granting a privilege on all of the tables in a database, including tables that you create in the future.</p>
<p>In MySQL, it&#8217;s as easy as:</p>
<pre>GRANT SELECT ON db_name.* TO user@hostname;</pre>
<p>The best that I&#8217;ve been able to achieve with PostgreSQL is this abomination:</p>
<pre>$ cat generate_grants.txt
SELECT 'grant select on '||schemaname||'.'||tablename||' to user_name;'
FROM pg_tables
WHERE schemaname IN ('public')
ORDER BY schemaname, tablename;
$
$ cat generate_grants.txt | psql -U nickh -W -d database \|
grep '^ grant' &gt;grants.txt
$
$ head -2 grants.txt
 grant select on public.table1 to user_name;
 grant select on public.table2 to user_name;
$
$ cat grants.txt | psql -U nickh -W -d database</pre>
<p>*shudder*</p>
<p>Thanks to <a title="Ben Williams' blog post" href="http://bensbrain.blogspot.com/2004/08/postgres-grant-on-all-tables-in.html">Ben Williams&#8217; blog post</a> for the initial query to generate the GRANT statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2010/09/postgresql-grants-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If Plasma dies, here&#8217;s what to do</title>
		<link>http://cretaceouslabs.com/blog/2010/01/if-plasma-dies-heres-what-to-do/</link>
		<comments>http://cretaceouslabs.com/blog/2010/01/if-plasma-dies-heres-what-to-do/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 17:45:18 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/?p=145</guid>
		<description><![CDATA[Every now and then, the Plasma desktop in KDE 4 crashes on me. Usually, it restarts itself. Sometimes, it doesn&#8217;t.
If you&#8217;re cursed with the latter scenario, there&#8217;s an easy solution.
Note: As avocadohead kindly mentioned in the comments, KDE &#62;= 4.3 has renamed &#8220;plasma&#8221; to &#8220;plasma-desktop&#8221;. So if you&#8217;re using KDE 4.3 or later, replace &#8220;plasma&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then, the Plasma desktop in KDE 4 crashes on me. Usually, it restarts itself. Sometimes, it doesn&#8217;t.</p>
<p>If you&#8217;re cursed with the latter scenario, there&#8217;s an easy solution.</p>
<p><strong>Note</strong>: As avocadohead kindly mentioned in the comments, KDE &gt;= 4.3 has renamed &#8220;plasma&#8221; to &#8220;plasma-desktop&#8221;. So if you&#8217;re using KDE 4.3 or later, replace &#8220;plasma&#8221; with &#8220;plasma-desktop&#8221; in the commands below.</p>
<p>By default, KDE sets the keyboard shortcut for &#8220;Run Command&#8221; to ALT+F2. So hit ALT+F2, and type this, and hit enter:</p>
<pre>kbuildsycoca4 &amp;&amp; kquitapp plasma &amp;&amp; kstart plasma</pre>
<p>Plasma should pop back to life.</p>
<p>That command is actually three commands:</p>
<ol>
<li><em>kbuildsycoca4</em> rebuilds KDE&#8217;s system configuration cache.</li>
<li><em>kquitapp plasma</em> ensures that Plasma&#8217;s no longer running, instead of just, say, hung.</li>
<li><em>kstart plasma</em> starts Plasma.</li>
</ol>
<p>It took me a while to figure this out. Thanks to <a href="http://eumenidae.blogspot.com/2008/12/kill-and-restart-plasma.html">this post</a>, I learned about <em>kstart</em>. From what I&#8217;ve read, it seems that running <em>kquitapp plasma</em> and <em>kstart plasma</em> from the CLI works for some people. Unfortunately, they fail for me on the CLI:</p>
<pre>[nickh@chameleon ~] kquitapp plasma
&lt;unknown program name&gt;(7282)/: "Application plasma could not be found using service org.kde.plasma and path /MainApplication."
[nickh@chameleon ~]
[nickh@chameleon ~] kstart plasma
Qt: Session management error: Could not open network socket
kstart(7394) main: Omitting both --window and --windowclass arguments is not recommended
[nickh@chameleon ~] &lt;unknown program name&gt;(7397)/ checkComposite: Plasma has an argb visual 0x9ca7300 71303169
&lt;unknown program name&gt;(7397)/ checkComposite: Plasma can use COMPOSITE for effects on 0x9ca6c18
plasma(7398): KUniqueApplication: Cannot find the D-Bus session server

plasma(7397): KUniqueApplication: Pipe closed unexpectedly.

[nickh@chameleon ~]</pre>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2010/01/if-plasma-dies-heres-what-to-do/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Matching Printable Characters</title>
		<link>http://cretaceouslabs.com/blog/2009/11/matching-printable-characters/</link>
		<comments>http://cretaceouslabs.com/blog/2009/11/matching-printable-characters/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 21:10:17 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/?p=138</guid>
		<description><![CDATA[Who doesn&#8217;t love regular expressions? They&#8217;re fucking awesome. I use&#8217;em at least 10 times per day.
Sometimes, there&#8217;re restrictions on what patterns you can use. I wanted to change a regex for validating passwords. Originally, it allowed letters, numbers, and a seemingly random collection of special characters. How lame is this?:
^[A-Za-z0-9]{1}[A-Za-z0-9_\\.\\!\@\#\-]{0,255}$
Not only are the allowed special [...]]]></description>
			<content:encoded><![CDATA[<p>Who doesn&#8217;t love regular expressions? <a href="/blog/wp-content/uploads/2009/11/dino-riders.jpg" alt="Dino-Riders: They're fucking awesome">They&#8217;re fucking awesome.</a> I use&#8217;em at least 10 times per day.</p>
<p>Sometimes, there&#8217;re restrictions on what patterns you can use. I wanted to change a regex for validating passwords. Originally, it allowed letters, numbers, and a seemingly random collection of special characters. How lame is this?:</p>
<pre>^[A-Za-z0-9]{1}[A-Za-z0-9_\\.\\!\@\#\-]{0,255}$</pre>
<p>Not only are the allowed special characters arbitrary, but they&#8217;re escaping characters in a character class, and using &#8220;{1}&#8221;.</p>
<p>I tried changing the regex to this:</p>
<pre>^[[:print:]]{0,255}$</pre>
<p>Unfortunately, that wasn&#8217;t considered &#8220;valid&#8221; by the system in question. Luckily, there&#8217;s a fairly concise alternative:</p>
<pre>^[\x20-\x7E]{0,255}$</pre>
<p>If you find a system that lacks support for POSIX character classes, check out <a href="http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes" alt="POSIX character classes on Wikipedia">this Wikipedia article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/11/matching-printable-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying Your ViM Colour Scheme</title>
		<link>http://cretaceouslabs.com/blog/2009/11/displaying-vim-colour-scheme-2/</link>
		<comments>http://cretaceouslabs.com/blog/2009/11/displaying-vim-colour-scheme-2/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 18:08:32 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[ViM]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/?p=133</guid>
		<description><![CDATA[I posted this mostly because I&#8217;m always forgetting it, and also because it&#8217;s a pain in the ass to search for on Google. I usually try &#8220;:echo g:colorscheme&#8221;, which fails miserably.
If you&#8217;re playing around with colour schemes in ViM and want to figure out which one is being used at the moment, simply type:
:echo g:colors_name
]]></description>
			<content:encoded><![CDATA[<p>I posted this mostly because I&#8217;m always forgetting it, and also because it&#8217;s a pain in the ass to search for on Google. I usually try &#8220;:echo g:colorscheme&#8221;, which fails miserably.</p>
<p>If you&#8217;re playing around with colour schemes in ViM and want to figure out which one is being used at the moment, simply type:</p>
<pre>:echo g:colors_name</pre>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/11/displaying-vim-colour-scheme-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Gnome and Firefox Are Dead Slow</title>
		<link>http://cretaceouslabs.com/blog/2009/11/gnome-firefox-dead-slow/</link>
		<comments>http://cretaceouslabs.com/blog/2009/11/gnome-firefox-dead-slow/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 22:52:29 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Xorg]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/?p=120</guid>
		<description><![CDATA[I&#8217;ve had Ubuntu Karmic Koala installed on my MacBook Pro Core2Duo for 2-3 weeks now. Almost everything&#8217;s been working perfectly. However, whenever I&#8217;d start a second Gnome session and run Firefox, the machine would slow to a crawl, and X&#8217;s CPU usage would skyrocket..we&#8217;re talking &#62;80% here.
I scoured Google for all sorts of things:

Gnome second [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had Ubuntu Karmic Koala installed on my MacBook Pro Core2Duo for 2-3 weeks now. Almost everything&#8217;s been working perfectly. However, whenever I&#8217;d start a second Gnome session and run Firefox, the machine would slow to a crawl, and X&#8217;s CPU usage would skyrocket..we&#8217;re talking &gt;80% here.</p>
<p>I scoured Google for all sorts of things:</p>
<ul>
<li>Gnome second session is slow</li>
<li>Gnome X is slow</li>
<li>Gnome Xorg is slow</li>
<li>Gnome Firefox slow</li>
<li>X second session is slow</li>
<li>Etc.</li>
</ul>
<p>I found <a title="Ubuntu Bug: Very slow when more then one user is logged in" href="http://www.mail-archive.com/universe-bugs@lists.ubuntu.com/msg154538.html">several</a> <a title="Bug Report: Very slow when more then one user is logged in" href="https://bugs.launchpad.net/ubuntu/+source/meta-gnome2/+bug/474655">other</a> <a title="Bug report: [HD3470] second X session is slow" href="https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+bug/359092">reports</a> <a title="Bug report: MASTER: no DRI on the second user session" href="https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/297322">of</a> <a title="Bug report: radeonhd, second simultaneous x session is slow" href="http://bugs.freedesktop.org/show_bug.cgi?id=18290">this</a>, but no solutions.</p>
<p>Eventually, I stumbled upon <a title="Blog post: Slow Firefox – High Xorg CPU usage – Debian and Ubuntu – SOLVED" href="http://blog.kelsin.net/2009/02/24/slow-firefox-high-xorg-cpu-usage-debian-and-ubuntu-solved/">this blog post</a>, which purports to have solved the problem. I gave it a shot, and holy shit, it worked!</p>
<p>Just to be verbose, here&#8217;s what I did:</p>
<ol>
<li>Open /etc/X11/xorg.conf .</li>
<li>Add this line to the &#8220;Device&#8221; section:
<pre>Option "AccelMethod" "XAA"</pre>
<p>So my &#8220;Device&#8221; section now looks like this:</p>
<pre>Section "Device"
  Identifier  "Configured Video Device"
  Option      "AccelMethod" "XAA"
EndSection</pre>
</li>
<li>Save the file and log-out of Gnome.</li>
<li>Switch to tty1 by hitting CTRL+ALT+F1 .</li>
<li>Restart GDM:
<pre>$ sudo /etc/init.d/gdm restart</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/11/gnome-firefox-dead-slow/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Copying Between GNU Screen buffers</title>
		<link>http://cretaceouslabs.com/blog/2009/11/copying-gnu-screen-buffers/</link>
		<comments>http://cretaceouslabs.com/blog/2009/11/copying-gnu-screen-buffers/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 22:06:52 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[GNU Screen]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/?p=67</guid>
		<description><![CDATA[GNU Screen is one of those tools that makes you think &#8220;How the %&#38;@# did I live without this for so long?!&#8221; If you work on command lines regularly, GNU Screen is a must.
In my desktop environment, I run Konsole and Yakuake, with a different Screen session in each[1]. A few days ago, I noticed [...]]]></description>
			<content:encoded><![CDATA[<p>GNU Screen is one of those tools that makes you think &#8220;How the %&amp;@# did I live without this for so long?!&#8221; If you work on command lines regularly, GNU Screen is a must.</p>
<p>In my desktop environment, I run Konsole and <a href="http://en.wikipedia.org/wiki/Yakuake">Yakuake</a>, with a different Screen session in each<a href="#end-note-1">[1]</a>. A few days ago, I noticed that I was using the mouse to copy text between these Screen sessions. How inefficient is that?</p>
<p>It turns out that there&#8217;s a really easy way to copy text between different Screen sessions.</p>
<p>Note: I use CTRL-J as my escape command.</p>
<p>Copy some text to the first Screen&#8217;s buffer, and type <em>^J:writebuf</em> . Now switch to your other Screen session, and type <em>^J:readbuf</em> . Your second Screen session has just grabbed what you copied in your first Screen session. Paste it wherever you want, and Bob&#8217;s your uncle.</p>
<p><a name="end-note-1"></a><span class="end-note">[1] These Screen sessions are different on purpose. My Yakuake session is for &#8220;throw-away&#8221; tasks that don&#8217;t necessarily pertain to any tasks that I&#8217;m currently working on.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/11/copying-gnu-screen-buffers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Mint Is Weird</title>
		<link>http://cretaceouslabs.com/blog/2009/10/linux-mint-is-weird/</link>
		<comments>http://cretaceouslabs.com/blog/2009/10/linux-mint-is-weird/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 01:12:00 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/2009/10/linux-mint-is-weird/</guid>
		<description><![CDATA[I have a MacBook Pro. I bought it back in 2007 when I was living in Australia. It&#8217;s awesome. I love it, especially the keyboard. Unfortunately, Mac OS X has pissed me off way too many times. So I jumped ship to Linux Mint 7.
Out of the box, Mint 7 supports my Mac&#8217;s Atheros wifi [...]]]></description>
			<content:encoded><![CDATA[<p>I have a MacBook Pro. I bought it back in 2007 when I was living in Australia. It&#8217;s awesome. I love it, especially the keyboard. Unfortunately, Mac OS X has pissed me off way too many times. So I jumped ship to Linux Mint 7.</p>
<p>Out of the box, Mint 7 supports my Mac&#8217;s Atheros wifi card <strong>and</strong> ATI video card. That&#8217;s something that not even Ubuntu managed to do. Needless to say, I was impressed.</p>
<p>After installing and configuring most of Mint 7, things were looking pretty good. As some of you know, I customize KDE heavily. Shortcuts, panels, virtual desktops, colour schemes, etc. Once all of that&#8217;s configured as I like it, I don&#8217;t touch&#8217;em: they&#8217;re perfect (for me).</p>
<p>Mint 7 ships with KDE 4 though, which uses Plasma. Trying to get Plasma configured just right is like trying to fine-tune a space ship: it sounds like fun, but it just Ain&#8217;t Gonna Happen <sup>(tm)</sup>.</p>
<p>While trying to configure Plasma, I ran <i>sudo aptitude safe-upgrade</i>, and went to bed. I awoke to hell. Well, desktop hell. None of my panels were showing, the <a href="http://sidux.files.wordpress.com/2009/04/plasma_cashew2.png">Plasma &#8220;cashew&#8221;</a> was missing, and right-clicking on the desktop did nothing. <strong>Fark!</strong></p>
<p>To make a long story short, Steely in #LinuxMint.com on irc.spotchat.org saved me. He corrected my sources.list , and after running mintupdate, life was peachy!</p>
<p>Apparently, one is <strong>not</strong> supposed to use aptitude&#8217;s <i>safe-upgrade</i> tool, because it&#8217;ll install packages that Linux Mint doesn&#8217;t want you to.</p>
<p>How/why/what/?!?</p>
<pre>&lt;steely&gt; mint will fix packages or omit items until they get what they consider a stable base

&lt;steely&gt; mint uses updates levels 1 to 5 and mintupdate is set to use levels 1 to 3 by default, 4 and 5 has kernel and driver and other package updates

&lt;steely&gt; if you use mintupdate you will rarely have problems but if you use the terminal it ignores levels and can introduce packages that conflict with mint's patches / fixes</pre>
<p>
So there you have it. When running Linux Mint, <strong>use <i>mintUpdate</i>, not <i>aptitude</i>, to perform upgrades</strong>.</p>
<p>In case anyone else is plagued by this problem, the solution is to comment out this line in /etc/apt/sources.list :</p>
<pre>deb http://ppa.launchpad.net/kubuntu-ppa/ppa/ubuntu jaunty main</pre>
<p>and uncomment this line:</p>
<pre>deb http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse</pre>
<p>Next, use <i>mintUpdate</i> to upgrade the rest of your packages, reboot, and pray to whichever god(s) you believe in.</p>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/10/linux-mint-is-weird/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Idiosynchracy With Apache Rewrites</title>
		<link>http://cretaceouslabs.com/blog/2009/09/idiosynchracy-with-apache-rewrites/</link>
		<comments>http://cretaceouslabs.com/blog/2009/09/idiosynchracy-with-apache-rewrites/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 15:04:00 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/2009/09/idiosynchracy-with-apache-rewrites/</guid>
		<description><![CDATA[Did you know that it&#8217;s not possible to apply an Apache rewrite condition to multiple rewrite rules? I thought this would work, but requests from every IP address were being redirected:
RewriteCond %{REMOTE_ADDR} ^10\.0\.10\.10$
RewriteRule ^uploads/(.*)$ /wp-content/uploads/$1
RewriteRule (.*) http://deadorange.com/blog$1 [L,R=301]
It turns out that RewriteCond directives only apply to the following RewriteRule. So my rewrite directives above were [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that it&#8217;s not possible to apply an Apache rewrite condition to multiple rewrite rules? I thought this would work, but requests from every IP address were being redirected:</p>
<pre>RewriteCond %{REMOTE_ADDR} ^10\.0\.10\.10$
RewriteRule ^uploads/(.*)$ /wp-content/uploads/$1
RewriteRule (.*) http://deadorange.com/blog$1 [L,R=301]</pre>
<p>It turns out that RewriteCond directives only apply to the following RewriteRule. So my rewrite directives above were equivalent to &#8220;If the request came from 10.0.10.10, rewrite /uploads/.* to /wp-content/uploads/.* .Next, redirect everyone to http://deadorange.com/blog$1 .&#8221;<br />
<br />Unfortunately, the only solution is to repeat the condition:</p>
<pre>RewriteCond %{REMOTE_ADDR} ^10\.0\.10\.10$
RewriteRule ^uploads/(.*)$ /wp-content/uploads/$1
RewriteCond %{REMOTE_ADDR} ^10\.0\.10\.10$
RewriteRule (.*) http://deadorange.com/blog$1 [L,R=301]</pre>
<p>That isn&#8217;t very <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a>, but if it&#8217;s the only way, we have to live with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/09/idiosynchracy-with-apache-rewrites/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Importing large WordPress blogs</title>
		<link>http://cretaceouslabs.com/blog/2009/09/importing-large-wordpress-blogs/</link>
		<comments>http://cretaceouslabs.com/blog/2009/09/importing-large-wordpress-blogs/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 14:26:00 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/2009/09/importing-large-wordpress-blogs/</guid>
		<description><![CDATA[I just finished importing a WordPress blog with >1500 posts into a different WordPress blog. Importing the posts succeeded, but the last few steps at the end failed, like recalculating how many posts are in each category. This happened because the page always timed out; the import took more than 10 minutes.
If you find yourself [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished importing a WordPress blog with >1500 posts into a different WordPress blog. Importing the posts succeeded, but the last few steps at the end failed, like recalculating how many posts are in each category. This happened because the page always timed out; the import took more than 10 minutes.</p>
<p>If you find yourself with this problem, the fix is easy:
<ol>
<li>First, comment out the following line in wp-admin/import/wordpress.php . In WordPress 2.8.4, it&#8217;s line 367.
<pre>set_time_limit( 60 );</pre>
</li>
<p> 
<li>Configure your web server to allow PHP scripts to execute for a long time. In Apache, you do that with the &#8220;Timeout&#8221; directive:
<pre>Timeout 6000</pre>
<p>This can be put within a specific virtual host, or configured globally.</li>
<p> 
<li>Increase PHP&#8217;s max execution time. This is done with the &#8220;max_execution_time&#8221; setting in the appropriate php.ini :
<pre>max_execution_time = 600    ; Maximum execution time of each script, in seconds</pre>
<p>or within your web server&#8217;s configuration, if that&#8217;s allowed. For example, within Apache, you include this globally, or within a virtual host:
<pre>&lt;IfModule mod_php5.c&gt;  php_value max_execution_time 6000&lt;/IfModule&gt;</pre>
</li>
<p></ol>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/09/importing-large-wordpress-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby in Etch</title>
		<link>http://cretaceouslabs.com/blog/2009/02/ruby-in-etch/</link>
		<comments>http://cretaceouslabs.com/blog/2009/02/ruby-in-etch/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 03:24:00 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://cretaceouslabs.com/blog/2009/02/ruby-in-etch/</guid>
		<description><![CDATA[As some of you may know, Ruby and Debian&#8217;s ways of packaging software go together like Darwin and religious zealots&#8230;as in, they don&#8217;t. So how should you install Ruby when using Debian Stable? How do you stay up-to-date with new versions of Ruby and gems?
By using Backports, and not worrying so much.
First, setup your box [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you may know, Ruby and Debian&#8217;s ways of packaging software go together like Darwin and religious zealots&#8230;as in, <a href="http://pkg-ruby-extras.alioth.debian.org/rubygems.html">they don&#8217;t</a>. So how should you install Ruby when using Debian Stable? How do you stay up-to-date with new versions of Ruby and gems?</p>
<p>By using Backports, and not worrying so much.</p>
<p>First, setup your box to be able to install <a href="http://backports.org/dokuwiki/doku.php?id=instructions">backports of packages</a>. Next, uninstall any Ruby-related packages. Yeah, that&#8217;s right. Do you know why? Because, if you&#8217;re running Etch, you&#8217;re using Ruby 1.8.5! Egad! That&#8217;s almost medieval. Make sure to uninstall irb and rdoc, too.</p>
<p>Now it&#8217;s time to install shinier versions&#8230;1.8.7, to be exact:</p>
<pre>$ sudo aptitude install -t etch-backports libruby1.8 ruby1.8 rdoc1.8 irb1.8</pre>
<p>All of that should be on one line.</p>
<p>There you have it. Now you&#8217;ve got Ruby 1.8.7 on Debian Stable (AKA &#8220;Etch&#8221;). Ruby&#8217;s not complete without RubyGems, though. Download the <a href="http://rubyforge.org/frs/?group_id=126">latest version</a> to /usr/src/ , and extract it:</p>
<pre>$ cd /usr/src/$ wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz$ tar zxf rubygems-1.3.1.tgz</pre>
<p>Then run the setup utility:</p>
<pre>$ cd rubygems-1.3.1/$ sudo ruby setup.rb</pre>
<p>Let&#8217;s do one last thing to make life easier. The RubyGems setup script installed the &#8220;gem&#8221; command as /usr/bin/gem1.8 . I don&#8217;t want to have to type that &#8220;1.8&#8243; every time.</p>
<pre>$ cd /usr/local/bin/$ sudo ln -v -s /usr/bin/gem1.8 gem</pre>
<p>There. Now we can run &#8220;gem&#8221; like the rest of the world.</p>
<p>Easy? Yar.</p>
]]></content:encoded>
			<wfw:commentRss>http://cretaceouslabs.com/blog/2009/02/ruby-in-etch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

