<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>waelchatila.com - Unix/Linux category</title>
  <link>http://waelchatila.com:80/categories/unixlinux/</link>
  <description>Notes on Software, Engineering and Science</description>
  <language>en</language>
  <copyright>Wael Chatila</copyright>
  <lastBuildDate>Thu, 11 Mar 2010 03:23:48 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Running Jetty as Non Root</title>
    <link>http://waelchatila.com:80/2009/01/20/1232522160000.html</link>
    
      
        <description>
          I&#039;m kicking the tires of Jetty and am in the process of setting it up on a production machine and found that the latest Jetty realeas (6.1.14) has a really easy way to start jetty out running as root and later switch to a uid of your choice which enables you to open up server sockets on the privileged ports 80 &amp; 443. See the README file under {jetty.root}/extras/setuid. The process is just a one-liner...well, there are some more perks as you&#039;ll see at the end.
&lt;p&gt;
The README seems little bit out of date as my
&lt;div class=&#034;codeSample&#034;&gt;mvn install&lt;/div&gt;
did all of the compiling and copying steps. However, when I try to launch jetty with the new jetty-setuid.xml config file I get the following error.

&lt;div class=&#034;codeSample&#034;&gt;
2009-01-20 23:10:33.887::WARN:  Config error at &amp;lt;Set name=&#034;uid&#034;&amp;gt;jetty&amp;lt;/Set&amp;gt;
2009-01-20 23:10:33.888::WARN:  EXCEPTION
java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Constructor.newInstance(libgcj.so.81)
   at org.mortbay.xml.XmlConfiguration.set(XmlConfiguration.java:405)
   at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:248)
   at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:214)
   at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:974)
   at java.lang.reflect.Method.invoke(libgcj.so.81)
   at org.mortbay.start.Main.invokeMain(Main.java:194)
   at org.mortbay.start.Main.start(Main.java:523)
   at org.mortbay.start.Main.main(Main.java:119)
Caused by: java.lang.NumberFormatException: invalid character at position 1 in jetty
   at java.lang.Integer.parseInt(libgcj.so.81)
   at java.lang.Integer.&amp;lt;init&amp;gt;(libgcj.so.81)
   at java.lang.reflect.Constructor.newInstance(libgcj.so.81)
   ...8 more
&lt;/div&gt;
My jetty-setuid.xml file looks like:
&lt;div class=&#034;codeSample&#034;&gt;
&amp;lt;Configure id=&#034;Server&#034; class=&#034;org.mortbay.setuid.SetUIDServer&#034;&amp;gt;
  &amp;lt;Set name=&#034;startServerAsPrivileged&#034;&amp;gt;false&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;umask&#034;&amp;gt;2&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;uid&#034;&amp;gt;jetty&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;gid&#034;&amp;gt;jetty&amp;lt;/Set&amp;gt;
&amp;lt;/Configure&amp;gt;
&lt;/div&gt;
For some reason its expecting an integer instead of &#034;jetty&#034;...well well
&lt;div class=&#034;codeSample&#034;&gt;
&amp;gt; su jetty
&amp;gt; id
uid=1002(jetty) gid=1003(jetty) groups=1003(jetty)
&lt;/div&gt;
My jetty-setuid.xml now looks like:
&lt;div class=&#034;codeSample&#034;&gt;
&amp;lt;Configure id=&#034;Server&#034; class=&#034;org.mortbay.setuid.SetUIDServer&#034;&amp;gt;
  &amp;lt;Set name=&#034;startServerAsPrivileged&#034;&amp;gt;false&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;umask&#034;&amp;gt;2&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;uid&#034;&amp;gt;1002&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;gid&#034;&amp;gt;1003&amp;lt;/Set&amp;gt;
&amp;lt;/Configure&amp;gt;
&lt;/div&gt;
...works like a charm.
        </description>
      
      
    
    
    
    <category>Unix/Linux</category>
    
    <category>Java</category>
    
    <category>Web</category>
    
    <comments>http://waelchatila.com:80/2009/01/20/1232522160000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2009/01/20/1232522160000.html</guid>
    <pubDate>Wed, 21 Jan 2009 07:16:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Virtualbox Port Forwarding Problems</title>
    <link>http://waelchatila.com:80/2008/11/30/1228105320000.html</link>
    
      
        <description>
          &lt;p&gt;
I&#039;ve recently started using &lt;a href=&#034;http://virtualbox.org&#034;&gt;VirtualBox&lt;/a&gt; and find it really good. However, I was setting up port forwarding with NAT according to the documentation and must have made a mistake since I got the following error while restarting the virtual machine
&lt;div class=&#034;codeSample&#034;&gt;
Failed to start virtual machine XYZ -56 (VERR_NO_DIGITS) 
&lt;/div&gt;
I tried to remove the newly added settings using 
&lt;div class=&#034;codeSample&#034;&gt;
vboxmanage setextradata XYZ ... &amp;lt;null&amp;gt;
&lt;/div&gt;
but I guess I had a typo somewhere in my initial attempt to use setextradata, and I couldn&#039;t figure out what the typo was (I had closed the command prompt window and there was no history available). I couldn&#039;t find anything online using google so I simple deleted the virtual machine and added it again using the same vdi...worked like a charm. Hope this helps someone out there.
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>Unix/Linux</category>
    
    <category>Windows</category>
    
    <comments>http://waelchatila.com:80/2008/11/30/1228105320000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2008/11/30/1228105320000.html</guid>
    <pubDate>Mon, 01 Dec 2008 04:22:00 GMT</pubDate>
  </item>
  
  <item>
    <title>RXTX on Gumstix</title>
    <link>http://waelchatila.com:80/2007/08/24/1187975400000.html</link>
    
      
        <description>
          &lt;p&gt;
Since it could be tricky to get the RXTX sources compiling properly for the gumstix platforms I thought I&#039;d spare anyone the pain by providing my binaries. 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#034;http://www.icegreen.com/rxtx_gumstix/librxtxSerial_PXA255.so&#034;&gt;librxtxSerial_PXA255.so &lt;/a&gt; (Connex / Basix)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#034;http://www.icegreen.com/rxtx_gumstix/librxtxSerial_PXA270.so&#034;&gt;librxtxSerial_PXA270.so &lt;/a&gt; (Verdex)&lt;/li&gt;
&lt;/ul&gt;

However, since you&#039;re here, I would advise against using java on the gum. Sure, the programs themselves are a breeze to develop, but getting jam and classpath to compile and run properly can very well take a considerable amount of time. Just think of the reason why you are reading this. Chances are you probably have troubles getting the RXTX sources to compile or run smoothly. Just do yourself a favor, write it in small fast c/c++ or something.
        </description>
      
      
    
    
    
    <category>Unix/Linux</category>
    
    <comments>http://waelchatila.com:80/2007/08/24/1187975400000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2007/08/24/1187975400000.html</guid>
    <pubDate>Fri, 24 Aug 2007 17:10:00 GMT</pubDate>
  </item>
  
  <item>
    <title>How to move a subversion repository to another server</title>
    <link>http://waelchatila.com:80/2007/03/06/1173223980000.html</link>
    
      
        <description>
          My closet server died last night. No big deal it was over ten years old and was running at 233MHz...besides it was my wife&#039;s old computer hehe. My friend Imran gave me one of his old work machines and I&#039;ve been moving stuff over. Since I had a svn repository on the old machine the situation presented itself with a problem to move the whole repository. Luckily the good people behind svn have thought about this and provide out-of-the box commands to do this. &lt;p/&gt;On the old server machine do.
&lt;div class=&#034;codeSample&#034;&gt;
svnadmin dump &lt;i&gt;repositoryPath&lt;/i&gt; &amp;gt; repository.dumpfile&lt;br&gt;
&lt;/div&gt;

File transfer the &lt;i&gt;repository.dumpfile&lt;/i&gt; file to the new server machine and over there do

&lt;div class=&#034;codeSample&#034;&gt;
cd /path/to/new-repository-parent-directory&lt;br&gt;
svnadmin create &lt;i&gt;repository-name&lt;/i&gt;&lt;br&gt;
svnadmin load &lt;i&gt;repository-name&lt;/i&gt; &lt; repository.dumpfile&lt;br&gt;
&lt;/div&gt;

Then on your client type 
&lt;div class=&#034;codeSample&#034;&gt;
svn switch --relocate &lt;i&gt;oldurl&lt;/i&gt; &lt;i&gt;newurl&lt;/i&gt;
&lt;/div&gt;
        </description>
      
      
    
    
    
    <category>Unix/Linux</category>
    
    <category>Windows</category>
    
    <comments>http://waelchatila.com:80/2007/03/06/1173223980000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2007/03/06/1173223980000.html</guid>
    <pubDate>Tue, 06 Mar 2007 23:33:00 GMT</pubDate>
  </item>
  
  <item>
    <title>AJAX Remote Controlled Lego Robot</title>
    <link>http://waelchatila.com:80/2006/07/13/1152788433678.html</link>
    
      
      
        <description>
          This article shows how to remote control a real world lego robot using AJAX technology.&lt;p&gt;&lt;a href=&#034;http://waelchatila.com:80/2006/07/13/1152788433678.html&#034;&gt;Read more...&lt;/a&gt;&lt;/p&gt;
          &lt;p&gt;&lt;a href="http://waelchatila.com:80/2006/07/13/1152788433678.html"&gt;Read more...&lt;/a&gt;&lt;/p&gt;
        </description>
      
    
    
    
    <category>Unix/Linux</category>
    
    <category>C++</category>
    
    <category>AJAX</category>
    
    <category>Hardware</category>
    
    <category>Games &amp; Fun</category>
    
    <comments>http://waelchatila.com:80/2006/07/13/1152788433678.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2006/07/13/1152788433678.html</guid>
    <pubDate>Thu, 13 Jul 2006 11:00:33 GMT</pubDate>
  </item>
  
  </channel>
</rss>
