<?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>SQUARISM &#187; Unix</title>
	<atom:link href="http://squarism.com/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://squarism.com</link>
	<description>until lambs become lions</description>
	<lastBuildDate>Mon, 07 May 2012 17:52:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Nmap won&#8217;t compile in homebrew solution</title>
		<link>http://squarism.com/2010/12/18/nmap-wont-compile-in-homebrew-solution/</link>
		<comments>http://squarism.com/2010/12/18/nmap-wont-compile-in-homebrew-solution/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 06:11:24 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=825</guid>
		<description><![CDATA[I recently moved my Mac Pro dev box to homebrew from macports. Doing the mysql move (the lazy way &#8212; moving the data directory) was easy enough but doing a massive `brew install` of a bunch of packages didn&#8217;t work when I got to nmap (the network port scanner). Specifically the linker error (maybe the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://squarism.com/wp-content/uploads/2010/12/nmap_homebrew-300x180.png" alt="" title="nmap_homebrew" width="300" height="180" class="alignright size-medium wp-image-827" />I recently moved my Mac Pro dev box to homebrew from macports.  Doing the mysql move (the lazy way &#8212; moving the data directory) was easy enough but doing a massive `brew install` of a bunch of packages didn&#8217;t work when I got to <a href="http://nmap.org/">nmap</a> (the network port scanner).</p>
<p>Specifically the linker error (maybe the linker &#8230; looks to a stacktrace to a Ruby and Java guy) was this:</p>
<pre>Undefined symbols:
  "ScriptResult::get_id() const", referenced from:
      formatScriptOutput(ScriptResult)       in output.o
      printhostscriptresults(Target*)     in output.o
      printportoutput(Target*, PortList*)    in output.o
  "ScriptResult::get_output() const", referenced from:
      formatScriptOutput(ScriptResult)       in output.o
      printhostscriptresults(Target*)     in output.o
      printportoutput(Target*, PortList*)    in output.o
  "open_nse()", referenced from:
      nmap_main(int, char**)in nmap.o
  "close_nse()", referenced from:
      nmap_free_mem()     in nmap.o
  "script_scan(std::vector<Target*, std::allocator<Target*> >&#038;)", referenced from:
      nmap_main(int, char**)in nmap.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [nmap] Error 1
make: *** [all] Error 2
Exit status: 2

http://github.com/mxcl/homebrew/blob/master/Library/Formula/nmap.rb#L1

Error: Failure while executing: make
Please report this bug at http://github.com/mxcl/homebrew/issues
These existing issues may help you:

http://github.com/mxcl/homebrew/issues/#issue/3128
</pre>
<p>I love the little URL for more help at the bottom, unfortunately a redirect killed the help.  The correct URL is <a href="https://github.com/mxcl/homebrew/issues/3128">here</a>.  Maybe an anchor tag in the wrong place on the URL, who knows.  Anyway, I posted a note on the issue site as well, I got around the issue by doing this first:<br />
<code>brew install lua</code></p>
<p>Then just install nmap like before:<br />
<code>brew install nmap</code></p>
<p>Worked for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/12/18/nmap-wont-compile-in-homebrew-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu One True Way</title>
		<link>http://squarism.com/2010/12/15/ubuntu-one-true-way/</link>
		<comments>http://squarism.com/2010/12/15/ubuntu-one-true-way/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 16:38:04 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=385</guid>
		<description><![CDATA[For a Linux development box, I typically install the same packages over and over again. For any new OS install, I call this the &#8220;One True Way&#8221; (OTW taken from a now defunct source online). Almost every box needs development libraries at some point. There&#8217;s a lot of extra stuff thrown in here too. These [...]]]></description>
			<content:encoded><![CDATA[<p>For a Linux development box, I typically install the same packages over and over again.  For any new OS install, I call this the &#8220;One True Way&#8221; (OTW taken from a now defunct source online).  Almost every box needs development libraries at some point.  There&#8217;s a lot of extra stuff thrown in here too.  These packages are circa ubuntu 10.04.  Keep this in mind.</p>
<p><code># aptitude install ruby ruby1.8-dev mysql-server mysql-client libmysql-ruby libmysqlclient-dev nmap htop nginx git-core postgresql nethack-console irssi tightvncserver xtightvncviewer distcc build-essential linux-kernel-headers linux-source couchdb solr-common solr-tomcat tomcat6 rar unrar p7zip k3b libk3b6-extracodecs gparted ubuntu-restricted-extras libdvdcss libxml2-dev libxslt-dev curl libcurl4-openssl-dev lua50 liblua50-dev libsqlite3-ruby libmagick9-dev</code></p>
<p>Download rubygems and install.</p>
<p>Add git hub to our gems list:<code># gem source -a http://gems.github.com</code>.</p>
<p>Install some gems I like. <code># gem install mysql RedCloth capistrano rmagick termios warbler sinatra feedzirra</code></p>
<p>Install Chrome.  Download .deb 64 package (google-chrome-beta_current_amd64.deb or newer) and double-click on the deb file.  Click install.</p>
<p>Grab <a href="http://www.proggyfonts.com/">proggy fonts</a>: clean, square, tiny, small.  Set terminal font to proggy font.  Set scrollback to 9000 lines, hidden scrollbar (shift+page up works instead), turn off menu, turn off terminal bell.</p>
<p>Install dropbox.</p>
<p>Go to town.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/12/15/ubuntu-one-true-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Downloading en mass</title>
		<link>http://squarism.com/2010/05/15/downloading-en-mass/</link>
		<comments>http://squarism.com/2010/05/15/downloading-en-mass/#comments</comments>
		<pubDate>Sun, 16 May 2010 03:08:27 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=474</guid>
		<description><![CDATA[Railscast has a podcast on iTunes which lets you download all past episodes and thus this post is moot. But, I thought, what if it wasn&#8217;t? What if I found a cool site with a bunch of media files I want to download? I knew wget can do this but it&#8217;s been a while. So [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://squarism.com/wp-content/uploads/2010/05/txt.png" alt="" title="txt" width="103" height="130" class="alignright size-full wp-image-479" /><br />
<a href="http://railscasts.com/">Railscast</a> has a podcast on iTunes which lets you download all past episodes and thus this post is moot.  But, I thought, what if it wasn&#8217;t?  What if I found a cool site with a bunch of media files I want to download?  I knew wget can do this but it&#8217;s been a while.  So here&#8217;s what I did.</p>
<h3>Get the links</h3>
<p>First I downloaded the <a href="http://railscasts.com/episodes/archive">archive page</a>.  It&#8217;s full of links to other pages which have the .mov media files on it.  But I really needed a list of those pages within the archive page.  Ok, I wget&#8217;d the archive html source page in a file named archive.txt:<br />
<code>curl -o archive.txt http://railscasts.com/episodes/archive</code></p>
<p>However this page is full of html source and all I need is the list of episodes.  So a simple:<br />
<code>grep href urls.txt|grep episodes > urls_href.txt</code> gets me that.  But it&#8217;s really full of text that looks like this: <code>&lt;a href="/episodes/195-my-favorite-web-apps-in-2009"&gt;My Favorite Web Apps in 2009&lt;/a&gt;</code></p>
<h3>Clean the links</h3>
<p> Ok now I just need to trim all this crap out.  First, there&#8217;s a bunch of whitespace out front in the links.  Let&#8217;s use sed inline.  This works on OSX and Linux but won&#8217;t work on Solaris (inline boo).<br />
<code>sed -ie 's/^[ ]*//' urls_href.txt</code>.  Now we&#8217;re missing a those spaces out front.</p>
<p>Ok, now we need to trim down to the relative link to the episode.  We want a URL that looks like:<br />
<code>http://railscasts.com/episodes/30-pretty-page-title</code></p>
<p>So at this point sed was failing me because the regex syntax is different than I&#8217;m used to.  So let&#8217;s switch to perl.<br />
<code>cat urls_href.txt | perl -e 'while(&lt;&gt;) { s/\&lt;a\s*(.*)\&gt;(.*)\&lt;\/a\&gt;/$1/; print}' &gt; urls_href_clean.txt</code></p>
<p>We&#8217;re almost there.  We have URLs that look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&quot;/episodes/17-habtm-checkboxes&quot;
&quot;/episodes/16-virtual-attributes&quot;
&quot;/15-fun-with-find-conditions&quot;</pre></div></div>

<p>We need a prefix of the domain and to get rid of those quotes:<br />
cat urls_href_clean.txt | perl -e &#8216;while(<>) { s/href\=/http\:\/\/railscasts.com/; s/\&#8221;//; s/\&#8221;//; print}&#8217; > urls_href_super_clean.txt</p>
<p>Despite our horribly unmaintainable &#8220;super&#8221; naming convention, we now have a text file full of URLs that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://railscasts.com/episodes/17-habtm-checkboxes
http://railscasts.com/episodes/16-virtual-attributes
http://railscasts.com/episodes/15-fun-with-find-conditions</pre></div></div>

<h3>Scrape</h3>
<p>Fire wget using our text file as input (-i).  Recurse (-r), go only two levels deep (-l), don&#8217;t download the file if we have one that&#8217;s newer and use timestamps to make this possible (-Nc), span hosts (-H), no directories (-nd), disrespect the robots.txt file (-erobots=off) and look for only .mov files (-A).<br />
<code>wget -r -erobots=off -l2 -H -Nc -nd -A.mov -i urls_href_super_clean.txt</code></p>
<p>You might want to create a working directory for this before you run it.  And probably run it under &#8220;screen&#8221; if you have that command.  After you do, you&#8217;ll eventually you&#8217;ll have a directory full of railscasts.  Or, you could just subscribe to <a href="http://itunes.apple.com/us/podcast/railscasts/id218282043">their feed on iTunes</a>.  Getting it through iTunes is a lot easier but that wasn&#8217;t <a href="http://en.wikipedia.org/wiki/Knowledge_by_acquaintance">the point</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/05/15/downloading-en-mass/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Goddamn Solaris</title>
		<link>http://squarism.com/2010/03/06/goddamn-solaris/</link>
		<comments>http://squarism.com/2010/03/06/goddamn-solaris/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 01:11:17 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=358</guid>
		<description><![CDATA[Solaris is a rock-solid serious OS with a dependable hardware platform. Sun has always been solid technically. Sun pours a lot of good tech into Solaris. ZFS is amazing. Dtrace is revolutionary. Zones are flexible and lightweight. They&#8217;re doing good engineering all around in a crazy number of areas. But we&#8217;re going to temporarily ignore [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://squarism.com/wp-content/uploads/2010/03/sun_expensive.png" alt="sun_expensive" title="sun_expensive" width="499" height="160" class="aligncenter size-full wp-image-375" /><br />
Solaris is a rock-solid serious OS with a dependable hardware platform.  Sun has always been solid technically.  Sun pours a lot of good tech into Solaris.  ZFS is amazing.  Dtrace is revolutionary.  Zones are flexible and lightweight.  They&#8217;re doing good engineering all around in a crazy number of areas.  But we&#8217;re going to temporarily ignore those things and talk about why Solaris is horrifying.  Hopefully Oracle can fix a number of these Goddamn Problems™.  If not, maybe OpenSolaris will/has.</p>
<p>I&#8217;m open to counter-points except for the argument &#8220;but you can change it&#8221;.  I know a lot of this is configurable (like adding packages or editing the default files) but that&#8217;s not the point.  Linux comes out of the box &#8220;right&#8221; or most specifically, easier/better.  It&#8217;s especially annoying because Sun boxes are so much more expensive and are <em>sooo</em> close to perfection.  And many times the box isn&#8217;t yours or the baseline isn&#8217;t yours so you can&#8217;t just add packages or reconfigure a global config file.</p>
<p>1. Default Bash Prompt.<br />
Seriously, <code>-bash-3.00#</code> in 2010?  Which box am I on?  I don&#8217;t know!  What directory am I in?  Every box, I edit /etc/profile to have <code>export PS1='[\u@\h \W]\$ '</code></p>
<p>2. No `locate&#8217;.<br />
Everyone does a find /.  Yay.  I love waiting 5 minutes to find one file.  In linux, I schedule updatedb at 2am and find files sub-second.</p>
<p>3. No `screen&#8217;.<br />
Greatest command in the world and it&#8217;s an optional install from sunfreeware.  So I have a crappy default term program and no way to start processes except with <code>nohup command &#038;</code>.  Boo.</p>
<p>4. Solaris tar is stupid.<br />
Can&#8217;t have filenames greater than 100 characters.  Ok, use gtar.  Great.  Gtar doesn&#8217;t do bzip or gzip on the fly.  Argh.  Why can&#8217;t Solaris just include and use exclusively GNU tar (as well as everything else GNU)?!</p>
<p>5. No network package installs<br />
Yum is great.  Aptitude is better.  Emerge is slow and dangerous (try moving between major Gentoo profiles).  But at least I can download packages from the net on the fly.  Ubuntu even tells me what to install when a command isn&#8217;t found!</p>
<p>6. You know what I meant Mr. Picky.<br />
If I type <code>ls file -l</code> I get <code>-l: No such file or directory</code> and then a non-long <code>file</code> return.  Because it thinks I meant &#8220;show me two files file and -l&#8221;.  When you type a command in Solaris and forget to put a switch on, you&#8217;re doomed to Ctrl-A, insert the switch and make it look like <code>ls -l file</code>.  In Linux, it knows what you meant.  Most core commands are more flexible in this way under Linux.  It&#8217;s goddamn maddening when you go back to Solaris.</p>
<p>7. UFS is pathetic.<br />
ZFS is pure bliss but it&#8217;s tricky to put on your root partition.  You can&#8217;t do it during the default install and you have to migrate everything.  Which is not only complicated but hard to do if you have UFS permissions all over the place (next point).  Also, UFS logging should be the default.  I don&#8217;t want to do fsck checks if my box crashes.  Really.  W(hy)TF isn&#8217;t logging the default?  Who doesn&#8217;t want journaling on?!  What&#8217;s the drawback?!  *head asplode*</p>
<p>8. ACL translations<br />
The problem with migrating is that fine-grained POSIX ACLs (UFS) aren&#8217;t compatible with ZFS ACLs.  You control POSIX ACLs on UFS with setfacl &#038; getfacl.  You control ACLs on ZFS with chmod.  The two commands are very different in syntax.  So you have to &#8220;port&#8221; them.  Which is especially maddening if you do a `man get_acl&#8217;.  There&#8217;s a goddamn C system call that can translate the ACLs built into the OS!  How do you think this works?<br />
<code>cp /zfs/my_file /ufs/</code></p>
<p>The OS doesn&#8217;t strip the extended ACLs off the file when it appears in /ufs/my_file!  The capability is in the OS but it&#8217;s not exposed as a command or another acl_translate call.  You&#8217;d have to write your own utility &#8230; hmm.  Maybe that&#8217;s a project.</p>
<p>9. Embrace GCC plz<br />
GCC can do a zillion things more than CC.  Get rid of CC, embrace GNU.  Keep format, keep whatever bios-replacement commands you want.  Keep the nice stuff from Solaris but please don&#8217;t try to compete with better GNU utilities that already are switch compatible with Solaris tools.  Some of these GNU binaries are literally drop-in replacements with Solaris compatible switches.  And even if not, make Solaris 11 a GNU platform milestone and let customers decide if they want to upgrade.</p>
<p>10. X11, CDE, openwin<br />
I love the new /SP/console and LOM stuff.  I love the console architecture.  I love all the things that PCs can&#8217;t do (unless you buy Vendor specific add-in cards).  I do not love CDE (yes Gnome is there) and OpenWindows.  /usr/openwin/bin/xclock should not be the path to xclock.  xclock should be in my default /usr/bin/ path and Xorg should be the only X11 anything anywhere.  I&#8217;m sick of not having Xnest and all the other awesome Linux standard tools.</p>
<p>11. netstat -pan doesn&#8217;t work.<br />
Solaris netstat won&#8217;t show me the process number of a network port.  This is heresy.  Just add the goddamn -p.  Do you know how useful it is to do something like <code>netstat -pan | grep `ps -ef|grep -v grep |grep java | awk '{print $2}'` | grep LISTEN</code> is?  Works on Linux.  Bam!  All the java listening ports.  Done.  Great for security, debugging and scripting.</p>
<p>12. Solaris ps -ef is stupid.<br />
Linux ps auxww is God.  GNU ps rules.  Holy ass this is annoying on Solaris.</p>
<p>13. No top.<br />
All you get is prstat.  Linux (some distros) has this awesome improvement on top called htop.  Htop lets you nice, kill and highlight processes.  It&#8217;s really great but I&#8217;d be happy with top on default Solaris installs.  Even my Mac has top on it.  I&#8217;d love to know why adding a binary in /usr/bin is so hard.  Does it break some other command called top?  Do things detect top in the $PATH and set Linux mode to true?</p>
<p>*breathe*</p>
<p>Rants are great.  By the end of the list, I realize I&#8217;m nitpicking.  But day in and day out, I&#8217;m praying to the Sun gods that they develops the absolute crap out of Solaris and get an amazing milestone together for Solaris 11 or Solaris 12 or whatever.  Something that will appeal to ever-increasing Ubuntu and casual hacker community instead of reminiscing about legacy compatibility until x86 mediocrity makes the obscure Solaris way of doing things completely irrelevant.</p>
<p>I remember when Solaris didn&#8217;t even have ssh by default.  I guess this &#8220;behind&#8221; strategy continues.  Maybe OpenSolaris can become the default on Sparc and people can stay behind until they feel like stepping into a different baseline.  But even outside of packages and baselines, nice things left off (like UFS logging) by default is just maddening.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/03/06/goddamn-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Aptitude Error</title>
		<link>http://squarism.com/2010/02/08/subversion-aptitude-error/</link>
		<comments>http://squarism.com/2010/02/08/subversion-aptitude-error/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 22:24:46 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=321</guid>
		<description><![CDATA[I used to have an SVN repository up and running. Then my server crashed. Nothing was really important so I never rebuilt it. However my server backup files referenced the SVN modules in apache. I suppose during the crazy rebuild time, I restored an old conf file that referenced dav_svn and I disabled the module [...]]]></description>
			<content:encoded><![CDATA[<p>I used to have an SVN repository up and running.  Then my server crashed.  Nothing was really important so I never rebuilt it.  However my server backup files referenced the SVN modules in apache.  I suppose during the crazy rebuild time, I restored an old conf file that referenced dav_svn and I disabled the module by deleting the file.</p>
<p>So now I want to get SVN back because Git (while great) lacks a nice GUI.  I&#8217;m not converting to SVN.  I&#8217;m just going to put stuff in both places for a while and then merge them after playing with Versions.</p>
<p>Anyway, why you are here.  You&#8217;re getting a <code>ERROR: Module dav_svn does not exist!</code> when trying to install subversion with <code>aptitude install libapache2-svn</code>?  That&#8217;s what I was getting.  I strace&#8217;d and googled it for a bit and nothing was working.  Eventually I found the original files and put them in their place and that seemed to resolve the package installation however aptitude still thinks the conf files are there even after removing.  So this method will get you past the aptitude install and let you install/uninstall as you like (I tested install/uninstall about fives times).  And then it will remove your existing svn configs.  <strong>So please don&#8217;t have anything regarding mod_svn that you want to keep.</strong></p>
<p>I found the originals from <a href="http://sysinf0.klabs.be/etc/apache2/mods-available/dav_svn.load?dist=;arch=">sysinf0.klabs.be</a>.</p>
<p>Create or edit /etc/apache2/mods-available/dav_svn.conf<br />
<code># dav_svn.conf - Example Subversion/Apache configuration<br />
#<br />
# For details and further options see the Apache user manual and<br />
# the Subversion book.<br />
#<br />
# NOTE: for a setup with multiple vhosts, you will want to do this<br />
# configuration in /etc/apache2/sites-available/*, not here.</p>
<p># <Location URL> ... </Location><br />
# URL controls how the repository appears to the outside world.<br />
# In this example clients access the repository as http://hostname/svn/<br />
# Note, a literal /svn should NOT exist in your document root.<br />
#<Location /svn></p>
<p>  # Uncomment this to enable the repository<br />
  #DAV svn</p>
<p>  # Set this to the path to your repository<br />
  #SVNPath /var/lib/svn<br />
  # Alternatively, use SVNParentPath if you have multiple repositories under<br />
  # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).<br />
  # You need either SVNPath and SVNParentPath, but not both.<br />
  #SVNParentPath /var/lib/svn</p>
<p>  # Access control is done at 3 levels: (1) Apache authentication, via<br />
  # any of several methods.  A "Basic Auth" section is commented out<br />
  # below.  (2) Apache <Limit> and <LimitExcept>, also commented out<br />
  # below.  (3) mod_authz_svn is a svn-specific authorization module<br />
  # which offers fine-grained read/write access control for paths<br />
  # within a repository.  (The first two layers are coarse-grained; you<br />
  # can only enable/disable access to an entire repository.)  Note that<br />
  # mod_authz_svn is noticeably slower than the other two layers, so if<br />
  # you don't need the fine-grained control, don't configure it.</p>
<p>  # Basic Authentication is repository-wide.  It is not secure unless<br />
  # you are using https.  See the 'htpasswd' command to create and<br />
  # manage the password file - and the documentation for the<br />
  # 'auth_basic' and 'authn_file' modules, which you will need for this<br />
  # (enable them with 'a2enmod').<br />
  #AuthType Basic<br />
  #AuthName "Subversion Repository"<br />
  #AuthUserFile /etc/apache2/dav_svn.passwd</p>
<p>  # To enable authorization via mod_authz_svn<br />
  #AuthzSVNAccessFile /etc/apache2/dav_svn.authz</p>
<p>  # The following three lines allow anonymous read, but make<br />
  # committers authenticate themselves.  It requires the 'authz_user'<br />
  # module (enable it with 'a2enmod').<br />
  #<LimitExcept GET PROPFIND OPTIONS REPORT><br />
    #Require valid-user<br />
  #</LimitExcept> </p>
<p>#</Location><br />
</code></p>
<p>Create or edit /etc/apache2/mods-available/dav_svn.load<br />
<code><br />
# Depends: dav<br />
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so<br />
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so<br />
</code></p>
<p>After putting those in:<br />
<code>sudo aptitude uninstall libapache2-svn<br />
sudo aptitude install libapache2-svn<br />
/etc/init.d/apache2 restart</code></p>
<p>Now when you do:<br />
<code>sudo aptitude search libapache2-svn<br />
c   libapache2-svn                   - Subversion server modules for Apache<br />
</code><br />
You&#8217;ll see that annoying little &#8216;c&#8217; from aptitude.  That means that it&#8217;s not installed but the config files are still hanging around.  Purge the config files with:<br />
<code>sudo aptitude purge libapache2-svn</code></p>
<p>And you&#8217;ll see:<br />
<code>aptitude search libapache2-svn<br />
p   libapache2-svn                   - Subversion server modules for Apache<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2010/02/08/subversion-aptitude-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Awk process shows up every night</title>
		<link>http://squarism.com/2008/10/08/awk-process-shows-up-every-night/</link>
		<comments>http://squarism.com/2008/10/08/awk-process-shows-up-every-night/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 15:46:19 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/2008/10/08/awk-process-shows-up-every-night/</guid>
		<description><![CDATA[We had a weird problem at work towards the end of a java development / identity management project turn up. The symptom was every night, an awk process would show up with some weird program arguments in the process table. It was similar to this: ps auxww&#124;grep awk 0 13076 12539 16 0 2456 264 [...]]]></description>
			<content:encoded><![CDATA[<p>We had a weird problem at work towards the end of a java development / identity management project turn up.  The symptom was every night, an awk process would show up with some weird program arguments in the process table.</p>
<p>It was similar to this:<br />
<code>ps auxww|grep awk<br />
 0 13076 12539 16 0 2456 264 pipe_w S ? 0:00 awk -v progname=/etc/cron.daily/logrotate progname {????? print progname ":\n"????? progname="";???? }???? { print; }<br />
</code></p>
<p>Of course, it wouldn&#8217;t happen when logrotate would be forced to run, it would simply happen at night only.  So we had to wait a day, try something and wait again.  So after many tests and troubleshooting we figured out that it was related to file permissions.  This was a surprise.  Why would file permissions cause something to hang forever like this?  Permissions usually cause black/white problems like &#8220;cannot open file&#8221; or &#8220;horrific death exception&#8221;.</p>
<p>I figured out why this happens and satisfied my inquisitiveness so that I could return to sanity.  It has to do with <a href="http://examples.oreilly.com/upt3/split/run-parts">run-parts</a>.  It has logic in it that detects executable files and runs awk.  You can see the &#8220;awk -v progname&#8221; string inside the if() statement eight lines from the bottom.</p>
<pre>
#!/bin/bash

# run-parts - concept taken from Debian

# keep going when something fails
set +e

if [ $# -lt 1 ]; then
        echo "Usage: run-parts <dir>"
        exit 1
fi

if [ ! -d $1 ]; then
        echo "Not a directory: $1"
        exit 1
fi

# Ignore *~ and *, scripts
for i in $1/*[^~,] ; do
        [ -d $i ] &#038;&#038; continue
        # Don't run *.{rpmsave,rpmorig,rpmnew,swp} scripts
        [ "${i%.rpmsave}" != "${i}" ] &#038;&#038; continue
        [ "${i%.rpmorig}" != "${i}" ] &#038;&#038; continue
        [ "${i%.rpmnew}" != "${i}" ] &#038;&#038; continue
        [ "${i%.swp}" != "${i}" ] &#038;&#038; continue
        [ "${i%,v}" != "${i}" ] &#038;&#038; continue

        if [ -x $i ]; then
                $i 2>&#038;1 | awk -v "progname=$i" \
                              'progname {
                                   print progname ":\n"
                                   progname="";
                               }
                               { print; }'
        fi
done

exit 0
</pre>
<p>&#8230;Mystery solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2008/10/08/awk-process-shows-up-every-night/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade fest.</title>
		<link>http://squarism.com/2007/04/10/upgrade-fest/</link>
		<comments>http://squarism.com/2007/04/10/upgrade-fest/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 22:48:18 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/2007/04/10/upgrade-fest/</guid>
		<description><![CDATA[Following an upgrade guide on gentoo&#8217;s lovely doc site. GCC was majorly out of date (3.3 to 4.1.1) and hopefully you can still read this after all is said and done. Right now, apache is in a weird state and I need to emerge a ton of crap: # /etc/init.d/apache2 restart * Apache2 has detected [...]]]></description>
			<content:encoded><![CDATA[<p>Following an <a href="http://www.gentoo.org/doc/en/gcc-upgrading.xml">upgrade guide</a> on gentoo&#8217;s lovely doc site.  GCC was majorly out of date (3.3 to 4.1.1) and hopefully you can still read this after all is said and done.</p>
<p>Right now, apache is in a weird state and I need to emerge a ton of crap:</p>
<blockquote><p>
# /etc/init.d/apache2 restart<br />
 * Apache2 has detected a syntax error in your configuration files:<br />
Syntax error on line 6 of /etc/apache2/modules.d/70_mod_php.conf:<br />
Cannot load /usr/lib/apache2-extramodules/libphp4.so into server: libXrender.so.1: cannot open shared object file: No such file or directory
</p></blockquote>
<p>Need X11 and a million other things put back on.  Cobwebs from leaving it alone for so long.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2007/04/10/upgrade-fest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lstat test</title>
		<link>http://squarism.com/2007/04/10/lstat-test/</link>
		<comments>http://squarism.com/2007/04/10/lstat-test/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 22:38:13 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/2007/04/10/lstat-test/</guid>
		<description><![CDATA[Following an interview question that was extremely hard I went to `man lstat&#8217; and tried to code up a test just based on system documentation. It was not entirely successful, however after a tip-off from an online resource I came up with this. File: lstat.c #include #include #include #include int main(int c, char** argv) { [...]]]></description>
			<content:encoded><![CDATA[<p>Following an interview question that was extremely hard I went to `man lstat&#8217; and tried to code up a test just based on system documentation.  It was not entirely successful, however after a tip-off from an online resource I came up with this.</p>
<p><span id="more-76"></span><br />
<em>File: lstat.c</em></p>
<pre>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>

int main(int c, char** argv) {
        struct stat buf;
        lstat(argv[1],&#038;buf);
        printf("%s is %d bytes\n", argv[1],buf.st_size);

        return 0;
}
</pre>
<p>When compile like this:<br />
<code>g++ -o lstat lstat.c</code></p>
<p>It looks like this where yep.txt is a dummy file.<br />
<code>user@box ~/c $ ls -l /tmp/yep.txt<br />
ls -l /tmp/yep.txt<br />
-rw-r--r-- 1 user users 17 Apr  9 23:16 /tmp/yep.txt</p>
<p>user@box ~/c $ ./lstat /tmp/yep.txt<br />
/tmp/yep.txt is 17 bytes</code></p>
<p>So all this does is really use stat since yep.txt is a file and not a symbolic link.  This stupid test just prints out the file size which you can see by the real `ls&#8217; above.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2007/04/10/lstat-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo 2006.0 installer screenshots</title>
		<link>http://squarism.com/2006/03/03/gentoo-20060/</link>
		<comments>http://squarism.com/2006/03/03/gentoo-20060/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 21:27:03 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/?p=6</guid>
		<description><![CDATA[Gentoo 2006.0 was released today. Of note, is a new GUI installer on the live cd. Here are some screenshots of the installer. (click read on)]]></description>
			<content:encoded><![CDATA[<p><strong>Here we go!</strong></p>
<p><span id="more-6"></span><br />
Booting<br />
<a href="http://squarism.com/2006/03/03/gentoo-20060/2006-0-gentoo-1/"><img src="http://squarism.com/wp-content/uploads/2006/03/2006.0_gentoo_1-300x224.jpg" alt="2006.0 gentoo 1" title="2006.0 gentoo 1" width="300" height="224" class="alignnone size-medium wp-image-1274" /></a> </p>
<p>Initial screen<br />
<a href="http://squarism.com/2006/03/03/gentoo-20060/2006-0-gentoo-2/"><img src="http://squarism.com/wp-content/uploads/2006/03/2006.0_gentoo_2-300x224.jpg" alt="2006.0 gentoo 2" title="2006.0 gentoo 2" width="300" height="224" class="alignnone size-medium wp-image-1275" /></a> </p>
<p>Launching the installer wizard<br />
<a href="http://squarism.com/2006/03/03/gentoo-20060/2006-0-gentoo-3/"><img src="http://squarism.com/wp-content/uploads/2006/03/2006.0_gentoo_3-300x224.jpg" alt="2006.0 gentoo 3" title="2006.0 gentoo 3" width="300" height="224" class="alignnone size-medium wp-image-1276" /></a> </p>
<p>Partition screen<br />
<a href="http://squarism.com/2006/03/03/gentoo-20060/2006-0-gentoo-4/"><img src="http://squarism.com/wp-content/uploads/2006/03/2006.0_gentoo_4-300x224.jpg" alt="2006.0 gentoo 4" title="2006.0 gentoo 4" width="300" height="224" class="alignnone size-medium wp-image-1277" /></a> </p>
<p>Stage selection screen<br />
<a href="http://squarism.com/2006/03/03/gentoo-20060/2006-0-gentoo-5/"><img src="http://squarism.com/wp-content/uploads/2006/03/2006.0_gentoo_5-300x224.jpg" alt="2006.0 gentoo 5" title="2006.0 gentoo 5" width="300" height="224" class="alignnone size-medium wp-image-1278" /></a> </p>
<p>Install log/progress screen<br />
<a href="http://squarism.com/2006/03/03/gentoo-20060/2006-0-gentoo-6/"><img src="http://squarism.com/wp-content/uploads/2006/03/2006.0_gentoo_6-300x224.jpg" alt="2006.0 gentoo 6" title="2006.0 gentoo 6" width="300" height="224" class="alignnone size-medium wp-image-1279" /></a> </p>
<p>The GUI is a mixed blessing. It certainly is more intuitive, but you still<br />
rely on the docs for figuring out what they mean by snapshot, for example, to<br />
use the CD~Rs portage snapshot:</p>
<p>Obtaining a Portage tree You must choose Snapshot on this screen. The<br />
installer will automatically install a Portage tree from the LiveCD once<br />
you select Snapshot; you do not need to specify a snapshot URI.</p>
<p>It~Rs not an easy task to create UIs, I don~Rt mean to be too critical.<br />
This is a good direction for Gentoo and the UI adds a lot to the distro.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2006/03/03/gentoo-20060/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A courier4 upgrade snag.</title>
		<link>http://squarism.com/2005/11/15/a-courier4-upgrade-snag/</link>
		<comments>http://squarism.com/2005/11/15/a-courier4-upgrade-snag/#comments</comments>
		<pubDate>Wed, 16 Nov 2005 00:47:54 +0000</pubDate>
		<dc:creator>Dillon</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://squarism.com/2005/11/15/a-courier4-upgrade-snag/</guid>
		<description><![CDATA[I ran into a weird error with Thunderbird. When I would reply to all in an email, some people were CC&#8217;d. When I hit send, I got a relay error. I restarted courier-imap and did all sorts of stuff and eventually decided to update all my mail software on my gentoo server. It was a [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a weird error with Thunderbird. When I would reply to all in an email, some people were CC&#8217;d.  When I hit send, I got a relay error.  I restarted courier-imap and did all sorts of stuff and eventually decided to update all my mail software on my gentoo server.</p>
<p>It was a long shot but it actually fixed the CC: problem.  Whether or not it directly fixed the CC: problem, I cannot prove.</p>
<p>I did a<br />
<code><br />
# emerge courier-imap postfix<br />
</code><br />
without enabling ~x86 unstable packages or bleeding edge stuff.  It happily emerged and didn&#8217;t work.  I couldn&#8217;t log into IMAP but postfix ran fine.</p>
<p>I was running courier3 and emerge picked up courier4.0.1.  Postfix went from 2.0.4 to 2.2.5.  Postfix did some upgrade bits on databases and config files (I think).  But courier-imap was dead in the water. </p>
<p>I had (and still have) a problem getting courier to log a bit more, like more debug messages.  </p>
<p><code><br />
imapd: authentication error: Input/output error<br />
</code></p>
<p>That wasn&#8217;t quite enough.  But luckily this message was enough to run into a forum post:</p>
<p><code><br />
authdaemond: /usr/lib/courier-authlib/libauthpam.so.0: undefined symbol: nscd_flush_cache<br />
</code></p>
<p>This is a shared library problem.  Someone linked against a file I don&#8217;t have, so it bombs at runtime.  I found this bit via Google cache (the original hint has been removed..weird).</p>
<blockquote><p>
Now test the POP3 using any MUA. If you get an error message (with DEBUG_LOGIN=2)</p>
<p>libauthpam.so.0: undefined symbol: nscd_flush_cache</p>
<p>you are using broken version of courier-libpam. Try this:</p>
<p># echo &#8220;&gt;=net-libs/courier-authlib-0.57&#8243; &gt;&gt; /etc/portage/package.mask<br />
# emerge courier-authlib</p>
<p>I have had problems with 0.57 versions, version 0.55 works fine.
</p></blockquote>
<p>I did exactly that.  Masked 0.57 and re-emerged.  I restarted a few services:<br />
<code><br />
# /etc/init.d/courier-authlib restart<br />
# /etc/init.d/courier-imapd restart<br />
</code></p>
<p>And was able to get to my IMAP mail again.</p>
]]></content:encoded>
			<wfw:commentRss>http://squarism.com/2005/11/15/a-courier4-upgrade-snag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

