<?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>Gen X Design &#124; Ian Selby &#187; Ubuntu</title>
	<atom:link href="http://www.gen-x-design.com/tags/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gen-x-design.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 15 Jan 2010 21:41:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Workaround for Ubuntu 8.10 mouse bug</title>
		<link>http://www.gen-x-design.com/archives/workaround-for-ubuntu-810-mouse-bug/</link>
		<comments>http://www.gen-x-design.com/archives/workaround-for-ubuntu-810-mouse-bug/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 22:41:41 +0000</pubDate>
		<dc:creator>Davey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[xinerama]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://www.gen-x-design.com/?p=179</guid>
		<description><![CDATA[Ubuntu 8.10 has a massive bug in the xorg window code at the moment. Originally reported in November when 8.10 shipped, the lack of action on this is kind of unusual for the generally excellent Linux community.
However I&#8217;ve worked out a minimally intrusive hacktastic workaround. What seems to be happening with this bug is sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 8.10 has a <a title="Launchpad Bug Report" href="https://bugs.launchpad.net/ubuntu/+bug/296167">massive bug</a> in the xorg window code at the moment. Originally reported in November when 8.10 shipped, the lack of action on this is kind of unusual for the generally excellent Linux community.</p>
<p>However I&#8217;ve worked out a minimally intrusive hacktastic workaround. <span id="more-179"></span>What seems to be happening with this bug is sometimes when X traffic is moving from one GPU to the other (this only affect multi video card setups) it causes the mouse hardware to get disconnected from the internal desktop model so X thinks the mouse is somewhere else and nothing works. The problem only affects configurations using &gt;2 monitors using  xinerama, the currently suggested fixes are either to downgrade to the Hardy version of Xorg, which has pretty poor xinerama performance or to follow a strange set of keyboard based window movements until the problem disappears.</p>
<p>My fix is to use some nifty Linux tools and a bit of Gnome fu to get the two to be in agreement again.</p>
<p>First you need to install xautomation,</p>
<blockquote><p><strong>Control X from the command line, and find things on the screen</strong><br />
Control X from the command line for scripts, and do &#8220;visual scraping&#8221; to<br />
find things on the screen. The control interface allows mouse movement,<br />
clicking, button up/down, key up/down, etc, and uses the XTest extension so<br />
you don&#8217;t have the annoying problems that xse has when apps ignore sent<br />
events. The visgrep program find images inside of images and reports the<br />
coordinates, allowing programs to find buttons, etc, on the screen to click<br />
on.</p></blockquote>
<p>The install as usual is trivial (gotta love dat package management)</p>
<pre>sudo apt-get install xautomation</pre>
<p>OK now you have xautomation, the command we are going to use will locate the mouse pointer at the origin (0,0) of the desktop, and doing this seems to re-align the mouse and X.</p>
<pre>xte "mousemove 0 0"</pre>
<p>really it&#8217;s that simple. [edit - well of not really, turns out some folks need to move the mouse onto the primary display and off again, just add a second mousemove line with co-ords for your second display]</p>
<p>So you could just type this into a terminal when the mouse borks and that would be good enough to repair, but who can really be bothered with all that malarkey, as this is happening to me every couple of hours, I dont want to be reminded how messed up my Ubuntu install is and have to  learn all the window navigation keystrokes needed to pop a terminal without a mouse, although with <a title="This is not QuickSilver!" href="http://do.davebsd.com/">Gnome-do</a> (the Gnome version of  quicksilver) it&#8217;s kinda easy.</p>
<p>so create a script to run the command.</p>
<pre>echo xte "mousemove 0 0" &gt; mm.sh
chmod 777 mm.sh</pre>
<p>Running the script will move the cursor as we want, so now we need to assign this to a hot-key. Gnome desktop doesn&#8217;t give you a particularly easy way to do this, so you have to run the Gnome Configuration Editor, which is sort of like a regedit for gnome apps.</p>
<pre>gconf-editor</pre>
<p>That will bring up the Gnome Configuration Editor, If you&#8217;ve ever messed with the Windows registry this will be reasonably familiar. To set up the hotkey we need to edit two entries, the first to register the script, the second to assign the hotkey.</p>
<p>Navigate to<strong> apps/metacity/keybinding_commands</strong> and enter the path to the mm.sh script we created earlier in one of the available slots. I&#8217;m using the command_1 slot, you can choose any of the 12 available slots.</p>
<div style="text-align: center; margin-top: 10px;"><img class="aligncenter size-full wp-image-191" src="http://www.gen-x-design.com/wp-content/uploads/2009/01/screenshot-configuration-editor-keybinding_commands.png" alt="screenshot-configuration-editor-keybinding_commands" width="523" height="339" /></div>
<p>Now navigate to <strong>apps/metacity/global_keybindings</strong> and set the matching  run_command key-binding to the value for the hotkey you want to run the script. The values for this are a string, and the tokens &lt;Control&gt; &lt;Shift&gt; &lt;Alt&gt; &lt;Super&gt; are used for the special combo keys. In my case I&#8217;m using &lt;Super&gt;M, which will be either the Window or the Command key depending on the keyboard your are using.</p>
<div style="text-align: center; margin-top: 10px;"><img class="aligncenter size-full wp-image-194" src="http://www.gen-x-design.com/wp-content/uploads/2009/01/screenshot-configuration-editor-global_keybindings.png" alt="screenshot-configuration-editor-global_keybindings" width="543" height="381" /></div>
<p>So if it all works according to plan, the script will be attached to the Super-M key combo, so if your mouse locks, pressing Super-M will repair the damage and let you carry on.</p>
<p>This will hopefully tide you over until the Xorg bug is fixed or nvidia release the forthcoming SLI support that will allow &gt;2 monitors to be used without having to use xinerama.</p>
<p>enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gen-x-design.com/archives/workaround-for-ubuntu-810-mouse-bug/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Installing Aptana Jaxer on Ubuntu</title>
		<link>http://www.gen-x-design.com/archives/installing-aptana-jaxer-on-ubuntu/</link>
		<comments>http://www.gen-x-design.com/archives/installing-aptana-jaxer-on-ubuntu/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 22:44:25 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Aptana]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jaxer]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gen-x-design.com/?p=150</guid>
		<description><![CDATA[
It&#8217;s been a while since I&#8217;ve written about Jaxer, and it&#8217;s a shame, because there&#8217;s been a lot of major changes over the past several months.  Anyway, I&#8217;ve been getting back into server-side javascript hacking, and found myself needing to get Jaxer up and running on a local dev server (and subsequently this one). [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: center"><img style="margin-top: 10px; margin-bottom: 10px; padding: 2px; border: 1px solid #ccc;"src="http://www.gen-x-design.com/wp-content/uploads/2009/01/jaxer-and-ubuntu.png" alt="Install Aptana Jaxer on Ubuntu" title="Install Aptana Jaxer on Ubuntu" width="580" height="120" /></div>
<p>It&#8217;s been a while since I&#8217;ve written about Jaxer, and it&#8217;s a shame, because there&#8217;s been a lot of major changes over the past several months.  Anyway, I&#8217;ve been getting back into server-side javascript hacking, and found myself needing to get Jaxer up and running on a local dev server (and subsequently this one).  You could also always work with Jaxer in Aptana&#8217;s <a href="http://www.aptana.com/cloud" target="_blank">cloud</a>, where you&#8217;d get all the benefits of Jaxer integration with Aptana Studio and deployment workflows (SVN, staging, production, and just plain awesomeness) if you don&#8217;t want to (or need to) install Jaxer yourself.  However, my needs (and presumably yours) required me to go down this route.</p>
<p>So, before we get started, let&#8217;s go over the list of prerequisites and assumptions:</p>
<ul>
<li>You&#8217;re on Ubuntu 8.04 (newer versions should work the same as well)</li>
<li>You&#8217;ve got Apache installed (via aptitude, or you will have to adjust paths accordingly)</li>
<li>You&#8217;ve got root access to your server</li>
</ul>
<p>That&#8217;s about it.  MySQL is also good to have, but not required.  Last thing before we start: many of the steps outlined here came from <a href="http://doc.integrasoftware.it/tec/sis/pub/jaxer" target="_blank">this site</a>, which was contributed by a Jaxer user at Aptana&#8217;s forums.  Right, let&#8217;s get busy&#8230;<br />
<span id="more-150"></span></p>
<h3>Step 1: Get Jaxer</h3>
<p>As you would expect, the first thing we&#8217;ll do is grab the latest version of Jaxer.  However, before we do so, let&#8217;s make sure we know whether we&#8217;re on a 64 or 32-bit version of Ubuntu.  Easy enough, from the command line:</p>
<pre>uname -a</pre>
<p>which outputs something like:</p>
<pre>Linux genxdesign 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64 GNU/Linux</pre>
<p>You can see, in my case I&#8217;m on 64 bit, as indicated by the &#8220;x86_64&#8243;.  Now that we&#8217;ve got that, we can head over to <a href="http://aptana.com/jaxer/download" target="_blank">http://aptana.com/jaxer/download</a>, and grab the appropriate linux distribution.  Easiest way to do so is to right-click on the link, select &#8220;Copy link location&#8221;, and then use it in the following command on your sever:</p>
<pre>wget [pasted url]</pre>
<p>Of course, you could also download it locally, then unzip and upload it to your server.  I am assuming that you&#8217;re doing all this in your home directory on the server.  Note also that the way the downloads work with Jaxer currently may give you a goofy file with wget.  For example, at the time of writing, my wget url was &#8220;http://ec2-67-202-37-218.compute-1.amazonaws.com/downloads/jaxer/ubu64/Jaxer_package_withApache.zip?version=1.0.1.4310&#038;cb=1000&#8243; which gave me a file called: &#8220;Jaxer_package_withApache.zip?version=1.0.1.4310&#8243; on the file system.  Not an issue, I can fix this by doing:</p>
<pre>mv Jaxer_package_withApache.zip\?version\=1.0.1.4310 jaxer.zip</pre>
<p>Finally, on the server, simply type:</p>
<pre>unzip jaxer.zip</pre>
<p>to unzip the file.</p>
<p>Once the file&#8217;s unzipped or uploaded to your server, we&#8217;ll need to move the contents to their final home in /opt.  So, back in your home directory:</p>
<pre>sudo mv AptanaJaxer/ /opt</pre>
<p>and we&#8217;re golden!</p>
<h3>Step 2: Get the Mozilla Stuff</h3>
<p>This is a bit easier than grabbing Jaxer itself, just one command:</p>
<pre>sudo apt-get install firefox-3.0-dev firefox-dev</pre>
<p>which we&#8217;ll follow with on more to make sure our libraries line up properly:</p>
<pre>sudo ln -s /usr/lib/libexpat.so.1 /usr/lib/libexpat.so.0</pre>
<p>That&#8217;s all we&#8217;ve got to do for Mozilla.  Onward&#8230;</p>
<h3>Step 3: Configure and Start</h3>
<p>Believe it or not, we&#8217;re nearly done.  At this point, we need to slurp out the Apache module configs from the Jaxer directory, and put them in the appropriate place for our Apache on Ubuntu.  Two simple commands will take care of this:</p>
<pre>sudo sh -c "grep '^LoadModule' /opt/AptanaJaxer/jaxer/confs/jaxer-linux.httpd.conf > /etc/apache2/mods-available/jaxer-linux.httpd.load"
sudo sh -c "grep -v '^LoadModule' /opt/AptanaJaxer/jaxer/confs/jaxer-linux.httpd.conf > /etc/apache2/mods-available/jaxer-linux.httpd.conf"</pre>
<p>Now that we&#8217;ve got the module configs in the right place, we can enable the module for Apache by doing the following:</p>
<pre>sudo a2enmod jaxer-linux.httpd</pre>
<p>It will tell you that you need to reload apache.  Don&#8217;t do that just yet.  First, we need to let Jaxer create some directories, so let&#8217;s start Jaxer:</p>
<pre>sudo JAXERBASE=/opt/AptanaJaxer /opt/AptanaJaxer/scripts/startJaxer.sh</pre>
<p>Don&#8217;t worry about any warnings you see, those are just about Jaxer setting things up for the first time (similar to the first run of MySQL in a fresh install).  We can go ahead and stop jaxer now, and then restart Apache:</p>
<pre>sudo JAXERBASE=/opt/AptanaJaxer /opt/AptanaJaxer/scripts/stopJaxer.sh
sudo /etc/init.d/apache2 restart</pre>
<p>if you don&#8217;t get any warnings or errors from Apache, go ahead and start Jaxer again:</p>
<pre>sudo JAXERBASE=/opt/AptanaJaxer /opt/AptanaJaxer/scripts/startJaxer.sh</pre>
<p>and you should be all set!  If there aren&#8217;t any errors being spit out by anything, you can now browse to the Jaxer url on your server: http://yourdomain.com/aptana, and then run the server diagnostics.  If everything&#8217;s working right, you&#8217;ll see some spinners, and then a screen that looks similar to this one:</p>
<div style="text-align: center; margin: 10px; font-size: 10px;"><a href="http://www.gen-x-design.com/wp-content/uploads/2009/01/picture-3.png"><img src="http://www.gen-x-design.com/wp-content/uploads/2009/01/picture-3-300x201.png" alt="Jaxer Server Diagnostics" title="Jaxer Server Diagnostics" width="300" height="201" style="border: 1px solid #ccc; padding: 2px;" /></a><br />click image for larger view</div>
<p>Just a few more things to do now&#8230;</p>
<h3>Step 4: Configure Apache</h3>
<p>Well, what we&#8217;ve currently got is Jaxer set up and running properly, but it isn&#8217;t set up for any of our sites.  To do this, you&#8217;ll have to add a few lines to your vhost configuration(s) wherever you&#8217;d like Jaxer to actually run on your web site.  For this example, I&#8217;ll assume you&#8217;re using the &#8220;default&#8221; site that comes with the standard Apache install on Ubuntu, but you can simply put these lines wherever you need them in your vhost files.</p>
<p>So, what we&#8217;re basically going to do here is tell Apache to use Jaxer as a filter for certain files in our web site.  We do this by adding some directives in the appropriate &#8220;<Directory>&#8221; area of our config.  Let&#8217;s take a look at what a typical config might look like.  If you type the following:</p>
<pre>sudo vi /etc/apache2/sites-available/default</pre>
<p>we&#8217;re looking for a section of the file that looks like:</p>
<pre>&lt;Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All 

        Order allow,deny
        allow from all
&lt;/Directory></pre>
<p>Yours will probably be a bit different, but we&#8217;re basically looking for the directory directive that refers to the document root for this vhost (&#8217;/var/www&#8217; in this case).  Once you&#8217;ve located that, you need to add the following lines anywhere in there:</p>
<pre>JaxerFilter html xhtml htm php
JaxerFilterContentType text/html application/xhtml+xml</pre>
<p>What we&#8217;ve done is told Apache to run any html, xhtml, or php page through Jaxer as a filter (which is what we typically want).  Once you&#8217;ve added these lines, you can stop Jaxer, restart Apache, and start Jaxer again:</p>
<pre>sudo JAXERBASE=/opt/AptanaJaxer /opt/AptanaJaxer/scripts/stopJaxer.sh
sudo /etc/init.d/apache2 restart
sudo JAXERBASE=/opt/AptanaJaxer /opt/AptanaJaxer/scripts/startJaxer.sh</pre>
<p>And that&#8217;s all there is to it!</p>
<h3>A Few More Things&#8230;</h3>
<p>Now that we&#8217;ve got everything running properly, I wanted to share a script to make starting / stopping Jaxer a bit easier, and a gotcha with URL re-writes you need to watch out for.</p>
<p>First, the control script.  I am by no means a bash guru, and this script could use some major improvement.  If you would like to improve upon it, let me know, I&#8217;d greatly appreciate it.  Anyway, it does get the job done just fine.  So, let&#8217;s go ahead and install it:</p>
<pre>wget http://www.gen-x-design.com/downloads/jaxer_control.txt
sudo cp jaxer_control.txt /etc/init.d/jaxer
sudo chmod +x /etc/init.d/jaxer</pre>
<p>Now, you can simply type &#8220;sudo /etc/init.d/jaxer [start|stop]&#8221; to start or stop Jaxer!  Much easier than remembering that crazy sh file location.</p>
<p>Second, URL re-write gotchas.  When I installed Jaxer on this server, I discovered the wordpress rewrite rules were breaking some special Jaxer urls needed for everything to function properly.  Here&#8217;s what a typical offending set of rewrite rules could look like (in a .htaccess file, for example):</p>
<pre>&lt;IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule></pre>
<p>Well, this breaks Jaxer, because the URL rewrites take precedence over the LocationMatch directives in the jaxer module configuration.  As I said, we can luckily fix this problem by adding one line, thus making our rewrite rules look like:</p>
<pre>&lt;IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/jaxer-.*\b
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule></pre>
<p>So that the special Jaxer URLs aren&#8217;t redirected (in this case) to index.php.</p>
<h3>Wrapping Up</h3>
<p>And that&#8217;s it!  Hopefully you find this quick and easy, and then you can get started with Jaxer, thus discovering how damn cool server-side javascript is.  If you&#8217;d like to learn more about Jaxer, or need help, here are some useful URLs:</p>
<ul>
<li><strong>Jaxer Docs</strong> &#8211; <a href="http://www.aptana.com/jaxer/guide/" target="_blank">http://www.aptana.com/jaxer/guide/</a></li>
<li><strong>Jaxer Forums</strong> &#8211; <a href="http://forums.aptana.com/viewforum.php?f=51" target="_blank">http://forums.aptana.com/viewforum.php?f=51</a></li>
<li><strong>Jaxer Home Page</strong> &#8211; <a href="http://www.aptana.com/jaxer" target="_blank">http://www.aptana.com/jaxer</a></li>
<li><strong>Aptana Cloud</strong> &#8211; The much better, easier way to work with Jaxer.  Get a free trial! <a href="http://www.aptana.com/cloud" target="_blank">http://www.aptana.com/cloud</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gen-x-design.com/archives/installing-aptana-jaxer-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

