<?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>Mike Gerwitz &#187; Guides</title>
	<atom:link href="http://mikegerwitz.com/cat/guides/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikegerwitz.com</link>
	<description>Free Software Hacker</description>
	<lastBuildDate>Mon, 07 May 2012 14:14:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SSH public key still prompting for password</title>
		<link>http://mikegerwitz.com/ssh-public-key-still-prompting-for-password/</link>
		<comments>http://mikegerwitz.com/ssh-public-key-still-prompting-for-password/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 21:57:42 +0000</pubDate>
		<dc:creator>Mike Gerwitz</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://mikegerwitz.com/?p=401</guid>
		<description><![CDATA[This was one of those problems that irritated me considerably, since the solution was the last thing that I tried. The issue was that, I noticed, my private key for one of my users on one of my boxes was no longer being accepted. It was still prompting for the password. I tried regenerating the [...]]]></description>
			<content:encoded><![CDATA[<p>This was one of those problems that irritated me considerably, since the solution was the last thing that I tried. The issue was that, I noticed, my private key for one of my users on one of my boxes was no longer being accepted. It was still prompting for the password. I tried regenerating the key, clearing out <tt>~/.ssh/authorized_keys</tt>, reconfiguring ssh, reinstalling <acronym title="Secure Shell">SSH</acronym>&#8230;of course, the logical thing to do would have been to check the logs. But for whatever reason, I saved that for last.</p>
<p>When attempting to log into the server, I was prompted for a password as if the server did not have my public key. It certainly did. Checking <tt>/var/log/auth.log</tt>, I noticed this:</p>
<blockquote><p>
# /var/log/auth.log<br />
Nov  2 17:47:37 hostname sshd[2053]: Authentication refused: bad ownership or modes for directory /home/myuser
</p></blockquote>
<p>Somehow (likely due to user error), the permissions for <tt>/home/myuser</tt> was set to <tt>0777</tt>!</p>

<div class="wp_codebox"><table><tr id="p4014"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p401code4"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-lah</span> <span style="color: #000000; font-weight: bold;">/</span>home <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> myuser
drwxrwxrwx <span style="color: #000000;">119</span> myuser myuser 8.0K <span style="color: #000000;">2010</span>-<span style="color: #000000;">11</span>-02 <span style="color: #000000;">17</span>:<span style="color: #000000;">45</span> myuser</pre></td></tr></table></div>

<p>The solution was to restore the directory permissions to what they should be &#8211; r/w access for the owner only.</p>

<div class="wp_codebox"><table><tr id="p4015"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p401code5"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> 0755 ~myuser
$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-lah</span> <span style="color: #000000; font-weight: bold;">/</span>home <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> myuser
drwxr-xr-x <span style="color: #000000;">119</span> myuser myuser 8.0K <span style="color: #000000;">2010</span>-<span style="color: #000000;">11</span>-02 <span style="color: #000000;">17</span>:<span style="color: #000000;">45</span> myuser</pre></td></tr></table></div>

<p>Hopefully now you&#8217;ll be able to log in with your private key.</p>

<div class="wp_codebox"><table><tr id="p4016"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p401code6"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> myhost
$ <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>auth.log
Nov  2 17:50:36 <span style="color: #c20cb9; font-weight: bold;">hostname</span> sshd<span style="color: #7a0874; font-weight: bold;">&#91;</span>2212<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Accepted publickey <span style="color: #000000; font-weight: bold;">for</span> myuser from 192.168.1.XXX port XXXXX ssh2</pre></td></tr></table></div>
]]></content:encoded>
			<wfw:commentRss>http://mikegerwitz.com/ssh-public-key-still-prompting-for-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing BASH Command History</title>
		<link>http://mikegerwitz.com/clearing-bash-command-history/</link>
		<comments>http://mikegerwitz.com/clearing-bash-command-history/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 07:48:35 +0000</pubDate>
		<dc:creator>Mike Gerwitz</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://www.mikegerwitz.com/2008/09/07/clearing-bash-command-history/</guid>
		<description><![CDATA[BASH (bourne again shell), the default shell used on many GNU/Linux distributions, keeps a history of all commands entered. This can be a great convenience. However, scrolling back, I saw a number of commands I would prefer gone in case somebody decided to snoop around my system. Especially the commands where I accidently entered the [...]]]></description>
			<content:encoded><![CDATA[<p><acronym title="Bourne Again Shell">BASH</acronym> (bourne again shell), the default shell used on many <acronym title="GNU's Not Unix!">GNU</acronym>/Linux distributions, keeps a history of all commands entered. This can be a great convenience. However, scrolling back, I saw a number of commands I would prefer gone in case somebody decided to snoop around my system. Especially the commands where I accidently entered the root password in the shell. I&#8217;m sure it&#8217;s happened to many of you before too &#8211; you think you type &#8220;su&#8221;, but something happens and it doesn&#8217;t enter. So then you type your password, not noticing (in my case, I may be reading a chat or article while I&#8217;m typing it in), and then BAM &#8211; it&#8217;s entered in the <acronym title="Bourne Again Shell">BASH</acronym> command history.</p>
<p>So, when going through my home folder one day, I came across a hidden file called <tt>.bash_history</tt>. Hmm, I wondered. Could this solve my problem? Yes! It can!</p>

<div class="wp_codebox"><table><tr id="p3810"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p38code10"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">rm</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_history
<span style="color: #666666; font-style: italic;"># You can also clear your history with the following command:</span>
$ <span style="color: #7a0874; font-weight: bold;">history</span> <span style="color: #660033;">-c</span></pre></td></tr></table></div>

<p>After deleting the file, open <acronym title="Bourne Again Shell">BASH</acronym> and hit the up key &#8211; you should get nothing but a pleasant beep. A wonderful representation of security. Of course, it&#8217;d be best to shred the file using a utility such as, well, <tt>shred</tt>, so that nobody can retrieve the deleted contents. Note that you can only use the below command to shred the file if you haven&#8217;t already deleted it.</p>

<div class="wp_codebox"><table><tr id="p3811"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p38code11"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">shred</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_history</pre></td></tr></table></div>

<p>And all should be well. But, what if you don&#8217;t want it to keep a track of your history? Well, there&#8217;s a couple ways to do so. I pulled the examples from the following link:</p>
<p><a href="http://gentoo-wiki.com/SECURITY_Bash_History_Functions">http://gentoo-wiki.com/SECURITY_Bash_History_Functions</a></p>
<p>The easiest one, which I did (I don&#8217;t feel like wasting any more time on this), was the following command:</p>

<div class="wp_codebox"><table><tr id="p3812"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p38code12"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null ~<span style="color: #000000; font-weight: bold;">/</span>.bash_history</pre></td></tr></table></div>

<p>This creates a link so that <tt>.bash_history</tt> points to <tt>/dev/null</tt>. Anything sent to <tt>/dev/null</tt> never returns &#8211; thus the name. It is simply discarded.</p>]]></content:encoded>
			<wfw:commentRss>http://mikegerwitz.com/clearing-bash-command-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo: Spellchecking in GTK Applications</title>
		<link>http://mikegerwitz.com/gentoo-spellchecking-in-gtk-applications/</link>
		<comments>http://mikegerwitz.com/gentoo-spellchecking-in-gtk-applications/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 07:26:37 +0000</pubDate>
		<dc:creator>Mike Gerwitz</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Gentoo]]></category>

		<guid isPermaLink="false">http://www.mikegerwitz.com/2008/09/07/gentoo-spellchecking-in-gtk-applications/</guid>
		<description><![CDATA[Since I last installed Gentoo, I noticed spellchecking in many applications wasn&#8217;t working &#8211; notable Pidgin and Xchat. It&#8217;s a necessity! You need to come off as someone who knows how to spell while chatting! It seems the problem was with myspell &#8211; the English dictionary for some reason was not installed. So, it was [...]]]></description>
			<content:encoded><![CDATA[<p>Since I last installed Gentoo, I noticed spellchecking in many applications wasn&#8217;t working &#8211; notable Pidgin and Xchat. It&#8217;s a necessity! You need to come off as someone who knows how to spell while chatting! <img src='http://mikegerwitz.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>It seems the problem was with myspell &#8211; the English dictionary for some reason was not installed. So, it was a simple fix:</p>

<div class="wp_codebox"><table><tr id="p3715"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p37code15"><pre class="bash" style="font-family:monospace;">$ emerge myspell-en</pre></td></tr></table></div>

<p>Restart the programs and it should work. It may also help to ensure you have your LINGUAS variable set in <tt>make.conf</tt>. For example:</p>

<div class="wp_codebox"><table><tr id="p3716"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p37code16"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LINGUAS</span>=<span style="color: #ff0000;">&quot;en_US en&quot;</span></pre></td></tr></table></div>
]]></content:encoded>
			<wfw:commentRss>http://mikegerwitz.com/gentoo-spellchecking-in-gtk-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RT61 / RT2x00 RaLink Linux Driver Installation</title>
		<link>http://mikegerwitz.com/rt61-rt2x00-ralink-linux-driver-installation/</link>
		<comments>http://mikegerwitz.com/rt61-rt2x00-ralink-linux-driver-installation/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 04:13:03 +0000</pubDate>
		<dc:creator>Mike Gerwitz</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.mikegerwitz.com/2008/08/30/rt61-rt2x00-ralink-linux-driver-installation/</guid>
		<description><![CDATA[2.6.27 kernel note: Everything works properly in 2.6.27 if you compile the kernel with support for rt61 (or your driver). Run make menuconfig in your kernel source directory (usually /usr/src/linux) and locate the RaLink driver you need in Device Drivers -&#62; Network Device Support -&#62; Wireless Lan. It is located at the bottom. If you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>2.6.27 kernel note: </strong>Everything works properly in 2.6.27 if you compile the kernel with support for rt61 (or your driver). Run <tt>make menuconfig</tt> in your kernel source directory (usually /usr/src/linux) and locate the RaLink driver you need in Device Drivers -&gt; Network Device Support -&gt; Wireless Lan. It is located at the bottom. If you compile it as a module, remember to modprobe.</p>
<p><strong>Crash note:</strong> Pre-2.6.27 (I was using 2.6.26), my PC would simply restart and complain about a Hyper Transport sync flood error once it rebooted (BIOS message). This would happen when the driver was loaded and the card was in use. I have not yet had this problem with the 2.6.27 kernel.</p>
<p>I recently purchased a Linksys wireless PCI card for my home computer and ran into a few problems with the driver installation under Gentoo using a 2.6.26 kernel. A simple &#8220;emerge rt61&#8243; command would not work &#8211; the sources would not compile. I tried a number of things, including compiling support with the kernel (as included in 2.6.24 and up), but that still did not work.</p>
<p>Yes, this will require some compiling &#8211; but don&#8217;t be afraid of it. The process is quite simple.</p>
<p>First, to find out if we&#8217;re talking about the same type of card here, type <tt>lspci</tt> as root. Below is my output:</p>
<p><code>01:07.0 Network controller: RaLink RT2561/RT61 802.11g PCI</code></p>
<p>RaLink provides open source drivers for this card on their website, however, as I stated above, they do not seem to compile with 2.6.26 kernels. I finally came across the following wiki page:</p>
<p><a href="http://gentoo-wiki.com/HARDWARE_rt2x00#Open_Source_rt2x00">http://gentoo-wiki.com/HARDWARE_rt2x00</a></p>
<p>The &#8220;Open Source&#8230;&#8221; section contains the information I used to get my card working. Be sure to read it in addition to this entry, as it provides you with additional information such as necessary kernel configuration options. The wiki page then instructs you to download the open source drivers that pertain to your card from the following website:</p>
<p><a href="http://rt2x00.serialmonkey.com/wiki/index.php?title=Main_Page">http://rt2x00.serialmonkey.com/wiki/index.php?title=Main_Page</a></p>
<p>In my case, the drivers I needed were &#8220;rt61&#8243;. Select the drivers that pertain to your system as stated by lspci. Download it, extract it, compile, and install (as root). Be sure to replace the wget <acronym title="Uniform Resource Locator">URL</acronym> below with the <acronym title="Uniform Resource Locator">URL</acronym> to the <acronym title="Concurrent Versions System">CVS</acronym> tarball you require:</p>
<p><code><br />
$ wget http://rt2x00.serialmonkey.com/rt61-cvs-daily.tar.gz<br />
$ tar -xzvf *.tar.gz<br />
$ cd rt*/Module<br />
$ make<br />
$ make install<br />
</code></p>
<p>That should be it! Again, as root, attempt to load the kernel module. Again, this will differ based off of the driver you installed:</p>
<p><code>$ modprobe rt61pci</code></p>
<p>At this point, the wiki does not go any further. So, if you don&#8217;t know how to manually configure wireless network settings, you&#8217;re kinda screwed. First, let&#8217;s make sure your wireless card is properly recognized:</p>
<p><code><br />
$ iwconfig<br />
$ iwlist wlan0 scan<br />
</code></p>
<p>When running the first command, you should see additional information next to &#8220;wlan0&#8243; or a similar device. When running the second, you should see a list of all available networks within range. If you do NOT, then you may not have set it up correctly. Refer to the wiki and driver documentation for more information.</p>
<p>The problem only is, it is not yet set up. So, let&#8217;s get to that. In the Module directory of the tarball you extracted (if you haven&#8217;t closed the terminal you ran the <tt>make</tt> command in, you&#8217;re in the correct directory) there is a README file. Direct your attention to the &#8220;Configuration&#8221; section.</p>
<h1>Wireless Configuration &#8211; <acronym title="Graphical User Interface">GUI</acronym></h1>
<p>It provides two options &#8211; a <acronym title="Graphical User Interface">GUI</acronym> or manual configuration. Let&#8217;s start with the GUI:</p>
<p><a href="http://rt2x00.serialmonkey.com/wiki/index.php/Downloads">http://rt2x00.serialmonkey.com/wiki/index.php/Downloads</a></p>
<p>Download the graphical configuration tool. After you extract it, you will have to compile it:</p>
<p><code><br />
$ ./configure.sh<br />
$ make &amp;&amp; make install<br />
</code></p>
<p>You may then run the command <tt>rutilt</tt>. If it does not recognize the command as root, try running it as a normal user. When needed, it will prompt you for your root password. Use the &#8220;Site Survey&#8221; tab and click &#8220;Scan&#8221; to list the available networks. Then, simply select one, enter the necessary information (such as the key, if you have one) and you should be on your way!</p>
<h1>Wireless Configuration &#8211; Manual &amp; Start on Boot</h1>
<p>I noticed that when I upgraded my kernel to 2.6.27 and used the built-in driver rather than the one discussed above, the <acronym title="Graphical User Interface">GUI</acronym> tool no longer worked. I wanted to abandon it anyway &#8211; I didn&#8217;t want to set up my configuration every time I started my computer. I wanted it to start up automatically.</p>
<p>I referenced the following link from the Gentoo documentation:</p>
<p><a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&amp;chap=4">http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&amp;chap=4</a></p>
<p>Take a look over it and decide what method you would like to use. I decided to go with wireless-tools. In the example below, I am using DHCP to keep things simple. If DHCP works for you, then you can get into manually configuring your <acronym title="Internet Protocol">IP</acronym> address. Again, refer to the documentation for more information, as this is just an example and provides little explanation.</p>
<p>In the example below, the ESSID I&#8217;m attempting to connect to is &#8220;Gerwitz Wireless Network&#8221; which uses an open WEP <acronym title="American Standard Code for Information Interchange">ASCII</acronym> key. I replaced my actual key below with &#8220;XXXXX&#8221;.</p>
<p><code><br />
$ emerge -av wireless-tools<br />
$ vi /etc/conf.d/net</code></p>
<p>&#8212;&#8211;</p>
<p><strong>/etc/conf.d/net:</strong><br />
<code><br />
modules=( "iwconfig" );</code></p>
<p>key_Gerwitz_Wireless_Network=&#8221;[1] s:XXXXX key [1] enc open&#8221;</p>
<p>preferred_aps=( &#8220;Gerwitz_Wireless_Network&#8221; )</p>
<p>config_Gerwitz_Wireless_Network=( &#8220;dhcp&#8221; )<br />
fallback_Gerwitz_Wireless_Network=(&#8221; 192.168.1.10/24&#8243; )<br />
fallback_route_Gerwitz_Wireless_Network=( &#8220;default via 192.168.1.1&#8243; )</p>
<p>&#8212;&#8211;</p>
<p><code><br />
$ /etc/init.d/wlan0 restart<br />
* Caching service dependencies ...                                     [ ok ]<br />
* Bringing down interface wlan0<br />
* Bringing up interface wlan0<br />
*   Configuring wireless network for wlan0<br />
*   Scanning for access points<br />
*     Found "Gerwitz Wireless Network" at 00:15:E9:76:1A:EE, managed, encrypted<br />
*   Connecting to "Gerwitz Wireless Network" in managed mode (WEP enabled - open) ...                                                                [ ok ]<br />
*     wlan0 connected to SSID "Gerwitz Wireless Network" at 00:15:E9:76:1A:EE<br />
*     in managed mode (WEP enabled - open)<br />
*   dhcp ...<br />
*     Running dhcpcd ...<br />
wlan0: dhcpcd 4.0.1 starting<br />
wlan0: broadcasting for a lease<br />
wlan0: offered 192.168.1.103 from 192.168.1.1<br />
wlan0: checking 192.168.1.103 is available on attached networks<br />
wlan0: acknowledged 192.168.1.103 from 192.168.1.1<br />
wlan0: leased 192.168.1.103 for 10800 seconds                           [ ok ]<br />
*     received address 192.168.1.103/24                                [ ok ]<br />
</code></p>
<p>Remember to replace &#8220;wlan0&#8243; with your interface. It should now start up on boot.</p>
<p>Granted, this guide does not cover everything &#8211; it is simply to help you to get your card working.</p>]]></content:encoded>
			<wfw:commentRss>http://mikegerwitz.com/rt61-rt2x00-ralink-linux-driver-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.04 &#8220;Hardy Heron&#8221; Broadcom Wireless</title>
		<link>http://mikegerwitz.com/ubuntu-804-hardy-heron-broadcom-wireless/</link>
		<comments>http://mikegerwitz.com/ubuntu-804-hardy-heron-broadcom-wireless/#comments</comments>
		<pubDate>Thu, 15 May 2008 08:21:57 +0000</pubDate>
		<dc:creator>Mike Gerwitz</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.mikegerwitz.com/2008/05/15/ubuntu-804-hardy-heron-broadcom-wireless/</guid>
		<description><![CDATA[Ubuntu 8.04 LTS was recently released. So I upgraded a couple of my computers (that I&#8217;m far too lazy and have no time to maintain Gentoo on) to this new release to find that my wireless PCMCIA card did not work on my laptop. Okay &#8211; that&#8217;s fine. I&#8217;ve had this problem since I began [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ubuntu.com/">Ubuntu 8.04 LTS</a> was recently released. So I upgraded a couple of my computers (that I&#8217;m far too lazy and have no time to maintain <a href="http://www.gentoo.org/">Gentoo</a> on) to this new release to find that my wireless PCMCIA card did not work on my laptop. Okay &#8211; that&#8217;s fine. I&#8217;ve had this problem since I began using Linux years ago. However, unlike the previous release, Hardy Heron didn&#8217;t seem to list the driver for it in the restricted drivers. Granted, you need an internet connection to download the drivers either way, it would have been nice for it to say &#8220;Hey, we&#8217;ve got you covered!&#8221; So I was worried that it was for some reason removed from this release.</p>
<p>So, for those of you who have this problem &#8211; start by plugging it into a wired connection and updating your repositories (<tt>sudo apt-get update</tt>). Then in System -> Administration -> Hardware Drivers, the driver for your wireless device should be listed. Simply install it and restart and you should be good to go.</p>]]></content:encoded>
			<wfw:commentRss>http://mikegerwitz.com/ubuntu-804-hardy-heron-broadcom-wireless/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Sansa e280v2 Regrets &amp; Guide for GNU/Linux</title>
		<link>http://mikegerwitz.com/sansa-e280v2-regrets-guide-for-gnulinux/</link>
		<comments>http://mikegerwitz.com/sansa-e280v2-regrets-guide-for-gnulinux/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 04:58:20 +0000</pubDate>
		<dc:creator>Mike Gerwitz</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://www.mikegerwitz.com/?p=21</guid>
		<description><![CDATA[Well, I recently ordered a Sansa e280 from Amazon. I was looking for a good mp3 player that the open-source firmware RockBox supported. I noted that the v2 series was not supported, but Amazon did not state that it was such a model. You can imagine my disappointment once it arrived. After debating whether or [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I recently ordered a Sansa e280 from Amazon. I was looking for a good mp3 player that the open-source firmware <a href="http://www.rockbox.org/">RockBox</a> supported. I noted that the v2 series was not supported, but Amazon did not state that it was such a model. You can imagine my disappointment once it arrived.</p>
<p>After debating whether or not to return it, I decided to keep it. v2s are out now, so v1 I assume will be discontinued &#8211; RockBox will eventually support it. And I&#8217;d like to provide aid to the RockBox team however I can. Unfortunately I have not looked into the firmware so I will not be much help in the actual development, however I will provide whatever information I can regarding the player, as the dev team does not own any v2s.</p>
<h1>Using the Sansa e200v2 Series on <acronym title="GNU's Not Unix!">GNU</acronym>/Linux</h1>
<p>So, in deciding to keep it, I ran into a few problems. It was a bit frustrating, and in order to help save you guys some of the frustration, I&#8217;ll post some information on how to use it with <acronym title="GNU's Not Unix!">GNU</acronym>/Linux. Specifically, <a href="http://www.ubuntu.com/">Ubuntu Gutsy</a>.</p>
<p><span id="more-21"></span></p>
<h2>Connecting to your PC</h2>
<p>Right when my Sansa arrived, I had a big problem &#8211; Ubuntu didn&#8217;t seem to recognize it. Depending on your firmware version, there&#8217;s a couple ways to solve this. I assume this applies to other distributions as well.</p>
<p><strong>Before you begin, you need to load the necessary module.</strong> When it could not recognize my device, I checked dmesg and noticed the following message:</p>
<p><code>[38018.977087] usb 2-3: new high speed <acronym title="Universal Serial Bus">USB</acronym> device using ehci_hcd and address 6</code></p>
<p>Entering the following command in the terminal should solve the problem of your device not being recognized:</p>
<p><code>sudo modprobe ehci_hcd</code></p>
<p>You probably don&#8217;t want to run that command every time you restart your computer, so open /etc/modules in your favorite editor (I recommend VIM, but gedit may be easier for some) as root and add &#8220;ehci_hcd&#8221; to the list. For example:</p>
<p><code>sudo gedit /etc/modules</code></p>
<p><strong>Check your firmware version:</strong></p>
<ol>
<li>Start your Sansa e200v2 and navigate to the &#8220;Settings&#8221; menu</li>
<li>Scroll down to &#8220;Info&#8221; and select it</li>
<li>Note your firmware version at the top (ex: V03.01.14A)</li>
</ol>
<p><strong>Firmware version 03.01.14A:</strong><br />
You must put the device into MSC mode:</p>
<ol>
<li>Go back to the &#8220;Settings&#8221; menu</li>
<li>Select &#8220;<acronym title="Universal Serial Bus">USB</acronym> Mode&#8221;</li>
<li>Select &#8220;MSC&#8221;</li>
<li>Connect your device to the PC with the supplied <acronym title="Universal Serial Bus">USB</acronym> cable</li>
</ol>
<p><strong>Older v2 firmware versions (03.XX.XX)</strong><br />
You need to place the device into recovery mode:</p>
<ol>
<li>Turn the player off</li>
<li>Slide the top button into the lock position (toward the headphone jack)</li>
<li>Hold the rewind button (|&lt;&lt;)</li>
<li>Plug the <acronym title="Universal Serial Bus">USB</acronym> cable into the player and computer</li>
<li>Keep holding the button until your distribution recognizes the device (in Ubuntu Nautilus will display the device after it mounts)</li>
</ol>
<p><em>If your device did not mount, please ensure you loaded the ehci_hcd module as discussed above. Run &#8220;dmesg&#8221; from a terminal to see any errors if it still does not work.</em></p>
<h2>How to correctly disconnect</h2>
<p>If you just pull out the <acronym title="Universal Serial Bus">USB</acronym> cable from your device to disconnect from the computer after writing data, chances are you may lose something. If you have written data to the device, unmount the device before disconnecting the cable. Ubuntu users may use the following method:</p>
<ol>
<li>Open Nautilus (if it&#8217;s not open you can go to Places &#8211; Computer)</li>
<li>Either on the left sidebar or, if you&#8217;re in &#8220;Computer&#8221;, in the main area, right-click on your device (it may be labeled &#8220;sansa&#8221;, &#8220;disk&#8221;, etc)</li>
<li>Select &#8220;unmount&#8221;</li>
<li>Wait until a balloon states it is safe to disconnect the device, then you may remove the <acronym title="Universal Serial Bus">USB</acronym> cable.</li>
</ol>
<p>You may also use the &#8220;umount&#8221; command from the terminal.</p>
<h2>Upgrading the Firmware</h2>
<p>Above I mentioned two types of firmware. If you do not have the newest version, I recommend that you get it (so that the <acronym title="Universal Serial Bus">USB</acronym> Mode menu is available). To upgrade:</p>
<ol>
<li>First download the V03.01.14A firmware from <a href="http://anythingbutipod.com/forum/showthread.php?t=25425">this website</a></li>
<li>Connect your device to your PC and place the firmware file into the root directory of the device (for example, /media/disk). The root directory contains the AUDIBLE, MUSIC, PHOTO, RECORD and VIDEO directories.</li>
<li>Disconnect your device from the computer (<em>SEE ABOVE FOR THE CORRECT WAY TO DISCONNECT YOUR DEVICE</em>)</li>
</ol>
<h2>Alas, No OGG support</h2>
<p><em><a href="http://www.fsf.org/resources/formats/playogg"><img src="images/play_ogg_small.png" alt="Play Ogg" style="border: medium none " /></a></em></p>
<p>I was rather annoyed and disappointed to see that SanDisk did not add OGG support in their v2 series. All my music I had converted to OGG format from mp3s and I had deleted the old mp3 files. So, I had to convert all of them back (I still keep them in OGG format on my computer) in order for the Sansa to play them. Once RockBox works, out with the mp3s again.</p>
<h2>Copying Music to the Device</h2>
<p>Once your music is in MP3 format, you may copy it to your device simply by placing it into the &#8220;MUSIC&#8221; folder. You may organize the music however you wish &#8211; feel free to place them in their own subfolders. As long as they are within the MUSIC directory, Sansa will recognize them.</p>
<p>Note that, for users who use MTP mode (Windows users or Linux users with MTP support), those files are not visible in MSC mode. Similarly, files in MSC mode are not visible in MTP mode.</p>
<h2>Deleting Music from the Device</h2>
<p>In GNOME (I&#8217;m unsure with others), when you delete a file, it places it into a trash folder (unless you delete it with the &#8220;rm&#8221; command or use the Nautilus delete command rather than &#8220;Move to Trash). The files will not be removed from your device if you simply pull the <acronym title="Universal Serial Bus">USB</acronym> cable, but the device will no longer list the music. So, it&#8217;ll be taking up space, but will be in a hidden folder (.trash). So, use the above method to properly disconnect from the computer. If you do so, it&#8217;ll prompt you to empty the trash on the device.</p>
<h2>Music Metadata (Song Title &amp; Track Order Problems)</h2>
<p>You may notice that some of your music isn&#8217;t properly displayed. The title, artist, etc may be displayed as &#8220;Unknown&#8221;, or the title may be the filename. This was something that had frustrated me for a while. So, I have a fix for you.</p>
<p><strong>Download <a href="http://easytag.sourceforge.net/">EasyTag</a> (below step for Ubuntu users):</strong><br />
<code>sudo apt-get install easytag</code></p>
<p>Once you have EasyTag installed, run it (for Ubuntu users it&#8217;ll be under &#8220;Applications &#8211; Sound &amp; Video&#8221;). Don&#8217;t get too carried away yet. This is the part that frustrated me. If you try anything now, you may still have some problems. You&#8217;ll be able to save the track titles, artists, etc, however the track number will not properly save. So your tracks will be out of order. This is because the firmware does not support ID3v2.4, which is the default for EasyTag.</p>
<ol>
<li>Go to Settings &#8211; Preferences</li>
<li>Select the &#8220;ID3 Tag Settings&#8221; tab</li>
<li>Select &#8220;ID3v2.3&#8243; for Version</li>
<li>Click the &#8220;Save&#8221; button</li>
</ol>
<p>Now we can get to work. EasyTag will attempt to get as much information as it can from the filenames and other sources, so you should not have to enter much, if anything, by hand (I didn&#8217;t have to).</p>
<ol>
<li>On the left, navigate to your device&#8217;s MUSIC folder</li>
<li>Wait very patiently while EasyTag retrieves the songs. This may take a while if you have a large number of songs with long filenames.</li>
<li>All the songs listed in red have to be saved. Check through the list and make sure EasyTag generated them correctly and make modifications as needed. Or, just skip this step if you&#8217;re lazy and trust EasyTag&#8217;s skills.</li>
<li>Select &#8220;File &#8211; Save File(s)&#8221; or click the corresponding button in the toolbar</li>
<li>Don&#8217;t forget to unmount before disconnecting the <acronym title="Universal Serial Bus">USB</acronym> cable</li>
</ol>
<p>Tada! You should now have properly named songs and correct track listings.</p>
<h2>Album Art</h2>
<p>This one also bugged me. Some other sites suggested using EasyTag to embed the album art in the MP3 file itself, but it never worked for me. So I figured out some alternate solutions. The Sansa was designed to work with Windows Media Player, so I looked at some old folders back from when I used Windows, before I ditched it for <acronym title="GNU's Not Unix!">GNU</acronym>/Linux. It would save the album art as &#8220;Folder.jpg&#8221;. So I copied Folder.jpg to the folder containing the album I wanted art for on the device, and sure enough, it worked!</p>
<ol>
<li>Organize the tracks into folders for their albums</li>
<li>Get a hold of the album art for your tracks. I use <a href="http://www.exaile.org/">Exaile</a> as my media player, so I simply went to &#8220;.exaile&#8221; in my home folder and retrieved the album art from there.</li>
<li>Place the album art in the folder containing the tracks for that album, and rename the file to either &#8220;Folder.jpg&#8221; or &#8220;Album Art.jpg&#8221;. Case-sensitive.</li>
</ol>
<p>Enjoy your album art <img src='http://mikegerwitz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Playlists</h2>
<p>Yes, the v2 series supports M3U playlists! In EasyTag, you can generate a playlist by selecting files and clicking &#8220;Write Playlist&#8230;&#8221; in the toolbar. Save it anywhere in the MUSIC folder &#8211; you may also save them in sub-directories.</p>
<h2>Rockbox Development Progress</h2>
<p>I&#8217;ll add more information on the Sansa if I can recall what else I had looked into. However, my true interest is in RockBox. Therefore, you can track the progress via the following links:</p>
<p><a href="http://www.rockbox.org/twiki/bin/view/Main/SansaE200v2">http://www.rockbox.org/twiki/bin/view/Main/SansaE200v2</a><br />
<a href="http://forums.rockbox.org/index.php?topic=13961.0">http://forums.rockbox.org/index.php?topic=13961.0</a><br />
<a href="http://forums.rockbox.org/index.php?topic=14064.0">http://forums.rockbox.org/index.php?topic=14064.0</a></p>
<p>Good luck!</p>]]></content:encoded>
			<wfw:commentRss>http://mikegerwitz.com/sansa-e280v2-regrets-guide-for-gnulinux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

