<?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>Autopragmatic</title>
	<atom:link href="http://autopragmatic.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://autopragmatic.com</link>
	<description>Why can't stuff just work?</description>
	<lastBuildDate>Mon, 19 Jan 2009 05:31:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Redirect linux console beep to the sound card</title>
		<link>http://autopragmatic.com/2009/01/19/redirect-linux-console-beep-to-the-sound-card/</link>
		<comments>http://autopragmatic.com/2009/01/19/redirect-linux-console-beep-to-the-sound-card/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 05:30:59 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://autopragmatic.com/?p=21</guid>
		<description><![CDATA[I&#8217;ve been frustrated for a long time that my Ubuntu Hardy Heron desktop machine would send a console or terminal beep (e.g. ctrl-G) to the PC speaker for a harsh 1980&#8217;s-style tone from under my desk.  I usually turn off the audible beep and live with a visual beep (screen or window flash), but I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been frustrated for a long time that my <a title="Ubuntu" href="http://ubuntu.com/" target="_blank">Ubuntu</a> Hardy Heron desktop machine would send a console or terminal beep (e.g. ctrl-G) to the PC speaker for a harsh 1980&#8217;s-style tone from under my desk.  I usually turn off the audible beep and live with a visual beep (screen or window flash), but I&#8217;ve started using <a title="irssi" href="http://www.irssi.org/" target="_blank">irssi</a> through <a title="A Guide to Efficiently Using Irssi and Screen" href="http://quadpoint.org/articles/irssi" target="_blank">screen</a>, and I wanted a way to let it notify me of messages even when buried under other windows.</p>
<p>I tried <a title="softbeep" href="http://0pointer.de/lennart/projects/softbeep/" target="_self">softbeep</a>, but that didn&#8217;t work for me.  However, I just found the <a title="Fancy Beeper Daemon" href="http://www.carcosa.net/jason/software/beep/">Fancy Beeper Daemon</a>, which did.  Here&#8217;s what I did to set it up.</p>
<p>First, I downloaded and unpacked the <a href="http://www.carcosa.net/jason/software/beep/beep-2.6.24+.tar.gz">beep-2.6.24+.tar.gz</a> tarball.  Then I ran &#8220;sudo install.sh&#8221; (I already had the linux kernel headers and compiler tools installed.)</p>
<p>For whatever reason,the new /dev/beep device wasn&#8217;t globally readable, so &#8220;sudo chmod a+r /dev/beep fixed that.  (A more sophisticated approach would have that chown to the console user on login, but this is a single-user machine, so I didn&#8217;t bother.)</p>
<p>Once that was done, I needed a daemon to poll that device and play a sound using aplay.  The Fancy Beeper Daemon tarball includes several examples, but I chose to create my own instead: <a href="http://autopragmatic.com/wp-content/uploads/2009/01/beepd_aplay.pl">beepd_aplay</a> (to use this, change the user, group and pid file location to suit your own setup).</p>
<p>Then I added that to my .bashrc to run automatically when I log in.   Now, I get a nice sound through my sound card and speakers instead of that harsh system beep.</p>
]]></content:encoded>
			<wfw:commentRss>http://autopragmatic.com/2009/01/19/redirect-linux-console-beep-to-the-sound-card/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Avoiding the &#8220;encountered a problem and needs to close&#8221; dialog on Windows</title>
		<link>http://autopragmatic.com/2008/03/25/avoiding-the-encountered-a-problem-and-needs-to-close-dialog-on-windows/</link>
		<comments>http://autopragmatic.com/2008/03/25/avoiding-the-encountered-a-problem-and-needs-to-close-dialog-on-windows/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 03:08:07 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://autopragmatic.com/2008/03/25/avoiding-the-encountered-a-problem-and-needs-to-close-dialog-on-windows/</guid>
		<description><![CDATA[ When running some Perl batch programs on Microsoft Windows XP, I got frustrated that some sub-programs would crash and pop up a dialog box with a message &#8220;perl.exe has encountered a problem and needs to close&#8221;.
Since the dialog is modal, everything stops until I press a button, which is incredibly annoying!  If it [...]]]></description>
			<content:encoded><![CDATA[<p> When running some Perl batch programs on Microsoft Windows XP, I got frustrated that some sub-programs would crash and pop up a dialog box with a message &#8220;perl.exe has encountered a problem and needs to close&#8221;.</p>
<p>Since the dialog is modal, everything stops until I press a button, which is incredibly annoying!  If it needs to close, then just close and get on with it!</p>
<p>After some digging around on the web, I found a way to suppress those dialogs:</p>
<p><a href="http://support.microsoft.com/kb/124873" title="Disabling System Hard Error Message Dialog Boxes" target="_blank">KB#124873: Disabling System Hard Error Message Dialog Boxes</a></p>
<p>In short, set the<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\ErrorMode<br />
registry key to the value &#8220;2&#8243;.</p>
]]></content:encoded>
			<wfw:commentRss>http://autopragmatic.com/2008/03/25/avoiding-the-encountered-a-problem-and-needs-to-close-dialog-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hosting a git repository on dreamhost</title>
		<link>http://autopragmatic.com/2008/01/26/hosting-a-git-repository-on-dreamhost/</link>
		<comments>http://autopragmatic.com/2008/01/26/hosting-a-git-repository-on-dreamhost/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 22:50:23 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://autopragmatic.com/2008/01/26/hosting-a-git-repository-on-dreamhost/</guid>
		<description><![CDATA[[This entry updated April 14, 2008 based on comments and this blog.  Updated again August 26, 2008.]
I use dreamhost.com as my hosting provider and wanted to use it to host git repositories as well.  git supports publishing via HTTP so that part is pretty easy, but I also wanted to make it easy [...]]]></description>
			<content:encoded><![CDATA[<p><em>[This entry updated April 14, 2008 based on comments and <a href="http://www.craigjolicoeur.com/2008/04/14/hosting-git-repositories-on-dreamhost/" target="_blank">this blog</a>.  Updated again August 26, 2008.]</em></p>
<p>I use <a href="http://dreamhost.com/">dreamhost.com</a> as my hosting provider and wanted to use it to host <a href="http://git.or.cz/">git</a> repositories as well.  git supports publishing via HTTP so that part is pretty easy, but I also wanted to make it easy to push my local work to the repository on dreamhost.</p>
<p>Unfortunately, git documentation was a little impenetrable the first few times I read it and dreamhost doesn&#8217;t offer git automatically, so here is a summary of what I did in case it helps<br />
someone else figure it out.</p>
<p><span id="more-9"></span></p>
<p>Throughout, I use &#8220;USER&#8221; and &#8220;MACHINE&#8221; instead of my username and shell machine at dreamhost and &#8220;example.com&#8221; instead of my actual web address.  Be sure to replace these with your own information, as appropriate. </p>
<p><strong>Step 1. Compile git on dreamhost</strong></p>
<p>Following various instructions on the web, I downloaded and compiled git in my dreamhost shell account.  The NO_CURL option is used because that library isn&#8217;t available and I only need git on dreamhost to receive pushes, not to pull from other repositories.  The NO_MMAP option is used to keep dreamhost from killing git for appearing to take too much memory.</p>
<p>This sample installs git in standard directories under the user&#8217;s home directory (e.g. /home/USER/bin).  That may or may not be what you want.   You will need $HOME/bin (or whatever you choose) in your PATH.  </p>
<pre>$ mkdir ~/src
$ cd ~/src
$ wget http://www.kernel.org/pub/software/scm/git/git-1.5.4.rc4.tar.gz
$ tar xzf git-1.5.4.rc4.tar.gz
$ cd git-1.5.4.rc4
$ ./configure --prefix=/home/USER/ NO_CURL=1 NO_MMAP=1
$ make
$ make install
$ git --version</pre>
<p><strong>Step 2. Creating a repository</strong></p>
<p>I created a &#8216;git&#8217; subdirectory under my web root to hold my repositories.</p>
<pre>$ mkdir ~/example.com/git</pre>
<p>Creating a new, empty project repository required these steps, which I later automated as a bash function.  (Stick it in your .bashrc)</p>
<pre>newgit()
{
if [ -z $1 ]; then
echo "usage: $FUNCNAME project-name.git"
else
gitdir="/home/USER/example.com/git/$1"
mkdir $gitdir
pushd $gitdir
git --bare init
git --bare update-server-info
chmod a+x hooks/post-update
touch git-daemon-export-ok
popd
fi
}</pre>
<p>Then creating a new repository is as easy logging into dreamhost and running <code>newgit repo-name.git</code>.  Or, I can even do it remotely via ssh:</p>
<pre>$ ssh USER@MACHINE.dreamhost.com newgit repo-name.git</pre>
<p><strong>Step 3a. Initializing a repository (from scratch)<br />
</strong></p>
<p><em><a href="http://www.craigjolicoeur.com/2008/04/14/hosting-git-repositories-on-dreamhost/" target="_blank"></a></em></p>
<p>Before the repository can be used, it needs to be initialized with some data. Assuming that this is a new project, I have to create a local repository and publish it to the dreamhost repository.</p>
<p>From my development machine, I can create an empty git repository:</p>
<pre>$ mkdir repo-name.git
$ cd repo-name.git
$ git init</pre>
<p>Next I need to create some files to upload &#8212; in this case just an empty &#8216;.gitignore&#8217; file:</p>
<pre>$ touch .gitignore
$ git add .gitignore
$ git commit -m "just gitignore"</pre>
<p>Since this repository was created locally instead of with &#8216;git clone&#8217;, I have to manually setup the dreamhost repository as the &#8216;origin&#8217; source.  I use ssh so I will be able to write to it:</p>
<pre>$ git remote add origin \
ssh://USER@MACHINE.dreamhost.com/home/USER/example.com/git/repo-name.git
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master</pre>
<p>Finally, I can push all the local repo contents to the dreamhost repository and then pull it back to make sure everything starts in sync:</p>
<pre>$ git push --all
$ git pull</pre>
<p><strong>Step 3b. Initializing a repository (from an existing repository)<br />
</strong></p>
<p>If I want to initialize the repository from an existing repository somewhere else, I can clone the existing repository to my development machine and then push it to dreamhost.   In this case, I use the &#8216;-o&#8217; flag to set the name of the clone to &#8217;source&#8217;:</p>
<pre>$ git clone -o source http://existing.source.example.com/git/repo-name.git
$ cd repo-name.git</pre>
<p>Then, just as in (3a) above, I set up dreamhost as my &#8216;origin&#8217; (the default for pull/push):</p>
<pre>$ git remote add origin \
ssh://USER@MACHINE.dreamhost.com/home/USER/example.com/git/repo-name.git
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master
$ git push --all
$ git pull</pre>
<p>Now I can update my repository from the original source, make changes, and then publish back to my dreamhost repository:</p>
<pre>$ git pull source master
hack...hack...hack... and commit
$ git push</pre>
<p><strong>Step 4. Pulling from and pushing to the repository<br />
</strong></p>
<p>Once the repository is initialized with data, people can clone the repository in a couple ways. One option is via http:</p>
<pre>$ git clone http://example.com/git/</pre>
<p>Or, if I want to clone the repository &#8212; perhaps on a different development machine, I can do that with ssh if I want to be able to push changes back:</p>
<pre>$ git clone \
ssh://USER@MACHINE.dreamhost.com/home/USER/example.com/git/repo-name.git</pre>
<p>Because I used &#8220;clone&#8221; with an already-initialized repository, the &#8216;origin&#8217; information is already set correctly and I don&#8217;t have to follow the steps laid out in (3a) or (3b).  I can just pull or push back directly to the &#8216;origin&#8217; location:</p>
<pre>$ git pull
$ git push</pre>
<p><strong>Step 4. Setup gitweb</strong></p>
<p>git comes with gitweb to provide a nicer web browser interface.  In my case, I put it right into the directory that holds my .git repositories. (I deleted an extra file I didn&#8217;t need and set permissions to be suexec friendly.)</p>
<pre>$ cd ~/example.com/git
$ cp ~/src/git-1.5.4.rc4/gitweb/git* .
$ rm gitweb.perl
$ chmod 755 gitweb.cgi</pre>
<p>I also created a runtime configuration file <code>gitweb_config.perl</code> like this:</p>
<pre># where's the git binary?
$GIT = "/home/USER/bin/git";
# where's our projects?
$projectroot = "/home/USER/example.com/git";
# what do we call our projects in the ui?
$home_link_str = "USER projects";
# where are the files we need for web display?
@stylesheets = ("gitweb.css");
$logo = "git-logo.png";
$favicon = "git-favicon.png";
# what do we call this site
$site_name = "USER git repositories";</pre>
<p>This kind of configuration can also be done at configure/make time, but having a file makes it easier to tweak and customize later.</p>
<p>I created a <code>.htaccess</code> file that enables CGI and redirects requests for the index to the CGI file:</p>
<pre>Options +ExecCGI
RewriteEngine On
RewriteRule ^$ gitweb.cgi
RewriteRule ^([?].*)$ gitweb.cgi$1</pre>
<p>Now browsing <code>example.com/git</code> gives a nice interface to any repository under that directory.</p>
<p><strong>Other resources:</strong></p>
<ul>
<li><a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#sharing-development" target="_blank">Git User Manual &#8211; Sharing development with others</a></li>
<li><a title="Dreamhost Wiki - Git" href="http://wiki.dreamhost.com/Git" target="_blank">Dreamhost Wiki &#8211; Git</a> (see Setup Three)</li>
<li><a title="how I set up gitweb" href="http://ianloic.com/2007/09/13/how_i_set_up_gitweb/" target="_blank">How_I_set_up_gitweb </a>(ianloic.com)</li>
<li><a href="http://madduck.net/blog/2007.07.11:publishing-git-repositories/" target="_blank">Publishing Git Repositories</a> (madduck)</li>
<li><a href="http://www.craigjolicoeur.com/2008/04/14/hosting-git-repositories-on-dreamhost/" target="_blank">Hosting Git Repositories on Dreamhost</a> (tail -f development.log)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://autopragmatic.com/2008/01/26/hosting-a-git-repository-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>ActiveState Perl and Microsoft Visual C++ Express 2005</title>
		<link>http://autopragmatic.com/2007/11/17/activestate-perl-and-microsoft-visual-c-express-2005/</link>
		<comments>http://autopragmatic.com/2007/11/17/activestate-perl-and-microsoft-visual-c-express-2005/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 19:39:34 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://autopragmatic.com/2007/11/17/activestate-perl-and-microsoft-visual-c-express-2005/</guid>
		<description><![CDATA[I recently tried to use Microsoft&#8217;s free Visual C++ Express 2005 with ActiveState Perl to compile XS modules from CPAN and found that it wouldn&#8217;t work.  The fix appears to be adding a file to the C:\perl\bin directory: perl.exe.manifest
This fix taken from Perl Monks: Problems with FREE MS VC++ tools.
]]></description>
			<content:encoded><![CDATA[<p>I recently tried to use Microsoft&#8217;s free <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fmsdn.microsoft.com%2Fvstudio%2Fexpress%2Fvisualc%2F&amp;ei=lj4_R9iTFpuMepyv4L0K&amp;usg=AFQjCNFKlYlKM8Q_AGRV1iSYaSVhetwOSQ&amp;sig2=YDd4dikXX2n5k-FiC6d1Dg" title="Visual C++ Express 2005" target="_blank">Visual C++ Express 2005</a> with <a href="http://activestate.com/Products/activeperl/" title="ActiveState Perl">ActiveState Perl</a> to compile XS modules from <a href="http://search.cpan.org/">CPAN</a> and found that it wouldn&#8217;t work.  The fix appears to be adding a file to the <tt>C:\perl\bin</tt> directory: <a href="http://autopragmatic.com/wp-content/uploads/2007/11/perlexe.manifest" title="perl.exe.manifest"><tt>perl.exe.manifest</tt></a></p>
<p>This fix taken from <a href="http://www.perlmonks.org/?node_id=510773">Perl Monks: Problems with FREE MS VC++ tools</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://autopragmatic.com/2007/11/17/activestate-perl-and-microsoft-visual-c-express-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gutsy Nvidia Twinview window placement</title>
		<link>http://autopragmatic.com/2007/11/11/gutsy-nvidia-twinview-window-placement/</link>
		<comments>http://autopragmatic.com/2007/11/11/gutsy-nvidia-twinview-window-placement/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 17:01:38 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://autopragmatic.com/2007/11/11/gutsy-nvidia-twinview-window-placement/</guid>
		<description><![CDATA[I recently upgraded to Ubuntu Gutsy Gibbon with the built-in Nvidia drivers and discovered that my dual monitor desktop reverted to the annoying behavior of placing windows and dialogs dead center in the expanded desktop, right at the split between the two monitors.  It would also maximize windows across both monitors rather than just [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded to Ubuntu Gutsy Gibbon with the built-in Nvidia drivers and discovered that my dual monitor desktop reverted to the annoying behavior of placing windows and dialogs dead center in the expanded desktop, right at the split between the two monitors.  It would also maximize windows across both monitors rather than just one.</p>
<p>After trying various configuration options in xorg.conf, I found that a simple change to the Compiz Advanced Desktop Effects Settings fixed this problem, at least for most windows.  (Some dialogs still split the screens.)</p>
<p>First, install the compizconfig-settings-manager package, which adds the Advanced Desktop Effects Settings application to the System-&gt;Preferences menu.</p>
<p>Next, launch that preference app and select the &#8220;Display Settings&#8221; tab.  Manually set the display output configuration in the &#8220;Outputs&#8221; section, then uncheck &#8220;Detect Outputs&#8221;. For example, for my side-by-side 1280&#215;1024 screens:</p>
<p><a href="http://autopragmatic.com/wp-content/uploads/2007/11/screenshot-compizconfig-settings-manager-general-display.png"><br />
<img src="http://autopragmatic.com/wp-content/uploads/2007/11/screenshot-compizconfig-settings-manager-general-display.png" alt="Display Settings" /></a></p>
<p>Logout and restart X (Ctrl-Alt-Backspace).  That should fix the problem.</p>
<p>Some of the Compiz effects may wind up restricted to a single monitor.  To fix this, many of them have options to span the effect across all monitors.  For example, the &#8220;Scale&#8221; effect has the following option:</p>
<p><a href="http://autopragmatic.com/wp-content/uploads/2007/11/screenshot-compizconfig-settings-manager-scale.png"><br />
<img src="http://autopragmatic.com/wp-content/uploads/2007/11/screenshot-compizconfig-settings-manager-scale.png" alt="Scale Settings" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://autopragmatic.com/2007/11/11/gutsy-nvidia-twinview-window-placement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>First post</title>
		<link>http://autopragmatic.com/2007/11/11/first-post/</link>
		<comments>http://autopragmatic.com/2007/11/11/first-post/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 16:05:16 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://autopragmatic.com/2007/11/11/first-post/</guid>
		<description><![CDATA[Sometimes, I spend a lot of time searching and experimenting for the solution to some annoying technology problem that seems like it should be simple and already written up somewhere online.
For a while now, I&#8217;ve been thinking that I  should post my own solutions (when I find them) so that the next person like [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, I spend a lot of time searching and experimenting for the solution to some annoying technology problem that seems like it should be simple and already written up somewhere online.</p>
<p>For a while now, I&#8217;ve been thinking that I  should post my own solutions (when I find them) so that the next person like me stands a better chance of finding a shortcut to the answer.  So that&#8217;s what this blog is for.</p>
]]></content:encoded>
			<wfw:commentRss>http://autopragmatic.com/2007/11/11/first-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
