<?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>Alex Sleat &#187; 10.04</title>
	<atom:link href="http://alexsleat.co.uk/tag/10-04/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexsleat.co.uk</link>
	<description>/home/alex</description>
	<lastBuildDate>Mon, 21 May 2012 22:17:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>fatal error: libconfig.h: No such file or directory &#124; Ubuntu 12.04</title>
		<link>http://alexsleat.co.uk/2012/05/16/fatal-error-libconfig-h-no-such-file-or-directory-ubuntu-12-04/</link>
		<comments>http://alexsleat.co.uk/2012/05/16/fatal-error-libconfig-h-no-such-file-or-directory-ubuntu-12-04/#comments</comments>
		<pubDate>Wed, 16 May 2012 11:30:46 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[11.10]]></category>
		<category><![CDATA[libconfig-dev]]></category>
		<category><![CDATA[libconfig.h]]></category>
		<category><![CDATA[ubuntu 12.04]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=31049</guid>
		<description><![CDATA[<br/><p>If you&#8217;re getting the following error:</p> fatal error: libconfig.h: No such file or directory <p>Then you&#8217;re probably missing the libconfig-dev package from your system. Simply run the following command and it&#8217;ll fix it:</p> sudo apt-get install libconfig-dev ]]></description>
			<content:encoded><![CDATA[<br/><p>If you&#8217;re getting the following error:</p>
<div class="dean_ch" style="white-space: wrap;">fatal error: libconfig.h: No such <span class="kw2">file</span> or directory</div>
<p>Then you&#8217;re probably missing the libconfig-dev package from your system. Simply run the following command and it&#8217;ll fix it:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> apt-get <span class="kw2">install</span> libconfig-dev</div>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2012/05/16/fatal-error-libconfig-h-no-such-file-or-directory-ubuntu-12-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gimp: error while loading shared libraries: libgegl-0.0.so.0: cannot open shared object file: No such file or directory</title>
		<link>http://alexsleat.co.uk/2012/05/02/gimp-error-while-loading-shared-libraries-libgegl-0-0-so-0-cannot-open-shared-object-file-no-such-file-or-directory/</link>
		<comments>http://alexsleat.co.uk/2012/05/02/gimp-error-while-loading-shared-libraries-libgegl-0-0-so-0-cannot-open-shared-object-file-no-such-file-or-directory/#comments</comments>
		<pubDate>Wed, 02 May 2012 09:08:05 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[11.10]]></category>
		<category><![CDATA[12.04]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[cannot open shared object file]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[libgegl]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[oneiric]]></category>
		<category><![CDATA[precise]]></category>
		<category><![CDATA[shared libraries]]></category>
		<category><![CDATA[sources.list]]></category>
		<category><![CDATA[symbolic link]]></category>
		<category><![CDATA[ubuntu 12.04]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=30417</guid>
		<description><![CDATA[<br/><p>After upgrading from Ubuntu 11.10 to 12.04 I found gimp couldn&#8217;t access the shared libraries it needed, most likely an error with symbolic links as described by lovelyindia in this post. </p> Fix 1: <p>He managed to fix the issue by removing gimp and purging the offending libraries and then letting apt deal with [...]]]></description>
			<content:encoded><![CDATA[<br/><p>After upgrading from Ubuntu 11.10 to 12.04 I found gimp couldn&#8217;t access the shared libraries it needed, most likely an error with symbolic links as described by lovelyindia in <a href="http://bentwithlove.blogspot.co.uk/2011/05/gimperror-while-loading-shared.html">this post</a>. </p>
<h3>Fix 1:</h3>
<p>He managed to fix the issue by removing gimp and purging the offending libraries and then letting apt deal with the libraries when he re-installed gimp, as per the below commands:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> apt-get update <br />
<span class="kw2">sudo</span> apt-get purge <span class="kw2">gimp</span> libgegl* libbabl* <br />
<span class="kw2">sudo</span> apt-get <span class="kw2">install</span> <span class="kw2">gimp</span> <br />
<span class="kw2">sudo</span> apt-get clean</div>
<p>While this is likely to work for most people encountering this issue, it didn&#8217;t for me.</p>
<h3>Fix 2:</h3>
<p>Then I remembered I had used the repogen <a href="http://repogen.simplylinux.ch/">source list generator</a>, in which I chose to include the gimp svn build. While you may not have gone about it the same way, you may also have a different repository in your sources.list file which is causing this issue, if the previous method did not resolve the issue.</p>
<p>In order to fix this, I had to open the sources.list file and comment out the offending repo.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> gedit /etc/apt/sources.list</div>
<p>Now search for any reference to gimp, in my case this was the lines I changed:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#### Gimp SVN &#8211; https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn</span><br />
<span class="re3">## Run this <span class="kw3">command</span>: <span class="kw2">sudo</span> apt-key adv &#8211;recv-keys &#8211;keyserver keyserver.ubuntu.com 405A15CB</span><br />
deb http://ppa.launchpad.net/matthaeus123/mrw-gimp-svn/ubuntu precise main</div>
<p>I commented out the line linking to the repo by adding a &#8216;#&#8217; to the front, as below:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#### Gimp SVN &#8211; https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn</span><br />
<span class="re3">## Run this <span class="kw3">command</span>: <span class="kw2">sudo</span> apt-key adv &#8211;recv-keys &#8211;keyserver keyserver.ubuntu.com 405A15CB</span><br />
<span class="re3"># deb http://ppa.launchpad.net/matthaeus123/mrw-gimp-svn/ubuntu precise main</span></div>
<p>I then uninstalled gimp, once I knew it may have been the newly added repository that I had added:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> apt-get purge <span class="kw2">gimp</span></div>
<p>Then I saved and exited the file and updated apt:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> apt-get update</div>
<p>I then re-installed gimp:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> apt-get <span class="kw2">install</span> <span class="kw2">gimp</span></div>
<p>This solved the issue for me, I hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2012/05/02/gimp-error-while-loading-shared-libraries-libgegl-0-0-so-0-cannot-open-shared-object-file-no-such-file-or-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 12.04 &#8211; Moving The Windows Buttons Back To The Right.</title>
		<link>http://alexsleat.co.uk/2012/04/11/ubuntu-12-04-moving-the-windows-buttons-back-to-the-right/</link>
		<comments>http://alexsleat.co.uk/2012/04/11/ubuntu-12-04-moving-the-windows-buttons-back-to-the-right/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 12:20:41 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.11]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[11.10]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[maximise]]></category>
		<category><![CDATA[minimise]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[ubuntu 12.04]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=29665</guid>
		<description><![CDATA[<br/><p>Those pesky windows buttons (maximise, minimise and close) default to the left of the menu bar after a new Ubuntu installations, and it&#8217;s been happening since 10.04. Most people, like myself, are stuck in our ways and just want them back where they belong. It&#8217;s pretty easy to do this, just open up a [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Those pesky windows buttons (maximise, minimise and close) default to the left of the menu bar after a new Ubuntu installations, and it&#8217;s been happening since 10.04. Most people, like myself, are stuck in our ways and just want them back where they belong. It&#8217;s pretty easy to do this, just open up a terminal (ctrl+alt+t) and copy in the following:</p>
<div class="dean_ch" style="white-space: wrap;">gconftool -s /apps/met&gt;gconftool -s /apps/met&gt;gconftool -s /apps/metacity/general/button_layout -t string menu:minimize,maximize,close</div>
<p>Once you hit enter, you should see the buttons return to their rightful place on the right, also in the right order.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2012/04/11/ubuntu-12-04-moving-the-windows-buttons-back-to-the-right/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Switching Between Two Resolutions in Linux</title>
		<link>http://alexsleat.co.uk/2011/10/24/switching-between-two-resolutions-in-linux/</link>
		<comments>http://alexsleat.co.uk/2011/10/24/switching-between-two-resolutions-in-linux/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 19:56:06 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[blog1]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[11.10]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[tv]]></category>
		<category><![CDATA[xorg]]></category>
		<category><![CDATA[xrandr]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=22690</guid>
		<description><![CDATA[<br/><p>I have a TV and my monitor connected to my PC by a VGA switch box but what&#8217;s annoying is they aren&#8217;t the same resolution. This causes problems because I can&#8217;t see what I&#8217;m doing when I have switched to TV and usually have to leave the setting manager open so that when I [...]]]></description>
			<content:encoded><![CDATA[<br/><p>I have a TV and my monitor connected to my PC by a VGA switch box but what&#8217;s annoying is they aren&#8217;t the same resolution. This causes problems because I can&#8217;t see what I&#8217;m doing when I have switched to TV and usually have to leave the setting manager open so that when I change between them I just have to hit return and the resolution changes. That&#8217;s great and all but it&#8217;s far more effort than I want for something I do fairly often.</p>
<p>My plan was initially to create two xorg.conf files and switch between them using a script, I figured this would be the easiest way even though I haven&#8217;t messed around with xorg stuff for a few years ever since things just started working better in Linux. Turns out I couldn&#8217;t even find where they keep the xorg.conf file, it sure isn&#8217;t in /etc/X11 where it was the last time I looked..</p>
<p>On the search for this file though I came across another useful tool called xrandr, which essentially allows you to change the resolution from the command line.</p>
<blockquote>
<p style="text-align: left;">Xrandr is used to set the size, orientation and/or reflection of the outputs for a<br />
screen. It can also set the screen size.</p>
<p style="text-align: left;">If invoked without any option, it will dump the state of the outputs, showing the<br />
existing modes for each of them, with a &#8216;+&#8217; after the preferred mode and a &#8216;*&#8217;<br />
after the current mode.</p>
<p style="text-align: left;">There are a few global options. Other options modify the last output that is spec‐<br />
ified in earlier parameters in the command line. Multiple outputs may be modified<br />
at the same time by passing multiple &#8211;output options followed immediately by<br />
their corresponding modifying options.</p>
</blockquote>
<p style="text-align: right;">For more information on xrandr check out the <a href="http://linux.die.net/man/1/xrandr">manual page</a> (or type <em>man xrandr</em> in terminal).</p>
<p style="text-align: left;">It turns out it&#8217;s an extremely easy tool to use, with a command as simple as the following changing the resolution:</p>
<div class="dean_ch" style="white-space: wrap;">xrandr &#8211;output VGA1 &#8211;mode 1440&#215;900</div>
<p>So the next thing I did was create the following script which allows the resolution to switch between 1440&#215;900 and 1360&#215;768 (my monitor and my TV native resolutions).</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#!/bin/bash</span></p>
<p><span class="re2">TV=</span><span class="st0">&quot;1360 x 768&quot;</span><br />
<span class="re2">MONITOR=</span><span class="st0">&quot;1440 x 900&quot;</span></p>
<p><span class="re2">TEST=</span><span class="st0">&quot;$(xrandr | grep current | sed -e &#8216;s/.*current //;s/, maximum.*//&#8217;)&quot;</span></p>
<p><span class="re3">#echo <span class="re1">$TEST</span></span></p>
<p><span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;$TEST&quot;</span> == <span class="st0">&quot;$MONITOR&quot;</span> <span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xrandr &#8211;output VGA1 &#8211;mode 1360&#215;768</p>
<p><span class="kw1">elif</span> <span class="br0">&#91;</span> <span class="st0">&quot;$TEST&quot;</span> == <span class="st0">&quot;$TV&quot;</span> <span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xrandr &#8211;output VGA1 &#8211;mode 1440&#215;900</p>
<p><span class="kw1">else</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">exit</span></p>
<p><span class="kw1">fi</span></div>
<p>This script simply checks what the current resolution is being used and then toggles between the two set resolutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/10/24/switching-between-two-resolutions-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenShot, libmp3lame and Ubuntu</title>
		<link>http://alexsleat.co.uk/2011/04/28/openshot-libmp3lame-and-ubuntu/</link>
		<comments>http://alexsleat.co.uk/2011/04/28/openshot-libmp3lame-and-ubuntu/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 22:36:18 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[11.10]]></category>
		<category><![CDATA[12.04]]></category>
		<category><![CDATA[avi]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[h.264]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[libavformat]]></category>
		<category><![CDATA[libmp3lame]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[mov]]></category>
		<category><![CDATA[mpeg]]></category>
		<category><![CDATA[openshot]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=15424</guid>
		<description><![CDATA[<br/><p></p> <p>If you&#8217;re getting the following error while trying export a video under several different codecs in OpenShot including AVI, MOV and MPEG using (mpeg2, mpeg4 or h.264) chances are this might help you with that error.</p> <p>The following formats/codecs are missing from your system:</p> <p>libmp3lame</p> <p>You will not be able to use the [...]]]></description>
			<content:encoded><![CDATA[<br/><p><a href="http://alexsleat.co.uk/wp-content/uploads/2011/04/Screenshot-26.png"><img class="aligncenter size-full wp-image-15425" title="Screenshot-26" src="http://alexsleat.co.uk/wp-content/uploads/2011/04/Screenshot-26.png" alt="" width="478" height="214" /></a></p>
<p>If you&#8217;re getting the following error while trying export a video under several different codecs in OpenShot including AVI, MOV and MPEG using (mpeg2, mpeg4 or h.264) chances are this might help you with that error.</p>
<blockquote><p>The following formats/codecs are missing from your system:</p>
<p>libmp3lame</p>
<p>You will not be able to use the selected export profile. You will need to install the missing formats/codecs or choose a different export profile.</p></blockquote>
<p><strong>This is a simple fix:</strong></p>
<ul>
<li>Open up Synaptic Package Manager</li>
<li>Search &#8220;libavformat&#8221;,</li>
<ul>
<li>If the current package installed is <em>&#8220;libavformat52&#8243;</em> select <em>&#8220;libavformat-extra-52&#8243;</em> (alternativly <em>&#8220;libavformat-unstripped-52&#8243;</em> should also work).</li>
<li>Else the package might be <em>&#8220;libavformat53&#8243;</em> so simply change to<em> &#8220;libavformat-extra-53&#8243;, </em>basically it might end in different numbers, it should work the same.</li>
</ul>
<li>Hit Apply and approve the changes.</li>
</ul>
<div><a href="http://alexsleat.co.uk/wp-content/uploads/2011/04/Screenshot-261011-092555.png"><img class="aligncenter size-full wp-image-22763" title="Screenshot - 261011 - 09:25:55" src="http://alexsleat.co.uk/wp-content/uploads/2011/04/Screenshot-261011-092555.png" alt="" width="1019" height="688" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/04/28/openshot-libmp3lame-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Realtek RTL8191S in Ubuntu 10.10</title>
		<link>http://alexsleat.co.uk/2011/02/15/realtek-rtl8191s-in-ubuntu-10-10/</link>
		<comments>http://alexsleat.co.uk/2011/02/15/realtek-rtl8191s-in-ubuntu-10-10/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 22:09:22 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[card]]></category>
		<category><![CDATA[dongle]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[realtek]]></category>
		<category><![CDATA[rtl8191s]]></category>
		<category><![CDATA[rtl819xU]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=12248</guid>
		<description><![CDATA[<br/><p>Errors:</p> $ sudo ifconfig wlan1 up SIOCSIFFLAGS: Resource temporarily unavailable</p> <p>$ dmesg usb rtl819xU:FirmwareDownload92S&#40;&#41;: failed with TCR-Status: a rtl819xU:ERR!!! _rtl8192_up&#40;&#41;: initialization is failed! <p>Solution 1:</p> <p>To get this wifi dongle working I simply had to download the above firmware and place it in /lib/firmware/RTL8192SU/ and then reboot my computer. You should check that location [...]]]></description>
			<content:encoded><![CDATA[<br/><p><strong>Errors:</strong></p>
<div class="dean_ch" style="white-space: wrap;">$ <span class="kw2">sudo</span> ifconfig wlan1 up<br />
SIOCSIFFLAGS: Resource temporarily unavailable</p>
<p>$ <span class="kw2">dmesg</span> usb<br />
rtl819xU:FirmwareDownload92S<span class="br0">&#40;</span><span class="br0">&#41;</span>: failed with TCR-Status: a<br />
rtl819xU:ERR!!! _rtl8192_up<span class="br0">&#40;</span><span class="br0">&#41;</span>: initialization is failed!</div>
<p><strong>Solution 1:</strong></p>
<p>To get this wifi dongle working I simply had to download the above firmware and place it in /lib/firmware/RTL8192SU/ and then reboot my computer. You should check that location before hand and make a backup of anything inside of it if you&#8217;re not sure what you are doing. If it&#8217;s empty you can use the following commands to make the directory and then download the firmware directly.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> <span class="kw2">mkdir</span> /lib/firmware/RTL8192SU/<br />
<span class="kw3">cd</span> /lib/firmware/RTL8192SU/<br />
<span class="kw2">sudo</span> <span class="kw2">wget</span> http://svn.debian.org/wsvn/kernel/dists/trunk/firmware-nonfree/realtek/RTL8192SU/rtl8192sfw.bin</div>
<p><strong>Solution 2:</strong></p>
<p>Alternatively download the source and build it:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">wget</span> http://launchpadlibrarian.net/<span class="nu0">33927923</span>/rtl8192se_linux_2<span class="nu0">.6</span><span class="nu0">.0010</span><span class="nu0">.1012</span><span class="nu0">.2009</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -zxvf rtl8192se_linux_2<span class="nu0">.6</span><span class="nu0">.0010</span><span class="nu0">.1012</span><span class="nu0">.2009</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw3">cd</span> rtl8192se_linux_2<span class="nu0">.6</span><span class="nu0">.0010</span><span class="nu0">.1012</span><span class="nu0">.2009</span><br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
<p><strong>Downloads:</strong><br />
Firmware: http://svn.debian.org/wsvn/kernel/dists/trunk/firmware-nonfree/realtek/RTL8192SU/rtl8192sfw.bin</p>
<p>Source: http://launchpadlibrarian.net/33927923/rtl8192se_linux_2.6.0010.1012.2009.tar.gz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/02/15/realtek-rtl8191s-in-ubuntu-10-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Auto Sync Kindle in Ubuntu</title>
		<link>http://alexsleat.co.uk/2011/01/17/auto-sync-kindle-in-ubuntu/</link>
		<comments>http://alexsleat.co.uk/2011/01/17/auto-sync-kindle-in-ubuntu/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 12:23:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[diy kindle stand]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[kindle 3]]></category>
		<category><![CDATA[kindle 3 stand]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[rules.d]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[udev]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=11625</guid>
		<description><![CDATA[<br/><p></p> <p>For Christmas I got a Kindle 3 and it was instantly filled with Free eBooks (http://www.gutenberg.org/wiki/Main_Page) and research papers (PDFs). I found myself wanting to be able to automatically synchronize it with a folder on my desktop when it was plugged in and found no one else had posted online how to do [...]]]></description>
			<content:encoded><![CDATA[<br/><p><a href="http://alexsleat.co.uk/wp-content/uploads/2011/01/2010-12-27-14.11.38.jpg"><img class="size-large wp-image-11639 alignleft" title="DIY Kindle Stand" src="http://alexsleat.co.uk/wp-content/uploads/2011/01/2010-12-27-14.11.38-1024x614.jpg" alt="" width="368" height="221" /></a></p>
<p>For Christmas I got a Kindle 3 and it was instantly filled with Free eBooks (http://www.gutenberg.org/wiki/Main_Page) and research papers (PDFs). I found myself wanting to be able to automatically synchronize it with a folder on my desktop when it was plugged in and found no one else had posted online how to do this, so I began researching into udev and rsync to get something working.</p>
<p><strong>Setting up udev rules to run a script when the Kindle is plugged in.</strong></p>
<p>Firstly, we need to find some parameters of the Kindle which are unique to it so that udev can identify that it is the Kindle being plugged in and not another USB mass storage device. We&#8217;ll need to find out where the device is mounted in /dev/ which can be a little tricky because this folder is pretty full.</p>
<p>An easier way to do this is to first, without the Kindle plugged in do the following command (list the directory and pipe the output to a file called dev1 in the home dir):</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">ls</span> /dev/ &gt; ~/dev1</div>
<p>Now plug the Kindle in and redo the command, changing the destination output:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">ls</span> /dev/ &gt; ~/dev2</div>
<p>The difference between the two files will show what has changed in the /dev/ directory:</p>
<div class="dean_ch" style="white-space: wrap;"> sdiff ~/dev1 ~/dev2</div>
<p>The output for mine (<em>show in the image below</em>) shows that 3 things changed when I plugged in the Kindle, sdb, sdb1 and sg2 directorys were added (shown by the &gt; sign to the left). The folder I am looking for is the sdb1, this is where the mass storage device is found.<br />
<a href="http://alexsleat.co.uk/wp-content/uploads/2011/01/Screenshot-alex@icarus-Desktop-.png"><img class="aligncenter size-full wp-image-11630" title="sdiff /dev/" src="http://alexsleat.co.uk/wp-content/uploads/2011/01/Screenshot-alex@icarus-Desktop-.png" alt="" width="953" height="488" /></a></p>
<p>Write down where it&#8217;s found in /dev/ and then you can clean up those two files you previously made:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">rm</span> ~/dev1 | <span class="kw2">rm</span> ~/dev2</div>
<p>The next thing we want to do is use udevadm to collect some useful information about the device which we can do by the following command (I have chosen to pipe the output to a file called kindle in the home dir, because the output was pretty big. If you don&#8217;t want to remove the &gt; ~/kindle from the end of the command):</p>
<div class="dean_ch" style="white-space: wrap;">udevadm info -a -p $<span class="br0">&#40;</span>udevadm info -q path -n /dev/sdb1<span class="br0">&#41;</span> &gt; ~/kindle</div>
<p><strong>WARNING:</strong> This can look pretty daunting but, (in the words of Douglas Adams) <strong>Don&#8217;t Panic.</strong></p>
<div style="overflow: auto; height: 350px; border: 1px solid black;">
<div class="dean_ch" style="white-space: wrap;"> &nbsp;looking at device <span class="st0">&#8216;/devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/host21/target21:0:0/21:0:0:0/block/sdb/sdb1&#8242;</span>:<br />
&nbsp; &nbsp; <span class="re2">KERNEL=</span>=<span class="st0">&quot;sdb1&quot;</span><br />
&nbsp; &nbsp; <span class="re2">SUBSYSTEM=</span>=<span class="st0">&quot;block&quot;</span><br />
&nbsp; &nbsp; <span class="re2">DRIVER=</span>=<span class="st0">&quot;&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span>partition<span class="br0">&#125;</span>==<span class="st0">&quot;1&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span>start<span class="br0">&#125;</span>==<span class="st0">&quot;16&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span><span class="kw2">size</span><span class="br0">&#125;</span>==<span class="st0">&quot;6410672&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span>alignment_offset<span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span>discard_alignment<span class="br0">&#125;</span>==<span class="st0">&quot;4294959104&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span><span class="kw2">stat</span><span class="br0">&#125;</span>==<span class="st0">&quot; &nbsp; &nbsp; 151 &nbsp; &nbsp; 3389 &nbsp; &nbsp; 4239 &nbsp; &nbsp; 3776 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 2424 &nbsp; &nbsp; 3776&quot;</span><br />
&nbsp; &nbsp; ATTR<span class="br0">&#123;</span>inflight<span class="br0">&#125;</span>==<span class="st0">&quot; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0&quot;</span></p>
<p>&nbsp; looking at parent device <span class="st0">&#8216;/devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/host21/target21:0:0/21:0:0:0/block/sdb&#8217;</span>:<br />
&nbsp; &nbsp; <span class="re2">KERNELS=</span>=<span class="st0">&quot;sdb&quot;</span><br />
&nbsp; &nbsp; <span class="re2">SUBSYSTEMS=</span>=<span class="st0">&quot;block&quot;</span><br />
&nbsp; &nbsp; <span class="re2">DRIVERS=</span>=<span class="st0">&quot;&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>range<span class="br0">&#125;</span>==<span class="st0">&quot;16&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>ext_range<span class="br0">&#125;</span>==<span class="st0">&quot;256&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>removable<span class="br0">&#125;</span>==<span class="st0">&quot;1&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>ro<span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span><span class="kw2">size</span><span class="br0">&#125;</span>==<span class="st0">&quot;6410688&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>alignment_offset<span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>discard_alignment<span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>capability<span class="br0">&#125;</span>==<span class="st0">&quot;51&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span><span class="kw2">stat</span><span class="br0">&#125;</span>==<span class="st0">&quot; &nbsp; &nbsp; 156 &nbsp; &nbsp; 3389 &nbsp; &nbsp; 4279 &nbsp; &nbsp; 3808 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 2456 &nbsp; &nbsp; 3808&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>inflight<span class="br0">&#125;</span>==<span class="st0">&quot; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp;0&quot;</span></p>
<p>&nbsp; looking at parent device <span class="st0">&#8216;/devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/host21/target21:0:0/21:0:0:0&#8242;</span>:<br />
&nbsp; &nbsp; <span class="re2">KERNELS=</span>=<span class="st0">&quot;21:0:0:0&quot;</span><br />
&nbsp; &nbsp; <span class="re2">SUBSYSTEMS=</span>=<span class="st0">&quot;scsi&quot;</span><br />
&nbsp; &nbsp; <span class="re2">DRIVERS=</span>=<span class="st0">&quot;sd&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>device_blocked<span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span><span class="kw3">type</span><span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>scsi_level<span class="br0">&#125;</span>==<span class="st0">&quot;3&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>vendor<span class="br0">&#125;</span>==<span class="st0">&quot;Kindle &nbsp;&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>model<span class="br0">&#125;</span>==<span class="st0">&quot;Internal Storage&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span><span class="kw2">rev</span><span class="br0">&#125;</span>==<span class="st0">&quot;0100&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>state<span class="br0">&#125;</span>==<span class="st0">&quot;running&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>timeout<span class="br0">&#125;</span>==<span class="st0">&quot;30&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>iocounterbits<span class="br0">&#125;</span>==<span class="st0">&quot;32&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>iorequest_cnt<span class="br0">&#125;</span>==<span class="st0">&quot;0xe1&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>iodone_cnt<span class="br0">&#125;</span>==<span class="st0">&quot;0xe1&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>ioerr_cnt<span class="br0">&#125;</span>==<span class="st0">&quot;0&#215;1&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>modalias<span class="br0">&#125;</span>==<span class="st0">&quot;scsi:t-0&#215;00&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>evt_media_change<span class="br0">&#125;</span>==<span class="st0">&quot;0&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>dh_state<span class="br0">&#125;</span>==<span class="st0">&quot;detached&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>queue_depth<span class="br0">&#125;</span>==<span class="st0">&quot;1&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>queue_type<span class="br0">&#125;</span>==<span class="st0">&quot;none&quot;</span><br />
&nbsp; &nbsp; ATTRS<span class="br0">&#123;</span>max_sectors<span class="br0">&#125;</span>==<span class="st0">&quot;240&quot;</span></div>
</div>
<p>While this many look daunting, what you want to do if find some attributes from the output which mean only your Kindle will be found when looking for them all, the problem I have found is that, with udev rules you cannot go too far down in the parent tree which stops me being able to use the Kindles serial to identify it. This could mean that my computer will sync any Kindle that&#8217;s plugged into it but I don&#8217;t have 2 to check. The following are the attributes I chose:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re2">KERNEL=</span>=<span class="st0">&quot;sd?&quot;</span>, ATTRS<span class="br0">&#123;</span>vendor<span class="br0">&#125;</span>==<span class="st0">&quot;Kindle &nbsp;&quot;</span>, ATTRS<span class="br0">&#123;</span>modalias<span class="br0">&#125;</span>==<span class="st0">&quot;scsi:t-0&#215;00&quot;</span></div>
<p>Now you&#8217;ll want to write the udev rule in /etc/udev/rules.d/</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw3">cd</span> /etc/udev/rules.d/</div>
<p>According to the readme the numbers represent the priority of the rule (higher overriding lower) followed by a descriptive name and it must end in .rules eg (xx-description.rules).</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> gedit <span class="nu0">81</span>-kindle-<span class="kw2">sync</span>.rules</div>
<p>The following is the whole line I used for the udev rule, the only addition to the above is the RUN+=&#8221;/home/alex/.scripts/kindlesync.sh&#8221; which will run the script in that directory, this script contains the rsync command.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re2">KERNEL=</span>=<span class="st0">&quot;sd?&quot;</span>, ATTRS<span class="br0">&#123;</span>vendor<span class="br0">&#125;</span>==<span class="st0">&quot;Kindle &nbsp;&quot;</span>, ATTRS<span class="br0">&#123;</span>modalias<span class="br0">&#125;</span>==<span class="st0">&quot;scsi:t-0&#215;00&quot;</span>, RUN+=<span class="st0">&quot;/home/alex/.scripts/./kindlesync.sh&quot;</span></div>
<p>Save and close the file and then restart the udev service:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">sudo</span> service udev restart</div>
<p><strong>Writing a script to sync a folder on the Desktop with a folder on the Kindle using rsync:</strong><br />
Change the first directory from &#8220;/home/alex/ebooks/kindle_sync&#8221; to the directory on your computer where you want to keep the files that will be synced onto your Kindle and the second from &#8220;/media/Kindle/documents/sync/&#8221; to the location on your mounted Kindle where you want the files to be stored, save this file as kindlesync.sh. This is the script you call from the udev rules so for mine it&#8217;s saved as &#8220;/home/alex/.scripts/kindlesync.sh&#8221;.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#!/bin/bash</span></p>
<p><span class="re3">#Sync</span><br />
rsync -av /home/alex/eBooks/kindle_sync/ /media/Kindle/documents/<span class="kw2">sync</span>/</div>
<p>Go to the location of the script and make it executable with the following command:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">chmod</span> +x kindlesync.<span class="kw2">sh</span></div>
<p>Now try plugging in your Kindle and make sure it syncs up!</p>
<p><strong>Problems</strong></p>
<p>In the udev rule, ACTION==&#8221;add&#8221; can be used to specify when the Kindle is first plugged in, however when trying to use this Ubuntu&#8217;s auto-mounting service mounts the drive after the script is ran so the sync becomes useless. Without this it runs the script 3 times, twice before it has mounted and then once it has mounted &#8211; this is currently the best I have found but it&#8217;s extremely messy.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/01/17/auto-sync-kindle-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A More Elegant Solution to Ubuntu Wi-Fi Reconnecting Issue</title>
		<link>http://alexsleat.co.uk/2011/01/09/a-more-elegant-solution-to-ubuntu-wi-fi-reconnecting-issue/</link>
		<comments>http://alexsleat.co.uk/2011/01/09/a-more-elegant-solution-to-ubuntu-wi-fi-reconnecting-issue/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 23:25:52 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[drop wifi]]></category>
		<category><![CDATA[failing to reconnect]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[network-manager]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[rc.local]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[script on login]]></category>
		<category><![CDATA[script on startup]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wifi doesnt reconnect]]></category>
		<category><![CDATA[wifi not connecting]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=11358</guid>
		<description><![CDATA[<br/><p>Previously I was having problems with Ubuntu dropping wifi connections and failing to reconnect, to solve this I wrote a script which would kill the network-manager and then connect using iwconfig commands (here). While this works fine, it felt a little hacky, having to have a script running as sudo constantly in the background [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Previously I was having problems with Ubuntu dropping wifi connections and failing to reconnect, to solve this I wrote a script which would kill the network-manager and then connect using iwconfig commands (<a href="http://alexsleat.co.uk/2010/11/05/ubuntu-disconnecting-from-wifi-and-failing-to-reconnect/">here</a>). While this works fine, it felt a little hacky, having to have a script running as sudo constantly in the background checking for a dropped connection. After a little searching I came across cron (the time based job scheduler ) and /etc/rc.local (a script which is run after all other initialization scripts have ran, allowing for scripts to be ran on startup) so from this I decided to split the old script up into connection and checking scripts which could be ran from init.d/local and cron, respectively.</p>
<p>Firstly my startup script in /etc/init.d/local which sets up and connects to the wireless network, open the file as sudo:</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">sudo</span> gedit /etc/rc.<span class="kw3">local</span></div>
<p>Paste in the following:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#! /bin/sh</span></p>
<p>service network-manager stop &amp;&amp; service networking stop</p>
<p>iwconfig wlan0 essid NETWORKNAME<br />
iwconfig wlan0 key WEPKEY<br />
ifconfig wlan0 up<br />
dhclient3 wlan0</p>
<p><span class="kw2">sleep</span> <span class="nu0">10</span></p>
<p><span class="kw1">if</span> iwconfig wlan0 | <span class="kw2">grep</span> -o <span class="st0">&quot;Access Point: Not-Associated&quot;</span><br />
<span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig wlan0 down<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sleep</span> <span class="nu0">10</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig wlan0 up</p>
<p><span class="kw1">fi</span></p>
<p><span class="kw3">exit</span> <span class="nu0">0</span><br />
&nbsp;</div>
<p>Next the script for checking the network is still connected, if not attempt to reconnect (named wirelesscheck.sh):</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re3">#!/bin/bash</span></p>
<p><span class="kw1">if</span> iwconfig wlan0 | <span class="kw2">grep</span> -o <span class="st0">&quot;Access Point: Not-Associated&quot;</span><br />
<span class="kw1">then</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; ifconfig wlan0 down<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sleep</span> <span class="nu0">10</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig wlan0 up<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="kw1">fi</span></div>
<p>Make sure this script is executable (from the directory of the script):</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">chmod</span> +x wirelesscheck.<span class="kw2">sh</span></div>
<blockquote><p>Note: This is setup in the sudo crontab, only because this command needs root privileges &#8211; other commands could be added to a user crontab (by removing sudo from the following.)</p></blockquote>
<p>Now, edit (-e) the crontab for sudo:</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">sudo</span> crontab -e</div>
<p>If crontab has not previously been used choose an editor (I used nano &#8211; 2) and append this line to the bottom of the file and change the frequency and directory of the script. The current settings will run it every 5 minutes (*/5) every hour, day, month and year and the file is located in &#8220;/path/to/script/wirelesscheck.sh&#8221;.</p>
<div class="dean_ch" style="white-space: wrap;">*/<span class="nu0">5</span> * * * * /path/to/script/wirelesscheck.<span class="kw2">sh</span></div>
<p>If you have any issues, leave a comment and I will help if I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/01/09/a-more-elegant-solution-to-ubuntu-wi-fi-reconnecting-issue/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To: Fix &#8220;Failed to download repository information Check your Internet connection.&#8221;</title>
		<link>http://alexsleat.co.uk/2011/01/07/how-to-fix-failed-to-download-repository-information-check-your-internet-connection/</link>
		<comments>http://alexsleat.co.uk/2011/01/07/how-to-fix-failed-to-download-repository-information-check-your-internet-connection/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 23:11:05 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[404 not found]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[failed]]></category>
		<category><![CDATA[Failed to download repository information]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[launchpad]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[ppa]]></category>
		<category><![CDATA[sources]]></category>
		<category><![CDATA[sources.list]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=11274</guid>
		<description><![CDATA[<br/><p>﻿﻿﻿If you&#8217;re getting this error but you&#8217;re still connected to the internet this page might help. This error is sometimes caused by repository&#8217;s which are down or broken.</p> Failed to download repository information Check your Internet connection. <p style="text-align: center;"></p> <p>From terminal run the following command:</p> sudo apt-get update <p>If the output runs through a few [...]]]></description>
			<content:encoded><![CDATA[<br/><p>﻿﻿﻿If you&#8217;re getting this error but you&#8217;re still connected to the internet this page might help. This error is sometimes caused by repository&#8217;s which are down or broken.</p>
<blockquote>
<div id="_mcePaste">Failed to download repository information</div>
<div id="_mcePaste">Check your Internet connection.</div>
</blockquote>
<p style="text-align: center;"><a href="http://alexsleat.co.uk/wp-content/uploads/2011/01/failed-to-download-repository-information.png"><img class="size-full wp-image-11260  aligncenter" title="failed to download repository information" src="http://alexsleat.co.uk/wp-content/uploads/2011/01/failed-to-download-repository-information.png" alt="" width="455" height="246" /></a></p>
<p>From terminal run the following command:</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">sudo</span> apt-get update</div>
<p>If the output runs through a few repositorys but ends with something similar to the below (most probably with different repositorys failing) and ultimately stopping your updating process then there is a good chance you can fix it by just removing those failing sources from the software sources.</p>
<blockquote><p>Err http://ppa.launchpad.net maverick/main Sources<br />
404  Not Found<br />
Err http://ppa.launchpad.net maverick/main amd64 Packages<br />
404  Not Found<br />
W: Failed to fetch http://ppa.launchpad.net/bugs-sehe/gparted/ubuntu/dists/maverick/main/source/Sources.gz  404  Not Found<br />
W: Failed to fetch http://ppa.launchpad.net/bugs-sehe/gparted/ubuntu/dists/maverick/main/binary-amd64/Packages.gz  404  Not Found<br />
E: Some index files failed to download, they have been ignored, or old ones used instead.</p></blockquote>
<p>Software Sources can be found under either:</p>
<p style="padding-left: 30px;"><em>Applications &gt; Ubuntu Software Centre &gt; Edit &gt; Software Sources..</em><br />
OR<br />
<em>System &gt; Administrator &gt; Synaptic Package Manager &gt; Settings &gt; Repositorys</em></p>
<p style="text-align: left;">Click the Other Software tab.</p>
<p style="text-align: left;">Nnow find the repositories which caused the failure on the update and uncheck them and then close the Software Centre.</p>
<p style="text-align: left;">Re-run the update command and hopefully everything will work!</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">sudo</span> apt-get update</div>
</p>
<p style="text-align: left;">Check the example below where gparted was causing the error:</p>
<p style="text-align: center;"><a href="http://alexsleat.co.uk/wp-content/uploads/2011/01/sudo-apt-get-update-2.png"><img class="size-medium wp-image-11282 aligncenter" title="sudo apt get update 2" src="http://alexsleat.co.uk/wp-content/uploads/2011/01/sudo-apt-get-update-2-300x147.png" alt="" width="300" height="147" /></a></p>
<p style="text-align: center;"><a href="http://alexsleat.co.uk/wp-content/uploads/2011/01/Screenshot-Software-Sources2.png"><img class="size-medium wp-image-11281 aligncenter" title="Screenshot-Software Sources2" src="http://alexsleat.co.uk/wp-content/uploads/2011/01/Screenshot-Software-Sources2-300x177.png" alt="" width="300" height="177" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/01/07/how-to-fix-failed-to-download-repository-information-check-your-internet-connection/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>How To: Restore Default sources.list</title>
		<link>http://alexsleat.co.uk/2011/01/07/how-to-restore-default-sources-list/</link>
		<comments>http://alexsleat.co.uk/2011/01/07/how-to-restore-default-sources-list/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 22:39:15 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blog1]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[10.10]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[apt line]]></category>
		<category><![CDATA[broken sources]]></category>
		<category><![CDATA[Check your Internet connection.]]></category>
		<category><![CDATA[Failed to download repository information]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[isadora]]></category>
		<category><![CDATA[julia]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[katya]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[lisa]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[repogen]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[sources.list]]></category>
		<category><![CDATA[sources.list generator]]></category>
		<category><![CDATA[ubuntu source list generator]]></category>

		<guid isPermaLink="false">http://alexsleat.co.uk/?p=11259</guid>
		<description><![CDATA[<br/><p>Having gone through several upgrades and countless repository&#8217;s added to the software sources, things can begin to get really messy really quickly and often begin to screw up when updating the system if you&#8217;re not careful. You may find yourself, like I have, wanting to restore your sources.list file back to its default in [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Having gone through several upgrades and countless repository&#8217;s added to the software sources, things can begin to get really messy really quickly and often begin to screw up when updating the system if you&#8217;re not careful. You may find yourself, like I have, wanting to restore your sources.list file back to its default in order to get things working again.</p>
<p>In order to do this there is a pretty handy webapp available called the &#8220;<strong>Ubuntu Sources List Generator</strong>&#8221; - <a href="http://repogen.simplylinux.ch/">http://repogen.simplylinux.ch/</a></p>
<p>By moving through each section it enables you to select your country, release and then check each repository you want to add, not only does it support all the official ones for things like security and updates, it also allows for 3rd party repos such as Banshee, Chromium, Conky and VLC amongst a bunch others. Once you have what you want hit generate and it&#8217;ll create a nice, comment, new sources.list file ready for you to replace your old one with.</p>
<p>You may want to backup your old sources.list just in case with the following command:</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">sudo</span> <span class="kw2">cp</span> /etc/apt/sources.list /etc/apt/sources.list.bkup</div>
<p>Once you have that you can open the sources.list and simply paste the new one in from the repogen:</p>
<div class="dean_ch" style="white-space: wrap;"> <span class="kw2">sudo</span> gedit /etc/apt/sources.list</div>
<p>Paste, Save and Close the file and now you should paste the generated GPG keys, found just below the generated sources.list file, into your terminal.</p>
<p>Everything should be back to default and allow you to once again update everything.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexsleat.co.uk/2011/01/07/how-to-restore-default-sources-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

