<?xml version="1.0" encoding="utf-8"?>
        <?xml-stylesheet type="text/css" href="http://bbot.org/blog/styles/feed.css"?>
<rss version="2.0"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:admin="http://webns.net/mvcb/"
 xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title>Filed under: Linux | bbot's blog</title>
<atom:link href="http://bbot.org/blog/archives/linux/index-rss.xml" rel="self" type="application/rss+xml" />
<link>http://bbot.org/blog</link>
<description>news, diary, journal, whatever</description>
<dc:language>en-us</dc:language>
<dc:creator>bbot</dc:creator>
<dc:date>2010-01-20T01:14:01-05:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />

<item>
<link>http://bbot.org/blog/archives/2009/07/25/copper_ii_apache_virtual_host_configuration/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2009/07/25/copper_ii_apache_virtual_host_configuration/index.html</guid>
<title>copper II: apache virtual host configuration</title>
<dc:date>2009-07-25T23:30:16-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[    <p>
<code><a href="http://bbot.org/blog/archives/2009/07/25/talking_the_talk_vi/index.html">Blogathon 2009</a> wordcount: 907</code></p>

    <p>
So I purchased a dedicated server from <a href="http://www.serverpronto.com/compare.php">serverpronto</a> (the starter+) on advice of <a href="http://badcheese.com/">Steve</a>, because I was tired of using <a href="https://www.nearlyfreespeech.net/">NFSnet's</a> e-mail forwarding to a gmail account, since that toolchain relies on several people to do their job perfectly, one of which (Google) who doesn't even get paid for privilege. I'd much rather have the whole mess in my hands, so I can get mad at myself when it doesn't work.</p>

    <p>
But configuring postfix is hard, and apache is easy, so I decided to get apache working first.</p>

    <p>
The server itself I named copperII, in memory of the late, great, <a href="http://bbot.org/blog/archives/2008/05/02/dmca_fun_ii/index.html">copper</a>.</p>

    <p>
I have a total of five domains, <a href="http://bbot.org/">bbot.org</a>, <a href="http://7chon.org/">7chon.org</a>, <a href="http://unitinu.net/">unitinu.net</a>, <a href="http://www.kyonko.org/">kyonko.org</a> and <a href="http://bierwagen.us/">bierwagen.us</a>. The last four don't get any traffic that matters, so I moved them over first, saving bbot.org for last.</p>

    <p>
Moving was a simple matter of four ftp operations, and one scp. The Pointless Four consist of either a single index.html file each, (7chon, bierwagen) or an index and an image. (kyonko, unitinu)</p>

    <p>
bbot.org, of course, has quite a lot more stuff, and thus required a recursive scp. Amusingly, this had to be done from copperII, and not from my laptop, since a architectural bug requires a fairly insecure workaround to be able to ssh out from ssh.phx.nearlyfreespeech.net. Bizarrely, this presents with the error message "Host key verification failed", when the problem is that it can't open /dev/tty.</p>

    <p>
I copied each site to its own directory under /srv/www/vhosts/, then proceeded to make a virtual host configuration file for each site in /etc/apache2/vhosts.d/ by editing the provided template file with the information for 7chon.org, then using a simple sed pipe operation of the form "s/target/replacement/g". S means substitute, and the final flag means "globally", or else sed will just replace the first instance of <em>target</em> with <em>replacement</em>, which is hilariously confusing the first time you forget the final g.</p>

    <p>
<code>copperII:/etc/apache2/vhosts.d # sed s/7chon/unitinu/g 7chon.conf > unitinu.conf<br />
copperII:/etc/apache2/vhosts.d # sed s/org/us/g unitinu.conf</code></p>

    <p>
The format of the virtual host config file is fairly straightforward. For minimum functionality, all you have to do it set ServerName to the domain name, then DocumentRoot and the final Directory tag to the full directory path. Once you do that, run <em>httpd2 -t</em> to check the configuration files (it should return "Syntax OK") and whatever distro-specific services manager operation to restart apache. In suse, it's <em>/etc/rc.d/apache2 restart</em>, though you should call it with <em>status</em> first to make sure it's running.</p>

    <p>
After that all you need to do is change the A records for each domain to point at the IP address of the server and it magically serves different content depending on what the client asks for! Magic!</p>

    <p>
On copper I set up logging so that bbot.org got its own log file, while the other domains logged to a common file. This is done by setting the CustomLog variable to <em>/path/to/log</em> and <em>type of log</em>, the type of log, if not one of the default log formats, being defined by LogFormat.</p>

    <p>
bbot.org was told to log to /var/log/apache2/bbot-access and bbot-error using the default combined log format, but the other sites had to use a custom log format that included the name of the site in the common virtual host log file, or else I would get confused, and cry. Fortunately for me, Apache <a href="http://httpd.apache.org/docs/2.0/en/logs.html">provided an example</a> of a common vhost log format in the documentation, saving me from having to exercise independent thought.</p>

    <p><code>
    LogFormat "%v %l %u %t \"%r\" %>s %b" commonvhost<br />
    ErrorLog /var/log/apache2/vhosts-error<br />
    CustomLog /var/log/apache2/vhosts-access comonvhost</code></p>

    <p>
This started logging to the correct location, but all it actually <em>logged</em> was "comonvhost" over and over, indicating that it had correctly parse the configuration file, but had ignored the LogFormat setting, for some reason. You should be able to see why.</p>

    <p>
Correct! As stated in the <em>Official Apache Foundation Documentation for HTTPd 2.0</em>, there is a typo in the CustomLog setting, specifying the log format as "co<strong>m</strong>onvhost" instead of "co<strong>mm</strong>onvhost". Apache, slavishly obeying what I told it to do instead of what I wanted it to do, proceeded to log the word "comonvhost" to the access log on every access. Thanks, Apache.</p>

    <p>
This can be thought of as an example of the age old <a href="http://en.wikipedia.org/wiki/SQL_injection">SQL injection</a> exploit, only implemented in brain matter, and thus impossible to patch. I implicitly trusted the documentation, and thus copy and pasted the code snippet into my configuration file without thinking about it. Thanks, brain.</p>

    <p>
Next: Awstats, Postfix, and the TF2 Dedicated Server!</p> ]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2009/06/19/fun_with_wget/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2009/06/19/fun_with_wget/index.html</guid>
<title>fun with wget</title>
<dc:date>2009-06-19T18:11:39-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[<link rel="stylesheet" href="http://bbot.org/blog/styles/nb_default.css">

    <p>
So one <a href="http://www.rocketbomber.com/">Matt Blind</a>, author of an excellent piece on <a href="http://www.rocketbomber.com/2009/06/01/rethinking-the-box-the-seven-types-of-customer">bookstore customers</a> also happens to produce <a href="http://www.rocketbomber.com/category/rankings/">bestseller lists for graphic novels.</a> How? Well, in his <a href="http://www.rocketbomber.com/2009/06/13/about-the-charts-version-20">own words</a>:</p>

<blockquote>The Core of the Charts is made up of data from three sites: Amazon, Barnes & Noble, and Borders.<br /><br />

Once a week, I visit each site to check their Graphic Novel categories, and I sort the search results by "bestselling". The links above will pull up exactly that.<br /><br />

I then click through, page after page, and type the titles into a spreadsheet in the order that they are ranked on the sales site. [this is the hard part]<br /><br />

And once I have a full list, I assign points to the books depending on how highly they rank. Add up the points each title earns (and add on similar data from a half-dozen second-tier sales sites) to get a composite score, and there's your ranking.<br /><br />

In concept, it's that simple.<br /><br />

In practice, because the sites themselves can update as often as once an hour, after I load up a website &amp; sort the search results, I then click open each new page in a new tab until I have 20-100 tabs open, representing a snapshot of the full sales (top 900-1200 titles) of this particular sales site over a relatively short time-frame (10-15 minutes). And then I start the data entry.</blockquote>

    <p>
Wow, that sucks. What did <a href="http://catb.org/esr/faqs/hacker-howto.html#believe2">Raymond say</a> about data entry?</p>

<blockquote>Hackers (and creative people in general) should never be bored or have to drudge at stupid repetitive work, because when this happens it means they aren't doing what only they can do -- solve new problems. This wastefulness hurts everybody. Therefore boredom and drudgery are not just unpleasant but actually evil.</blockquote>

    <p>
You're right, Raymond! This sorely needs some <em>automation</em>.</p>

    <p>
But complete automation would be Nontrivial, so lets take the merest of first steps. Opening hundreds of tabs sucks. How about just one tab?</p>

    <p>
First thing, I wrote a little bash script to generate the links list, since it would, of course, be 101 lines long, and I didn't feel like copy and pasting each one from firefox, or whatever.</p>

    <p>
First, let's look at the base url.</p>

    <p>
http://browse.barnesandnoble.com/browse/nav.asp?No=10&N=0+989443&Ne=989443&visgrp=fiction&act=BC_ANC</p>

    <p>
Clicking on "next" results in:</p>

    <p>
http://browse.barnesandnoble.com/browse/nav.asp?No=20&N=0+989443&Ne=989443&visgrp=fiction&act=BC_ANC</p>

    <p>
The string of interest is "No=20", which increments by ten every page. So the resulting script is:</p>

<code><strong>for (( i=30; i <= 1000; i=i+10  ))<br />
do<br />
	echo "http://browse.barnesandnoble.com/browse/nav.asp?No=$i&N=0+989443&Ne=989443&visgrp=fiction&act=BC_ANC"<br />
done</strong></code>

    <p>
This script creates a variable (i), sets it to 30 (i=30), tells it to run the loop as long as i is less than or equal to 1000 (i <= 1000), then increments i by 10 each loop. (i=i+10). It then inserts the current value of i in the base url. It starts at 30 because I already had the first three pages of sales ranks.</p>

    <p>
Running this script and piping the output to "links.txt" results in a 101 line long text file, with a url on each line. We tell wget to use this file, to wait a random time between 0 and 2 seconds between hitting each link, and to use the user-agent "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)", who happened to be the most recent visitor to bbot.org when I plundered the log for user agents. We also tell it to log to wget.log, and to be verbose, because --verbose is awesome.</p>

<code><strong>wget --random-wait --user-agent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)" --input-file=links.txt --output-file=wget.log --verbose</strong></code>

    <p>
Wget then hogs the terminal, but remains silent, because we told it to output to wget.log. We can watch along in another terminal by tail -f'ing wget.log, and occasionally ls'ing. It goes pretty fast, taking 20.52 seconds to download 7.4 mebibytes worth of html. After cat'ing everything you end up with a mighty browser-crushing 7.4 mebibyte html that makes Opera colossally unhappy, but which Firefox can handle fine-ish, and takes forever to upload, so we bzip it to a svelte 220 kibibytes.</p>

    <p>
<a href="http://bbot.org/sales.bz2">http://bbot.org/sales.bz2</a></p>

    <p>
Standard large html file disclaimers apply. It's big big big, media rich, and outrageously malformed.</p>]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2009/04/28/distro_paranoia/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2009/04/28/distro_paranoia/index.html</guid>
<title>distro paranoia</title>
<dc:date>2009-04-28T16:08:24-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[So, it turns out that <a href="http://marilyn.frields.org:8080/~paul/wordpress/">Paul Frields</a>, project leader for Fedora Linux <a href="http://paranoia.dubfire.net/2009/04/current-red-hat-linux-employee-fedora.html">used to develop spyware for the FBI</a>.<br /><br />

Well golly, <em>I</em> use Fedora.<br /><br />

<em>Oh come on. The FBI doesn't care about linux users.</em><br /><br />

You're right, I'm sure the FBI has absolutely no interest in a group of technical experts whose work underlie <a href="http://en.wikipedia.org/wiki/DNS_root">critical national infrastructure</a> and who refuse to use commerical software due to ideological reasons.<br /><br />

These people are beyond suspicion, while <a href="http://www.latimes.com/news/nationworld/nation/la-na-harman22-2009apr22,0,6177765.story">senators</a> and <a href="http://en.wikipedia.org/wiki/Al-Haramain_Foundation">charities</a> are not.<br /><br />

Uh huh. Sure.<br /><br />

So I'm looking for a new distro. The limitations is that it has to be linux-based, and come with a package manager. What are my choices?

<ul>
<li><a href="http://www.ubuntu.com/">Ubuntu</a>. PRO: Easily the most popular linux distro. CON: It's <em>Ubuntu</em>.</li>
<li><a href="http://www.debian.org/">Debian</a>. PRO: Ubuntu, but with less lameness. CON: Extremely ideological. Getting the NVidia drivers and mp3 support working will require effort. On the one hand, I had to do the same with Fedora. On the other, it's fucking 2009. I shouldn't <em>have</em> to do that anymore.</li>
<li><a href="http://www.gentoo.org/">Gentoo</a>. PRO: Nerdy. Compiling everything results in a faster, more optimized system, and also prevents attackers from shipping compromised binaries. CON: I'm not going to be reading the source code, either, so compiling everything isn't actually any more secure. Also, while the end result may be faster, I'll still be compiling everything on a 900mhz machine. Also also, it's <em>gentoo</em>, the distro of choice for people upgrading from ubuntu.</li>
<li><a href="http://www.novell.com/linux/">SuSE</a>. PRO: I've actually used suse before, way back in middle school. Presumably the installer's better now. CON: Primarily a german-language distro. Documentation in english may be spotty.</li>
<li><a href="http://www.mandriva.com/">Mandriva</a>. PRO: It's a linux distro? CON: I've never used it, nor heard much of anything about it. Apparently it's popular enough to have a package manager.</li>
<li><a href="http://www.slackware.com/">Slackware</a>. PRO: Pretty cool bros only. CON: I'm not all that cool of a bro. Plus, I like wussy window managers like GNOME and KDE, and the other slackware users might make fun of me for using them. Also, package selection may be weak or out of date, since the slackware maintainers are too busy telling kids to get off of their lawn to update their repositories.</li>
</ul>

Exciting!]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2008/04/17/uptime_how_i_shall_miss_you/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2008/04/17/uptime_how_i_shall_miss_you/index.html</guid>
<title>uptime, how I shall miss you</title>
<dc:date>2008-04-17T17:22:01-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[I just restarted my computer for the first time in 149 days.<br /><br />

A moment of silence for my dear departed uptime.]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2008/04/13/from_hells_heart_i_stab_at_thee_vi/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2008/04/13/from_hells_heart_i_stab_at_thee_vi/index.html</guid>
<title>from hell's heart I stab at thee, vi</title>
<dc:date>2008-04-13T14:40:32-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[So the previous blog entry looks pretty simple, right?<br /><br />

Wrong!<br /><br />

You see, I pasted the chat transcript directly into vi, which nanoblogger uses to edit blog entires. Nanoblogger uses direct html formatting, so the greater than/lesser than names were interpreted as tags, and thus didn't render. Lame!<br /><br />

HTML being a proper markup language, however, implements a kinda sorta escape code sequence, where you can use "&amp;lt;" and "&amp;gt;" (<em>lesser</em>-than and <em>greater</em>-than, get it?) to render &lt; and &gt; without your html interpreter (read: web browser) invisibly erasing them.<br /><br />

But the problem was, I had about twelve instances of &lt; and &gt; to replace. Text navigation in vi, while not impossibly difficult, is still awkward; and in any event, doing all that crap by hand was ideologically impure. Whatever was I to do?<br /><br />

Search and replace, of course!<br /><br />

Vi, being a Real Man's text editor, uses sed-style regex expressions for search and replace, and as I was about to discover, sed-style <em>wildcards</em>. The command string I first tried using was "%s/&lt;bbot&gt;/&amp;lt;bbot&amp;gt;/g" (%s/ to search every line, /g to replace every instance. The regex is of form /search string/thing to replace search string with/)<br /><br />

That command, of course, resulted in "&lt;bbot&gt;lt;bbot&lt;bbot&gt;gt;" instead of "&lt;bbot&gt;", since motherfucking <em>sed</em> uses &amp; in the replacement string to mean <em>what the search string matched</em>. This lets you do all sorts of enormously clever things, but is a giant pain in the fucking ass when you're messing with HTML enity codes. <br /><br />

Now, normally, you would use shell style quoting to tell sed to ignore &amp;, but vi isn't the shell! It ignores quotes! I, of course, only figured this out after running through every permutation I could think of, before just using the \ escape character.<br /><br />

Builds character, right?<br /><br />]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2008/04/07/tor/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2008/04/07/tor/index.html</guid>
<title>tor</title>
<dc:date>2008-04-07T12:40:51-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[So copper.unitinu.net is now running a <a href="http://www.torproject.org/">Tor</a> relay. Since there's nothing else running on that box, Tor is happily soaking up ten megabits a second. How did I do it, you ask?<br /><br />

Easy!<br /><br />

First I downloaded the tor and libevent sources.<br />

<blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">
<code>
[root@copper ~]#wget http://www.monkey.org/~provos/libevent-1.3e.tar.gz<br />
<em>output removed</em><br />
[root@copper ~]#wget http://www.torproject.org/dist/tor-0.1.2.19.tar.gz<br />
<em>output removed</em><br />
</code>
</blockquote>

Then I unpacked the archives, ran the makefiles, etc. But tor errored out during configuration!<br />

<blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">
<code>
checking whether we need extra options to link libevent... configure: error: Found linkable libevent in (system), but it doesn't run, even with -R.  Maybe specify another using --with-libevent-dir?<br />
[root@copper tor-0.1.2.19]#<br />
</code>
</blockquote>

Since libevent installed correctly, I guessed that tor couldn't find the libraries. <a href="http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=wq&q=%22checking+whether+we+need+extra+options+to+link+libevent...+configure%3A+error%3A+Found+linkable+libevent+in+%28system%29%2C+but+it+doesn%27t+run%2C+even+with+-R.%22&btnG=Search">Googling the error message</a> <a href="http://www.googlewhack.com/">googlewhacked</a> on <a href="http://monkeymail.org/archives/libevent-users/2006-November/000363.html">another fellow</a> with the same problem, which he solved by setting LD_LIBRARY_PATH to /usr/local/lib. So I, you know, did that.<br />

<blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">
<code>
[root@copper tor-0.1.2.19]# export LD_LIBRARY_PATH=/usr/local/lib<br />
<em>output removed</em><br />
[root@copper tor-0.1.2.19]# ./configure && make<br />
<em>output removed, but it worked! too bad make doesn't give a completion message.</em><br />
</code>
</blockquote>

That was easy! Kinda.]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2008/03/11/blackberry_why_must_you_bedevil_me_so/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2008/03/11/blackberry_why_must_you_bedevil_me_so/index.html</guid>
<title>blackberry, why must you bedevil me so</title>
<dc:date>2008-03-11T08:36:05-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[So, my blackberry comes with a neat little utility called "memos", which, oddly enough, allows you to write memos. I've been using it to write bits and pieces of various things, and it finally came time that I had enough that I wanted to actually export them in a usable format. How is this done, you ask? Easy!
<br /><br />
<ol>
<li>You back up the device using RIM's terrible backup utility. This takes an oddly long time, seeing as how it's only backing up text, and over a USB2 connection at that.</li>
<li>This produces an .ipd file, which is some wacky proprietary binary format, and cannot be read by any linux utility.</li>
<li>Find a program which claims to be able to read .ipd files; which is of course shareware, since it targets a tiny user base of people with too much money.</li>
<li>Download the free version, to discover that only lets you export ten memos at a time, because the cocksucker who wrote it wants twenty bucks.</li>
<li>Produce four .txt files of ten memos each, by hand, taking an inordinate amount of time.</li>
<li>Copy this over samba to the linux computer.</li>
<li>Use cat to mash the files together, then manually, again, paste each one into Tomboy</li>
</ol>
<br /><br />
EASY]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2006/10/15/lol_sl/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2006/10/15/lol_sl/index.html</guid>
<title>lol sl </title>
<dc:date>2006-10-15T22:59:24-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[<blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">2006-10-15T22:48:43Z WARNING: Alert: A new version of Second Life is available.<br />2006-10-15T22:48:43Z<br />2006-10-15T22:48:43Z<br />2006-10-15T22:48:43Z You must download this update to use the system.<br />2006-10-15T22:48:43Z<br />2006-10-15T22:48:43Z Download to your Applications folder?</blockquote>

<br />I click on the &quot;Download&quot; box.<br />

<blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">2006-10-15T22:48:43Z<br />2006-10-15T22:48:53Z WARNING: OSMessageBox: Automatic updating is not yet implemented for Linux.</blockquote>

<br />Ha ha ha ha. Good one, Linden!<br /><br />No, wait.]]></description>

</item>
<item>
<link>http://bbot.org/blog/archives/2006/08/14/zoomj_ipod/index.html</link>
<guid isPermaLink="true">http://bbot.org/blog/archives/2006/08/14/zoomj_ipod/index.html</guid>
<title>zoomj ipod </title>
<dc:date>2006-08-14T14:50:32-05:00</dc:date>
<dc:creator>bbot</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[I just got my ipod working under linux. It was less than trivially easy.<br /><br />First I had to get a firewire card. This was surprisingly easy. And then all I had to do was plug the ipod in and Linux automagically recognized it and mounted the file system.<br /><br />Ha ha ha. Just kidding. This is what it did after I plugged it in.<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[root@aluminum uqm-0.5.0]# dmesg -c<br />ieee1394: Node changed: 0-00:1023 -&gt; 0-01:1023<br />ieee1394: Node changed: 0-01:1023 -&gt; 0-00:1023<br />ieee1394: Node changed: 0-00:1023 -&gt; 0-01:1023<br />ieee1394: Node changed: 0-01:1023 -&gt; 0-00:1023<br />ieee1394: Error parsing configrom for node 0-00:1023<br />ieee1394: Error parsing configrom for node 0-01:1023<br />ieee1394: The root node is not cycle master capable; selecting a new root node and resetting...<br />ieee1394: Node resumed: ID:BUS[0-00:1023]  GUID[000a270002012f83]<br />ieee1394: Node changed: 0-00:1023 -&gt; 0-01:1023<br />scsi7 : SCSI emulation for IEEE-1394 SBP-2 Devices<br />ieee1394: sbp2: Logged into SBP-2 device<br />ieee1394: Node 0-00:1023: Max speed [S400] - Max payload [2048]<br />  Vendor: Apple     Model: iPod              Rev: 1.30<br />  Type:   Direct-Access                      ANSI SCSI revision: 02<br />SCSI device sdc: 9780750 512-byte hdwr sectors (5008 MB)<br />sdc: test WP failed, assume Write Enabled<br />sdc: asking for cache data failed<br />sdc: assuming drive cache: write through<br />SCSI device sdc: 9780750 512-byte hdwr sectors (5008 MB)<br />sdc: test WP failed, assume Write Enabled<br />sdc: asking for cache data failed<br />sdc: assuming drive cache: write through<br /> sdc: [mac] sdc1 sdc2 sdc3<br />Attached scsi removable disk sdc at scsi7, channel 0, id 0, lun 0<br /><b>HFS+-fs warning: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended.  mounting read-only.</b><br />SELinux: initialized (dev sdc3, type hfsplus), not configured for labeling</blockquote><br />So I could <i>see </i>all the files, and listen to stuff, but I couldn&#039;t delete anything, or add any music.<br /><br />But hey! What about fsck.hfsplus?<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[root@aluminum uqm-0.5.0]# fsck.hfsplus /dev/sdc3<br />bash: fsck.hfsplus: command not found</blockquote><br />Fuck!<br /><br />So I get online and grab fsck.hfsplus. The problem is that it&#039;s a Darwin native app, so it&#039;s little-endian. Linux can&#039;t run little-endian code, so you have to apply a patch.<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[bbot@aluminum uqm-0.5.0]$ cd /media/usbdisk1<br />[bbot@aluminum usbdisk1]$ ls<br />4chan                          hokuto~                        mIRC<br />Archive                        HOWTO_hfsplus_files            New Folder<br />diskdev_cmds-332.11.patch.bz2  HOWTO_hfsplus.htm              Untitled.txt<br />diskdev_cmds-332.11.tar.gz     imprints (another copy).html~  Untitled.txt~<br />diskdev_cmds.diff.gz           imprints (copy).html~<br />hfsplus-patch-20020606.htm     japan photos<br /><br />[bbot@aluminum usbdisk1]$ tar zxf diskdev_cmds-332.11.tar.gz<br />[bbot@aluminum usbdisk1]$ bunzip2 -c diskdev_cmds-332.11.patch.bz2 | patch -p0<br /><br />(a few hundred lines of patcher messages.)<br /><br />[bbot@aluminum usbdisk1]$ cd diskdev_cmds-332.11<br />[bbot@aluminum diskdev_cmds-332.11]$ make -f Makefile.lnx<br /><br />(a few hundred lines of complier messages.)<br /><br />[bbot@aluminum diskdev_cmds-332.11]$ cp newfs_hfs.tproj/newfs_hfs /sbin/mkfs.hfsplus<br />cp: cannot create regular file `/sbin/mkfs.hfsplus&#039;: Permission denied<br />[bbot@aluminum diskdev_cmds-332.11]$ su<br />Password:<br />[root@aluminum diskdev_cmds-332.11]# cp newfs_hfs.tproj/newfs_hfs /sbin/mkfs.hfsplus<br />[root@aluminum diskdev_cmds-332.11]# cp fsck_hfs.tproj/fsck_hfs /sbin/fsck.hfsplus<br />[root@aluminum diskdev_cmds-332.11]# cd /sbin<br />[root@aluminum sbin]# ln -s mkfs.hfsplus mkfs.hfs<br />[root@aluminum sbin]# ln -s fsck.hfsplus fsck.hfs</blockquote><br />Victory!<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[root@aluminum sbin]# ./fsck.hfsplus /dev/sdc3<br />** /dev/sdc3<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />   Incorrect number of thread records<br />(4, 3)<br />** Checking Catalog hierarchy.<br />** Checking volume bitmap.<br />** Checking volume information.<br />   Master Directory Block needs minor repair<br />** Repairing volume.<br />** Rechecking volume.<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />   Incorrect number of thread records<br />(4, 3)<br />** Checking Catalog hierarchy.<br />** Checking volume bitmap.<br />** Checking volume information.<br />** Repairing volume.<br />** Rechecking volume.<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />   Incorrect number of thread records<br />(4, 3)<br />** Checking Catalog hierarchy.<br />** Checking volume bitmap.<br />** Checking volume information.<br />** Repairing volume.<br />** Rechecking volume.<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />   Incorrect number of thread records<br />(4, 3)<br />** Checking Catalog hierarchy.<br />** Checking volume bitmap.<br />** Checking volume information.<br />** The volume iPod could not be repaired after 3 attempts.</blockquote><br />Shit!<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[root@aluminum sbin]# ./fsck.hfsplus -q /dev/sdc3<br />** /dev/sdc3<br />QUICKCHECK ONLY; FILESYSTEM CLEAN</blockquote><br />And sure enough, dmesg wasn&#039;t showing the error message anymore.<br /><br />Now I installed the linux equivilent of iTunes. Which worked beautifully!<br /><br />Ha ha ha.<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[root@aluminum uqm-0.5.0]# gtkpod<br />gtkpod: error while loading shared libraries: libgpod.so.0: cannot open shared object file: No such file or directory</blockquote><br />So I had to export the enviromental varible, so gtkpod could find itself.<br /><blockquote style="padding:4px;background-color:#f1f1f1;border:1px solid #ccc">[root@aluminum uqm-0.5.0]# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/l<wbr />ocal/lib<br />[root@aluminum uqm-0.5.0]# export LD_LIBRARY_PATH<br />[root@aluminum uqm-0.5.0]# gtkpod</blockquote><br />Ta dah. From there on out it actually worked.<br /><br />The moral? Linux is only free if your time has no value.<br /><br />But this would have been a <i>lot harder</i> a few years ago. My firewire card Just Worked, and the ipod initialized automatically. <br />But if I had a mac, I could have just plugged it in.]]></description>

</item>
</channel>
</rss>
