<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7150563171193653239</id><updated>2026-01-16T08:16:57.657+00:00</updated><category term="Linux"/><category term="Terminal"/><category term="Ubuntu"/><category term="CloudFoundry"/><category term="Lucid"/><category term="BOSH"/><category term="OSX"/><category term="apt-get"/><category term="java"/><category term="sudo"/><category term="Atheros"/><category term="BusyBox"/><category term="CSS"/><category term="Chrome"/><category term="Debian"/><category term="DroboApps"/><category term="DroboFS"/><category term="Firefox"/><category term="Grub"/><category term="ISO8859-1"/><category term="Jenkins"/><category term="Maverick"/><category term="Natty"/><category term="QEMU"/><category term="RAM"/><category term="RaspberryPi"/><category term="Raspian"/><category term="Sensu"/><category term="UI"/><category term="WeatherStation"/><category term="WindowButtons"/><category term="WindowControls"/><category term="XML"/><category term="bash"/><category term="blogger"/><category term="cfsummit"/><category term="clearlock"/><category term="cron"/><category term="dbus"/><category term="do-release-upgrade"/><category term="dynamic views"/><category term="gnome-screensaver"/><category term="http_proxy"/><category term="lock-input"/><category term="no_proxy"/><category term="rsync"/><category term="which"/><title type='text'>Troy&#39;s Blog</title><subtitle type='html'>A place to record obscure technical facts before I forget them.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.troyastle.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-1000553619752511585</id><published>2014-10-01T13:16:00.000+01:00</published><updated>2016-03-03T09:55:56.233+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CloudFoundry"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Debugging java.lang.OutOfMemoryError: unable to create new native thread on Cloud Foundry</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Within a multi-threaded Java application running on Cloud Foundry we started seeing the following error during our performance tests:&lt;br /&gt;
&lt;pre&gt;[App/0]  ERR java.lang.OutOfMemoryError: unable to create new native thread
&lt;/pre&gt;
Doing some basic troubleshooting the testers observed the following:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Increasing the memory allocated to the application &lt;strong&gt;did not resolve the error&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Running the same Java application on a Linux VM &lt;strong&gt;we did not see the error&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
So the question arises what is different between a Cloud Foundry Linux Container and a Linux VM that precipitates these errors?&lt;br /&gt;
&lt;h2&gt;
Research&lt;/h2&gt;
&lt;a href=&quot;https://plumbr.eu/outofmemoryerror/unable-to-create-new-native-thread&quot;&gt;This article on plumber.eu&lt;/a&gt; does a great job of describing the &lt;tt&gt;unable to create new native thread&lt;/tt&gt; error. In short the error occurs when we exhaust the available user processes and then continue trying to create processes from within Java.&lt;br /&gt;
The article also describes how to resolve the error on a Linux VM, &lt;strong&gt;by increasing the number of user processes using &lt;tt&gt;ulimit -u&lt;/tt&gt;&lt;/strong&gt;. This is a scale-up solution and Cloud Foundry is a scale-out environment thus the higher user process limits are not made available within containers rendering this solution a non-starter.&lt;br /&gt;
&lt;h2&gt;
Investigation&lt;/h2&gt;
For us the solution needed to be scale-out run multiple Linux Containers each with fewer threads. To implement this solution effectively we needed to know the following:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;How many user processes were available within each Linux Container.&lt;/li&gt;
&lt;li&gt;How many of those processes are available for us to use as Java threads.&lt;/li&gt;
&lt;/ul&gt;
Additionally we wanted to understand why our testers had not seen the error on the Linux VM.&lt;br /&gt;
&lt;h2&gt;
Determining the number of user processes&lt;/h2&gt;
On a Linux VM to determine the number of user processes available to a user we simply run &lt;tt&gt;ulimit -a&lt;/tt&gt; and look at the &lt;tt&gt;max user processes&lt;/tt&gt; value. However on Cloud Foundry developers do not have an interactive Shell into the Linux Container.&lt;br /&gt;
&lt;a href=&quot;https://twitter.com/jambay&quot;&gt;James Bayer&lt;/a&gt; came up with a neat &lt;a href=&quot;http://www.iamjambay.com/2013/12/send-interactive-commands-to-cloud.html&quot;&gt;hack to work around this using websocketd&lt;/a&gt; so I &lt;a href=&quot;https://github.com/trastle/cf-websocket-shell&quot;&gt;used his hack to create an interactive shell&lt;/a&gt; into the Linux Container.&lt;br /&gt;
&lt;br /&gt;
Using the interactive Shell we can easily observe the &lt;tt&gt;max user processes&lt;/tt&gt; available to us is &lt;tt&gt;512&lt;/tt&gt;:&lt;br /&gt;


&lt;pre&gt;$ whoami 
vcap

$ ulimit -a
core file size (blocks, -c) 0 
 data seg size (kbytes, -d) unlimited 
 scheduling priority (-e) 0 
 file size (blocks, -f) unlimited 
 pending signals (-i) 1024 
 max locked memory (kbytes, -l) 64 
 max memory size (kbytes, -m) unlimited 
 open files (-n) 16384 
 pipe size (512 bytes, -p) 8 
 POSIX message queues (bytes, -q) 819200 
 real-time priority (-r) 0 
 stack size (kbytes, -s) 8192 
 cpu time (seconds, -t) unlimited 
 max user processes (-u) 512 
 virtual memory (kbytes, -v) unlimited 
 file locks (-x) unlimited  
&lt;/pre&gt;
&lt;h2&gt;
Determining how many of user processes are available for Java threads&lt;/h2&gt;
At a guess from the &lt;tt&gt;max user processes&lt;/tt&gt; processes value we should be able to run about 500 threads within each Linux  container (this will vary based on your Stack, we are currently using Ubuntu Lucid).&lt;br /&gt;


To test this I threw together &lt;a href=&quot;https://github.com/trastle/tgobbler&quot;&gt;a basic Java application to exhaust the available threads&lt;/a&gt;. Running the application in Cloud Foundry I see the following:&lt;br /&gt;


&lt;pre&gt;tastle@TASTLE-M-W03P tgobbler (master) $ cf logs tgobbler --recent
Connected, dumping recent logs for app tgobbler in org COL-DEV-FT / space Development as taste...
[DEA]     OUT Starting app instance (index 0) with guid 34c88014-fdf0-4f25-b555-b58291d6f879
[App/0]   OUT Threads started: 1
...
[App/0]   OUT Threads started: 490
[App/0]   ERR Exception in thread &quot;main&quot; java.lang.OutOfMemoryError: unable to create new native thread
...
[DEA]     OUT Starting app instance (index 0) with guid 34c88014-fdf0-4f25-b555-b58291d6f879
[App/0]   OUT Threads started: 1
...
[App/0]   OUT Threads started: 490
[App/0]   ERR Exception in thread &quot;main&quot; java.lang.OutOfMemoryError: unable to create new native thread
[App/0]   ERR  at java.lang.Thread.start0(Native Method)
[App/0]   ERR  at java.lang.Thread.start(Thread.java:714)
[App/0]   ERR  at org.trastle.App.main(App.java:12)
&lt;/pre&gt;
So we can see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;The application starts a first time, then consumes 490 threads, then dies.&lt;/li&gt;
&lt;li&gt;Cloud Foundry notices, then restarts the failing application.&lt;/li&gt;
&lt;li&gt;The application starts a second time, then consumes 490 threads, then dies.&lt;/li&gt;
&lt;/ol&gt;
After a few more runs it became clear that &lt;strong&gt;490 threads&lt;/strong&gt; was a consistent max.&lt;br /&gt;


&lt;h2&gt;
Why do we not see this error on an Ubuntu Linux VM?&lt;/h2&gt;
The Stack we use in Cloud Foundry is Ubuntu Linux so testing this on a Debian VM we should be able to reproduce the failure. However our testers had already observed this was not the case.&lt;br /&gt;


So lets look at the &lt;tt&gt;max user processes&lt;/tt&gt; available on the VM:&lt;br /&gt;


&lt;pre&gt;tastle@tastle-debian:~$ ulimit -a
 core file size          (blocks, -c) 0
 data seg size           (kbytes, -d) unlimited
 scheduling priority             (-e) 0
 file size               (blocks, -f) unlimited
 pending signals                 (-i) 3824
 max locked memory       (kbytes, -l) 64
 max memory size         (kbytes, -m) unlimited
 open files                      (-n) 1024
 pipe size            (512 bytes, -p) 8
 POSIX message queues     (bytes, -q) 819200
 real-time priority              (-r) 0
 stack size              (kbytes, -s) 8192
 cpu time               (seconds, -t) unlimited
 max user processes              (-u) 3824
 virtual memory          (kbytes, -v) unlimited
 file locks                      (-x) unlimited
&lt;/pre&gt;
There are roughly 7x the user processes available to us on on the VM explaining why we could not see the issue. This is largely because the VM is tuned for a lower level of multi-tenancy the the Cloud Foundry Linux Container. In order to reproduce the error on the VM we can reduce the &lt;tt&gt;max user processes&lt;/tt&gt;&lt;br /&gt;


&lt;pre&gt;tastle@tastle-debian:~$ ulimit -u 512
tastle@tastle-debian:~$ ulimit -a
 core file size          (blocks, -c) 0
 data seg size           (kbytes, -d) unlimited
 scheduling priority             (-e) 0
 file size               (blocks, -f) unlimited
 pending signals                 (-i) 3824
 max locked memory       (kbytes, -l) 64
 max memory size         (kbytes, -m) unlimited
 open files                      (-n) 1024
 pipe size            (512 bytes, -p) 8
 POSIX message queues     (bytes, -q) 819200
 real-time priority              (-r) 0
 stack size              (kbytes, -s) 8192
 cpu time               (seconds, -t) unlimited
 max user processes              (-u) 512
 virtual memory          (kbytes, -v) unlimited
 file locks                      (-x) unlimited
&lt;/pre&gt;
Running the same test application now we see the following:&lt;br /&gt;


&lt;pre&gt;tastle@tastle-debian:~$ java -jar tgobbler-1.0.jar
...
Threads started: 500
Exception in thread &quot;main&quot; java.lang.OutOfMemoryError: unable to create new native thread
&lt;/pre&gt;
The result largely similar to what we saw in the Cloud Foundry Linux Container. The difference exists because the user processes available represent everything running as that user not just the Java application.&lt;br /&gt;


&lt;h2&gt;
Resolution &lt;/h2&gt;
We now know we will always be able to create roughly 490 Java threads within a single Cloud Foundry Linux Container.&lt;br /&gt;


It makes sense to leave some head room in each container so we will aim to utilise a &lt;strong&gt;maximum&lt;/strong&gt; of 90% of the available threads. This leaves us with a target maximum of 450 threads per Linux Container. When more threads are required we will scale out to multiple containers.&lt;br /&gt;


&lt;h2&gt;
Update: Changes to the Java Buildpack&lt;/h2&gt;
After discussing this &lt;a href=&quot;https://github.com/cloudfoundry/java-buildpack/issues/79&quot;&gt;issue&lt;/a&gt;, the Cloud Foundry team have very kindly integrated a call to &lt;tt&gt;ulimit -a&lt;/tt&gt; and &lt;tt&gt;df -h&lt;/tt&gt; into the kill script used in the Java Buildpack. The output of this script will also be surfaced over Loggregator making the information readily available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/1000553619752511585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2014/10/debugging-javalangoutofmemoryerror.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1000553619752511585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1000553619752511585'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2014/10/debugging-javalangoutofmemoryerror.html' title='Debugging java.lang.OutOfMemoryError: unable to create new native thread on Cloud Foundry'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-7996383067664839775</id><published>2014-10-01T09:07:00.002+01:00</published><updated>2014-10-01T09:07:53.073+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BOSH"/><category scheme="http://www.blogger.com/atom/ns#" term="CloudFoundry"/><category scheme="http://www.blogger.com/atom/ns#" term="Jenkins"/><category scheme="http://www.blogger.com/atom/ns#" term="Sensu"/><title type='text'>Extending Cloud Foundry with Open Source Toys</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
A talk that I gave with my colleague Matt Johnson describing how we have extended &lt;a href=&quot;http://cloudfoundry.org/index.html&quot; target=&quot;_blank&quot;&gt;Cloud Foundry&lt;/a&gt; using Open Source tools including: &lt;a href=&quot;http://jenkins-ci.org/&quot; target=&quot;_blank&quot;&gt;Jenkins&lt;/a&gt;, &lt;a href=&quot;http://sensuapp.org/&quot; target=&quot;_blank&quot;&gt;Sensu&lt;/a&gt;, &lt;a href=&quot;https://collectd.org/&quot; target=&quot;_blank&quot;&gt;CollectD&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://graphite.wikidot.com/&quot; target=&quot;_blank&quot;&gt;Graphite&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Presented at the &lt;a href=&quot;http://www.meetup.com/London-Cloud-Foundry-User-Group-LCFUG-Meetup/&quot;&gt;London Cloud Foundry User Group&lt;/a&gt; September 2014 meetup.
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;356&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;//www.slideshare.net/slideshow/embed_code/39722152&quot; style=&quot;border-width: 1px; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;&quot; width=&quot;427&quot;&gt; &lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 5px;&quot;&gt;
&lt;strong&gt; &lt;a href=&quot;https://www.slideshare.net/trastle/extending-cloud-foundry-london-cf-user-group-sept-2014pptx&quot; target=&quot;_blank&quot; title=&quot;Extending Cloud Foundry - London CF User Group Sept 2014.pptx&quot;&gt;Extending Cloud Foundry - London CF User Group Sept 2014.pptx&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/trastle&quot; target=&quot;_blank&quot;&gt;Troy Astle&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/7996383067664839775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2014/10/extending-cloud-foundry-with-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7996383067664839775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7996383067664839775'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2014/10/extending-cloud-foundry-with-open.html' title='Extending Cloud Foundry with Open Source Toys'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-3851332181755260846</id><published>2014-09-25T11:49:00.000+01:00</published><updated>2014-09-25T11:49:46.705+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BOSH"/><category scheme="http://www.blogger.com/atom/ns#" term="CloudFoundry"/><title type='text'>Taking blobs from BOSH releases</title><content type='html'>&lt;p&gt;When developing BOSH releases we quite often take packages from existing BOSH releases to save time. Finding the binary blobs you need for the package (from the .blobs directory) is a pain, the files in this directory are all UUIDs making them difficult to work with.&lt;p&gt;

&lt;p&gt;To resolve this issue I wrote a small function for my .bashrc to copy the blobs to a new directory and reverse the UUID naming process that takes place when you upload the blobs using BOSH.&lt;/p&gt;


&lt;script src=&quot;https://gist.github.com/trastle/c732316c5e19d6e30545.js&quot;&gt;&lt;/script&gt;


&lt;p&gt;The usage pattern for the function is as follows:&lt;/p&gt;

&lt;pre&gt;
you@yourpc $ git clone git@github.com:FreightTrain/sensu-client-boshrelease.git
you@yourpc $ cd sensu-client-boshrelease
you@yourpc $ bosh create release
...
you@yourpc $ bosh-blobs-realize
...
&lt;/pre&gt;

&lt;p&gt;I hope someone finds this useful.&lt;/p&gt;
&lt;p&gt;Troy&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/3851332181755260846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2014/09/taking-blobs-from-bosh-releases.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/3851332181755260846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/3851332181755260846'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2014/09/taking-blobs-from-bosh-releases.html' title='Taking blobs from BOSH releases'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-7856651530368744883</id><published>2014-06-15T18:18:00.002+01:00</published><updated>2014-06-15T18:28:09.180+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BOSH"/><category scheme="http://www.blogger.com/atom/ns#" term="cfsummit"/><category scheme="http://www.blogger.com/atom/ns#" term="CloudFoundry"/><title type='text'>Cloud Foundry Summit 2014 Lighting Talk</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
At this year&#39;s &lt;a href=&quot;http://cfsummit.com/&quot; target=&quot;_blank&quot;&gt;CF Summit&lt;/a&gt;, I was given the opportunity to speak with my colleague &lt;a href=&quot;http://www.matt-j.co.uk/&quot; target=&quot;_blank&quot;&gt;Matt Johnson&lt;/a&gt; about using &lt;a href=&quot;http://cloudfoundry.org/&quot; target=&quot;_blank&quot;&gt;Cloud Foundry&lt;/a&gt; and BOSH at Cisco. The talk covers some of the pain points we had adopting Cloud Foundry, how things have improved and the open source automation pipeline we built to reliably deploy and test our Cloud Foundry installations.&lt;br /&gt;
&lt;br /&gt;
The slides from the talk are up&amp;nbsp;&lt;a href=&quot;http://www.slideshare.net/trastle/a-year-with-cloud-foundry-and-bosh&quot; target=&quot;_blank&quot;&gt;on SlideShare&lt;/a&gt;&amp;nbsp;if you want to take a look.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-fSkk5thGeyI/U53TQ6cZWHI/AAAAAAAAswI/yKN-0GJH5bk/s1600/2014+-+4&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-fSkk5thGeyI/U53TQ6cZWHI/AAAAAAAAswI/yKN-0GJH5bk/s1600/2014+-+4&quot; height=&quot;360&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Cloud Foundry Summit 2014&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/7856651530368744883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2014/06/cloud-foundry-summit-2014-lighting-talk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7856651530368744883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7856651530368744883'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2014/06/cloud-foundry-summit-2014-lighting-talk.html' title='Cloud Foundry Summit 2014 Lighting Talk'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-fSkk5thGeyI/U53TQ6cZWHI/AAAAAAAAswI/yKN-0GJH5bk/s72-c/2014+-+4" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-2170033936002810936</id><published>2014-03-04T17:57:00.001+00:00</published><updated>2014-06-15T18:28:38.985+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CloudFoundry"/><title type='text'>Setting the Disk Quota for your Cloud Foundry apps</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;h3&gt;
Setting the disk quota using a manifest&lt;/h3&gt;
It is possible to set the disk quota for an application using the application&#39;s &lt;code&gt;`manifest.yml&lt;/code&gt;`.
The required property is disk_quota:
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;---
applications:
- name: testapp-large-disk
  memory: 512M
  instances: 1
  disk_quota: 3072
  path: .&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
Setting the disk quota manually&lt;/h3&gt;
There is currently no CLI command to set the disk quota for an app, however it is supported by the Cloud Foundry REST API. This means you can set the disk quota using the &lt;code&gt;`cf curl&lt;/code&gt;` command.&lt;br /&gt;
&lt;h4&gt;
Example commands&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;$ cf curl /v2/apps

# Find the metadata.guid for the app you want to increase the disk quota of

$ cf curl /v2/apps/[APP-GUID-HERE] -X PUT -d &#39;{&quot;disk_quota&quot;:2048}&#39;&lt;/code&gt;&lt;/pre&gt;
&lt;strong&gt;Note&lt;/strong&gt;: You will need to set the &lt;code&gt;`disk_quota&lt;/code&gt;` to the number of megabytes of disk quota you require for your application. This must be less than the maximum allowed disk quota or the command will fail.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/2170033936002810936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2014/03/setting-disk-quota-for-your-cloud.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2170033936002810936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2170033936002810936'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2014/03/setting-disk-quota-for-your-cloud.html' title='Setting the Disk Quota for your Cloud Foundry apps'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-8777167322101752806</id><published>2013-05-23T14:41:00.003+01:00</published><updated>2013-05-23T14:41:59.000+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chrome"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="UI"/><category scheme="http://www.blogger.com/atom/ns#" term="WindowButtons"/><category scheme="http://www.blogger.com/atom/ns#" term="WindowControls"/><title type='text'>Move the window controls to the left in Chrome on Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I regularly switch between using Mac&#39;s and Linux machines at home and at work and as such I like to keep my window controls consistent across machines.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My home machine is a Mac running OSX 10.08 and my work Laptop runs Ubuntu Linux 13.04 with Gnome Shell. Both of these desktops have their window controls on the left in the same order:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUAzsZ6STJxNXS0A3-M56e2fLTMr0skN068tWWwzA8fyQ3mWp2n2Ftu-1fVQpsG7fhczR0FlppJJaFxBpEL7vfVZ4PXnwhX1j4CSbhK2mAtMLw4vVTybhQigqsnxK67AsQ6LcNV0dA9c8/s1600/Screen+Shot+2013-05-20+at+11.19.30+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUAzsZ6STJxNXS0A3-M56e2fLTMr0skN068tWWwzA8fyQ3mWp2n2Ftu-1fVQpsG7fhczR0FlppJJaFxBpEL7vfVZ4PXnwhX1j4CSbhK2mAtMLw4vVTybhQigqsnxK67AsQ6LcNV0dA9c8/s1600/Screen+Shot+2013-05-20+at+11.19.30+PM.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
OSX 10.8&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi18oDBGNFF2vlvB3Qr2pOIFeXb2WHBZEb49mqHOOctgnKfgqU0mB6YEXK6Qk1vyjuNQpUfdymHXecmwxosqQm8I58TinIugE6vwOPFgZYw3tGoEE3UaKBzQ3Eeq8_DjvqL8eZp_xOExj0/s1600/ubuntu_default.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi18oDBGNFF2vlvB3Qr2pOIFeXb2WHBZEb49mqHOOctgnKfgqU0mB6YEXK6Qk1vyjuNQpUfdymHXecmwxosqQm8I58TinIugE6vwOPFgZYw3tGoEE3UaKBzQ3Eeq8_DjvqL8eZp_xOExj0/s1600/ubuntu_default.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Ubuntu 13.04&amp;nbsp;+ Gnome Shell&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
This is all nice and harmonious until I install my preferred browser, Google Chrome, on Ubuntu. Chrome places its window controls on the right as per the MS Windows layout.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw-eL3TQBM3q8oqATQ1L2LaykNqZ_7Zkjl_o7eiPXuh9gTa3sGyEyBI_Rm6UgjOz4NQJce8R25g-MneppFxYjj4Q_mA8dqLn-kDI6-XOkSGCFvoZT3n6Q-E-Ed-qACh4FOvITmbFa02FU/s1600/chrome_default.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw-eL3TQBM3q8oqATQ1L2LaykNqZ_7Zkjl_o7eiPXuh9gTa3sGyEyBI_Rm6UgjOz4NQJce8R25g-MneppFxYjj4Q_mA8dqLn-kDI6-XOkSGCFvoZT3n6Q-E-Ed-qACh4FOvITmbFa02FU/s1600/chrome_default.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Google Chrome&amp;nbsp;+ Ubuntu 13.04&amp;nbsp;+ Gnome Shell (Default)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
To resolve this you can change the default configuration exposed by Chrome by entering the following command at the terminal:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre&gt;$ gconftool-2 --set /apps/metacity/general/button_layout --type string &quot;close,minimize,maximize:&quot;&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b style=&quot;color: #333333; font-family: Arial, serif; font-size: 14px; line-height: 22.390625px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 22.390625px;&quot;&gt;To re-load the configuration you&#39;ll need to start a new desktop session (log out or restart). Once this is done your chrome window controls will fit in with the rest of your system.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBlX__7mwaG6q6452Z4QNGeluHrN_-m6Mv-32DR53p0J-GLTnFY4M-dJppktlruoovS6KFJ4NvX4-JuqvkVDtasOD3b_r2f7AAMyZJZD9QsTFgrqtuMY9nHWyeNgdeloRYUJ19AvQtC2I/s1600/Screenshot+from+2013-05-23+14:38:01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBlX__7mwaG6q6452Z4QNGeluHrN_-m6Mv-32DR53p0J-GLTnFY4M-dJppktlruoovS6KFJ4NvX4-JuqvkVDtasOD3b_r2f7AAMyZJZD9QsTFgrqtuMY9nHWyeNgdeloRYUJ19AvQtC2I/s1600/Screenshot+from+2013-05-23+14:38:01.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Google Chrome&amp;nbsp;+ Ubuntu 13.04&amp;nbsp;+ Gnome Shell (Modified)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
I know I&#39;ll want to do this again some time and am writing this here for my own reference, hopefully someone else finds it useful also.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/8777167322101752806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2013/05/move-window-controls-to-left-in-chrome.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/8777167322101752806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/8777167322101752806'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2013/05/move-window-controls-to-left-in-chrome.html' title='Move the window controls to the left in Chrome on Ubuntu'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUAzsZ6STJxNXS0A3-M56e2fLTMr0skN068tWWwzA8fyQ3mWp2n2Ftu-1fVQpsG7fhczR0FlppJJaFxBpEL7vfVZ4PXnwhX1j4CSbhK2mAtMLw4vVTybhQigqsnxK67AsQ6LcNV0dA9c8/s72-c/Screen+Shot+2013-05-20+at+11.19.30+PM.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-5607123349803912240</id><published>2013-03-01T05:30:00.000+00:00</published><updated>2013-03-01T09:48:11.932+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><category scheme="http://www.blogger.com/atom/ns#" term="RAM"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><title type='text'>Discover how much memory is installed in OSX from the terminal</title><content type='html'>&lt;p&gt;Today I was sitting SSHed into an OSX box and needed to know how much RAM was physically installed in the machine. Top of course told me how much RAM was in use however finding the installed RAM took me a few minutes longer than I would have liked.&lt;/p&gt;

&lt;p&gt;So this is a note to myself for next time, use the following:&lt;/p&gt;

&lt;pre&gt;trastle$ system_profiler |  grep -A 9 &quot;BANK [0-9]/DIMM[0-9]&quot;
        BANK 0/DIMM0:

          Size: 2 GB
          Type: DDR3
          Speed: 1333 MHz
          Status: OK
          Manufacturer: 0x80AD
          Part Number: 0x484D54333235533642465238432D48392020
          Serial Number: 0xDEADBEEF

        BANK 1/DIMM0:

          Size: 2 GB
          Type: DDR3
          Speed: 1333 MHz
          Status: OK
          Manufacturer: 0x80AD
          Part Number: 0x484D54333235533642465238432D48392020
          Serial Number: 0xDEADBEEF&lt;/pre&gt;

&lt;p&gt;Have fun!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/5607123349803912240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2013/03/discover-how-much-memory-is-installed.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5607123349803912240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5607123349803912240'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2013/03/discover-how-much-memory-is-installed.html' title='Discover how much memory is installed in OSX from the terminal'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-5791225442617814415</id><published>2013-02-27T00:44:00.000+00:00</published><updated>2013-02-27T00:46:11.200+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="RaspberryPi"/><category scheme="http://www.blogger.com/atom/ns#" term="Raspian"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="WeatherStation"/><title type='text'>Raspberry Pi + Weather Station = A bit of fun</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Over the past six months or so I have been working on a new release of the &lt;a href=&quot;http://wow.metoffice.gov.uk/&quot; target=&quot;_blank&quot;&gt;UK Met Office&#39;s WOW service&lt;/a&gt;. It&#39;s been a fun project so when my Dad&#39;s birthday rolled around earlier in the year I decided the best way to show him what I was working on was to give him a weather station and hook it up to WOW.&lt;br /&gt;
&lt;br /&gt;
In the end I bought him a &lt;a href=&quot;http://www.clasohlson.com/uk/Weather-Station/Pr363242000&quot; target=&quot;_blank&quot;&gt;USB weather station&lt;/a&gt; and a &lt;a href=&quot;http://www.raspberrypi.org/&quot; target=&quot;_blank&quot;&gt;Raspberry Pi&lt;/a&gt; and hooked the two together to upload data to the web. I have finally gotten around to writing up some instructions for the project and have posted them on github along with a couple of bash and udev files to make the process easier.&lt;br /&gt;
&lt;br /&gt;
For anyone who is interested in using a Raspberry Pi to upload data from their USB weather station the instructions are here: &lt;a href=&quot;http://trastle.github.com/rpi-weather/&quot;&gt;http://trastle.github.com/rpi-weather/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://trastle.github.com/rpi-weather/&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhX1sVfhDjDVlcYzsxz-6le7XxtRSDvpZwFSfOL1XXcVPT11xfQoCKx-sf7zF6PnNxOt5DHgMfmpgjCmSa_dlxG-SLEWgW6LOLd-SgNTWvUMMgjNdc_NThCOVw7YUloAKStnAGS3J5yLQ/s1600/Screen+Shot+2013-02-27+at+12.42.13+AM.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/5791225442617814415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2013/02/over-past-six-months-or-so-i-have-been.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5791225442617814415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5791225442617814415'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2013/02/over-past-six-months-or-so-i-have-been.html' title='Raspberry Pi + Weather Station = A bit of fun'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhX1sVfhDjDVlcYzsxz-6le7XxtRSDvpZwFSfOL1XXcVPT11xfQoCKx-sf7zF6PnNxOt5DHgMfmpgjCmSa_dlxG-SLEWgW6LOLd-SgNTWvUMMgjNdc_NThCOVw7YUloAKStnAGS3J5yLQ/s72-c/Screen+Shot+2013-02-27+at+12.42.13+AM.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-1678461986000794569</id><published>2012-03-13T10:09:00.000+00:00</published><updated>2012-10-20T14:45:12.968+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamic views"/><title type='text'>Hiding elements from Blogger&#39;s Dynamic View Template</title><content type='html'>&lt;div&gt;I&#39;ve been playing a little with Blogger&#39;s Dynamic Views template in the past week, so far it seems pretty neat for photo based content.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div&gt;One of the quirks of the new Dynamic Views is that, unlike standard Blogger templates, users cannot edit the HTML of the page. This is a pretty huge drawback but it is tempered by the fact that you can still &lt;a href=&quot;http://support.google.com/blogger/bin/answer.py?hl=en&amp;amp;answer=175740&quot;&gt;modify the CSS using the template designer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div&gt;In order to make the blog I was working on a little less cluttered I wanted to hide a number of elements on the page. This may be useful to others so I have itemised my changes below.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the search box (from the top right):&lt;/span&gt;
&lt;pre&gt;/* Hide search */
.header-bar #search{ display: none !important; }&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the Google Chrome feedback link (from the bottom right):&lt;/span&gt;
&lt;pre&gt;/* Hide the google chrome feedback button */
a.feedback  { display: none !important; }&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the &quot;Home&quot; button (from the pages list):&lt;br /&gt;
Note: This assumes the home button is the first page in your list of pages.&lt;/span &gt;
&lt;pre&gt;/* Hide the home button */
#pages ul li:first-child  { display: none !important; }
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the &quot;Sharing Controls&quot; (Facebook, Twitter buttons etc):&lt;/span &gt;
&lt;pre&gt;/* Hide the sharing controls */ 
.share-controls { display: none !important; }
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the gadget dock (from the right hand side of the page):&lt;/span &gt;
&lt;pre&gt;/* Hide the gadget Dock */
#gadget-dock { display: none !important; }
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the views on the main page:&lt;/span &gt;
&lt;pre&gt;
/* Hide the views on the main page */
#views  { display: none !important; }
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;div&gt;
&lt;span style=&quot;font-style:italic&quot;&gt;Hide the dynamic view switcher:&lt;/span &gt;
&lt;pre&gt;/* Hide the views on the main page */
#views { display: none !important; }
/*Hide the vertical bar from before the first page link */
#pages::before { border-left-width: 0 !important;}&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div&gt;It is worth noting that these changes do not remove elements from the structure of the page (anyone reading the source of the page can still see the elements) but it does make the overall page a little cleaner.&lt;br /&gt; &lt;br /&gt;&lt;/div&gt;

&lt;div&gt;You can see the results of my changes &lt;a href=&quot;http://daily.troyastle.com/&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://morboandlrrr.blogspot.com/&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/1678461986000794569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2012/03/hiding-elements-from-bloggers-dynamic.html#comment-form' title='55 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1678461986000794569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1678461986000794569'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2012/03/hiding-elements-from-bloggers-dynamic.html' title='Hiding elements from Blogger&#39;s Dynamic View Template'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>55</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-1743748287897125689</id><published>2012-02-10T04:24:00.000+00:00</published><updated>2016-03-02T13:16:18.035+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="which"/><title type='text'>Bash function to show the linked locations of a binary</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The &lt;a href=&quot;http://unixhelp.ed.ac.uk/CGI/man-cgi?which&quot;&gt;which&lt;/a&gt; command on Linux will show you the location, from your &lt;a href=&quot;http://en.wikipedia.org/wiki/PATH_(variable)&quot;&gt;PATH&lt;/a&gt;, that a binary will be executed from.&lt;br /&gt;
&lt;pre&gt;trastle@w500:~$ which javac
/usr/bin/javac&lt;/pre&gt;
&lt;br /&gt;
This is very useful, however often you will find that the location in your PATH is actually a symbolic link to another location.&lt;br /&gt;
&lt;pre&gt;trastle@w500:~$ which java | xargs readlink $1
/etc/alternatives/java&lt;/pre&gt;
&lt;br /&gt;
This in turn can be another symbolic link:&lt;br /&gt;
&lt;pre&gt;trastle@w500:~$ which java | xargs readlink $1 | xargs readlink $1
/opt/ibm/java/ibm-java2-i386-60/bin/java&lt;/pre&gt;
&lt;br /&gt;
This means it can take a few commands to view all the links in play when a command is called. Oddly I find myself doing this quite often so I throw a small function in my .bashrc to help out:&lt;br /&gt;
&lt;pre&gt;function whichlink
{
  local loc=`/usr/bin/which $1`;
  echo &quot;$loc&quot;
  
  while [ -h &quot;$loc&quot; ]
  do
    loc=`/bin/readlink $loc`
    echo &quot;--&amp;gt; $loc&quot;
  done
}&lt;/pre&gt;
&lt;br /&gt;
The output is as follows:&lt;br /&gt;
&lt;pre&gt;trastle@w500:~$ whichlink javac
/usr/bin/javac
--&amp;gt; /etc/alternatives/javac
--&amp;gt; /opt/ibm/java/ibm-java2-i386-60/bin/java&lt;/pre&gt;
&lt;br /&gt;
Alternately if you don&#39;t want to print all of the links along the way and just want to know the final destination the following is useful:&lt;br /&gt;
&lt;pre&gt;trastle@w500:~$ readlink -f `which javac`
/opt/ibm/java/ibm-java2-i386-60/bin/javac&lt;/pre&gt;
&lt;br /&gt;
I am certain at some point I&#39;ll want to do this on another machine and text is more reliable than my long term memory. Enjoy.&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1743748287897125689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1743748287897125689'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2012/02/bash-function-to-show-linked-locations.html' title='Bash function to show the linked locations of a binary'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-7968138398705205154</id><published>2011-11-29T14:33:00.000+00:00</published><updated>2011-11-29T14:33:17.648+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="rsync"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><title type='text'>Using --exclude-from in rsync</title><content type='html'>I&#39;ve been toying with some &lt;a href=&quot;http://en.wikipedia.org/wiki/Rsync&quot;&gt;rsync&lt;/a&gt; scripts tonight and after reading the &lt;a href=&quot;http://www.samba.org/ftp/rsync/rsync.html&quot;&gt;rsync man page&lt;/a&gt; I still needed a little trial and error to determine the exact behaviour of the &lt;tt&gt;--exclude-from&lt;/tt&gt; flag. &lt;br /&gt;
&lt;br /&gt;
The &lt;tt&gt;--exclude-from&lt;/tt&gt; flag specifies a file that contains exclude patterns (one per line). The rsync man page is VERY detailed on the subject of filters and how they can be used. &lt;br /&gt;
&lt;br /&gt;
Looking at a simplified version of my scenario, consider the following directory structure:&lt;br /&gt;
&lt;pre&gt;   Source
   |---.DS_Store
   |---Alpha
   |  |---.DS_Store
   |  |---Document 1.txt
   |  |---Document 2.txt
   |  `---Temporary Items
   |     |---.DS_Store
   |     |---TI1.tmp
   |     `---TI2.tmp
   |---Beta
   |  |---.DS_Store
   |  |---Document 3.txt
   |  |---Document 4.txt
   |  `---Temporary Items
   |     |---.DS_Store
   |     |---TI2.tmp
   |     `---TI4.tmp
   `---Temporary Items
      |---.DS_Store
      `---TI5.tmp
&lt;/pre&gt;I want backup the Source directory shown above and exclude the following from my backup:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;All of the &quot;.DS_Store&quot; files.&lt;/li&gt;
&lt;li&gt;All of the &quot;Temporary Items&quot; directories.&lt;/li&gt;
&lt;li&gt;All files contained in the &quot;Temporary Items&quot; directories.&lt;/li&gt;
&lt;/ol&gt;My final backup will look like this:&lt;br /&gt;
&lt;pre&gt;   Destination
   |---Alpha
   |  |---Document 1.txt
   |  `---Document 2.txt
   `---Beta
      |---Document 3.txt
      `---Document 4.txt
&lt;/pre&gt;&lt;br /&gt;
Making this happen is very simple. The exclusions file (skip.txt) only needs to contain the following two lines:&lt;br /&gt;
&lt;pre&gt;Temporary Items
.DS_Store
&lt;/pre&gt;The rsync command to perform the backup is as follows:&lt;br /&gt;
&lt;pre&gt;rsync -az  --exclude-from=./skip.txt ./Source/ ./Destination/&lt;/pre&gt;The output of this command is the &quot;Destination&quot; directory shown above.&lt;br /&gt;
&lt;br /&gt;
There were two things that caused me greif getting my script to work:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;To exclude a file (or directory) with spaces in the name, the names &lt;strong&gt;DO NOT&lt;/strong&gt; need to be quoted or escaped.&lt;/li&gt;
&lt;li&gt;To exclude all files underneath a directory you need only exclude the directory itself.&lt;/li&gt;
&lt;/ol&gt;Now that this is committed to my long term memory I can move on.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/7968138398705205154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2011/11/using-exclude-from-in-rsync.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7968138398705205154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7968138398705205154'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2011/11/using-exclude-from-in-rsync.html' title='Using --exclude-from in rsync'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-1034477244577359697</id><published>2011-11-21T05:23:00.001+00:00</published><updated>2011-11-21T05:23:51.234+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ISO8859-1"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Fixing unmappable character during Java compilation on Ubuntu</title><content type='html'>In the lab we have a standard header at the top of our source files, a copyright statement and licence. This header contains an &lt;a href=&quot;http://en.wikipedia.org/wiki/ISO/IEC_8859-1&quot;&gt;ISO 8859-1&lt;/a&gt; encoded copyright character (©).&lt;br /&gt;
&lt;br /&gt;
Normally the header blurs into the background, the exception to this rule is the first time a do a build on a new Ubuntu system and I see the following error: &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[javac] /src/com/yourcorp/HelloWorld.java:8: unmappable character for encoding ASCII
[jacac] /* ?? Copyright Yourcorp 2011&lt;/pre&gt;&lt;br /&gt;
The Java compiler is expecting ASCII characters rather than ISO 8859-1. To resolve this error I do the following:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Edit &lt;b&gt;/var/lib/locales/supported.d/local&lt;/b&gt; and add:&lt;br /&gt;
&lt;pre&gt;en_AU ISO-8859-1
en_US ISO-8859-1

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Open a terminal and run:&lt;br /&gt;
&lt;pre&gt;$ sudo dpkg-reconfigure locales

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Edit &lt;b&gt;/etc/environment&lt;/b&gt; and add:&lt;br /&gt;
&lt;pre&gt;LANG=&quot;EN_US&quot;

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Reboot.&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;With Ubuntu being so stable these days it&#39;s a long time between re-installs so I have posted this here for next time when I forget.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/1034477244577359697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2011/11/fixing-unmappable-character-during-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1034477244577359697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1034477244577359697'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2011/11/fixing-unmappable-character-during-java.html' title='Fixing unmappable character during Java compilation on Ubuntu'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-2130645095502720036</id><published>2011-06-26T08:54:00.074+01:00</published><updated>2011-07-06T00:49:40.523+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dbus"/><category scheme="http://www.blogger.com/atom/ns#" term="gnome-screensaver"/><category scheme="http://www.blogger.com/atom/ns#" term="sudo"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Run scripts when gnome-screensaver starts or stops in Ubuntu</title><content type='html'>For a project I have been playing with I need to be able to run a script when gnome-screensaver starts or stops on Ubuntu (10.04). &lt;br /&gt;
&lt;br /&gt;
The gnome-screensaver &lt;a href=&quot;http://live.gnome.org/GnomeScreensaver/FrequentlyAskedQuestions&quot;&gt;FAQ&lt;/a&gt; provides detail on the dbus signal fired when gnome-screensaver activates and deactivates. The FAQ even has sample perl code to respond to the signal. Unfortunately the sample code polls dbus-monitor which is too inefficient for script I plan to run in the background on my laptop.&lt;br /&gt;
&lt;br /&gt;
Python offers a great &lt;a href=&quot;http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html&quot;&gt;dbus library&lt;/a&gt; which allows signal receivers to be registered with dbus resulting in an efficient event listener.&lt;br /&gt;
&lt;br /&gt;
On to the script.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 1: Setup the required files and directories&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Make a directory for your work:&lt;br /&gt;
&lt;pre&gt;sudo mkdir -p /opt/ssTrigger&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Change yourself the owner of the new directory:&lt;br /&gt;
&lt;pre&gt;sudo chown `whoami`:`whoami` /opt/ssTrigger&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Create stubs for the scripts to be used&lt;br /&gt;
&lt;pre&gt;touch /opt/ssTrigger/ssTrigger /opt/ssTrigger/ssStart /opt/ssTrigger/ssStop&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Make the stub scripts executable:&lt;br /&gt;
&lt;pre&gt;chmod 755 /opt/ssTrigger/*&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Step 2: Edit the ssTrigger script&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open the ssTriger file created earlier:&lt;br /&gt;
&lt;pre&gt;gedit /opt/ssTrigger/ssTrigger&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add the following to ssTrigger:&lt;br /&gt;
&lt;pre&gt;#!/usr/bin/env python
from gobject import MainLoop
from dbus import SessionBus
from dbus.mainloop.glib import DBusGMainLoop
from subprocess import Popen

class SSTrigger:
    def __init__(self):
        DBusGMainLoop(set_as_default=True)
        self.mem=&#39;ActiveChanged&#39;
        self.dest=&#39;org.gnome.ScreenSaver&#39;
        self.bus=SessionBus()
        self.loop=MainLoop()
        self.bus.add_signal_receiver(self.catch,self.mem,self.dest)
    def catch(self,ssOn):
        if ssOn == 1: #Screensaver turned on
            Popen([&quot;/opt/ssTrigger/ssStart&quot;])
        else: #Screensaver turned off
            Popen([&quot;/opt/ssTrigger/ssStop&quot;])

SSTrigger().loop.run()
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Save and close the file.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Step 3: Set ssTrigger to start when you login:&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open the Startup Applications menu:&lt;br /&gt;
System -&gt; Preferences -&gt; Startup Applications&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Click &quot;Add&quot; to create a new startup application.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Enter the following details:&lt;br /&gt;
Name: Screensaver Trigger Script&lt;br /&gt;
Command: /opt/ssTrigger/ssTrigger&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Click &quot;Add&quot; to save your new application.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Restart your computer.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Finishing up:&lt;/strong&gt;&lt;br /&gt;
Once you have restarted you can run:&lt;br /&gt;
&lt;pre&gt;ps aux | grep ssTrigger&lt;/pre&gt;Check the output to make sure the ssTrigger script has started at login.&lt;br /&gt;
&lt;br /&gt;
Edit the &lt;strong&gt;ssStart&lt;/strong&gt; and &lt;strong&gt;ssStop&lt;/strong&gt; scripts to run commands as gnome-screensaver starts and stops respectively.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/2130645095502720036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2011/06/run-scripts-when-gnome-screensaver.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2130645095502720036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2130645095502720036'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2011/06/run-scripts-when-gnome-screensaver.html' title='Run scripts when gnome-screensaver starts or stops in Ubuntu'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-2337439753586412182</id><published>2011-06-24T14:39:00.011+01:00</published><updated>2011-12-05T23:14:18.946+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apt-get"/><category scheme="http://www.blogger.com/atom/ns#" term="Firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Natty"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Downgrade to Firefox 3.6 on Ubuntu 11.04 Natty</title><content type='html'>We have a requirement in the office to downgrade to Firefox 3.6 on some test machines running Ubuntu Natty (11.04). To do this you can pin the firefox and firefox-branding packages to older packages from the Ubuntu Maverick (10.10) release.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 1: Edit your software sources to add Maverick&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open your sources.list file:&lt;br /&gt;
&lt;pre&gt;sudo gedit /etc/apt/sources.list&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Add the folowing three lines:&lt;br /&gt;
&lt;pre&gt;# Maverick, used for firefox and firefox-branding 
deb http://ftp.iinet.net.au/pub/ubuntu/ maverick main 
deb http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates main&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Save and close the file&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Step 2: Pin the packages firefox and firefox-branding&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Create the pin file for firefox:&lt;br /&gt;
&lt;pre&gt;sudo gedit /etc/apt/preferences.d/firefox&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Add the following:&lt;br /&gt;
&lt;pre&gt;Package: firefox
Pin: release n=natty
Pin-Priority: -10

Package: firefox
Pin: release n=maverick
Pin-Priority: 900&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Save and close the file.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Create the pin file for firefox-branding:&lt;br /&gt;
&lt;pre&gt;sudo gedit /etc/apt/preferences.d/firefox-branding&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Add the following:&lt;br /&gt;
&lt;pre&gt;Package: firefox-branding
Pin: release n=natty
Pin-Priority: -10

Package: firefox-branding
Pin: release n=maverick
Pin-Priority: 900&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Save and close the file.&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Step 3: Check your apt policy to make sure it worked&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Update your apt cache:&lt;br /&gt;
&lt;pre&gt;sudo apt-get update&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Show the apt policy for firefox:&lt;br /&gt;
&lt;pre&gt;sudo apt-cache policy firefox&lt;/pre&gt;&lt;br /&gt;
Sample output:&lt;br /&gt;
&lt;pre&gt;sudo apt-cache policy firefox
firefox:
  Installed: 5.0+build1+nobinonly-0ubuntu0.11.04.2
  Candidate: 3.6.18+build2+nobinonly-0ubuntu0.10.10.1
  Package pin: 3.6.18+build2+nobinonly-0ubuntu0.10.10.1
  Version table:
 *** 5.0+build1+nobinonly-0ubuntu0.11.04.2 900
        500 http://ftp.iinet.net.au/pub/ubuntu/ natty-updates/main i386 Packages
        500 http://ftp.iinet.net.au/pub/ubuntu/ natty-security/main i386 Packages
        100 /var/lib/dpkg/status
     4.0+nobinonly-0ubuntu3 900
        500 http://ftp.iinet.net.au/pub/ubuntu/ natty/main i386 Packages
     3.6.18+build2+nobinonly-0ubuntu0.10.10.1 900
        500 http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates/main i386 Packages
     3.6.10+build1+nobinonly-0ubuntu3 900
        500 http://ftp.iinet.net.au/pub/ubuntu/ maverick/main i386 Packages&lt;/pre&gt;&lt;br /&gt;
The line you are most interested in is &quot;Candidate&quot;.&lt;br /&gt;
This indicates the package that apt ranks as the installation candidate.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Repeat this check for firefox-branding&lt;br /&gt;
&lt;pre&gt;sudo apt-cache policy firefox-branding&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;strong&gt;Step 4: Install firefox 3.6&lt;/strong&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Remove firefox 5.x:&lt;br /&gt;
&lt;pre&gt;sudo apt-get remove firefox&lt;/pre&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Install firefox 3.6:&lt;br /&gt;
&lt;pre&gt;sudo apt-get install firefox&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
And you&#39;re done. Enjoy your outdated version of Firefox!&lt;br /&gt;
&lt;br /&gt;
&lt;hr&gt;&lt;strong&gt;Update - July 24th 2011:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
How to reverse the process:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Remove these three (3) lines you added to /etc/apt/sources.list&lt;br /&gt;
&lt;pre&gt;# Maverick, used for firefox and firefox-branding 
deb http://ftp.iinet.net.au/pub/ubuntu/ maverick main 
deb http://ftp.iinet.net.au/pub/ubuntu/ maverick-updates main
&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;Unpin the firefox and firefox-branding packages:&lt;br /&gt;
&lt;pre&gt;sudo rm /etc/apt/preferences.d/firefox
sudo rm /etc/apt/preferences.d/firefox-branding
&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;Update your apt cache&lt;br /&gt;
&lt;pre&gt;sudo apt-get update
&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;Install the latest Firefox:&lt;br /&gt;
&lt;pre&gt;sudo apt-get upgrade
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Close ALL your Firefox windows and re-open Firefox.&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;hr&gt;&lt;strong&gt;Update - December 6th 2011:&lt;/strong&gt;&lt;br /&gt;
&lt;p&gt;From the comments people have posted below I can see that this process works to downgrade Firefox on Ubuntu 11.10 as well as Ubuntu 10.04.&lt;/p&gt;&lt;p&gt;Downgrading packages to the Ubuntu 10.10 release will only work on Ubuntu 11.04 or better. Do not use this procedure on Ubuntu releases older than 11.04. If you try to do this you will be upgrading packages not downgrading.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/2337439753586412182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2011/06/downgrade-to-firefox-36-on-ubuntu-natty.html#comment-form' title='22 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2337439753586412182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2337439753586412182'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2011/06/downgrade-to-firefox-36-on-ubuntu-natty.html' title='Downgrade to Firefox 3.6 on Ubuntu 11.04 Natty'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-4292143438470636159</id><published>2011-04-29T08:50:00.008+01:00</published><updated>2011-05-02T07:15:48.154+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clearlock"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="lock-input"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Lock input without a screen saver in Linux</title><content type='html'>We came across this problem in the office today. How do we lock the input devices on a Linux machine (we were using Ubuntu 11.04) and keep a the current applications showing and updating? The solution we ended up with was to use xlock.&lt;br /&gt;
&lt;br /&gt;
First you&#39;ll need to install xlock: &lt;br /&gt;
&lt;pre&gt;sudo apt-get install xlockmore&lt;/pre&gt;Then run xlock from a terminal with the following options: &lt;br /&gt;
&lt;pre&gt;xlock -mode blank -geometry 0x0 -timeout 2&lt;/pre&gt;&lt;br /&gt;
The xlock command locks keyboard and mouse input, the flags do the following:&lt;br /&gt;
&lt;tt style=&quot;color: #993300;&quot;&gt;-mode blank&lt;/tt&gt;  displays a blank box in the top left corner of your monitor.&lt;br /&gt;
&lt;tt style=&quot;color: #993300;&quot;&gt;-geometry 0x0&lt;/tt&gt;  makes the size of the blank box 0x0 pixels.&lt;br /&gt;
&lt;tt style=&quot;color: #993300;&quot;&gt;-timeout 2&lt;/tt&gt;  sets the timeout (in seconds) for the password prompt if anyone hits a key.&lt;br /&gt;
&lt;br /&gt;
Update 2011-05-02: A second (better) solution&lt;br /&gt;
&lt;br /&gt;
First you&#39;ll need to install xtrlock: &lt;br /&gt;
&lt;pre&gt;sudo apt-get install xtrlock&lt;/pre&gt;Then run xtrlock from a terminal: &lt;br /&gt;
&lt;pre&gt;xtrlock&lt;/pre&gt;&lt;br /&gt;
This will start xtrlock and lock the screen. To unlock the screen type your password and hit enter.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/4292143438470636159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2011/04/lock-input-without-screen-saver-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/4292143438470636159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/4292143438470636159'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2011/04/lock-input-without-screen-saver-in.html' title='Lock input without a screen saver in Linux'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-5346475255008513882</id><published>2010-10-15T01:56:00.000+01:00</published><updated>2010-10-15T01:56:45.102+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="do-release-upgrade"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Lucid"/><category scheme="http://www.blogger.com/atom/ns#" term="Maverick"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Upgrading from Lucid to Maverick using a local mirror</title><content type='html'>I maintain a local Ubuntu mirror in our Lab at work. This morning the first user tried to update from Lucid to Maverick. There was a couple of teething issues but with a couple of changes it went off without a hitch. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1: Correctly specify your mirror to the Software Sources dialog:&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open a terminal&lt;br&gt;&lt;br /&gt;
(Applications -&amp;gt; Accessories -&amp;gt; Terminal)&lt;/li&gt;
&lt;li&gt;Open your list of mirrors:&lt;br&gt;&lt;pre&gt;trastle$ sudo gedit /usr/share/python-apt/templates/Ubuntu.mirrors&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add a location for your local mirror. Mine looks like this:&lt;br&gt;&lt;pre&gt;...
#LOC:ADL
http://adl-mirror/ubuntu-repo/ubuntu/
...&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Save and close the file.&lt;/li&gt;
&lt;li&gt;Close the terminal.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Step 2: Select your mirror in the software sources dialog&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open the software sources dialog&lt;br&gt;(System -&amp;gt; Administration -&amp;gt; Software Sources)&lt;/li&gt;
&lt;li&gt;Open the &quot;&lt;b&gt;Ubuntu Software&lt;/b&gt;&quot; tab&lt;/li&gt;
&lt;li&gt;Click the &quot;&lt;b&gt;Download From:&lt;/b&gt;&quot; combo box.&lt;/li&gt;
&lt;li&gt;Select &quot;&lt;b&gt;Other...&lt;/b&gt;&quot;&lt;/li&gt;
&lt;li&gt;Select the mirror you just added from the list&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Choose Server&lt;/b&gt;&quot; at the bottom right.&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Close&lt;/b&gt;&quot; at the bottom right.&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Close&lt;/b&gt;&quot; in the information out of date dialog that pops up.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Step 3: Disable all third party sources&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open the software sources dialog&lt;br&gt;(System -&amp;gt; Administration -&amp;gt; Software Sources)&lt;/li&gt;
&lt;li&gt;Open the &quot;&lt;b&gt;Other Software&lt;/b&gt;&quot; tab&lt;/li&gt;
&lt;li&gt;Untick every source in the list.&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Close&lt;/b&gt;&quot; at the bottom right.&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Close&lt;/b&gt;&quot; in the information out of date dialog that pops up.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Step 4: Do the Upgrade&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Ensure your on a network with Internet access as well as access to your mirror.&lt;/li&gt;
&lt;li&gt;Open a terminal&lt;br&gt;(Applications -&amp;gt; Accessories -&amp;gt; Terminal)&lt;/li&gt;
&lt;li&gt;Change to the root user:&lt;br&gt;&lt;pre&gt;trastle$ sudo -i&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Update your available software:&lt;br&gt;&lt;pre&gt;root# apt-get update &lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Do the upgrade&lt;br&gt;&lt;pre&gt;root# do-release-upgrade &lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;The following message will appear shortly after starting the upgrade:&lt;br&gt;&lt;pre&gt;Updating repository information
WARNING: Failed to read mirror file

No valid mirror found 

While scanning your repository information no mirror entry for the 
upgrade was found. This can happen if you run a internal mirror or if 
the mirror information is out of date. 

Do you want to rewrite your &#39;sources.list&#39; file anyway? If you choose 
&#39;Yes&#39; here it will update all &#39;lucid&#39; to &#39;maverick&#39; entries. 
If you select &#39;No&#39; the upgrade will cancel.&lt;/pre&gt;Your using a local mirror so choose &lt;b&gt;Yes&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;The release upgrade will take some time to complete.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Step 5: Re-enable third party sources&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open the software sources dialog&lt;br&gt;(System -&amp;gt; Administration -&amp;gt; Software Sources)&lt;/li&gt;
&lt;li&gt;Open the &quot;&lt;b&gt;Other Software&lt;/b&gt;&quot; tab&lt;/li&gt;
&lt;li&gt;Tick the sources you want to use.&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Close&lt;/b&gt;&quot; at the bottom right.&lt;/li&gt;
&lt;li&gt;Click &quot;&lt;b&gt;Reload&lt;/b&gt;&quot; in the information out of date dialog that pops up.&lt;/li&gt;
&lt;/ol&gt;Enjoy your upgraded system.&lt;br /&gt;
I hope someone finds this helpful.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/5346475255008513882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2010/10/upgrading-from-lucid-to-maverick-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5346475255008513882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5346475255008513882'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2010/10/upgrading-from-lucid-to-maverick-using.html' title='Upgrading from Lucid to Maverick using a local mirror'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-1216204960969648867</id><published>2010-07-22T13:51:00.002+01:00</published><updated>2010-07-22T13:56:26.097+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Debian"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Lucid"/><category scheme="http://www.blogger.com/atom/ns#" term="QEMU"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><title type='text'>Building a ARM powered Debian VM with QEMU on Ubuntu Lucid</title><content type='html'>I have recently spent some time trying to get an emulated ARM machine up and running on an x86 Ubuntu Lucid host. Initially I wanted Ubuntu for the client OS but I found that the only ARM installers available were for the Ubuntu Netbook Edition, which does not suit my needs at this point. So I went with Debian Lenny (the current &lt;a href=&quot;http://www.debian.org/releases/stable/&quot;&gt;Debian stable&lt;/a&gt; release) which has a myriad of ARM installers available.&lt;br /&gt;
&lt;br /&gt;
When tracking down info about the Debian ARM port you&#39;ll quickly discover that there are two ports available &lt;a href=&quot;http://wiki.debian.org/ArmPort&quot;&gt;ARM&lt;/a&gt; and &lt;a href=&quot;http://wiki.debian.org/ArmEabiPort&quot;&gt;ARMEL&lt;/a&gt;. ARM is the original port (now&amp;nbsp;deprecated)&amp;nbsp;and ARMEL is name of the newer code stream which supports &lt;a href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html&quot;&gt;ARM EABI&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The emulation software I am using is &lt;a href=&quot;http://wiki.qemu.org/Main_Page&quot;&gt;QEMU&lt;/a&gt;. An open-source project started by &lt;a href=&quot;http://en.wikipedia.org/wiki/Fabrice_Bellard&quot;&gt;Fabrice Bellard&lt;/a&gt; (who also founded the &lt;a href=&quot;http://ffmpeg.org/&quot;&gt;ffmpeg&lt;/a&gt; project!). QEMU is fairly&amp;nbsp;versatile&amp;nbsp;and will emulate a myriad of CPU architectures including ARM, Sparc, PPC and even s390 (under KVM).&lt;br /&gt;
&lt;br /&gt;
The Ubuntu Lucid&amp;nbsp;repositories do contain packages for QEMU. However after installing via apt-get I found the binary failed out with a segmentation fault almost immediately. Not to worry the QEMU build system is easy to master.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Part 1: Building and installing QEMU:&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Download the QEMU source (0.12.4, the current release, is available &lt;a href=&quot;http://download.savannah.gnu.org/releases/qemu/qemu-0.12.4.tar.gz&quot;&gt;here&lt;/a&gt;):&lt;br /&gt;
&lt;pre&gt;trastle$ wget http://download.savannah.gnu.org/releases/qemu/qemu-0.12.4.tar.gz&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Unpack the tar ball:&lt;br /&gt;
&lt;pre&gt;trastle$ tar -xvvf qemu-0.12.4.tar.gz&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Install the required packages to build QEMU:&lt;br /&gt;
&lt;pre&gt;trastle$ sudo apt-get build-dep qemu&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Build and install QEMU:&lt;br /&gt;
&lt;pre&gt;trastle$ cd qemu-0.12.4
trastle$ ./configure
trastle$ make
trastle$ sudo make install&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Part 2: Install Debian Lenny in QEMU:&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Change to the directory you want to build your VM in:&lt;br /&gt;
&lt;pre&gt;trastle$ mkdir ~/arm
trastle$ cd ~/arm&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Download the current build of the Debian Lenny ARMEL kernel (vmlinuz) and installer (initrd) images from a local Debian mirror:&lt;br /&gt;
&lt;pre&gt;trastle$ wget ftp://ftp.au.debian.org/debian/dists/lenny/main/installer-armel
         /current/images/versatile/netboot/vmlinuz-2.6.26-2-versatile
trastle$ wget ftp://ftp.au.debian.org/debian/dists/lenny/main/installer-armel
         /current/images/versatile/netboot/initrd.gz&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Create a disk image for QEMU (more details on &lt;a href=&quot;http://wiki.qemu.org/download/qemu-doc.html#qemu_005fimg_005finvocation&quot;&gt;qemu-img&lt;/a&gt;).&lt;br /&gt;
Importantly, the raw format will allow you to mount the image from Ubuntu once its populated:&lt;br /&gt;
&lt;pre&gt;trastle$ qemu-img create -f raw armdisk.img 8G&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Start the Debian install with QEMU:&lt;br /&gt;
&lt;pre&gt;trastle$ qemu-system-arm -m 256 -M versatilepb \
         -kernel ~/arm/vmlinuz-2.6.26-2-versatile \
         -initrd ~/arm/initrd.gz \
         -hda ~/arm/armdisk.img -append &quot;root=/dev/ram&quot;&lt;/pre&gt;QEMU will open a terminal window and within that window the Lenny installer will kick into action. Follow the installer&#39;s directions and allow the install to begin. Installation will be slower than normal. Allow 4 or 5 hours for it to complete.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;As the install completes you&#39;ll be informed no boot loader is present, don&#39;t worry QEMU takes the place of the boot loader. Once the install completes the VM will reboot kicking off the installer again, don&#39;t proceed, just kill QEMU.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Part 3: Running your ARM Lenny install in QEMU:&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Once the installation is complete you will need to copy the initrd from the installed system. To do this you must &lt;a href=http://en.wikibooks.org/wiki/QEMU/Images#Mounting_an_image_on_the_host&quot;&gt;mount the QEMU disk image&lt;/a&gt;.&lt;br /&gt;
&lt;pre&gt;trastle$ mkdir ~/arm/mount/
trastle$ sudo mount -o loop,offset=32256 ~/arm/armdisk.img ~/arm/mount
trastle$ cp ~/arm/mount/boot/initrd.img-2.6.26-2-versatile ~/arm/.
trastle$ sudo umount ~/arm/mount
&lt;/pre&gt;32256 is not just a random number, it&#39;s the sector where the first disk partition begins.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Boot your Debian Lenny VM:&lt;br /&gt;
&lt;pre&gt;trastle$ qemu-system-arm -m 256 -M versatilepb \
         -kernel ~/arm/vmlinuz-2.6.26-2-versatile \
         -initrd ~/arm/initrd.img-2.6.26-2-versatile \
         -hda ~/arm/armdisk.img -append &quot;root=/dev/sda1&quot;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;Now you have a running ARM VM to do with as you please.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/1216204960969648867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1216204960969648867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1216204960969648867'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2010/07/building-arm-powered-debian-vm-with.html' title='Building a ARM powered Debian VM with QEMU on Ubuntu Lucid'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-3329206384813238271</id><published>2010-06-21T11:43:00.004+01:00</published><updated>2011-04-04T05:00:16.136+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grub"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Lucid"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><title type='text'>Boot to single user mode in Ubuntu 10.04 Lucid Lynx</title><content type='html'>This is symptomatic of how often I break X.org but I often need to boot my Ubuntu 10.04 machine into single user mode and fix some configuration file before rebooting into the GUI. I forget how to do it every time so here is how:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Hold the &lt;b&gt;Shift&lt;/b&gt; key at boot to display the Grub boot menu.&lt;/li&gt;
&lt;li&gt;Select the top Grub entry, it will be similar to: &lt;pre&gt;Ubuntu, with Linux 2.6.32-22-generic-pae&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Hit &lt;b&gt;e&lt;/b&gt; to edit the the Grub entry.&lt;/li&gt;
&lt;li&gt;Find the line that looks like this: &lt;pre&gt;linux /boot/vmlinuz-2.6.32-22-generic-pae
root=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
ro vga=794 quiet splash&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Change the line to: &lt;pre&gt;linux /boot/vmlinuz-2.6.32-22-generic-pae
root=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
init=/bin/bash rw&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Hit &lt;b&gt;crtl&lt;/b&gt;+&lt;b&gt;x&lt;/b&gt; to boot&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Your machine will now do a one time boot into single user mode. Once you reboot the changes you just made to Grub will be reverted.&lt;br /&gt;
&lt;br /&gt;
** /bin/sh corrected to /bin/bash thanks Hola2040.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/3329206384813238271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2010/06/boot-to-single-user-mode-in-ubuntu-1004.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/3329206384813238271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/3329206384813238271'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2010/06/boot-to-single-user-mode-in-ubuntu-1004.html' title='Boot to single user mode in Ubuntu 10.04 Lucid Lynx'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-6469544065177815413</id><published>2010-06-20T07:34:00.003+01:00</published><updated>2010-07-20T13:23:22.240+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BusyBox"/><category scheme="http://www.blogger.com/atom/ns#" term="cron"/><category scheme="http://www.blogger.com/atom/ns#" term="DroboApps"/><category scheme="http://www.blogger.com/atom/ns#" term="DroboFS"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Activate the cron daemon on a DroboFS</title><content type='html'>I recently purchased a &lt;a href=&quot;http://www.drobo.com/products/drobo-fs.php&quot;&gt;DroboFS&lt;/a&gt;&amp;nbsp;NAS from &lt;a href=&quot;http://www.drobo.com/&quot;&gt;DataRobotics&lt;/a&gt;. The device runs a minimal Marvell&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Linux&quot;&gt;Linux&lt;/a&gt; OS on top of a low power &lt;a href=&quot;http://en.wikipedia.org/wiki/ARM_architecture&quot;&gt;ARM&lt;/a&gt; CPU (&lt;a href=&quot;http://www.arm.com/products/processors/classic/arm9/arm926.php&quot;&gt;ARM926EJ-S&lt;/a&gt;).&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The DroboFS supports third party development through the &lt;a href=&quot;http://www.drobo.com/droboapps/apps-for-drobofs.php&quot;&gt;DroboApps&lt;/a&gt; platform. This allows end users to compile ARM applications using the GNU tool chain and run them on their DroboFS. On top of this these applications can be run as services using a small service API provided by DroboApps.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;A number of DroboApps are available to enable dormant services on the DroboFS including the SSH, HTTP and FTP servers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The DroboFS ships with a &lt;a href=&quot;http://en.wikipedia.org/wiki/Cron&quot;&gt;cron&lt;/a&gt; daemon tucked away at /usr/sbin/crond however there is no DroboApp available to enable the daemon. To rectify this I have written a small DroboApp script to activate the cron daemon at boot.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;To get cron running as a service you&#39;ll need to do the following:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Enable DroboApps on your DroboFS.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Install the Dropbear SSH DroboApp.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;SSH into your DroboFS&lt;/li&gt;
&lt;li&gt;Create a directory for the cron DroboApp:&lt;br /&gt;
&lt;pre&gt;mkdir /mnt/DroboFS/Shares/DroboApps/crond&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Save the following service.sh into your cron DroboApp directory &lt;br /&gt;
&lt;pre&gt;#!/bin/sh
# ------------------------------------------------------------
# service.sh for cron DroboApp
#
# Exposes the crond binary existing on the DroboFS as a 
# DroboApps service.
# ------------------------------------------------------------

# Binaries used
AWK=&quot;/usr/bin/awk&quot;
GREP=&quot;/bin/grep&quot;
CROND=&quot;/usr/sbin/crond&quot;
DATE=&quot;/bin/date +%Y:%m:%d-%H:%M:%S&quot; # Nicely formatted date
ECHO=&quot;/bin/echo&quot;
PS=&quot;/bin/ps&quot;

# Load the DroboApps service functions
. /etc/service.subr

# Required DroboApps variables
prog_dir=`dirname \`realpath $0\``
name=&quot;crond&quot;                    # service name
version=&quot;1.14.2&quot;                # program version
pidfile=${prog_dir}/crond.pid # location of pid file
logfile=${prog_dir}/crond.log # location of log file

# Start crond
start()
{
  # Start the service
  $CROND

  # Create the pidfile
  pid=`$PS | $GREP $CROND | $GREP -v grep | $AWK &#39;{print $1}&#39;`
  $ECHO $pid &amp;gt; $pidfile
}

case &quot;$1&quot; in
  start)
    start_service
    $ECHO &quot;`$DATE` Started cron service&quot; &amp;gt;&amp;gt; $logfile    
    ;;
  stop)
    stop_service
    $ECHO &quot;`$DATE` Stopped cron service&quot; &amp;gt;&amp;gt; $logfile    
    ;;
  restart)
    stop_service
    sleep 3
    start_service
    $ECHO &quot;`$DATE` Restarted cron service&quot; &amp;gt;&amp;gt; $logfile    
    ;;
  status)
    status
    ;;
  *)
    $ECHO &quot;Usage: $0 [start|stop|restart|status]&quot;
    exit 1
    ;;
esac
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Restart your DroboFS.&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;Now the cron daemon is running from boot on your DroboFS. To add tasks for the cron daemon to run you will need to SSH into your DroboFS and run the following: &lt;br /&gt;
&lt;pre&gt;mkdir -p /var/spool/cron/crontabs
crontab -e&lt;/pre&gt;I hope someone finds this helpful.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
2010-06-24: Edit added &quot;mkdir -p /var/spool/cron/crontabs&quot; Thanks pimvanderzwet</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/6469544065177815413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2010/06/activate-cron-daemon-on-drobofs.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/6469544065177815413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/6469544065177815413'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2010/06/activate-cron-daemon-on-drobofs.html' title='Activate the cron daemon on a DroboFS'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-6277109204980305536</id><published>2010-05-09T05:07:00.006+01:00</published><updated>2010-07-11T03:57:51.448+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Atheros"/><category scheme="http://www.blogger.com/atom/ns#" term="Lucid"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Atheros AR5212 in Ubuntu 10.04 Lucid Lynx</title><content type='html'>I&#39;ve just finished a fresh install of &lt;a href=&quot;http://www.ubuntu.com/&quot;&gt;Ubuntu Lucid Lynx 10.04&lt;/a&gt; on my crusty old Thinkpad T60. Everything is working great with the exception of my &lt;a href=&quot;http://www.atheros.com/pt/AR5002X.htm&quot;&gt;Atheros AR5212&lt;/a&gt; wireless card.&lt;br /&gt;
&lt;br /&gt;
Clicking the network manager applet in the panel I see the wireless listed as &quot;Device not ready&quot;. This is tedious. &lt;br /&gt;
&lt;br /&gt;
The solution to this issue is to remove the mainline &lt;a href=&quot;http://wireless.kernel.org/en/users/Drivers/ath5k&quot;&gt;ATK5K&lt;/a&gt; wireless driver from your Kernel and replace it with non-mainline &lt;a href=&quot;http://sourceforge.net/projects/madwifi/&quot;&gt;MadWifi&lt;/a&gt; driver (&lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_open_source_wireless_drivers&quot;&gt;source&lt;/a&gt;). MadWifi has superior support for the AR5212 card. This shouldn&#39;t take you more than about 20 minutes to sort out.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Open a terminal: Aplications -&gt; Accessories -&gt; Terminal&lt;/li&gt;
&lt;li&gt;To check on your wireless card and make sure you have the AR5212:&lt;br /&gt;
&lt;pre&gt;trastle$ sudo lshw -c network&lt;/pre&gt;The result will look similar to this:&lt;br /&gt;
&lt;pre&gt;*-network
    description: Wireless interface
    product: AR5212 802.11abg NIC
    vendor: Atheros Communications Inc.
    physical id: 0
    bus info: pci@0000:03:00.0
    logical name: wifi0&lt;/pre&gt;Now you know your sporting an Atheros AR5212.&lt;/li&gt;
&lt;li&gt;Install some software you&#39;ll need to build MadWifi:&lt;br /&gt;
&lt;pre&gt;trastle$ sudo apt-get install subversion linux-kernel-headers build-essential \
libssl-dev&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Now go to your desktop &lt;br /&gt;
&lt;pre&gt;trastle$ cd ~/Desktop &lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Make a directory to put the MadWifi source in:&lt;br /&gt;
&lt;pre&gt;trastle$ mkdir madwifi-src&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Get the latest MadWifi source:&lt;br /&gt;
&lt;pre&gt;trastle$ svn checkout http://madwifi-project.org/svn/madwifi/trunk madwifi-src&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Change into your new source directory:&lt;br /&gt;
&lt;pre&gt;trastle$ cd madwifi-src&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Change to the root user:&lt;br /&gt;
&lt;pre&gt;trastle$ sudo -i&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Blacklist the non working ATH5K drivers:&lt;br /&gt;
&lt;pre&gt;root$ echo &quot;# Block ATH5K&quot; &gt;&gt; /etc/modprobe.d/blacklist
root$ echo &quot;blacklist ath9k&quot; &gt;&gt; /etc/modprobe.d/blacklist
root$ echo &quot;blacklist ath5k&quot; &gt;&gt; /etc/modprobe.d/blacklist&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Change to the MadWifi source directory&lt;br /&gt;
&lt;pre&gt;root$ cd /home/[your user]/Desktop/madwifi-src&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Build and install the MadWifi driver:&lt;br /&gt;
&lt;pre&gt;root$ make &amp;&amp; make install -d&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add the MadWifi driver to your Kernel&lt;br /&gt;
&lt;pre&gt;root$ echo ath_pci &gt;&gt; /etc/modules&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Now save anything else you have been working on and reboot your laptop. After the reboot your wireless will be working nicely.&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;2010-06-20: Edit added step 10. Thanks Xi.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/6277109204980305536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2010/05/atheros-ar5212-in-ubuntu-1004-lucid.html#comment-form' title='28 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/6277109204980305536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/6277109204980305536'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2010/05/atheros-ar5212-in-ubuntu-1004-lucid.html' title='Atheros AR5212 in Ubuntu 10.04 Lucid Lynx'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>28</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-7273504220776423838</id><published>2010-03-20T06:27:00.006+00:00</published><updated>2010-03-20T06:34:07.309+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>Building XMLStarlet in Snow Leopard (OSX 10.6)</title><content type='html'>&lt;a href=&quot;http://xmlstar.sourceforge.net/&quot;&gt;XMLStarlet&lt;/a&gt; is a command line XML toolkit. Very useful if you want to parse some data from a webpage, RSS feed of similar.&amp;nbsp;XMLStarlet&amp;nbsp;does not provide a binary version for Snow Leopard. They do however provide their source under the &lt;a href=&quot;http://xmlstar.sourceforge.net/license.php&quot;&gt;MIT licence&lt;/a&gt;. So your free to download, build and modify.&lt;br /&gt;
&lt;br /&gt;
To get XMLStarlet up and running on Snow Leopard is nice and easy.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Install Xcode with the Unix the Unix Dev Support Option (see my past post about building wget for more details on this).&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Go download yourself a copy of the &lt;a href=&quot;http://sourceforge.net/projects/xmlstar/files/&quot;&gt;XMLStarlet source&lt;/a&gt; (I am using &lt;a href=&quot;http://sourceforge.net/projects/xmlstar/files/xmlstarlet/1.0.1/xmlstarlet-1.0.1.tar.gz/download&quot;&gt;v 1.0.1&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;XMLStarlet requires &lt;a href=&quot;http://xmlsoft.org/&quot;&gt;libxml2&lt;/a&gt; and &lt;a href=&quot;http://xmlsoft.org/XSLT/&quot;&gt;libxslt&lt;/a&gt;. Snow Leopard ships with both these libraries installed, however they are not in the location expected by the XMLStarlet build script so some symlinks are required. Enter the following in a terminal:&lt;pre&gt;sudo ln -s /usr/lib/libxslt.1.dylib /usr/lib/libxslt.a
sudo ln -s /usr/lib/libexslt.dylib /usr/lib/libexslt.a
sudo ln -s /usr/lib/libxml2.dylib /usr/lib/libxml2.a

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Unpack the XMLStarlet tarball by double clicking it in Finder.&lt;br /&gt;
Take note of the name of the newly unpacked directory (something like xmlstarlet-1.0.1).&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Open a terminal and cd to where you just unpacked (by default this will be the directory below).&lt;pre&gt;cd ~/Downloads/xmlstarlet-1*

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Run the configure script:&lt;pre&gt;./configure

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Run the builds&lt;pre&gt;make

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Run the installer:&lt;pre&gt;sudo make install

&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Finally, to test that the install worked correctly enter the following in a terminal:&lt;pre&gt;TA:~ troy$ xml 
XMLStarlet Toolkit: Command line utilities for XML
... 
XMLStarlet is a command line toolkit to query/edit/check/transform XML documents 
(for more information see http://xmlstar.sourceforge.net/)

&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;Enjoy.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/7273504220776423838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2010/03/building-xmlstarlet-in-snow-leopard-osx.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7273504220776423838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/7273504220776423838'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2010/03/building-xmlstarlet-in-snow-leopard-osx.html' title='Building XMLStarlet in Snow Leopard (OSX 10.6)'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-2233440426180246016</id><published>2009-11-21T13:44:00.001+00:00</published><updated>2010-03-03T10:45:20.825+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apt-get"/><category scheme="http://www.blogger.com/atom/ns#" term="http_proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="no_proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="sudo"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Proxy environment variables and sudo in Ubuntu</title><content type='html'>At work we use a proxy server to access the internet from our test network. We also have an internal Ubuntu mirror on the test network to install updates and packages, this server must be accessed by the test machines directly without the proxy.&lt;br /&gt;
&lt;br /&gt;
Setting up the proxy and the exception for the mirror can be done in a terminal using the environment variables http_proxy, https_proxy, ftp_proxy, and no_proxy.&lt;br /&gt;
&lt;br /&gt;
In Ubuntu these variables are all set in the &lt;a href=&quot;http://www.regatta.cs.msu.su/doc/usr/share/man/info/ru_RU/a_doc_lib/files/aixfiles/environment.htm&quot;&gt;/etc/environment&lt;/a&gt; file. On my test system this file contains the following:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trastle@trastle-test:~$ cat /etc/environment
...
http_proxy=&quot;http://webproxy:3128/&quot;
ftp_proxy=&quot;ftp://webproxy:3128/&quot;
https_proxy=&quot;https://webproxy:3128/&quot;
no_proxy=&quot;office-mirror&quot;&lt;/pre&gt;&lt;br /&gt;
Testing that these settings have been applied to the current terminal can be done by calling printenv:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trastle@trastle-test:~$ printenv | grep proxy
http_proxy=http://webproxy:3128/
ftp_proxy=ftp://webproxy:3128/
https_proxy=https://webproxy:3128/
no_proxy=office-mirror&lt;/pre&gt;&lt;br /&gt;
This output shows that all of the required environment variables are set. However when I try to perform an update from the office mirror it fails! The http_proxy is being used to access hosts clearly specified in the no_proxy variable.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trastle@trastle-test:~$ sudo apt-get update
Ign http://office-mirror jaunty Release.gpg
...
Err http://office-mirror jaunty/main Packages
503 Service Unavailable
...
W: Failed to fetch http://office-mirror/ubuntu/dists/jaunty/main/binary-i386/Packages
503 Service Unavailable
...
E: Some index files failed to download, they have been ignored, or old ones used instead.&lt;/pre&gt;&lt;br /&gt;
This all makes more sense when you check the environment variables that sudo is running with:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trastle@trastle-test:~$ sudo printenv | grep proxy
http_proxy=http://webproxy:3128/&lt;/pre&gt;&lt;br /&gt;
For safety sudo runs with an minimal environment. This default list is hard coded into sudo (initial_keepenv_table in env.c if you want to &lt;a href=&quot;ftp://ftp.sudo.ws/pub/sudo/&quot;&gt;go read the source&lt;/a&gt;). Ubuntu patches this list to include http_proxy but not no_proxy. This breaks the ability to get updates from the local mirror. Sudo can be queried to determine which environment variables it preserves by default:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trastle@trastle-test:~$ sudo sudo -V
Sudo version 1.6.9p17
...
Sudoers path: /etc/sudoers
...
Environment variables to preserve:
http_proxy
XAUTHORIZATION
XAUTHORITY
TZ
PS2
PS1
PATH
MAIL
LS_COLORS
KRB5CCNAME
HOSTNAME
HOME
DISPLAY
COLORS
...&lt;/pre&gt;&lt;br /&gt;
The solution to this problem is to modify the list of environment variables that sudo will preserve by editing the /etc/sudoers file and providing an explicit list of which environment variables to be preserved, overwriting the default list. The configuration that must be added to /etc/sudoers is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Defaults env_keep=&quot;no_proxy http_proxy https_proxy ftp_proxy XAUTHORIZATION \
XAUTHORITY TZ PS2 PS1 PATH MAIL LS_COLORS KRB5CCNAME HOSTNAME HOME DISPLAY COLORS&quot;&lt;/pre&gt;&lt;br /&gt;
This will preserve all of the default environment variables as well as no_proxy, https_proxy and ftp_proxy. You can test this setting to prove that sudo is now preserving these extra environment variables by running:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;trastle@trastle-test:~$
sudo printenv | grep proxy
http_proxy=http://webproxy:3128/
ftp_proxy=ftp://webproxy:3128/
https_proxy=https://webproxy:3128/
no_proxy=office-mirror&lt;/pre&gt;&lt;br /&gt;
With these additional environment variables preserved updates and installs from the command line using your local mirror and ignoring your proxy server will work like a charm.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/2233440426180246016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2009/11/proxy-environment-variables-and-sudo-in.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2233440426180246016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/2233440426180246016'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2009/11/proxy-environment-variables-and-sudo-in.html' title='Proxy environment variables and sudo in Ubuntu'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-3209351293357700691</id><published>2009-10-29T10:32:00.002+00:00</published><updated>2010-03-03T10:49:58.879+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Apache Directory Studio Fails to start on Ubuntu 9.04</title><content type='html'>I needed to install Apache Directory Studio this morning and after downloading unpacking version 1.4.0 I could not get it to run. Starting ADS at the command line resulted in the following output, the splash screen and a small sad blank window.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$ ./ApacheDirectoryStudio
0    [main] INFO  org.apache.directory.studio.Application  - Entering Apache Directory Studio.
4003 [main] INFO  org.apache.directory.studio.Application  - Exiting Apache Directory Studio.&lt;/pre&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyAWcYrUFLXuNXWuotWsiDccKEksH8sUgkl4MPsAxEFKXsj8jWl9tvLY8ijRDZiigFMHSeCTr0Ksvvbq2Q4RZU9X5Zl9TnKjLBsL88JRdzIlWKGN-e9Bnl0BFrJcI2SortUG-PqUBlj-Y/s1600-h/ADS_fail.png&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyAWcYrUFLXuNXWuotWsiDccKEksH8sUgkl4MPsAxEFKXsj8jWl9tvLY8ijRDZiigFMHSeCTr0Ksvvbq2Q4RZU9X5Zl9TnKjLBsL88JRdzIlWKGN-e9Bnl0BFrJcI2SortUG-PqUBlj-Y/s320/ADS_fail.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Reading the logs in ~/.ApacheDirectoryStudio/.metadata/.log revealed an exception:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;!ENTRY org.eclipse.ui.workbench 4 0 2009-10-29 09:29:30.476
!MESSAGE Widget disposed too early!
!STACK 0
java.lang.RuntimeException: Widget disposed too early!
at org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:171)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1182)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1163)
...&lt;/pre&gt;&lt;br /&gt;
After a bit of a hunt through the ADS mailing lists I learned that this error is due to a problem with the Mozilla XULRunner version on my system.&lt;br /&gt;
&lt;br /&gt;
In order to get ADS to run correctly I had to specify the version XULRunner it should run with manually:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;./ApacheDirectoryStudio -vmargs -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner/xulrunner-1.9.1&lt;/pre&gt;&lt;br /&gt;
The original Mozilla bug is detailed &lt;a href=&quot;https://lists.ubuntu.com/archives/ubuntu-mozillateam-bugs/2008-June/044261.html&quot;&gt;here&lt;/a&gt;, and this solution for ADS found &lt;a href=&quot;http://osdir.com/ml/dev-directory-apache/2009-09/msg00130.html&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/3209351293357700691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2009/10/apache-directory-studio-fails-to-start.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/3209351293357700691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/3209351293357700691'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2009/10/apache-directory-studio-fails-to-start.html' title='Apache Directory Studio Fails to start on Ubuntu 9.04'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyAWcYrUFLXuNXWuotWsiDccKEksH8sUgkl4MPsAxEFKXsj8jWl9tvLY8ijRDZiigFMHSeCTr0Ksvvbq2Q4RZU9X5Zl9TnKjLBsL88JRdzIlWKGN-e9Bnl0BFrJcI2SortUG-PqUBlj-Y/s72-c/ADS_fail.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-1265338265073973592</id><published>2009-10-28T23:24:00.005+00:00</published><updated>2010-03-03T10:05:32.100+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><title type='text'>Building wget in Snow Leopard</title><content type='html'>I like Snow Leopard, it&#39;s a nifty OS, but occasionally something will baffle me. This evening it was the exclusion of &lt;a href=&quot;http://www.gnu.org/software/wget/manual/wget.html&quot;&gt;wget&lt;/a&gt; from the command line tools.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMnXEv7IoVEYVfX0Cno5aKg2MBQzU1FnJt72AKioYKUAJ8aksxKRn-63uwciSCaIxIe9q27g07coF8NpcM4lq3yarSg8YS2bFe0AI7TcayddoVMaDxfmqK_rpJSBavDfIGIIqSymyEsLY/s1600-h/nowget.png&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMnXEv7IoVEYVfX0Cno5aKg2MBQzU1FnJt72AKioYKUAJ8aksxKRn-63uwciSCaIxIe9q27g07coF8NpcM4lq3yarSg8YS2bFe0AI7TcayddoVMaDxfmqK_rpJSBavDfIGIIqSymyEsLY/s320/nowget.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Clearly this sucks and living without wget is not an option. Thankfully wget is free software so it&#39;s easy to grab the source and build it yourself.&lt;br /&gt;
&lt;br /&gt;
Firstly you&#39;ll need to have Xcode installed with &quot;Unix Dev Support&quot;. The Unix Dev Support option gives you gcc, make and other essential goodies. Xcode is on the Mac OS 10.6 DVD in the optional installs section (you can also &lt;a href=&quot;http://developer.apple.com/technology/xcode.html&quot;&gt;download Xcode&lt;/a&gt; from Apple).&lt;br /&gt;
&lt;br /&gt;
Next you&#39;ll need to grab the latest wget source from: &lt;a href=&quot;ftp://ftp.gnu.org/pub/gnu/wget/&quot;&gt;ftp://ftp.gnu.org/pub/gnu/wget/&lt;/a&gt; or click &lt;a href=&quot;ftp://ftp.gnu.org/pub/gnu/wget/wget-latest.tar.gz&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
To compile and install wget complete the following:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Unpack the wget tarball by double clicking it in Finder.&lt;br /&gt;
Take note of the name of the newly unpacked directory (something like wget-1.12). &lt;br /&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Open a terminal and cd to where you just unpacked (by default this will be the directory below).&lt;br /&gt;
&lt;pre&gt;cd ~/Downloads/wget-1.*&lt;/pre&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Run the configure script:&lt;br /&gt;
&lt;pre&gt;./configure&lt;/pre&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Run the build and installer:&lt;br /&gt;
&lt;pre&gt;sudo make install&lt;/pre&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;All done. Now you can delete the wget folder and tarball in your ~/Downloads directory.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Once your done you&#39;ll be able to run wget in your terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMlbc0C08Xhpi4hzn6LKZv4P8lExdlR5G57ePhCaSDbBHlL9cHuSpZiteOUYUvSxhS0CkVx9AOLbG_gAt8tmbkfzArvb_C0q3O5khRWXTxJVtGP017_z-Ah6E4HV95XBLhktpjkVd-6zg/s1600-h/wget.png&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMlbc0C08Xhpi4hzn6LKZv4P8lExdlR5G57ePhCaSDbBHlL9cHuSpZiteOUYUvSxhS0CkVx9AOLbG_gAt8tmbkfzArvb_C0q3O5khRWXTxJVtGP017_z-Ah6E4HV95XBLhktpjkVd-6zg/s320/wget.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Much better.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/1265338265073973592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2009/10/building-wget-in-snow-leopard.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1265338265073973592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/1265338265073973592'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2009/10/building-wget-in-snow-leopard.html' title='Building wget in Snow Leopard'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMnXEv7IoVEYVfX0Cno5aKg2MBQzU1FnJt72AKioYKUAJ8aksxKRn-63uwciSCaIxIe9q27g07coF8NpcM4lq3yarSg8YS2bFe0AI7TcayddoVMaDxfmqK_rpJSBavDfIGIIqSymyEsLY/s72-c/nowget.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7150563171193653239.post-5976504758796920764</id><published>2009-10-22T02:40:00.001+01:00</published><updated>2010-03-03T09:54:31.813+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Terminal"/><title type='text'>When you forget to start screen...</title><content type='html'>&lt;a href=&quot;http://www.gnu.org/software/screen/&quot;&gt;Screen&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Nohup&quot;&gt;nohup&lt;/a&gt; are great tools which can be used, by someone with forethought, to keep their processes running after they disconnect from a server.&lt;br /&gt;
&lt;br /&gt;
The problem with both nohup and screen is that you need to use them before starting a process. If you forgot or didn&#39;t realize the process was going to take ages then your all out of luck.&lt;br /&gt;
&lt;br /&gt;
Recently on a man page hunt I discovered a workaround for this situation using &lt;a href=&quot;http://www.research.att.com/%7Egsf/man/man1/disown.html&quot;&gt;disown&lt;/a&gt;. At the terminal with the long running process enter the following:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;ctrl + z  (pause the current process and background it)
bg        (resume the last backgrounded process in the background)
disown    (disassociate the last process from the current terminal) 
exit      (to close the current terminal)&lt;/pre&gt;&lt;br /&gt;
Now your disconnected, your process is still running and you can go home. If you don&#39;t want to go home and instead want to check that your process is still running, ssh back into your server and run ps aux and hunt it down in the process list.</content><link rel='replies' type='application/atom+xml' href='http://blog.troyastle.com/feeds/5976504758796920764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.troyastle.com/2009/10/when-you-forget-to-start-screen.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5976504758796920764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150563171193653239/posts/default/5976504758796920764'/><link rel='alternate' type='text/html' href='http://blog.troyastle.com/2009/10/when-you-forget-to-start-screen.html' title='When you forget to start screen...'/><author><name>Troy Test 1234</name><uri>http://www.blogger.com/profile/14530084019359702159</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>