<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Isching</title>
	<atom:link href="http://isching.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://isching.wordpress.com</link>
	<description>It is ching, is it not?</description>
	<lastBuildDate>Sat, 17 Dec 2011 12:20:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='isching.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Isching</title>
		<link>http://isching.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://isching.wordpress.com/osd.xml" title="Isching" />
	<atom:link rel='hub' href='http://isching.wordpress.com/?pushpress=hub'/>
		<item>
		<title>HOWTO: Use Anki flashcards with code snippets and syntax highlighting</title>
		<link>http://isching.wordpress.com/2011/12/17/howto-use-anki-flashcards-with-code-snippets-and-syntax-highlighting/</link>
		<comments>http://isching.wordpress.com/2011/12/17/howto-use-anki-flashcards-with-code-snippets-and-syntax-highlighting/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 12:20:49 +0000</pubDate>
		<dc:creator>/n/</dc:creator>
				<category><![CDATA[anki]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Anki]]></category>
		<category><![CDATA[flashcards]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[minted]]></category>
		<category><![CDATA[pygments]]></category>
		<category><![CDATA[syntax-highlighting]]></category>

		<guid isPermaLink="false">http://isching.wordpress.com/?p=50</guid>
		<description><![CDATA[I regularly use Anki, a wonderful flashcards program for spaced repetition learning. Recently I found myself wanting to create flashcards that contain code snippets. Now, I find code snippets really useful, but only when properly formatted and with syntax highlighting. I &#8230; <a href="http://isching.wordpress.com/2011/12/17/howto-use-anki-flashcards-with-code-snippets-and-syntax-highlighting/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=50&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I regularly use <em><strong><a href="http://ankisrs.net/">Anki</a></strong></em>, a wonderful flashcards program for spaced repetition learning. Recently I found myself wanting to create flashcards that contain code snippets. Now, I find code snippets really useful, but only when properly formatted and with syntax highlighting. I wanted both in my flashcards, but they didn&#8217;t seem directly supported in <em>Anki</em>.</p>
<p style="text-align:justify;">This seemed logical as Anki is &#8220;content-agnostic&#8221;. However, <em>Anki</em> does provide excellent support for Latex, and that seemed the way to go.</p>
<p style="text-align:justify;">After a bit of research, I found the following combination that should work:</p>
<p style="text-align:justify;"><em><strong><a href="http://pygments.org/faq/">Pygments</a></strong></em>: A fine syntax highlighting engine written in Python that supports Latex among its many output formats. It can also be run directly via the <em>pygmentize</em> command-line tool. Incredibly useful!</p>
<p style="text-align:justify;"><em><strong><a href="http://code.google.com/p/minted/">minted</a></strong></em>: A Latex package that wraps Pygments, so you only need to wrap your snippet in <em>\begin{minted}&lt;snippet&gt;\end{minted}</em> to get syntax highlighting.</p>
<p><pre class="brush: plain;">
\begin{minted}{cpp}
#include
using namespace std;
int main()
{
 return 0;
}
\end{minted}
</pre></p>
<p style="text-align:justify;">These are the steps I followed to get these tools to work with Anki.</p>
<div style="text-align:justify;"><span id="more-50"></span></div>
<p style="text-align:justify;">Install <em><a href="http://pygments.org/download/">Pygments</a></em>: I followed instructions given on the <em>Pygments</em> page and used <em>easy_install</em>. I had to install the <em>python-setuptools</em> package to get <em>easy_install</em> on my machine.  (i.e. <em>sudo aptitude install python-setuptools</em>)</p>
<p style="text-align:justify;">Install Latex: On Ubuntu, this is the <em>texlive</em> (or <em>texlive-full</em>) package. Check <a href="https://help.ubuntu.com/community/LaTeX">here</a> for detailed instructions on setting up Latex. I already had it installed (for another project; I don&#8217;t think it&#8217;s installed by default on a Ubuntu box).</p>
<p style="text-align:justify;">Install <em><a href="http://code.google.com/p/minted/">minted</a></em>: This is a Latex package that uses <em>Pygments</em> for syntax highlighting a code snippet. I downloaded the zip file from the package downloads and used the below instructions to incorporate it into my Latex installation.</p>
<p><pre class="brush: bash;">
$ cp ~/Downloads/minted-v1.7.zip .
$ unp minted-v1.7.zip
 Archive: minted-v1.7.zip
 inflating: minted.dtx
 inflating: minted.ins
 inflating: minted.pdf
 inflating: README
 inflating: Makefile
$ latex minted.ins
$ sudo mkdir /usr/share/texmf/tex/latex/minted
$ sudo cp minted.sty /usr/share/texmf/tex/latex/minted
$ sudo texhash
 Updating /usr/local/share/texmf/ls-R...
 texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN...
 texhash: Updating /var/lib/texmf/ls-R-TEXLIVE...
 texhash: Updating /var/lib/texmf/ls-R...
 texhash: Done.
</pre></p>
<p style="text-align:justify;">At this point, I needed to verify that I had the package correctly installed.<br />
I created the below <em>test.tex</em> Latex file:</p>
<p><pre class="brush: plain;">
\documentclass[12pt]{article}
\special{papersize=3in,5in}
\usepackage[utf8]{inputenc}
\usepackage{amssymb,amsmath}
\usepackage{minted}
\pagestyle{empty}
\setlength{\parindent}{0in}
\begin{document}
\begin{minted}{cpp}

#include
using namespace std;
int main()
{
 return 0;
}

\end{minted}

\end{document}

</pre></p>
<p style="text-align:justify;">I ran on the command line: &#8220;<em>latex test.tex</em>&#8220; to be greeted with this error:</p>
<p><pre class="brush: bash;">
Package ifplatform Warning:
 shell escape is disabled, so I can only detect \ifwindows.

))

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

See the minted package documentation for explanation.
Type H  for immediate help.
 ...

l.7 \pagestyle
 {empty}
?
</pre></p>
<p style="text-align:justify;">So, I ran it again with the &#8220;<em>-shell-escape</em>&#8221; argument and this time it ran successfully.</p>
<p style="text-align:justify;">To be doubly sure, I ran the <em>pdflatex</em> command with the same arguments (&#8220;<em>pdflatex -shell-escape test.tex</em>&#8220;) and checked the pdf output file.</p>
<p style="text-align:justify;">Now that I had <em>minted</em> working on my machine, it was time to get Anki to support this. I could either add this to the Latex environment for all the decks, or choose to add it for individual decks.  The former is a lot more involved than the latter so I will describe that first.</p>
<p style="text-align:justify;">Anki provides a plugin to configure the Latex environment it uses. Go to <em>File &gt; Download &gt; Shared Plugin</em>, and download the &#8220;<em>Configure latex</em>&#8221; plugin. Restart Anki. Now, go to <em>Settings &gt; Plugins &gt; &#8220;Open Plugin Folder&#8230;&#8221;</em>. You should the &#8220;<em>Configure latex.py</em>&#8221; file in this folder. Open it.</p>
<p style="text-align:justify;">In the &#8220;<em>latex.latexPreamble</em>&#8221; section, add this line: &#8220;<em>\\usepackage{minted}\n</em>&#8221; below the existing <em>\usepackage</em> line. Close the file and restart Anki. This makes the minted package available in the Latex environment used for the decks. Note that this seems to affect only newly created decks.</p>
<p style="text-align:justify;">Verify this by creating a new deck and checking the <em>Latex</em> tab in<em> Settings &gt; Deck Properties</em>. You should see the additional line in the Header text area.</p>
<p style="text-align:justify;">To make the <em>minted</em> package available in already existing decks, or make it selectively available to decks that need it, open the deck and manually add the line  (&#8220;<em>\usepackage{minted}</em>&#8220;) in the <em>Latex</em> tab in <em>Settings &gt; Deck Properties</em> instead of changing it via the &#8220;<em>Configure Latex</em>&#8221; plugin.</p>
<p style="text-align:justify;">Now, I was almost there. I knew that when I tried to use minted in a flashcard I would likely get the same error as when I tried the command-line version:</p>
<p><pre class="brush: bash;">

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

See the minted package documentation for explanation.
Type H  for immediate help.
 ...

l.7 \pagestyle
 {empty}
?

</pre></p>
<p style="text-align:justify;">Go on, try it (In case Anki has changed since I wrote this).</p>
<p style="text-align:justify;">So, how do I make Anki invoke the latex command with the <em>-shell-escape</em> flag? Well, I looked around and couldn&#8217;t find an option to pass parameters to the latex command. I finally tracked down Anki&#8217;s latex plugin file to <em>/usr/share/anki/anki/latex.py</em>. The actual call to the latex command, within this file, was:</p>
<p><pre class="brush: python;">

if call([&quot;latex&quot;, &quot;-interaction=nonstopmode&quot;,
 &quot;tmp.tex&quot;], stdout=log, stderr=log, startupinfo=si):
 return (False, errmsg(&quot;latex&quot;))

</pre></p>
<p style="text-align:justify;">I backed up this file, and edited it (via <em>sudo vim /usr/share/anki/anki/latex.py</em>) to pass the <em>-shell-escape</em> argument. This is the diff:</p>
<p><pre class="brush: bash;">
G61-Ubuntu&gt; cd /usr/share/anki/anki/
G61-Ubuntu&gt; diff latex.py latex.py_original
99c99
&lt; if call([&quot;latex&quot;, &quot;-shell-escape&quot;, &quot;-interaction=nonstopmode&quot;,
---
&gt; if call([&quot;latex&quot;, &quot;-interaction=nonstopmode&quot;,
G61-Ubuntu&gt;
</pre></p>
<p style="text-align:justify;">That&#8217;s it. I now could enter the first snippet in this post in an Anki flash card and it would correctly display the syntax-highlighted C++ source code.</p>
<p style="text-align:justify;"><strong>Note:</strong> On Windows, you typically install <a href="http://miktex.org/">MiKTeX</a> as the Latex distribution. I found that if you set the option to &#8220;Ask me&#8221;  for the &#8220;Download packages as needed&#8221; option (paraphrasing here; I don&#8217;t remember the exact commands) it didn&#8217;t download and install the <em>minted</em> package as I expected, but returned an error. After looking at how Anki invokes the <em>latex</em> command on Ubuntu, I assume it&#8217;s the &#8220;<em>-interaction=nonstopmode</em>&#8221;  option that&#8217;s preventing this. I googled and found that changing the option to either &#8220;Yes&#8221; or &#8220;No&#8221; prevents this error.</p>
<p style="text-align:justify;"><strong>Note2:</strong> I am not very familiar with the components I describe above, and this may not be the best or easiest way to get syntax highlighting in Anki. If you have any suggestions or updates to what I have above, please drop me a comment.</p>
<p style="text-align:justify;"><strong>Note3:</strong> I also added a feature request for Anki to allow arguments to the <em>latex</em> command via the <em>Configure Latex</em> plugin, so please check if that is supported in your version before hacking at the file directly.</p>
<br />Filed under: <a href='http://isching.wordpress.com/category/anki/'>anki</a>, <a href='http://isching.wordpress.com/category/howto/'>HOWTO</a>, <a href='http://isching.wordpress.com/category/linux/'>Linux</a>, <a href='http://isching.wordpress.com/category/ubuntu/'>ubuntu</a> Tagged: <a href='http://isching.wordpress.com/tag/anki-2/'>Anki</a>, <a href='http://isching.wordpress.com/tag/flashcards/'>flashcards</a>, <a href='http://isching.wordpress.com/tag/latex/'>latex</a>, <a href='http://isching.wordpress.com/tag/minted/'>minted</a>, <a href='http://isching.wordpress.com/tag/pygments/'>pygments</a>, <a href='http://isching.wordpress.com/tag/syntax-highlighting/'>syntax-highlighting</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/isching.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/isching.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/isching.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/isching.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/isching.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/isching.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/isching.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/isching.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=50&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://isching.wordpress.com/2011/12/17/howto-use-anki-flashcards-with-code-snippets-and-syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb6c184ffa7106424d976bd4b60a00a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">/n/</media:title>
		</media:content>
	</item>
		<item>
		<title>HOWTO: Export ratings information from Banshee</title>
		<link>http://isching.wordpress.com/2009/07/27/howto-export-ratings-information-from-banshee/</link>
		<comments>http://isching.wordpress.com/2009/07/27/howto-export-ratings-information-from-banshee/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 20:29:50 +0000</pubDate>
		<dc:creator>/n/</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[banshee]]></category>
		<category><![CDATA[export ratings]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[sqlite3]]></category>

		<guid isPermaLink="false">http://isching.wordpress.com/?p=42</guid>
		<description><![CDATA[Information on how to extract ratings information from a Banshee music library. <a href="http://isching.wordpress.com/2009/07/27/howto-export-ratings-information-from-banshee/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=42&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I have an extensive music collection. I have spent considerable time over the years on my collection to get them to a fairly pristine state with proper IDv3 tags and a folder structure that actually works.</p>
<p style="text-align:justify;">Along the way I discovered <a href="http://www.foobar2000.org/">the most amazing music player</a> I&#8217;ve ever used, which excels on so many counts, not least the presence of one of the best <a href="http://www.tinkafoo.com/log/masstagger.html">tagging tools</a>. Then I threw it all away when I moved to Ubuntu. Yes, it&#8217;s among the few pieces of software I miss on Linux. ( Atleast until such time as I can get it working under Wine )</p>
<p style="text-align:justify;">Anyway, on Ubuntu I settled on <a href="http://banshee-project.org/">Banshee</a> and recently started adding ratings to the songs. This is a major investment of my time, and it is consequently not unreasonable to expect to:</p>
<ul style="text-align:justify;">
<li>Be able to back up my investment in maintaining this information.</li>
<li>Be able to export the ratings from Banshee into some standard format.</li>
</ul>
<p><span id="more-42"></span></p>
<h3 style="text-align:justify;">Backup Banshee data</h3>
<p style="text-align:justify;">The first is easily achieved: Banshee maintains all its information in the user home directory, under <em>~/.config/banshee-1/</em>:</p>
<p style="text-align:justify;">
<p><pre class="brush: bash;">

$ ls ~/.config/banshee-1/
addin-db-001  banshee.db  downloads  equalizers.xml  log

</pre></p>
<p style="text-align:justify;"><strong>Excellent!</strong> <strong>Backing up my Banshee experience is as simple as backing up this folder.</strong> Even better, the library information is stored in a <em><a href="http://www.sqlite.org/">SQLite</a> 3</em> database file  called <em>banshee.db</em>.</p>
<h3 style="text-align:justify;">Export Ratings information</h3>
<p style="text-align:justify;"><strong>What&#8217;s not so good is that Banshee does not support any formal way to export the ratings information.</strong> Neither did googling turn up any pointers. Hence, this post.</p>
<p style="text-align:justify;">The<em> </em><em>banshee.db</em><em> </em>file contains a few main tables (<em>CoreArtists</em>, <em>CoreAlbums</em>, <em>CoreTracks</em>), and all it takes is a peek into the db and a little bit of SQL to extract the ratings information from these tables and into a text file. I haven&#8217;t bothered to turn this into a more structured format like xml, since I don&#8217;t need it.</p>
<p style="text-align:justify;">( If you don&#8217;t find the<em> sqlite3</em> command, you probably need to install the <em>sqlite3</em> package. )</p>
<p style="text-align:justify;">
<p><pre class="brush: bash;">

sqlite3 -header ~/.config/banshee-1/banshee.db &quot;select ct.Uri as FileLocation, ct.Rating, ct.Genre, ct.Title, car.Name Artist, cal.Title as Album from CoreTracks ct inner join CoreArtists car on ct.ArtistID=car.ArtistID inner join CoreAlbums cal on cal.AlbumID=ct.AlbumID&quot; \; 

</pre></p>
<p style="text-align:justify;">Sample output:</p>
<p style="text-align:justify;">
<p><pre class="brush: bash;">

$ sqlite3 -header ~/.config/banshee-1/banshee.db &quot;select ct.Uri as FileLocation, ct.Rating, ct.Genre, ct.Title, car.Name Artist, cal.Title as Album from CoreTracks ct inner join CoreArtists car on ct.ArtistID=car.ArtistID inner join CoreAlbums cal on cal.AlbumID=ct.AlbumID&quot; \; | head -10
FileLocation|Rating|Genre|Title|Artist|Album
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/10. Room At The Top Of The Stairs.mp3|0|Bluegrass|Room At The Top Of The Stairs|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/01. My Walking Shoes.mp3|0|Bluegrass|My Walking Shoes|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/02. Hound Dawg.mp3|0|Bluegrass|Hound Dawg|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/03. Maggie's Farm.mp3|0|Bluegrass|Maggie's Farm|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/04. Memphis.mp3|0|Bluegrass|Memphis|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/05. Flint Hill Special.mp3|0|Bluegrass|Flint Hill Special|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/06. The Old Home Place.mp3|0|Bluegrass|The Old Home Place|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/07. Uncle Pen.mp3|5|Bluegrass|Uncle Pen|David Grisman, John Hartford &amp; Mike Seeger|Retrograss
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/08. Air Mail Special.mp3|0|Bluegrass|Air Mail Special|David Grisman, John Hartford &amp; Mike Seeger|Retrograss

</pre></p>
<p style="text-align:justify;">The columns are self-explanatory. <strong>The output contains the song&#8217;s <em>Title, Artist, Album, Genre, Rating</em> and <em>FileLocation</em> which should be enough to uniquely identify the file/song and assign ratings to a library in any other format.</strong> This should hopefully work even if the physical file location is changed.</p>
<p style="text-align:justify;">There are many other fields and tables in the SQLite db file that I haven&#8217;t used. If the above fields aren&#8217;t enough, and you need to export some other data ( like Year, Compilation, Disc, Composer etc ), have a peek at the db file yourself:</p>
<p style="text-align:justify;">
<p><pre class="brush: bash;">

$ sqlite3 -header ~/.config/banshee-1/banshee.db &quot;.schema&quot; \; | more

....

$ sqlite3 -header ~/.config/banshee-1/banshee.db &quot;select Uri,Rating,Genre,Title from CoreTracks where Rating != 0&quot; \; | head -5
Uri|Rating|Genre|Title
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/07. Uncle Pen.mp3|5|Bluegrass|Uncle Pen
Bluegrass/Jerry Garcia &amp; David Grisman/Not For Kids Only/02. Freight Train.mp3|4|Bluegrass|Freight Train
Bluegrass/Jerry Garcia &amp; David Grisman/Not For Kids Only/07. Hopalong Peter.mp3|5|Bluegrass|Hopalong Peter
Bluegrass/Jerry Garcia &amp; David Grisman/Not For Kids Only/08. Teddy Bears' Picnic.mp3|5|Bluegrass|Teddy Bears' Picnic
$

$ sqlite3 -header ~/.config/banshee-1/banshee.db &quot;select Uri,Rating,Genre,Title from CoreTracks&quot; \; | head -5
Uri|Rating|Genre|Title
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/10. Room At The Top Of The Stairs.mp3|0|Bluegrass|Room At The Top Of The Stairs
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/01. My Walking Shoes.mp3|0|Bluegrass|My Walking Shoes
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/02. Hound Dawg.mp3|0|Bluegrass|Hound Dawg
Bluegrass/David Grisman, John Hartford &amp; Mike Seeger/Retrograss/03. Maggie's Farm.mp3|0|Bluegrass|Maggie's Farm

</pre></p>
<p style="text-align:justify;">Also, if you do not want the column header in the output, lose the<em><strong> -header</strong></em> switch.</p>
<h3 style="text-align:justify;">Caution</h3>
<p style="text-align:justify;">We are using an internal implementation artefact that could change at any time. The Banshee version this command works against is given below. If you&#8217;re running newer versions, it might be prudent to check the output to see if the sql commands still function as expected.</p>
<p style="text-align:justify;">&#8212;</p>
<p style="text-align:justify;"><em>Versions (tested against)</em>: <em><strong>Banshee 1.4.3</strong></em></p>
<br />Posted in HOWTO Tagged: banshee, export ratings, HOWTO, music, sqlite3 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/isching.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/isching.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/isching.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/isching.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/isching.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/isching.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/isching.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/isching.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=42&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://isching.wordpress.com/2009/07/27/howto-export-ratings-information-from-banshee/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb6c184ffa7106424d976bd4b60a00a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">/n/</media:title>
		</media:content>
	</item>
		<item>
		<title>nslu2 issue: Unable to recognize ext3 partition on hard drive</title>
		<link>http://isching.wordpress.com/2009/07/25/nslu2-issue-unable-to-recognize-ext3-partition-on-hard-drive/</link>
		<comments>http://isching.wordpress.com/2009/07/25/nslu2-issue-unable-to-recognize-ext3-partition-on-hard-drive/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 16:46:13 +0000</pubDate>
		<dc:creator>/n/</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[nslu2]]></category>

		<guid isPermaLink="false">http://isching.wordpress.com/?p=35</guid>
		<description><![CDATA[Problem getting nslu2 NAS storage device to recognize ext3 partitions on external drive <a href="http://isching.wordpress.com/2009/07/25/nslu2-issue-unable-to-recognize-ext3-partition-on-hard-drive/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=35&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have an unslung nslu2 which boots from a USB drive on the &#8220;<em>Disk 2&#8243;</em> slot. I also have a 1TB Western Digital hard disk that is partitioned with 2 <em>ext3 </em>partitions and 1 <em>fat32</em> partition. My goal is to mount the 3 partitions via nslu2; the problem is that only the <em>fat32</em> partition gets mounted.</p>
<p>To give some perspective, I used to have 2 <em>fat32</em> partitions earlier, both of which could be accessed through nslu2. I reformatted two of them to <em>ext3</em> to improve performance (Music played via banshee accessing my 30 GB music library shared via nslu2 would stutter and break regularly; numerous people have suggested that this was due to it being a <em>fat32</em> partition )</p>
<p>Going into more detail ..</p>
<p><span id="more-35"></span></p>
<p>My 1TB Western Digital hard disk is partitioned thusly:</p>
<p><pre class="brush: bash;">

# fdisk  -l /dev/sdb

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

 Device Boot      Start         End      Blocks  Id System
/dev/sdb1               1       52268   419842678+ 83 Linux
/dev/sdb2           52269      104536   419842710   b Win95 FAT32
/dev/sdb3          104537      121601   137074612+ 83 Linux
#

</pre></p>
<p>The goal is to connect this up to the <em>Disk 1</em> port, and have the 2 <em>ext3</em> and 1 <em>fat32</em> partitions shared through nslu2.</p>
<p>However, what happens when I connect it up is that the <em>fat32</em> partition shows up in <em>/share/hdd/data/HDD_1_1_1</em> ( but not in <em>/etc/fstab</em>, or the output of <em>mount</em> command ), and other partitions do not show up ( though folders <em>/share/hdd/data/HDD_1_1_2</em> and <em>/share/hdd/data/HDD_1_1_3</em> are present ).</p>
<p><pre class="brush: bash;">

# mount
/dev/sda1 on /share/flash/data type ext3 (defaults,usrquota)
/dev/sda2 on /share/flash/conf type ext3 (defaults)
/dev/sda3 on swap type swap (defaults)
# umount /share/hdd/data/HDD_1_1_1
# mount /share/hdd/data/HDD_1_1_1 
mount: can't find /share/hdd/data/HDD_1_1_1 in /etc/fstab

</pre></p>
<p>Also, I am unable to mount the ext3 partitions as the command returns with an &#8220;Invalid argument&#8221; error.</p>
<p><pre class="brush: bash;">

# mount /dev/sdb1 /share/hdd/data/HDD_1_1_2/
mount: mounting /dev/sdb1 on /share/hdd/data/HDD_1_1_2/ failed: Invalid argument

</pre></p>
<p><em>dmesg</em> output shows that nslu2 isn&#8217;t able to properly read the hard drive.</p>
<p><pre class="brush: bash;">

hub.c: new USB device 00:01.2-1, assigned address 3
Device descriptor:8 bytes received.
Device descriptor:18 bytes received.
Protocol: Transparent SCSI
*** detect:usb-storage
* scsi_register: usb-storage-1, 
* scsi_reg, hostno:1 prot is 49
* scsi_reg, retval-&gt;host_no:1
scsi1 : SCSI emulation for USB Mass Storage devices
! scan_scsis
do read capacity!!!
 read capacity ok!!!
The capacity is 1953525168
*** 49
 Vendor: WD        Model: 10EAVS External   Rev: 1.75
 Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0
SCSI device sdb: 1953525168 512-byte hdwr sectors (1000205 MB)
31 port connect!!!!!
 /dev/scsi/host1/bus0/target0/lun0: p1 p2 p3
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
MSDOS FS: IO charset cp437
EXT3-fs: unsupported inode size: 256
EXT2-fs warning (device sd(8,17)): ext2_read_super: mounting ext3 filesystem as ext2

EXT2-fs: unsupported inode size: 256
FAT: bogus logical sector size 0
#

</pre></p>
<p>Stuck for ideas at the moment.</p>
<br />Posted in Linux Tagged: ext3, nas, nslu2 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/isching.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/isching.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/isching.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/isching.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/isching.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/isching.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/isching.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/isching.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=35&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://isching.wordpress.com/2009/07/25/nslu2-issue-unable-to-recognize-ext3-partition-on-hard-drive/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb6c184ffa7106424d976bd4b60a00a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">/n/</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu issue: Sudden loss of wifi connection</title>
		<link>http://isching.wordpress.com/2009/07/13/ubuntu-issue-sudden-loss-of-wifi-connection/</link>
		<comments>http://isching.wordpress.com/2009/07/13/ubuntu-issue-sudden-loss-of-wifi-connection/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 18:22:02 +0000</pubDate>
		<dc:creator>/n/</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[issues]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://isching.wordpress.com/?p=11</guid>
		<description><![CDATA[Problem with Ubuntu 9.04 with wi-fi connection dropping intermittently. <a href="http://isching.wordpress.com/2009/07/13/ubuntu-issue-sudden-loss-of-wifi-connection/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=11&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">My Ubuntu laptop suddenly lost wi-fi connection as I was in the midst of an important online session. The frustrating thing was that all attempts to connect to the wi-fi connection ended with timeout messages, then it suddenly got onto the network when I tried after almost half an hour of futile, desperate efforts.</p>
<p style="text-align:justify;">I know it wasn&#8217;t an issue with the network; wife&#8217;s MacBook connected to the wi-fi just fine during this period. Googling the dmesg messages turned up nothing tangible.</p>
<p><pre class="brush: bash;">
[   35.090022] [drm] Initialized drm 1.1.0 20060810
[   35.158146] pci 0000:00:02.0: PCI INT A -&amp;gt; GSI 16 (level, low) -&amp;gt; IRQ 16
[   35.158157] pci 0000:00:02.0: setting latency timer to 64
[   35.158473] [drm] Initialized i915 1.6.0 20080730 on minor 0
[   37.823593] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   37.825808] iwl3945 0000:0c:00.0: firmware: requesting iwlwifi-3945-1.ucode
[   37.967080] Registered led device: iwl-phy0:radio
[   37.967110] Registered led device: iwl-phy0:assoc
[   37.967171] Registered led device: iwl-phy0:RX
[   37.967189] Registered led device: iwl-phy0:TX
[   38.001315] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   42.887035] [drm:i915_get_vblank_counter] *ERROR* trying to get vblank count for disabled pipe 0
[   65.622137] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   65.820342] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   66.020181] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   66.220181] wlan0: authentication with AP 00:1d:68:6b:f1:39 timed out
[   83.426670] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   83.427419] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   83.624187] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   83.824193] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   84.024185] wlan0: authentication with AP 00:1d:68:6b:f1:39 timed out
[   95.626076] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   95.824064] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   96.024166] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[   96.224170] wlan0: authentication with AP 00:1d:68:6b:f1:39 timed out
[  113.424981] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  113.429815] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  113.632043] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  113.831718] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  114.028034] wlan0: authentication with AP 00:1d:68:6b:f1:39 timed out
[  131.231906] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  131.232738] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  131.432039] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 2
[  131.632125] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  131.836074] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  145.627856] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  145.629653] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  145.828070] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 2
[  146.028045] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  146.244030] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  163.866027] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  163.866901] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  164.068036] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 2
[  164.264039] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  164.468033] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  181.672824] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  181.673582] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  181.876640] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 2
[  182.076053] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  182.276051] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  199.470824] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  199.471520] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  199.668087] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 2
[  199.868059] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  200.072036] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  215.635841] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  215.643307] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 1
[  215.841221] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 2
[  216.040061] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  216.240038] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  219.016083] wlan0 direct probe responded
&lt;.... snip (more of the same) ...&gt;

[  984.241056] wlan0: direct probe to AP 00:1d:68:6b:f1:39 try 3
[  984.441054] wlan0: direct probe to AP 00:1d:68:6b:f1:39 timed out
[  997.073581] wlan0 direct probe responded
[  997.073588] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  997.276034] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  997.472968] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[  997.681073] wlan0: authentication with AP 00:1d:68:6b:f1:39 timed out
[ 3112.138020] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[ 3112.138664] wlan0: authenticate with AP 00:1d:68:6b:f1:39
[ 3112.166703] wlan0: authenticated
[ 3112.166714] wlan0: associate with AP 00:1d:68:6b:f1:39
[ 3112.367040] wlan0: associate with AP 00:1d:68:6b:f1:39
[ 3112.569548] wlan0: associate with AP 00:1d:68:6b:f1:39
[ 3112.696327] wlan0: RX AssocResp from 00:1d:68:6b:f1:39 (capab=0x411 status=0 aid=2)
[ 3112.696334] wlan0: associated
[ 3112.701082] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
</pre></p>
<p style="text-align:justify;"><strong>This isn&#8217;t the first time wi-fi has suddenly stopped working, but this was certainly the longest period for which it stopped.</strong> I have a hunch it might somehow be connected to the laptop overheating, but I&#8217;m yet to find a way to verify this theory of mine.</p>
<p>&#8212;<br />
Versions: Linux xxx 2.6.28-14-generic #46-Ubuntu SMP i686 GNU/Linux</p>
<br />Posted in Linux Tagged: issues, Linux, ubuntu <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/isching.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/isching.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/isching.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/isching.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/isching.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/isching.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/isching.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/isching.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=isching.wordpress.com&amp;blog=8540793&amp;post=11&amp;subd=isching&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://isching.wordpress.com/2009/07/13/ubuntu-issue-sudden-loss-of-wifi-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb6c184ffa7106424d976bd4b60a00a8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">/n/</media:title>
		</media:content>
	</item>
	</channel>
</rss>
