<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: howto</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/howto/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Howto | Add ActiveDirectory Addressbook to Sylpheed Email</title>
      <link>https://chrisjrob.com/2015/11/19/add-activedirectory-addressbook-to-sylpheed-email/</link>
      <pubDate>Thu, 19 Nov 2015 21:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2015/11/19/add-activedirectory-addressbook-to-sylpheed-email</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/sylpheed.png" align="right" alt="Featured Image">
         
         <p>Where we require a lightweight mail client, we tend to use <a href="http://sylpheed.sraoss.jp/en/">Sylpheed</a> (from which Claws Mail was later forked).</p>

<p>It seems unlikely that you would be able to add an ActiveDirectory Address Book into such a lightweight email client, and indeed the <a href="http://sylpheed.sraoss.jp/doc/manual/en/sylpheed-12.html">manual</a> states:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>### FIXME: write this part.
</code></pre></div></div>

<p>But in fact it was trivially easy:</p>

<!--more-->

<h2 id="caveat">Caveat</h2>

<p>Whilst these instructions worked for us, do be aware that we are using Samba4 ActiveDirectory. 
In theory this is a drop-in replacement for Windows ActiveDirectory and these instructions <em>should</em> work unchanged.</p>

<h2 id="add-ldap-addressbook">Add LDAP Addressbook</h2>

<p>Firstly run Sylpheed and go to Tools and Addressbook. 
Within the Sylpheed Addressbook go to File New LDAP Server
You should now see a screen like this:</p>

<p><img src="/assets/sylpheed-ldap-1.png" alt="Sylpheed LDAP Basic Settings" /></p>

<p>Having entered the Name, Hostname and Port you are able to “Check Server”, to ensure connectivity.
Next either enter your Search Base, or click on the &amp;ellipsis; button to select from the detected Search Bases.</p>

<table>
  <thead>
    <tr>
      <th>Item</th>
      <th>Explanation</th>
      <th>Example</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Name</td>
      <td>Addressbook or server name</td>
      <td>example</td>
    </tr>
    <tr>
      <td>Hostname</td>
      <td>ActiveDirectory Host Name</td>
      <td>ads.example.lan</td>
    </tr>
    <tr>
      <td>Port</td>
      <td>LDAP Port Number*</td>
      <td>389 or 636</td>
    </tr>
    <tr>
      <td>Search Base</td>
      <td>Your AD domain in LDAP form</td>
      <td>DC=example,DC=lan</td>
    </tr>
  </tbody>
</table>

<p>*You should probably choose 636 when connecting via a public network, and you may need to open ports on your router.</p>

<p>Now select the Extended tab and you should see the following screen:</p>

<p><img src="/assets/sylpheed-ldap-2.png" alt="Sylpheed LDAP Extended Settings" /></p>

<table>
  <thead>
    <tr>
      <th>Item</th>
      <th>Explanation</th>
      <th>Example</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Search Criteria</td>
      <td>This simple example worked for us</td>
      <td>(objectclass=*)</td>
    </tr>
    <tr>
      <td>Bind DN</td>
      <td>Your ActiveDirectory username</td>
      <td>chris@example.lan</td>
    </tr>
    <tr>
      <td>Bind Password</td>
      <td>Your ActiveDirectory password</td>
      <td>-</td>
    </tr>
  </tbody>
</table>

<p>Now click on OK to finish.</p>

<h2 id="test">Test</h2>

<p>You should now have a Search field available, enter a colleague’s first name and Search and you should be faced with their email addresses.</p>

<h2 id="conclusion">Conclusion</h2>

<p>As far as I can tell the addressbook lookup is not automatic and you have to click on the addressbook icon in the Compose Window and search for the person, in order to add them to the To: field. A bit clunky perhaps, but arguably not so very different from the need in Outlook to press Check Names to look up new addresses. 
Needless to say - once the address is in the recent address list, it is auto-completed in the future.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install ESET Remote Administrator on Ubuntu</title>
      <link>https://chrisjrob.com/2015/11/17/install-eset-remote-administrator-on-ubuntu/</link>
      <pubDate>Tue, 17 Nov 2015 20:12:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2015/11/17/install-eset-remote-administrator-on-ubuntu</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/eset-remote-administrator.png" align="right" alt="Featured Image">
         
         <p>After much research I decided to purchase <a href="http://www.eset.co.uk/Business/Endpoint-Security/Endpoint-Antivirus">ESET Antivirus</a> for our Windows clients. 
But rather than install ESET Antivirus on each client in turn, I decided to install ESET Remote Administrator on an Ubuntu VPS.
ESET Remote Administrator is a server program for controlling ESET Antivirus (and other ESET programs) on clients, you can use it to deploy the ESET Agent, which in turn can then install and monitor the ESET Antivirus software.</p>

<!--more-->

<p>Our Windows PCs are controlled by an ActiveDirectory server (actually a <a href="https://www.samba.org/">Samba</a>4 ActiveDirectory server, although that should not make any difference to these instructions).</p>

<p>I found the <a href="http://help.eset.com/era_install/62/en-US/index.html?linux.htm">ESET instructions</a> for so doing decidedly sketchy, but I eventually managed to install it and took some notes as I went. 
I cannot promise these instructions are complete, but used in conjunction with the <a href="http://help.eset.com/era_install/62/en-US/index.html?linux.htm">ESET instructions</a> they may be of help.</p>

<h2 id="update-hosts">Update Hosts</h2>

<p>Edit <code class="language-plaintext highlighter-rouge">/etc/hosts</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>127.0.0.1       localhost.example.lan      localhost.localdomain        localhost
192.168.0.109   eset.example.lan           eset
</code></pre></div></div>

<p>Test by typing the following two commands and checking the output matches:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># hostname
eset

# hostname -f
eset.example.lan
</code></pre></div></div>

<h2 id="dependencies">Dependencies</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install mysql-server unixodbc libmyodbc cifs-utils libjcifs-java winbind libqtwebkit4 xvfb
# dpkg-reconfigure libmyodbc 
</code></pre></div></div>

<h2 id="install-mysql-server">Install MySQL Server</h2>

<p>Edit <code class="language-plaintext highlighter-rouge">/etc/mysql/my.cnf</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>max_allowed_packet=33M
</code></pre></div></div>

<p>Restart MySQL</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># service mysql-server restart
</code></pre></div></div>

<h2 id="configure-mysql">Configure MySQL</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mysql -u root -p
</code></pre></div></div>

<p>Cannot remember whether I created database and/or username and password, suggest you try without and then with.</p>

<h2 id="install-eset-remote-administration-server">Install ESET Remote Administration Server</h2>

<p>Replace ??? with actual:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># sh Server-Linux-x86_64.sh --license-key=??? \
--db-type="MySQL Server" --db-driver="MySQL" --db-hostname=127.0.0.1 --db-port=3306 \
--server-root-password="???" --db-name="era_db" --db-admin-username="root" --db-admin-password="???" \
--db-user-username="era" --db-user-password="???" \
--cert-hostname="eset" --cert-auth-common-name="eset.example.lan" --cert-organizational-unit="eset.example.lan" \
--cert-organization="example ltd" --cert-locality="UK" \
--ad-server="ads.example.lan" --ad-user-name="era" --ad-user-password="???"
</code></pre></div></div>

<p>In case of error, read the following carefully:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/var/log/eset/RemoteAdministrator/EraServerInstaller.log
</code></pre></div></div>

<h2 id="install-tomcat7">Install Tomcat7</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install tomcat7 tomcat7-admin
</code></pre></div></div>

<p>Wait 5 minutes for Tomcat to start, then visit http://localhost:8080 to check it has worked.</p>

<h2 id="configure-ssl">Configure SSL</h2>

<p>See <a href="https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration">SSL/TLS Configuration HOW-TO</a>.</p>

<h3 id="step-1---generate-keystore">Step 1 - Generate Keystore</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /usr/share/tomcat7/.keystore
</code></pre></div></div>

<p>Use password ‘changeit’.</p>

<p>At the time of writing $JAVA_HOME is <code class="language-plaintext highlighter-rouge">/usr/lib/jvm/java-7-openjdk-amd64/jre</code></p>

<h3 id="step-2---configure-tomcat">Step 2 - Configure Tomcat</h3>

<p>You should have two sections like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           redirectPort="8443" /&gt;

&lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           keystoreFile="/usr/share/tomcat7/.keystore" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS" /&gt;
</code></pre></div></div>

<p>These will already exist, but need uncommenting and adjusting with keystore details.</p>

<h3 id="test">Test</h3>

<p>You should now be able to go to <a href="http://localhost:8443">http://localhost:8443</a>.</p>

<h2 id="join-windows-domain">Join Windows Domain</h2>

<p>The ERA server must be joined to the domain</p>

<p>Install samba and stop any samba services that start.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install samba krb5-user smbclient
</code></pre></div></div>

<p>Edit <code class="language-plaintext highlighter-rouge">/etc/samba/smb.conf</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[global]
         workgroup = EXAMPLE
         security = ADS
         realm = EXAMPLE.COM
         dedicated keytab file = /etc/krb5.keytab
         kerberos method = secrets and keytab
         server string = Samba 4 Client %h
         winbind enum users = yes
         winbind enum groups = yes
         winbind use default domain = yes
         winbind expand groups = 4
         winbind nss info = rfc2307
         winbind refresh tickets = Yes
         winbind normalize names = Yes
         idmap config * : backend = tdb
         idmap config * : range = 2000-9999
         idmap config EXAMPLE : backend  = ad
         idmap config EXAMPLE : range = 10000-999999
         idmap config EXAMPLE:schema_mode = rfc2307
         printcap name = cups
         cups options = raw
         usershare allow guests = yes
         domain master = no
         local master = no
         preferred master = no
         os level = 20
         map to guest = bad user
         username map = /etc/samba/smbmap
</code></pre></div></div>

<p>Create <code class="language-plaintext highlighter-rouge">/etc/samba/smbmap</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>!root = EXAMPLE\Administrator Administrator admionistrator
</code></pre></div></div>

<p>Edit <code class="language-plaintext highlighter-rouge">/etc/krb5.conf</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[libdefaults]
      default_realm = EXAMPLE.COM
      dns_lookup_realm = false
      dns_lookup_kdc = true
      ticket_lifetime = 24h
      forwardable = yes
</code></pre></div></div>

<p>Make sure that <code class="language-plaintext highlighter-rouge">/etc/resolv.conf</code> points to the AD DC, and dns is setup correctly.</p>

<p>Then run this command:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># net ads join -U Administrator@EXAMPLE.COM
</code></pre></div></div>

<p>Enter Administrators password when requested.</p>

<p>Edit <code class="language-plaintext highlighter-rouge">/etc/nsswitch.conf</code> and add ‘winbind’ to passwd &amp; group lines.</p>

<p>Start samba services.</p>

<h2 id="update-dns">Update DNS</h2>

<p>For some reason the join does not always create the DNS entry on Samba4, so you may need to add this manually.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="https://www.samba.org/">Samba</a></li>
  <li><a href="http://help.eset.com/era_install/62/en-US/index.html?linux.htm">ESET Remote Administrator Installation Instructions</a></li>
  <li><a href="http://support.eset.com/kb3728/">Troubleshoot Linux Installation</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Spellcheck in irssi</title>
      <link>https://chrisjrob.com/2014/07/09/irssi-spellchecking/</link>
      <pubDate>Wed, 09 Jul 2014 11:34:11 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2014/07/09/irssi-spellchecking</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/irssi.png" align="right" alt="Featured Image">
         
         <p>This page explains how to set up spelling in Irssi on Debian Lenny.  It assumes that you have already installed irssi.</p>

<h2 id="install-packages">Install packages</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install aspell-en libaspell-dev aspell libtext-aspell-perl
</code></pre></div></div>

<p>Don’t forget to change the localisation to match your own locale.</p>

<!--more-->

<h2 id="create-users-scripts-folder">Create user’s scripts folder</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ mkdir -p */.irssi/scripts/autorun
</code></pre></div></div>

<h2 id="download-the-irssi-script">Download the irssi script</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd */.irssi/scripts
$ wget http://www.mimir.ch/mimir/irssi/files/aspell_complete.pl
$ cd autorun
$ ln -s ../aspell_complete.pl
</code></pre></div></div>

<h2 id="restart-irssi">Restart irssi</h2>

<p>Lastly, either restart IRSSI, or, in type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/script load ~/.irssi/scripts/autorun/aspell_complete.pl
</code></pre></div></div>

<p>You should see aspell loading and your locale mentioned.</p>

<h2 id="testing">Testing</h2>

<p>How the spelling functionality works is that you enter a word and then, before pressing spacebar, you hit the [TAB] key, whereon the preceding word will be spellchecked.</p>

<h2 id="troubleshooting">Troubleshooting</h2>

<p>If you have not installed the correct aspell localisation, then you may find that irssi segfaults.</p>

<h2 id="references">References</h2>

<ul>
  <li>http://www.mimir.ch/mimir/irssi/</li>
  <li>http://www.eckrall.co.uk/?page_id=55</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Convert XPS to PDF</title>
      <link>https://chrisjrob.com/2013/03/12/convert-xps-to-pdf/</link>
      <pubDate>Tue, 12 Mar 2013 10:47:53 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2013/03/12/convert-xps-to-pdf</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>XPS is Microsoft’s attempt to replace PDF, the only difference is that everyone can read PDFs, and not everyone can read XPS.  I understand that KDE 4 versions of Okular will support XPS, which may make these instructions unnecessary, although having a tool for conversion readily at hand is always useful!</p>

<!--more-->

<p>These instructions were tested in Debian Lenny.  These instructions worked for our specific systems YMMV.</p>

<h2 id="building-from-source">Building from source</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install libxext-dev libxt-dev
$ wget http://ghostscript.com/releases/ghostpdl-8.71.tar.bz2
$ tar xvvjf ghostpdl-8.71.tar.bz2
$ cd ghostpdl-8.71
$ make xps
</code></pre></div></div>

<h2 id="testing">Testing</h2>

<p>After the build you will find gxps in xps/obj</p>

<p>To test, you will need a test document in XPS format.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd xps/obj
$ ./gxps -sDEVICE=pdfwrite -sOutputFile=test.pdf -dNOPAUSE test.xps
</code></pre></div></div>

<h2 id="move-to-bin">Move to bin</h2>

<p>You probably want to move the gxps executable into a convenient location within your PATH.  /usr/local/bin may be a good destination.  Once there you ought to be able to run the command from anywhere and it just work.  Not sure what your PATH is?  Type “echo $PATH” in your terminal.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ echo $PATH
$ sudo cp xps/obj/gxps /usr/local/bin/
$ sudo chown root:root /usr/local/bin/gxps
</code></pre></div></div>

<h2 id="creating-file-type">Creating file type</h2>

<p>XPS probably does not exist on your Linux system as a file type, you can either create yourself using KDE Control Centre, or in KDE:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Single user:
~/.kde/share/mimelnk/application/xps.desktop

All users:
/usr/share/mimelnk/application/xps.desktop

[Desktop Entry]
Comment=XPS Document
Hidden=false
Icon=application-xps
MimeType=application/xps
Patterns=*.xps;*.XPS
Type=MimeType
X-KDE-AutoEmbed=false
</code></pre></div></div>

<h2 id="adding-to-servicemenu">Adding to ServiceMenu</h2>

<p>If you are using Konqueror, you can add a service menu (to enable right-click / action menu).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Single user:
~/.kde/share/apps/konqueror/servicemenus/xpstopdf.desktop

All users:
/usr/share/apps/konqueror/servicemenus/xpstopdf.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=xpstopdf service menu
ServiceTypes=application/xps
Icon=acroread
Actions=xpstopdf

[Desktop Action xpstopdf]
Icon=acroread
Name=Convert XPS to PDF
Exec=cd "%d"; gxps -sDEVICE=pdfwrite -sOutputFile="`echo "%f" | cut -d . -f 1`.pdf" -dNOPAUSE "%f"; mv "%f" ~/.local/share/Trash/files; kdialog --title "Convert XPS to PDF" --passivepopup "Done" 3; echo;
</code></pre></div></div>

<h2 id="testing-servicemenu">Testing ServiceMenu</h2>

<p>You should now be able to right-click on the file and “Convert XPS to PDF”.  This will create a PDF of the same name and move the XPS into trash.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.ghostscript.com/GhostPCL.html">http://www.ghostscript.com/GhostPCL.html</a></li>
  <li><a href="http://obscured.info/2010/03/01/converting-xps-to-pdf-on-ubuntu-9-10/">http://obscured.info/2010/03/01/converting-xps-to-pdf-on-ubuntu-9-10/</a></li>
  <li><a href="http://blog.rubypdf.com/2009/04/14/convert-xps-to-pdf-in-two-ways/">http://blog.rubypdf.com/2009/04/14/convert-xps-to-pdf-in-two-ways/</a></li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Debian Squeeze With Raid1 + LVM</title>
      <link>https://chrisjrob.com/2011/03/01/install-debian-squeeze-with-raid1lvm/</link>
      <pubDate>Tue, 01 Mar 2011 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2011/03/01/install-debian-squeeze-with-raid1lvm</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/hp-proliant-microserver-n36l.jpg" align="right" alt="Featured Image">
         
         <p>I’ve just bought a new <a href="http://h10010.www1.hp.com/wwpc/uk/en/sm/WF06a/15351-15351-4237916-4237917-4237917-4248009.html?jumpid=in_r2515_uk/en/smb/psg/psc404redirect-ot-xx-xx-/chev/" title="HP N36L Microserver">HP N36L Microserver</a>,
for £210 with £100 cashback.  It came with a 250gb SATA, so I added a second
250gb SATA; so that I could have a simple software RAID array.  I also added
2gb of Crucial RAM.</p>

<!--more-->

<p>When the server arrived, I was surprised to find it had RAID built into
it, but my understanding is that this is FakeRAID and thus should be
avoided at all costs.  If you were particularly interested in that
 option, with particular reference to Windows Home Server (yikes) then
<a href="http://www.tenniswood.co.uk/technology/windows-home-server/how-to-setup-a-raid-array-on-a-hp-microserver/" title="How to setup a raid array on a HP Microserver">this page may be helpful</a>.</p>

<p>I plugged in <a href="http://linitx.com/viewproduct.php?prodid=12992" title="IODD External Harddrive">my wonderful IODD ISO drive</a>
and selected Debian Squeeze AMD64 netinstall, and off I went.  When it
came to the partitioning, you need to carry this out manually, in the
following order:</p>

<ul>
  <li>Partition <strong>both disks </strong>as follows:
    <ul>
      <li>Create boot primary partition (about 500mb)
        <ul>
          <li>Set mount as /boot and make bootable</li>
        </ul>
      </li>
      <li>Create partition using most of the rest of the first drive (e.g.
247gb)
        <ul>
          <li>Set partition as Use as physical volume for RAID</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Configure software RAID
    <ul>
      <li>Create MD Device, RAID1, 2 devices, 0 spare devices</li>
      <li>Select the RAID partition on each drive</li>
    </ul>
  </li>
  <li>Create Physical Volumes for LVM
    <ul>
      <li>Create volume group</li>
      <li>Create suitable volumes for your systems, e.g. swap (2 x
RAM, root (10GB or so), home (to your taste), usr (2gb+), var
(2gb+), tmp (1gb+).
        <ul>
          <li>it is a good idea not to use the whole space, as the whole
benefit to LVM is being able to then add available space
into any volume</li>
        </ul>
      </li>
      <li>I also created a large volume for /var/lib/vz/private, as this
will be an openvz server.</li>
    </ul>
  </li>
  <li>Partition disks
    <ul>
      <li>Set each LVM volume to use the appropriate file system type,
e.g. ext3 or ext4, and set the appropriate mountpoint, e.g. home
should be /home etc, swap should be allocated to swap space etc</li>
    </ul>
  </li>
</ul>

<p>I found this howto on <a href="http://dev.jerryweb.org/raid/" title="LVM + RAID for debian-installer">LVM + RAID for debian-installer</a>
most useful but, providing you follow the logical progression, it really
is not as difficult as it seems.</p>

<p>After the partitioning, I continued with the installation, removing all
options including “Standard System” from the software profiles; so that
I basically installed a base system, which is how I prefer it.</p>

<p>Next I installed: sudo, <a href="http://en.wikipedia.org/wiki/GNU_Screen" title="Wikipedia::GNU Screen">GNU Screen</a>,
openssh-server, vim, fcheck, locales, localepurge, apt-file,
 apt-show-versions and nullmailer (ssmtp is  better if your mailserver
requires secure authentication).  Doubtless you have your own favourite
packages to install!</p>

<p>Next step will be to configure as a small
<a href="http://openvz.org" title="openvz">openvz</a> server, and migrate the virtual
machines off my old server (which I will be commissioning as a storage
server).</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Archive to DAT</title>
      <link>https://chrisjrob.com/2010/11/23/archive-to-dat/</link>
      <pubDate>Tue, 23 Nov 2010 16:25:08 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/11/23/archive-to-dat</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/freecom-dat.jpg" align="right" alt="Featured Image">
         
         <p>I am a rank amateur at both tar and mt.  This page constitutes no more than you could discover yourself by reading the manpages for tar and mt, or Googling.</p>

<p>You have been warned!</p>

<h2 id="simple-instructions">Simple instructions</h2>

<!--more-->

<h3 id="rewind">Rewind</h3>

<p><strong>Use the rewind command before backup to ensure that you are overwriting previous backups.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 rewind
</code></pre></div></div>

<h3 id="backup">Backup</h3>

<p>E.g. directory <code class="language-plaintext highlighter-rouge">/www</code> and <code class="language-plaintext highlighter-rouge">/home</code> with tar command (z - compressed)</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># tar -czf /dev/st0 /www /home
</code></pre></div></div>

<p><strong>Use -v to receive verbose feedback.</strong></p>

<h3 id="backup-with-verify">Backup with Verify</h3>

<p>If you do not compress your backup, then you can verify in the same process:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># tar -cWf /dev/st0 /www /home
</code></pre></div></div>

<h3 id="where">Where</h3>

<p>Find out what block you are at with mt command:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 tell
</code></pre></div></div>

<p>This does not appear to work on my version of the software.  In theory the Status option has a line for <code class="language-plaintext highlighter-rouge">block number=</code>, but surprising after completing a backup it seems to still return 0.  If I ever work out why this is, I will update this entry.</p>

<h3 id="list">List</h3>

<p>Display list of files on tape drive:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># tar -tzf /dev/st0
</code></pre></div></div>

<h3 id="restore">Restore</h3>

<p>E.g. <code class="language-plaintext highlighter-rouge">/www</code> directory</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># cd /
# mt -f /dev/st0 rewind
# tar -xzf /dev/st0 www
</code></pre></div></div>

<p>E.g. <code class="language-plaintext highlighter-rouge">/home/test</code> directory</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># cd /
# mt -f /dev/st0 rewind
# tar --checkpoint -xvvzpkf /dev/st0 home/test

--checkpoint : provide occasional checkpoint messages
-x : extract
-v : verbosely
-v : even more verbosly
-z : uncompress
-p : retaining permissions
-k : leaving existing files alone
-f /dev/st0 home/test
</code></pre></div></div>

<h3 id="unload">Unload</h3>

<p>Unload the tape:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 offline
</code></pre></div></div>

<h3 id="status">Status</h3>

<p>Display status information about the tape unit:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 status
</code></pre></div></div>

<h3 id="erase">Erase</h3>

<p>Erasing the tape may take hours and there is not normally any need to do this; simply rewind the tape before performing backup, or use the mt command to position at the beginning of the tape.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 erase
</code></pre></div></div>

<h3 id="moving-about-the-tape">Moving about the tape</h3>

<p>You can go BACKWARD or FORWARD on tape with mt command itself</p>

<h4 id="go-to-end-of-data">Go to end of data</h4>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 eod
</code></pre></div></div>

<h4 id="goto-previous-record">Goto previous record</h4>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 bsfm 1
</code></pre></div></div>

<h4 id="forward-record">Forward record</h4>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 fsf 1
</code></pre></div></div>

<h2 id="restore-1">Restore</h2>

<p>This code has not been checked or tested:</p>

<ul>
  <li>Check status of tape: <code class="language-plaintext highlighter-rouge">mt -f /dev/st0</code> status</li>
  <li>Go to the directory where you want to restore your file(s).</li>
  <li>Go to the right file on the tape with the following commands:
    <ul>
      <li>Check file number and position in file: <code class="language-plaintext highlighter-rouge">mt -f /dev/st0 status</code></li>
      <li>Advance one file: <code class="language-plaintext highlighter-rouge">mt -f /dev/st0 fsf 1</code></li>
      <li>View contents of tar-file: <code class="language-plaintext highlighter-rouge">tar -tvf /dev/st0</code></li>
      <li>Go back one file: <code class="language-plaintext highlighter-rouge">mt -f /dev/st0 bsf 1</code></li>
      <li>
        <p>If you are in the last block of a file and you should be at the beginning of the file, do the following:</p>

        <p><code class="language-plaintext highlighter-rouge">mt -f /dev/st0 bsf 1</code></p>

        <p><code class="language-plaintext highlighter-rouge">mt -f /dev/st0 fsf 1</code></p>
      </li>
      <li>And check with: <code class="language-plaintext highlighter-rouge">mt -f /dev/st0 status</code></li>
    </ul>
  </li>
  <li>Extract your file(s): <code class="language-plaintext highlighter-rouge">tar -xvf /dev/st0 ~files~</code></li>
  <li>Rewind and eject tape: <code class="language-plaintext highlighter-rouge">mt -f /dev/st0 offline</code></li>
</ul>

<h2 id="hardware-compression">Hardware Compression</h2>

<p>It may be possible to switch off and on the hardware compression on the:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mt -f /dev/st0 compression 0
# mt -f /dev/st0 compression 1
</code></pre></div></div>

<p>Other people report replacing the 0 with “off” and 1 with “on”.</p>

<h2 id="references">References</h2>

<ul>
  <li>man tar</li>
  <li>man mt</li>
  <li><a href="http://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/">Howto: Linux Tape Backup with MT and TAR commands</a></li>
  <li><a href="http://www.cs.inf.ethz.ch/stricker/lab/linux_tape.html">How to use the DAT-tape with Linux</a></li>
  <li><a href="http://www.cyberciti.biz/faq/unix-verify-tape-backup/">Verify tar command tape backup under Linux or UNIX</a></li>
  <li><a href="http://www.cyberciti.biz/faq/tape-drives-naming-convention-under-linux/">Tape drives naming convention under Linux</a></li>
  <li><a href="http://www.cyberciti.biz/faq/backup-home-directories-in-linux/">Backup home directories in Linux</a></li>
  <li><a href="http://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/">Howto: Use tar command through network over ssh session</a></li>
  <li><a href="http://www.cyberciti.biz/faq/rhel-centos-debian-set-tape-blocksize/">Linux Set the Block Size for a SCSI Tape Device</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Ruby on Rails3 on Debian Lenny</title>
      <link>https://chrisjrob.com/2010/11/20/install-ruby-on-rails3-on-debian-lenny/</link>
      <pubDate>Sat, 20 Nov 2010 16:15:40 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/11/20/install-ruby-on-rails3-on-debian-lenny</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/debian_logo.png" align="right" alt="Featured Image">
         
         <p>I know nothing about Ruby on Rails, but this is how I ended up successfully (I think!) installing it.  There may be better ways.</p>

<h2 id="download-and-compile-ruby">Download and Compile Ruby</h2>

<p>At the time of writing, the current version is 1.9.2</p>

<ul>
  <li>http://www.ruby-lang.org/en/downloads/</li>
</ul>

<!--more-->

<p>I tend to use checkinstall wherever possible, so that I can manage the package via apt-get and dpkg.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install checkinstall

$ wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz
$ tar -xvvzf ruby-1.9.2-p0.tar.gz
$ cd ruby-1.9.2-p0

$ ./configure
$ make
$ sudo checkinstall
</code></pre></div></div>

<p>Set the version number to 1.9.2</p>

<h2 id="install-rails">Install Rails</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo gem install rails
</code></pre></div></div>

<h2 id="install-passenger">Install Passenger</h2>

<p><strong>This assumes you are using apache2.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo gem install passenger
$ sudo passenger-install-apache2-module
</code></pre></div></div>

<p>Please read thoroughly the output from this the last command, as it will give you the information you require for the next section.</p>

<h2 id="enable-passenger">Enable Passenger</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /etc/apache2/mods-available
</code></pre></div></div>

<p>Create or edit the following files, using the output from passenger-install-apache2-module above.</p>

<h3 id="passengerconf">passenger.conf</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;IfModule mod_passenger.c&gt;
    PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.15
    PassengerRuby /usr/local/bin/ruby
&lt;/IfModule&gt;
</code></pre></div></div>

<h3 id="passengerload">passenger.load</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
</code></pre></div></div>

<h3 id="enable-in-apache">Enable in Apache</h3>

<p>You should now be able to enable the apache module with:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo a2enmod passenger
</code></pre></div></div>

<h2 id="update-vhosts">Update Vhosts</h2>

<p>This will vary depending on your system, but you are aiming to have a vhost configuration similar to the following:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;VirtualHost *:80&gt;
    ServerName www.yourhost.com
    DocumentRoot /somewhere/public    # &lt;-- be sure to point to 'public'!
    RailsEnv development              # &lt;-- change to testing/production as appropriate (see note below)
    RackEnv development               # &lt;-- change to testing/production as appropriate (see note below)
    &lt;Directory /somewhere/public&gt;
       AllowOverride all              # &lt;-- relax Apache security settings
       Options -MultiViews            # &lt;-- MultiViews must be turned off
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</code></pre></div></div>

<p>By default, passenger uses the Ruby on Rails production database, which may or may not be appropriate, depending on where you are in the development process.  If you are still developing your rails app, then you may want to set in the above:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>RailsEnv development
RackEnv development
</code></pre></div></div>

<p>In theory you only need the former, but the presence of the file config.ru in your application directory makes passenger require RackEnv instead.</p>

<p>Otherwise, when making changes to your database, do remember to:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># db:migrate RAILS_ENV=production
# touch tmp/restart.txt
</code></pre></div></div>

<p>Otherwise your application will not work.</p>

<h2 id="ispconfig">ISPConfig</h2>

<p>If you are using ISPConfig, then I currently have this working by adding the following to the sites Apache Directives in the admin control panel:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DocumentRoot /var/www/web11/web/blog/public
&lt;Directory /var/www/web11/web/blog/public&gt;
    AllowOverride all
    Options -MultiViews
&lt;/Directory&gt;
</code></pre></div></div>

<p>And then edit <code class="language-plaintext highlighter-rouge">/etc/apache2/vhosts/Vhosts_ispconfig.conf</code> and remove the old DocumentRoot line from the relevant vhost section.  Unfortunately you will have to do this everytime you change your site configuration.  This is very poor, there has to be a better way.</p>

<h2 id="installing-jquery">Installing JQuery</h2>

<p>These are rather poor notes, you are probably better looking elsewhere, but the key thing is that the long and complex instructions for installing jquery that abound on the Internet should be avoided.  The installation should be a mere couple of commands.</p>

<p>Either type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ gem install jquery-rails
</code></pre></div></div>

<p>Or as I preferred, edit your Gemfile (in the root of your rails project) and add:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem 'jquery-rails'
</code></pre></div></div>

<p>My handwritten notes don’t say this, but I believe you would then need to run:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ bundle install
</code></pre></div></div>

<p>And then (add “–ui” on the end of the following command to include the jquery UI):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ rails generate jquery:install
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Wine on LTSP</title>
      <link>https://chrisjrob.com/2010/10/06/install-wine-on-ltsp/</link>
      <pubDate>Wed, 06 Oct 2010 15:29:55 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/10/06/install-wine-on-ltsp</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/winehq_logo_glass.png" align="right" alt="Featured Image">
         
         <p><strong>These instructions have not been tested since re-writing, in particular there will be permissions issues.</strong></p>

<h2 id="step-1-install-wine">Step 1: Install Wine</h2>

<p>Please visit for instructions on how to install Wine:</p>

<!--more-->

<ul>
  <li>http://www.winehq.org/site/download</li>
</ul>

<p>If you get a problem with applications appearing without any text, then you need to install some Windows fonts in Wine. 
One option is to simply download them from <a href="http://sourceforge.net/projects/corefonts/">http://sourceforge.net/projects/corefonts/</a>. You may also be able to install via a debian installer package:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get ttf-mscorefonts-installer
</code></pre></div></div>

<p>Install Wine packages:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install libwine libwine-print libwine-sane libwine-alsa
</code></pre></div></div>

<p>Your requirements may vary, a non-inclusive list of available libraries is:</p>

<ul>
  <li>libwine: the core wine library</li>
  <li>libwine-print: the printing library</li>
  <li>libwine-sane: the scanning library</li>
  <li>libwine-alsa: the alsa sound library</li>
  <li>libwine-oss: the oss sound library</li>
</ul>

<p>You will notice winetools mentioned on several websites, my understanding is that this is no longer supported.</p>

<h2 id="step-2-create-a-wine-directory-for-your-application">Step 2: Create a Wine directory for your application</h2>

<p>By default Windows applications are installed in <code class="language-plaintext highlighter-rouge">/home/user/.wine</code>. If you want to install your application in a different directory then you must use the WINEPREFIX variable.</p>

<p>If you want your application to be installed in <code class="language-plaintext highlighter-rouge">/usr/local/share/appname</code> you must first create the directory:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /usr/local/share
$ mkdir appname
$ WINEPREFIX="/usr/local/share/appname" wineprefixcreate
</code></pre></div></div>

<p>In this directory you will now find a fake Windows drive and the Wine configuration files system.reg and user.reg.</p>

<h2 id="step-3-configure-your-wine-directory">Step 3: Configure your Wine directory</h2>

<p><strong>You can probably skip this step for typical installations.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ WINEPREFIX="/usr/local/share/appname" winecfg
</code></pre></div></div>

<h2 id="step-4-install-your-application">Step 4: Install your application</h2>

<h4 id="installing-from-an-msi-file">Installing from an .msi file</h4>

<p>You can install .msi files with the msiexec.exe utility. This command is built into Wine, so you don’t have to install Windows Installer from Microsoft.
If the .msi file is called msifile.msi you just have to type msiexec /i msifile.msi and the application will be installed.</p>

<p><strong>Make sure you’re not using a native version of msi.dll, but the builtin one.</strong>
To run the Windows install program, please type the following:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ WINEPREFIX="/usr/local/share/appname" wine /path/to/setup.exe
</code></pre></div></div>

<p><strong>Substitute “/path/to/setup.exe” with the installation path executable for your application</strong></p>

<h2 id="step-5-test-your-application">Step 5: Test your application</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ WINEPREFIX="/usr/local/share/appname" wine "drive_c/Program Files/app/appname.exe"
</code></pre></div></div>

<h2 id="step-6-configure-for-multi-user-operation">Step 6: Configure for multi-user operation</h2>

<p><strong>This section needs a re-write (or just refer to Example automation script below)</strong></p>

<p>It is possible to configure the system so that a system Wine installation (and applications) can be shared by all the users, and still let the users all have their own personalized configuration.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Creating individual user directory, e.g. /home/username/.appname
# Symlink directory structure to /usr/local/share/appname
# Remove symlink for user.reg (will be auto-created for each user on first run)

$ ln -sf /usr/local/share/appname/system.reg system.reg
</code></pre></div></div>

<p>To assist in this process, please refer to the following guide:</p>

<ul>
  <li>http://www.winehq.org/site/docs/wineusr-guide/using-regedit</li>
</ul>

<p>and perhaps even symlink these back to the administrator’s account, to make it easier to install apps system-wide later:</p>

<p>You might be tempted to do the same for user.reg as well, however that file contains user specific settings. Every user should have their own copy of that file along with the permissions to modify it.</p>

<p>You’ll want to pay attention to drive mappings. If you’re sharing the system.reg file you’ll want to make sure the registry settings are compatible with the drive mappings in ~/.wine/dosdevices of each individual user. As a general rule of thumb, the closer you keep your drive mappings to the default configuration provided by wineprefixcreate, the easier this will be to manage. You may or may not be able to share some or all of the actual “c:” drive you originally installed the application to. Some applications require the ability to write specific settings to the drive, especially those designed for Windows 95/98/ME.</p>

<h3 id="example-automation-script">Example automation script</h3>

<p>This script was probably cobbled together from the superb ies4linux installation, or possibly from Franks Corner,</p>

<div class="language-pl highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">#!/usr/bin/perl</span>
<span class="c1"># Launch script for multiuser appname, master copy in /usr/local/share/appname.</span>

<span class="k">use</span> <span class="nv">strict</span><span class="p">;</span>

<span class="k">my</span> <span class="nv">$MASTERPREFIX</span> <span class="o">=</span> <span class="p">'</span><span class="s1">/usr/local/share/appname</span><span class="p">';</span>
<span class="k">my</span> <span class="nv">$WINEPREFIX</span>   <span class="o">=</span> <span class="nv">$ENV</span><span class="p">['</span><span class="s1">HOME</span><span class="p">'}</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/.appname</span><span class="p">';</span>

<span class="k">use</span> <span class="nv">vars</span> <span class="sx">qw($MASTERPREFIX $WINEPREFIX)</span><span class="p">;</span>

<span class="c1"># If we're not set up, create the user's magic symlink-copy of the master</span>
<span class="c1"># installation.</span>

<span class="k">unless</span> <span class="p">(</span><span class="o">-</span><span class="nv">d</span> <span class="p">"</span><span class="si">$WINEPREFIX</span><span class="p">")</span> <span class="p">{</span>
	<span class="nb">system</span><span class="p">('</span><span class="s1">mkdir</span><span class="p">',</span> <span class="p">'</span><span class="s1">-p</span><span class="p">',</span> <span class="p">"</span><span class="si">$WINEPREFIX</span><span class="p">")</span> <span class="o">==</span> <span class="mi">0</span> <span class="p">](</span><span class="o">|</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">mkdir -p </span><span class="si">$WINEPREFIX</span><span class="s2">: $?</span><span class="p">";</span>
	<span class="nb">system</span><span class="p">('</span><span class="s1">lndir</span><span class="p">',</span> <span class="p">"</span><span class="si">$MASTERPREFIX</span><span class="p">",</span> <span class="p">"</span><span class="si">$WINEPREFIX</span><span class="p">")</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">lndir failed: is xutils installed? $?</span><span class="p">";</span>

	<span class="c1"># The profile directory will be recreated automatically by wine on the</span>
	<span class="c1"># first run, so it's OK to blow away eny existing copy hanging around in</span>
	<span class="c1"># unwritable symlink form from the install, and it's OK to just create a</span>
	<span class="c1"># blank one.</span>
   
	<span class="nv">$PROFILES</span> <span class="o">=</span> <span class="nv">$WINEPREFIX</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/drive_c/windows/profiles</span><span class="p">';</span>
	<span class="nb">system</span><span class="p">('</span><span class="s1">rm</span><span class="p">',</span> <span class="p">'</span><span class="s1">-fr</span><span class="p">',</span> <span class="p">"</span><span class="si">$PROFILES</span><span class="p">")</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">rm -fr </span><span class="si">$PROFILES</span><span class="s2"> failed: $?</span><span class="p">";</span>
	<span class="nb">system</span><span class="p">('</span><span class="s1">mkdir</span><span class="p">',</span> <span class="p">'</span><span class="s1">-p</span><span class="p">',</span> <span class="p">"</span><span class="si">$PROFILES</span><span class="p">")</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">mkdir -p </span><span class="si">$PROFILES</span><span class="s2"> failed: $?</span><span class="p">";</span>

	<span class="c1"># WINE needs to be able to write to the following files, so they can't be</span>
	<span class="c1"># symlinks to root-owned ones.</span>
   
	<span class="k">foreach</span> <span class="k">my</span> <span class="nv">$file</span> <span class="p">('</span><span class="s1">.no_prelaunch_window_flag</span><span class="p">',</span> <span class="p">'</span><span class="s1">system.reg</span><span class="p">',</span> <span class="p">'</span><span class="s1">userdef.reg</span><span class="p">',</span> <span class="p">'</span><span class="s1">user.reg</span><span class="p">')</span> <span class="p">{</span>
		<span class="k">if</span> <span class="p">(</span><span class="o">-</span><span class="nv">l</span> <span class="nv">$WINEPREFIX</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/</span><span class="p">'</span> <span class="o">.</span> <span class="nv">$file</span><span class="p">)</span> <span class="p">{</span>
			<span class="nb">system</span><span class="p">('</span><span class="s1">rm</span><span class="p">',</span> <span class="p">'</span><span class="s1">-f</span><span class="p">',</span> <span class="nv">$WINEPREFIX</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/</span><span class="p">'</span> <span class="o">.</span> <span class="nv">$file</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">rm -f </span><span class="si">$WINEPREFIX</span><span class="s2">/</span><span class="si">$file</span><span class="s2"> failed: $?</span><span class="p">";</span>
			<span class="nb">system</span><span class="p">('</span><span class="s1">cp</span><span class="p">',</span> <span class="nv">$MASTERPREFIX</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/</span><span class="p">'</span> <span class="o">.</span> <span class="nv">$file</span><span class="p">,</span> <span class="nv">$WINEPREFIX</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/</span><span class="p">'</span> <span class="o">.</span> <span class="nv">$file</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Cannot copy </span><span class="si">$MASTERPREFIX</span><span class="s2">/</span><span class="si">$file</span><span class="s2"> to </span><span class="si">$WINEPREFIX</span><span class="s2">/</span><span class="si">$file</span><span class="s2">: $?</span><span class="p">";</span>
		<span class="p">)</span>
	<span class="p">}</span>
	<span class="nb">system</span><span class="p">('</span><span class="s1">chmod</span><span class="p">',</span> <span class="p">'</span><span class="s1">-R</span><span class="p">',</span> <span class="p">'</span><span class="s1">og-rwx</span><span class="p">',</span> <span class="nv">$WINEPREFIX</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Cannot chmod -R og-rwx </span><span class="si">$WINEPREFIX</span><span class="s2">: $?</span><span class="p">";</span>

<span class="p">}</span>

<span class="nb">exec</span><span class="p">('</span><span class="s1">env</span><span class="p">',</span> <span class="p">'</span><span class="s1">WINEPREFIX=</span><span class="p">'</span> <span class="o">.</span> <span class="nv">$WINEPREFIX</span><span class="p">,</span> <span class="p">'</span><span class="s1">wine</span><span class="p">',</span> <span class="nv">$WINEPREFIX</span> <span class="o">.</span> <span class="p">'</span><span class="s1">/drive_c/Program Files/appname/appname.exe</span><span class="p">',</span> <span class="nv">@ARGV</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Failed to launch appname: $?</span><span class="se">\n</span><span class="p">";</span>

<span class="nb">exit</span><span class="p">;</span>
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.winehq.org/">WineHQ</a>
    <ul>
      <li><a href="http://www.winehq.org/mailman/listinfo/wine-users">Wine Mailing List</a></li>
    </ul>
  </li>
  <li><a href="http://www.ltsp.org/">LTSP</a>
    <ul>
      <li><a href="http://marc.info/?l=ltsp-discuss&amp;r=1&amp;w=2">LTSP Mailing List</a></li>
    </ul>
  </li>
  <li><a href="http://www.tatanka.com.br/">IES4Linux</a></li>
  <li>
    <table>
      <tbody>
        <tr>
          <td>Franks Corner</td>
          <td>http://frankscorner.org/}</td>
        </tr>
      </tbody>
    </table>
  </li>
  <li>Wine printing problems:
    <ul>
      <li>http://www.la-sorciere.de/Wine-HOWTO/wineprintconfig.html</li>
      <li>http://groups.google.com/group/comp.emulators.ms-windows.wine/msg/b05da7237281dbab</li>
    </ul>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | OpenVZ Notes</title>
      <link>https://chrisjrob.com/2010/10/05/openvz-notes/</link>
      <pubDate>Tue, 05 Oct 2010 13:09:30 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/10/05/openvz-notes</guid>
      <description>
       <![CDATA[
         
         <h2 id="warning">Warning</h2>

<p>This is just an aide-memoire, please don’t try and follow it.</p>

<h2 id="creating-a-template">Creating a template</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># rm -f /etc/ssh/ssh_host_*
cat &lt;&lt; EOF &gt; /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
rm -f \$0
EOF
# chmod a+x /etc/rc2.d/S15ssh_gen_host_keys
</code></pre></div></div>

<!--more-->

<h2 id="tip-re-freenx-server">Tip re. freenx-server</h2>

<p>You will need to reconfigure the freenx-server:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo dpkg-reconfigure freenx-server
</code></pre></div></div>

<h2 id="updating-template">Updating template</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo vzctl enter XXX
$ sudo apt-get clean
$ exit
$ sudo vzctl set XXX --ipdel all --save
$ sudo vim /var/lib/vz/private/XXX/etc/resolv.conf
$ sudo rm -f /var/lib/vz/private/XXX/etc/hostname
$ sudo vzctl stop XXX
$ cd /var/lib/vz/private/XXX
$ tar --numeric-owner -zcf /var/lib/vz/template/cache/debian-5.0-i386-minimal.tar.gz .
</code></pre></div></div>

<h2 id="create-configuration-template-for-10-vms">Create configuration template for 10 vms</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo vzsplit -n 10 -f vps.tenth
</code></pre></div></div>

<h2 id="create-new-vm">Create new vm</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo vzctl create XXX --ostemplate debian-5.0-i386-minimal --config vps.basic
sudo vzctl create XXX --ostemplate debian-5.0-i386-kde --config vps.tenth
sudo vzctl start XXX
sudo vzctl set XXX --ipadd 192.168.0.XXX --save
sudo vzctl set XXX --nameserver 192.168.0.254 --save
sudo vzctl set XXX --onboot yes --save
sudo vzctl set XXX --hostname server-XXXXXX.example.co.uk --save
sudo vzctl set XXX --diskspace $(( 1048576*2 )):$(( 1153434*2 )) --save
sudo vzctl set XXX --diskspace 10G:11G --save
vzcfgvalidate /etc/vz/conf/XXX.conf
</code></pre></div></div>

<h2 id="other-tricks">Other tricks</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo vzctl start XXX
sudo vzctl exec XXX passwd
sudo vzctl exec XXX ps aux
sudo vzctl enter XXX
sudo vzctl stop XXX
</code></pre></div></div>

<h2 id="removing-a-vm">Removing a vm</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo vzctl destroy XXX
$ sudo rm /etc/vz/conf/XXX.conf.destroyed
</code></pre></div></div>

<h2 id="list-running-and-non-running">List running and non-running</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo vzlist -a
</code></pre></div></div>

<h2 id="memory-use">Memory use</h2>

<h3 id="check-memory-usage-for-guest-103">Check memory usage for guest 103</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo vzcalc -v 103
</code></pre></div></div>

<h3 id="set-minimum-memory-256-x-memory-wanted">Set minimum memory 256 x memory wanted</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo vzctl set vpsid --vmguarpages $((256 * 256)) --save
</code></pre></div></div>

<h3 id="set-maximum-memory-256-x-memory-wanted">Set maximum memory 256 x memory wanted</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo vzctl set vpsid --privvmpages $((256 * 1024)) --save
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li>http://wiki.openvz.org/Debian_template_creation</li>
  <li>http://wiki.openvz.org/Resource_shortage</li>
  <li>http://www.linux.com/archive/feature/114214</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Kiosktool</title>
      <link>https://chrisjrob.com/2010/09/29/install-kiosktool/</link>
      <pubDate>Wed, 29 Sep 2010 10:06:35 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/09/29/install-kiosktool</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/kiosktool3.png" align="right" alt="Featured Image">
         
         <p>First let’s take a look at where KDE squirrels away all these settings. KDE is complex, but it’s well-organised, and there is always a method to whatever KDE madness you find yourself in.</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">/etc/kderc</code> :  This points to the file locations where configuration profiles are stored.</li>
  <li><code class="language-plaintext highlighter-rouge">/etc/kde3</code> : Global configuration files are here.</li>
  <li><code class="language-plaintext highlighter-rouge">/home/~username~/.kde</code> : User’s individual settings go here.</li>
</ul>

<!--more-->

<p>You can see for yourself where your particular KDE installation is going to look for configuration files:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ kde-config --path config
/home/carla/.kde/share/config/:/etc/kde3/:/usr/share/kubuntu-
default-settings/kde-profile/default/share/config/
</code></pre></div></div>

<p>KDE reads these in reverse order, so if it encounters any conflicts, the last value read is the one used. User’s individual configurations take precedence, so they are read last. 
There is a way to make an exception to the precedence rule: using $i, or the “immutable” key. You’ll see how this is used in the examples below. Anything marked immutable has precedence, no matter what order it’s in.</p>

<h2 id="installing-kiosktool">Installing Kiosktool</h2>

<p><strong>This is now unnecessary, as this has been fixed on Debian, you should now be able to simply do an aptitude install.</strong></p>

<p>Kiosktool is simply an easy way of administering the above files. Kiosk Admin Tool is available in Debian Testing/Unstable and should be as simple to install as:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install kiosktool
</code></pre></div></div>

<p>Unfortunately the current version of Kiosktool is broken for Debian, as Debian have changed the filename for the menu configuration from applications.menu to kde-applications.menu, and unfortunately Kiosktool is now unmaintained, so to install requires a few more steps than normal:</p>

<h3 id="install-the-build-dependencies">Install the build dependencies</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get build-dep kiosktool
</code></pre></div></div>

<p><strong>Before installing the dependencies, please copy them into the clipboard.</strong></p>

<h3 id="download-the-source">Download the source</h3>

<p>Note that you do not need to be root to do this, and it helps later if you’re not! Change your repository if necessary, or remove it entirely to install from your default repository. Note however that at the time of writing Kiosktool is only available in testing, unstable and backports (the same versions in each).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get -t etch-backports source kiosktool
</code></pre></div></div>

<h3 id="edit-the-source">Edit the source</h3>

<p>This will download three files: a .orig.tar.gz, a .dsc and a .diff.gz. In the case of packages made specifically for Debian, the last of these is not downloaded and the first usually won’t have “orig” in the name. The .dsc file is used by dpkg-source for unpacking the source package into the directory packagename-version. Within each downloaded source package there is a debian/ directory that contains the files needed for creating the .deb package.</p>

<p>Navigate to this directory and open the following file in a text editor:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/path/to/kiosktool-1.0/kiosktool/menueditComponent.cpp
</code></pre></div></div>

<p>Replace all instances of applications.menu with kde-applications.menu.</p>

<h3 id="build-the-deb">Build the deb</h3>

<p>From within the directory that was created for the package after downloading.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get -b source kiosktool
</code></pre></div></div>

<p>To install the package built by the commands above one must use the package manager directly, like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># dpkg -i kiosktool-&lt;version&gt;.deb
</code></pre></div></div>

<h3 id="remove-the-build-dependencies">Remove the build dependencies</h3>

<p>It seems that some of the build dependencies may be incompatible with the LTSP enlightened sound daemon (esd), if you copied them (as recommended in Install the build dependencies section), then please purge them now. Otherwise you will need to review <code class="language-plaintext highlighter-rouge">/var/log/dpkg.log</code> for the relevant files.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get --purge remove package1 package2 etc
</code></pre></div></div>

<h2 id="using-kiosktool">Using Kiosktool</h2>

<p>After installation you should have a menu entry for it in System -&gt; KIOSK Admin Tool, or use the kiosktool command to start it from the command prompt.</p>

<p>You may find that a copying dialog crops up at regular intervals and that often it will stall, please read:</p>

<ul>
  <li><a href="/2010/09/29/fix-kiosktool-fish-protocol-stalls/">Fix kiosktool fish protocol stalls</a></li>
</ul>

<h2 id="references">References</h2>

<p>This document was cobbled from the following sources:</p>

<ul>
  <li><a href="http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html">APT HOWTO Chapter 6 Working with source packages</a></li>
  <li><a href="http://www.enterprisenetworkingplanet.com/netos/article.php/3573736">Lock Down Desktops with KDE Kiosk by Carla Schroder</a></li>
</ul>

<p>Other references:</p>

<ul>
  <li>http://techbase.kde.org/User:Danimo/KIOSK</li>
</ul>

<p>The advice in the Edit the source section was copied from a mailing list post, which I now cannot find. The post also mentioned that patches were available for this issue, although I could not find any such patches, and anyway the method above is probably just as easy.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Fix Kiosktool Fish Protocol Stalls</title>
      <link>https://chrisjrob.com/2010/09/29/fix-kiosktool-fish-protocol-stalls/</link>
      <pubDate>Wed, 29 Sep 2010 10:05:41 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/09/29/fix-kiosktool-fish-protocol-stalls</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/kiosk_1.gif" align="right" alt="Featured Image">
         
         <p>When making changes to profiles under kiosktool, it stalls when uploading changes to the local machine using the fish protocol, see screenshots.</p>

<p>Persistently clicking cancel followed by retry does deliver the goods, but sometimes it can take ten attempts or more, with the load average quickly escalating to ten times the server’s usual level.</p>

<!--more-->

<p>I understand it requires the fish protocol, even though it is editing the local machine, because kiosk has to be run as a standard user, but requires root access to edit the profile.</p>

<p>The fish protocol usually works fine in konqueror.</p>

<p>Under our Kiosk configuration I have the base directory set as <code class="language-plaintext highlighter-rouge">/etc/kde-profile</code> and the option “On exit, upload profiles to a remote server” is unchecked.</p>

<h2 id="screenshots">Screenshots</h2>

<p><img src="/assets/kiosk_1.gif" />
<img src="/assets/kiosk_2.gif" />
<img src="/assets/kiosk_3.gif" /></p>

<h2 id="workaround">Workaround</h2>

<p>Keep cancelling the copy and then retry.</p>

<p><strong>Never come out without successfully completing the copy, or you can end up with corruption in your personal desktop, or menus, or even end up unable to log in.  You have been warned.</strong></p>

<h2 id="the-solution">The Solution</h2>

<p>The solution seems to be to edit the menu entry for Kiosk-Tool and change it to:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>env KDE_FORK_SLAVES=true kiosktool
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li>http://lists.kde.org/?t=111633283900002&amp;r=1&amp;w=2 (Similar problem under SUSE)</li>
  <li>http://bugs.kde.org/show_bug.cgi?id=8137 (similar problem under FreeBSD)</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Create Nagios Status Map Icons</title>
      <link>https://chrisjrob.com/2010/09/16/create-nagios-statusmap-icons/</link>
      <pubDate>Thu, 16 Sep 2010 09:42:07 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/09/16/create-nagios-statusmap-icons</guid>
      <description>
       <![CDATA[
         
         <h2 id="install-gd-tools">Install GD Tools</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install libgd-tools
</code></pre></div></div>

<h2 id="create-image-in-gimp">Create image in Gimp</h2>

<!--more-->

<p>Create a suitable image in Gimp, ensuring that it has a transparent rather than a white background.</p>

<p>From the menu - Image → Mode → Indexed and “Generate Optimum Palette” with “Maximum number of colours: 255”.</p>

<p>Save result as a PNG file, e.g. “router.png”</p>

<h2 id="convert-to-gd2">Convert to GD2</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ pngtogd2 router.png router.gd2 0 1
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install FreeNX</title>
      <link>https://chrisjrob.com/2010/07/08/install-freenx/</link>
      <pubDate>Thu, 08 Jul 2010 16:01:27 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/07/08/install-freenx</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>Installing from Ubuntu onto Debian Lenny seems sub-optimal, but is quick and dirty.</p>

<h2 id="step-1---add-sources">Step 1 - Add sources</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu intrepid main
# deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu intrepid main
</code></pre></div></div>

<!--more-->

<h2 id="step-2---install-freenx-in-debian">Step 2 - Install FreeNX in Debian</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># aptitude update
# aptitude install freenx
</code></pre></div></div>

<h2 id="step-3---connecting">Step 3 - Connecting</h2>

<p>To connect, you need to download the NoMachine client.  If you have issues with the arrow/cursor keys, please see:</p>

<ul>
  <li><a href="/2010/07/08/fix-nxclient-arrow-keys/">Fix nxclient arrow keys</a></li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://freenx.berlios.de/info.php">FreeNX</a></li>
  <li><a href="http://wiki.debian.org/freenx">FreeNX on Debian Wiki</a> ← Read this</li>
  <li><a href="http://www.debianhelp.co.uk/freenx.htm">FreeNX on DebianHelp</a></li>
  <li><a href="http://www.telemedia.ch/publ/ltsp-howto.html">FreeNX on LTSP</a>
    <ul>
      <li><a href="http://www.telemedia.ch/publ/freenx-setup-howto.html">FreeNX</a></li>
    </ul>
  </li>
  <li><a href="http://www.nomachine.com/">NoMachine</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Fix nxclient arrow keys</title>
      <link>https://chrisjrob.com/2010/07/08/fix-nxclient-arrow-keys/</link>
      <pubDate>Thu, 08 Jul 2010 15:59:28 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/07/08/fix-nxclient-arrow-keys</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>I recently that the arrow keys on my laptop were not working correctly, usually triggering knapshot.  The following webpage addresses this concern.  You should go there now, only read on if that page is gone.</p>

<ul>
  <li>http://wiki.laptop.org/go/Remote_Desktop</li>
</ul>

<!--more-->

<h2 id="keyboard-mapping">Keyboard mapping</h2>

<p>The UK keyboard layout of my laptop is not correctly mapped by the nxclient (which sees it as pc102 instead of pc105). For instance, on a KDE session, the arrow keys are not working, and the Up key thinks it is a PrntScr key and starts ksnapshot! Not really handy… Here is a manual workaround.</p>

<p>When connected remotely to the server, open a terminal and register this keymap configuration with X.</p>

<p><strong>Please note that these instructions are for the XO and may not be correct - I will correct the following as/when I have time or find problems.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ xmodmap xmodmap.keys

Content of the xmodmap.keys file
keycode   8 =
keycode   9 = Escape
keycode  10 = 1 exclam exclamdown exclamdown exclamdown exclamdown
keycode  11 = 2 at notsign notsign notsign notsign
keycode  12 = 3 numbersign U0300 U0300 U0300 U0300
keycode  13 = 4 dollar U0301 U0301 U0301 U0301
keycode  14 = 5 percent U0306 U0306 U0306 U0306
keycode  15 = 6 asciicircum U030A U030A U030A U030A
keycode  16 = 7 ampersand U0302 U0302 U0302 U0302
keycode  17 = 8 asterisk U0324 U0324 U0324 U0324
keycode  18 = 9 parenleft U0307 U0307 U0307 U0307
keycode  19 = 0 parenright U0308 U0308 U0308 U0308
keycode  20 = minus underscore U0304 U0304 U0304 U0304
keycode  21 = equal plus U0303 U0303 U0303 U0303
keycode  22 = BackSpace Terminate_Server
keycode  23 = Tab ISO_Left_Tab
keycode  24 = q Q Greek_omega Greek_OMEGA Greek_omega Greek_OMEGA
keycode  25 = w W oslash Oslash oslash Oslash
keycode  26 = e E oe OE oe OE
keycode  27 = r R U0327 U0327 U0327 U0327
keycode  28 = t T U032E U032E U032E U032E
keycode  29 = y Y U0325 U0325 U0325 U0325
keycode  30 = u U U032D U032D U032D U032D
keycode  31 = i I U032C U032C U032C U032C
keycode  32 = o O U0323 U0323 U0323 U0323
keycode  33 = p P U0304 U0304 U0304 U0304
keycode  34 = bracketleft braceleft U0331 U0331 U0331 U0331
keycode  35 = bracketright braceright U0330 U0330 U0330 U0330
keycode  36 = Return
keycode  37 = Control_L
keycode  38 = a A ae AE ae AE
keycode  39 = s S ssharp ssharp ssharp ssharp
keycode  40 = d D eth ETH eth ETH
keycode  41 = f F thorn THORN thorn THORN
keycode  42 = g G
keycode  43 = h H sterling sterling sterling sterling
keycode  44 = j J EuroSign EuroSign EuroSign EuroSign
keycode  45 = k K
keycode  46 = l L
keycode  47 = semicolon colon masculine ordfeminine masculine ordfeminine
keycode  48 = apostrophe quotedbl currency currency currency currency
keycode  49 = grave asciitilde dead_grave dead_tilde dead_grave dead_tilde
keycode  50 = Shift_L
keycode  51 = backslash bar section section section section
keycode  52 = z Z
keycode  53 = x X
keycode  54 = c C ccedilla Ccedilla ccedilla Ccedilla
keycode  55 = v V
keycode  56 = b B
keycode  57 = n N ntilde Ntilde ntilde Ntilde
keycode  58 = m M mu mu mu mu
keycode  59 = comma less guillemotleft guillemotleft guillemotleft guillemotleft
keycode  60 = period greater guillemotright guillemotright guillemotright guillemotright
keycode  61 = slash question questiondown questiondown questiondown questiondown
keycode  62 = Shift_R
keycode  63 = KP_Multiply XF86_ClearGrab
keycode  64 = Alt_L Meta_L
keycode  65 = space
keycode  66 = Caps_Lock
keycode  67 = F1 XF86_Switch_VT_1
keycode  68 = F2 XF86_Switch_VT_2
keycode  69 = F3 XF86_Switch_VT_3
keycode  70 = F4 XF86_Switch_VT_4
keycode  71 = F5 XF86_Switch_VT_5
keycode  72 = F6 XF86_Switch_VT_6
keycode  73 = F7 XF86_Switch_VT_7
keycode  74 = F8 XF86_Switch_VT_8
keycode  75 = F9 XF86_Switch_VT_9
keycode  76 = F10 XF86_Switch_VT_10
keycode  77 = Num_Lock Pointer_EnableKeys
keycode  78 = Scroll_Lock
keycode  79 = KP_Home KP_7
keycode  80 = KP_Up KP_8
keycode  81 = KP_Prior KP_9
keycode  82 = KP_Subtract XF86_Prev_VMode
keycode  83 = KP_Left KP_4
keycode  84 = KP_Begin KP_5
keycode  85 = KP_Right KP_6
keycode  86 = KP_Add XF86_Next_VMode
keycode  87 = KP_End KP_1
keycode  88 = KP_Down KP_2
keycode  89 = KP_Next KP_3
keycode  90 = KP_Insert KP_0
keycode  91 = KP_Delete KP_Decimal
keycode  92 = ISO_Level3_Shift
keycode  93 =
keycode  94 = less greater bar brokenbar bar brokenbar
keycode  95 = F11 XF86_Switch_VT_11
keycode  96 = F12 XF86_Switch_VT_12
keycode  97 =
keycode  98 =
keycode  99 =
keycode 100 =
keycode 101 =
keycode 102 =
keycode 103 =
keycode 104 = KP_Enter
keycode 105 = Control_R
keycode 106 = KP_Divide XF86_Ungrab
keycode 107 = Print Sys_Req
keycode 108 = ISO_Level3_Shift
keycode 109 =
keycode 110 = Home
keycode 111 = Up
keycode 112 = Prior
keycode 113 = Left
keycode 114 = Right
keycode 115 = End
keycode 116 = Down
keycode 117 = Next
keycode 118 = Insert
keycode 119 = Delete
keycode 120 =
keycode 121 =
keycode 122 =
keycode 123 =
keycode 124 =
keycode 125 = KP_Equal
keycode 126 =
keycode 127 = Pause Break
keycode 128 =
keycode 129 =
keycode 130 =
keycode 131 =
keycode 132 =
keycode 133 = Super_L
keycode 134 = Super_R
keycode 135 = Menu
keycode 136 =
keycode 137 =
keycode 138 =
keycode 139 =
keycode 140 =
keycode 141 =
keycode 142 =
keycode 143 =
keycode 144 =
keycode 145 =
keycode 146 =
keycode 147 =
keycode 148 =
keycode 149 =
keycode 150 =
keycode 151 =
keycode 152 =
keycode 153 =
keycode 154 =
keycode 155 =
keycode 156 =
keycode 157 =
keycode 158 =
keycode 159 =
keycode 160 =
keycode 161 =
keycode 162 =
keycode 163 =
keycode 164 =
keycode 165 =
keycode 166 =
keycode 167 =
keycode 168 =
keycode 169 =
keycode 170 =
keycode 171 =
keycode 172 =
keycode 173 =
keycode 174 =
keycode 175 =
keycode 176 =
keycode 177 =
keycode 178 =
keycode 179 =
keycode 180 =
keycode 181 =
keycode 182 =
keycode 183 =
keycode 184 =
keycode 185 =
keycode 186 =
keycode 187 =
keycode 188 =
keycode 189 =
keycode 190 =
keycode 191 =
keycode 192 =
keycode 193 =
keycode 194 =
keycode 195 =
keycode 196 =
keycode 197 =
keycode 198 =
keycode 199 =
keycode 200 =
keycode 201 =
keycode 202 =
keycode 203 = Mode_switch
keycode 204 = NoSymbol Alt_L
keycode 205 = NoSymbol Meta_L
keycode 206 = NoSymbol Super_L
keycode 207 = NoSymbol Hyper_L
keycode 208 =
keycode 209 =
keycode 210 =
keycode 211 =
keycode 212 =
keycode 213 =
keycode 214 =
keycode 215 =
keycode 216 =
keycode 217 =
keycode 218 =
keycode 219 = multiply division ISO_Next_Group ISO_Prev_Group ISO_Next_Group ISO_Prev_Group
keycode 220 = XF86Search
keycode 221 = XF86Meeting
keycode 222 =
keycode 223 =
keycode 224 =
keycode 225 =
keycode 226 =
keycode 227 =
keycode 228 =
keycode 229 =
keycode 230 =
keycode 231 =
keycode 232 =
keycode 233 =
keycode 234 =
keycode 235 = XF86Display
keycode 236 =
keycode 237 =
keycode 238 =
keycode 239 =
keycode 240 =
keycode 241 =
keycode 242 =
keycode 243 =
keycode 244 =
keycode 245 =
keycode 246 =
keycode 247 =
keycode 248 =
keycode 249 =
keycode 250 =
keycode 251 =
keycode 252 =
keycode 253 =
keycode 254 =
keycode 255 =
</code></pre></div></div>

<p>Now, all arrows keys can be used, but the Up one. Go into KDE Control Center. In the Regional &amp; Accessibility/Input Action pane, look for the Preset Action/PrintScreen. In the General tab, click on the Disable check box.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Make a Linux USB Key</title>
      <link>https://chrisjrob.com/2010/04/30/make-a-linux-usb-key/</link>
      <pubDate>Fri, 30 Apr 2010 11:59:28 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/04/30/make-a-linux-usb-key</guid>
      <description>
       <![CDATA[
         
         <p>Despite all the fantastic tools around, making a Linux USB key seems to be inconsistent.  Modern hardware seems to be fairly good, but older hardware may need fat 16 or fat 32 or superfloppy format.  The eee pc 701 for example seemed to need superfloppy format to work.</p>

<!--more-->

<h2 id="the-shortcut">The Shortcut</h2>

<p>Try erasing the contents of your USB key, then skipping down to Install Unetbootin below.  You could be lucky, and save yourself some fiddling about!</p>

<h2 id="step-1-make-sure-that-your-usb-key-is-unmounted">Step 1: Make sure that your USB key is unmounted</h2>

<p>Open a terminal and type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ mount
</code></pre></div></div>

<p>This will list your current mounts, including your USB key (if mounted).  Take a note of the mount point (e.g. <code class="language-plaintext highlighter-rouge">/media/disk</code>) and type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo umount /media/disk
</code></pre></div></div>

<p>Once you are confident that the drive is not mounted, you may proceed.</p>

<h2 id="step-2-determine-the-device">Step 2: Determine the device</h2>

<p>Find you USB key by typing:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo fdisk -l

Disk /dev/sdc: 64 MB, 64487424 bytes
4 heads, 32 sectors/track, 984 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Disk identifier: 0x5187ef1e

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1         983       62896    6  FAT16
</code></pre></div></div>

<h2 id="step-3-delete-the-old-partitions">Step 3: Delete the old partitions</h2>

<p><strong>This will lose any data on this drive!!!</strong></p>

<p>Ignore the number after the letter, so in the above example the device is <code class="language-plaintext highlighter-rouge">/dev/sdc</code>, not <code class="language-plaintext highlighter-rouge">/dev/sdc1</code>; the 1 is partition 1, but fdisk works on the whole drive, not just a single partition.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo fdisk /dev/sdX
</code></pre></div></div>

<p>Command (m for help):</p>

<ul>
  <li>Type “p” and enter to view the existing partitions (generally only one)</li>
  <li>Type “d” and enter to delete the partition (if there are multiple partitions, you may need to enter 1 for the first)</li>
  <li>Type “p” to view the remaining partitions (there should not be any!)</li>
</ul>

<p>At this point, nothing has <em>really</em> happened, you can “q” to quit and nothing will have been touched.</p>

<h2 id="step-4-create-the-new-partition">Step 4: Create the new partition</h2>

<ul>
  <li>Type “n” to make a new partition</li>
  <li>Type “p” to make this partition primary and press enter</li>
  <li>Type “1” (one) to make this the first partition and then press enter</li>
  <li>Press [enter] to accept the default first cylinder</li>
  <li>Press [enter] again to accept the default last cylinder</li>
  <li>Type “p” to view what you have done</li>
</ul>

<p>This should display the current configuration of your drive:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Disk /dev/sdc: 64 MB, 64487424 bytes
4 heads, 32 sectors/track, 984 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Disk identifier: 0x5187ef1e

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         984       62960   83  Linux
</code></pre></div></div>

<h2 id="step-5-change-partition-to-w95-fat32">Step 5: Change partition to W95 Fat32</h2>

<ul>
  <li>Type “t” to change type</li>
  <li>Type “b” for Win95 Fat32</li>
  <li>Type “p” to view what you have done</li>
</ul>

<h2 id="step-6-make-partition-bootable">Step 6: Make partition bootable</h2>

<ul>
  <li>Type “a” to add bootable flag</li>
  <li>Type “1” (one) to select first partition</li>
  <li>Type “p” to view what you have done</li>
</ul>

<h2 id="step-7-write-partition-changes">Step 7: Write partition changes</h2>

<p>Up to this point, nothing has actually been changed; if you are happy with the changes you have made, then:</p>

<ul>
  <li>Type “w” to write the new partition information to the USB key</li>
</ul>

<h2 id="step-8-format-the-partition">Step 8: Format the partition</h2>

<p>The final step is to create the fat filesystem:</p>

<p><strong>Note that this time we DO quote the partition number</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mkfs.vfat -F 32 /dev/sdx1
</code></pre></div></div>

<p>This process ends by sync’ing the disk.</p>

<h2 id="step-9-mount-the-usb-key">Step 9: Mount the USB key</h2>

<p>For most systems, this can be easily achieved by simply unplugging and replugging in the key, and taking option to Mount when prompted.  Equally you can mount manually by typing:</p>

<p><strong>Change “mountpoint” below for an appropriate name</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mkdir /mnt/mountpoint
$ sudo mount /dev/sdx1 /mnt/mountpoint
</code></pre></div></div>

<h2 id="step-9-install-unetbootin">Step 9: Install Unetbootin</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo aptitude install unetbootin
</code></pre></div></div>

<h2 id="step-10-use-unetbootin">Step 10: Use Unetbootin</h2>

<p><img src="/assets/unetbooting_350.gif" class="image-right" /></p>

<p>Run Unetbootin from your menu, either select a distribution and version, or take the option to install an already downloaded disk image.</p>

<p>Next select the usb drive.</p>

<p>Given the tiny size of my USB key, I am using slitaz, which is a minimal distribution.</p>

<p><strong>Have a look at the contents of the USB drive, in at least one test, unetbootin had only copied a single file across.  Just run unetbooting again if that happens.</strong></p>

<h2 id="step-11-reboot-and-test">Step 11: Reboot and Test</h2>

<p>That’s it, you should now be able to reboot onto the drive.</p>

<h2 id="step-12-troubleshooting">Step 12: Troubleshooting</h2>

<p>My first attempt was using FAT32, which did not work.  Next I tried FAT16, which also did not work, then I tried EXT2, by change partition type to “83 Linux” and then typing the following command (replacing the “x” for your correct drive letter):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mkfs.ext2 /dev/sdx1
</code></pre></div></div>

<p>This time the USB key was detected as USB-HDD and booted perfectly.  It does seem that everyone’s has different experiences, and there is an element of trial and error to get things working.</p>

<p>If you have a usb key over 512mb and are using FAT32, then you might try reducing the size of the partition to 512k, and create a second partition with the remaining space.</p>

<p>See Alternative Methods for other options.</p>

<h2 id="step-13-superfloppy">Step 13: Superfloppy</h2>

<p>I understand that the problem with USB booting, is that many BIOS’s understand the superfloppy format - i.e. a formatted but unpartitioned drive.  This is easy enough to create under Linux, simply delete the partitions in fdisk and format with:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mkdosfs -I /dev/sdx
</code></pre></div></div>

<p>or possibly on older hardware:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># mkdosfs -v -F 16 -I /dev/sdx
</code></pre></div></div>

<p>The problem is that superfloppies will not be auto-mounted under Linux, with the result that Unetbootin cannot write to them.  But you can mount superfloppies manually:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /media
$ sudo mkdir sdx
$ sudo mount /dev/sdx sdx
</code></pre></div></div>

<p>Then use unetbooting to write to /dev/sdx, and not forgetting to umount afterwards:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo sync
$ sudo umount sdx
</code></pre></div></div>

<h2 id="alternative-methods">Alternative Methods</h2>

<p>Some distributions offer their own USB key creation software, including Ubuntu 8.10+, PuppyLinux 4.10+, and Slitaz, to name but a few.</p>

<p>Also, it is possible to obtain disk images that can be written to a usb key directly, thus circumventing these problems.  For example:</p>

<ul>
  <li><a href="http://wiki.debian.org/DebianEeePC/HowTo/Install">Debian Installer</a></li>
  <li><a href="http://wiki.debian.org/DebianEeePC/Live">Debian Live</a></li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.ubuntu-eee.com/wiki/index.php5?title=Install:_from_a_Live_Ubuntu_image_on_a_USB_stick">Install a Live Ubuntu image on a USB stick</a></li>
  <li><a href="http://www.pendrivelinux.com/">PenDriveLinux</a></li>
  <li><a href="http://d-i.pascal.at/">Installing Debian Sarge from a USB memory stick</a></li>
  <li><a href="http://wiki.debian.org/BootUsb">Debian Wiki USB Boot</a></li>
  <li><a href="http://wiki.debian.org/DebianEeePC/HowTo/Install">Debian EeePC Install</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | VirtualBox Mismatch</title>
      <link>https://chrisjrob.com/2010/02/01/virtualbox-mismatch/</link>
      <pubDate>Mon, 01 Feb 2010 09:45:53 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/02/01/virtualbox-mismatch</guid>
      <description>
       <![CDATA[
         
         <p>I have been told that installing package <code class="language-plaintext highlighter-rouge">virtualbox-ose-dkms</code> solves all these problems.  I have installed and it reported that my modules were up-to-date, which is promising.  I shall try and remember to update this page later, but I thought I’d write this now in case I forget!!</p>

<h2 id="solving-virtualbox-mismatch">Solving VirtualBox Mismatch</h2>

<!--more-->

<p>If you install <code class="language-plaintext highlighter-rouge">virtualbox-ose</code> under Debian, along with <code class="language-plaintext highlighter-rouge">virtualbox-ose-modules-2.6</code>, there can be a mismatch between versions, which will prevent VirtualBox from running.  At the time of writing <code class="language-plaintext highlighter-rouge">virtualbox-ose</code> is at version 1.66 and <code class="language-plaintext highlighter-rouge">virtualbox-ose-modules-2.6</code> is at 1.62.</p>

<p>Unfortunately you need to build the kernel module yourself.</p>

<h3 id="step-1-determine-modules-package-name">Step 1: Determine modules package name</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ dpkg -l "virtualbox-ose-modules*" | grep ii
ii  virtualbox-ose-modules-2.6.30-2-amd64 3.0.12-dfsg-1+2.6.30-8squeeze1 VirtualBox modules for Linux (kernel 2.6.30-
</code></pre></div></div>

<p>Take a note of this package name for the next step.</p>

<h3 id="step-2-uninstall-the-debian-package">Step 2: Uninstall the Debian package</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get remove virtualbox-ose-modules-2.6.30-2-amd64
</code></pre></div></div>

<h3 id="step-3-install-virtualbox-source">Step 3: Install VirtualBox Source</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install virtualbox-ose-source
$ sudo module-assistant auto-install virtualbox-ose
</code></pre></div></div>

<p>This will produce a custom <code class="language-plaintext highlighter-rouge">virtualbox-ose-modules</code> package in <code class="language-plaintext highlighter-rouge">/usr/src</code>, which will then be used to install.</p>

<p><strong>Look out for error messages, if it states that a deb file already exists, remove it and try again.</strong></p>

<h3 id="step-4-load-kernel-driver">Step 4: Load Kernel Driver</h3>

<p><strong>This step was carried out automatically in the version that I have.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo modprobe -r vboxdrv
$ sudo modprobe vboxdrv
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Submit a UK Self-Assessment Return under Linux</title>
      <link>https://chrisjrob.com/2010/01/15/submit-a-self-assessment-tax-return-under-linux/</link>
      <pubDate>Fri, 15 Jan 2010 10:48:27 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/01/15/submit-a-self-assessment-tax-return-under-linux</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/hmrc.jpg" align="right" alt="Featured Image">
         
         <p>Yes once again I come to complete my tax return, last time it was <a href="/2009/01/11/uk-self-assessment-for-linux/">a far from successful experience</a>.</p>

<p>Given that that page is now a year old and my next year’s return is required, I thought it was an opportune time to update it.  Unfortunately nothing much has changed, the list of personal tax applications has shrunk, as TaxCalc’s market domination continues.  The only Linux-compatible competitor seems to still be ftax and it requires Acrobat Reader, which isn’t available for 64-bit Linux.</p>

<!--more-->

<p>The problem is that you don’t really want to mess about with your personal tax, especially when that includes on-line submission.  You need to have faith in the company that offers the product, and you need them to have sufficient numbers of customers that, if there is a problem, it gets fixed quickly.</p>

<p>In short, the only meaninful competition for TaxCalc would seem to be HMRC’s own web-based offering.  If it weren’t for my positive experiences in using TaxCalc, the convenience of being able to import the previous year’s return, and the fact that I have a Windows virtual-machine on my laptop, I would probably try out the HMRC system.  As it is, sadly, the Windows-only TaxCalc wins again.</p>

<h2 id="introduction">Introduction</h2>

<p>I created this page when completing my tax return for 2007/8, and am now updating it for 2008/09 tax year (January 2010).  I currently use TaxCalc running on Linux under my Windows virtual machine (in VirtualBox OSE), I would like to stop relying on Windows; so what are the options for submitting a UK Self-assessment tax return under Linux?</p>

<ul>
  <li>Linux alternatives</li>
  <li>HMRC On-line Self-Assessment</li>
  <li>Install TaxCalc under Wine</li>
  <li>Run TaxCalc in VirtualBox</li>
</ul>

<h2 id="linux-alternatives">Linux Alternatives</h2>

<p>The following is HMRC’s list of approved software:</p>

<ul>
  <li>http://www.hmrc.gov.uk/efiling/SA_efiling/soft_dev.htm</li>
</ul>

<p>The list updated as at January 2010 is as follows:</p>

<ul>
  <li><a href="http://www.taxcalc.com/">Acorah Software Products Ltd (TaxCalc)</a> - Windows only</li>
  <li><a href="http://www.andica.com/">Andica Limited</a> - Windows only</li>
  <li><a href="http://www.btcsoftware.co.uk/">BTC Software Limited</a> - Professional only</li>
  <li><a href="http://www.prosystem.cch.co.uk/">CCH Software</a> - Professional only</li>
  <li><a href="http://www.drummohr.com/">Drummohr Technology Ltd</a> - Professional only</li>
  <li><a href="http://www.tax.co.uk/">Forbes Computer Systems Ltd</a> - Windows only</li>
  <li><a href="http://www.iris.co.uk/">IRIS Software Ltd</a> - Professional only</li>
  <li><a href="http://www.isokon.com/">Isokon Limited</a> - Professional only</li>
  <li><a href="http://www.keytimesystems.co.uk/">Keytime Objective Ltd</a> - Not available for download</li>
  <li><a href="http://www.ftax.co.uk/">Legatio Ltd (Ftax)</a> - Windows, Mac and Linux</li>
  <li><a href="http://www.ptpgroup.co.uk/">PTP Software Ltd</a> - Professional only</li>
  <li><a href="http://www.sa2000.co.uk/">Quality Management Software Ltd</a> - Windows only</li>
  <li><a href="http://www.pinacleaccounts.co.uk/">RFA Limited</a> - Professional only</li>
  <li><a href="http://www.sage.co.uk/accountants/welcome.aspx">Sage (UK) Ltd</a> - Professional only</li>
  <li><a href="http://www.digita.com/">Thomson Reuters</a> - Not seemingly available for download</li>
</ul>

<p><strong>The comments are my own personal impression at the time of visiting the websites, these opinions may be wrong and you should make your own enquiries before making a decision.</strong></p>

<p>Some of these, like Sage, are clearly not consumer level products, and my impression is that the above list is somewhat misleading, as in practice TaxCalc seems to have the personal market pretty much sown up.  Am I wrong?  Let me know in the Comments section at the bottom.</p>

<p>Of those that are consumer level products only ftax seems to support Linux.  Ftax requires Adobe Acrobat Reader, which is not currently available for 64-bit Linux, also the demonstration shows that it is a smart walk-through of the actuals forms; which does fall short of the wizard mode under TaxCalc.  So to run ftax I am only swapping one set of compatibility issues for another.  If you are running 32-bit Linux, then I would definitely investigate ftax further, perhaps by searching reviews of ftax.</p>

<p>If you are going to try ftax, then you will notice the lack of any help for Linux on their site.  In fact there is help, but it is difficult to find, given their lack of a search facility.  Google to the rescue:</p>

<ul>
  <li><a href="http://www.google.co.uk/search?hl=en&amp;source=hp&amp;q=site:ftax.co.uk+linux">google “site:ftax.co.uk linux”</a></li>
</ul>

<h2 id="hmrc-on-line-self-assessment">HMRC On-line Self-Assessment</h2>

<p>Another option is to use HMRC’s own software, which I believe is web-based.  The only issue with this is that it appears that you need to enrol in the on-line service, even if you have previously used TaxCalc (or other Internet-filing service); see the following page for details:</p>

<ul>
  <li>http://www.hmrc.gov.uk/sa/using-online.htm</li>
</ul>

<p>Nevertheless, this is probably a good option, judging from the on-line demo:</p>

<ul>
  <li>http://www.hmrc.gov.uk/demo/individual/self-assessment/</li>
</ul>

<p>However, the system requirements for this service state:</p>

<p><em>“If you use HMRC’s tax software and; or the Data Provisioning Service, you will also need a minimum browser level, Internet Explorer 5.0 (Windows users) Safari 2.0.4 (Mac users) or Opera 7.0 (Windows or Mac) Your Internet browser must have JavaScript and cookies enabled and be capable of supporting 128-bit SSL. Other operating systems and browsers, such as Mozilla Firefox, may allow you to access the site and use the pages but might not display the site as designed or allow you to access all the functionality.”</em></p>

<p>Okay, so it doesn’t mention Linux, but I wouldn’t be unduly concerned about that.  No the issue seems to be the browser, and, reading between the lines, this would suggest to me that the site is using extensive Javascript, which is largely blocked (quite rightly) by Firefox.  The chances are that there would be issues; although it wouldn’t be massive problem for me to fallback on IE under a Virtual Machine, your mileage may vary.</p>

<h2 id="install-taxcalc-under-wine">Install TaxCalc under Wine</h2>

<p>TaxCalc themselves state:</p>

<p><em>“We do have some customers that run Windows emulation software to enable the use of Taxcalc on other Operating Systems (e.g. MAC OS). Although we have had some positive feedback on this we do not officially support the use of TaxCalc on Non-Windows Operating Systems at this time.”</em></p>

<p>So the next option is to consider installing TaxCalc under Wine, my concern with this is that I would expect that a simple application like TaxCalc would indeed install fine under Wine.  My concern would be that I would complete my tax return and go to upload to the tax office, and that point hit a snag.  Also, I am running on Debian Lenny 64-bit, surely that must effect Wine as well - can 64-bit Wine run 32-bit Windows applications?  The existence of this page would suggest that there may be issues:</p>

<ul>
  <li>http://wiki.winehq.org/WineOn64bit</li>
</ul>

<p>Having downloaded TaxCalc, I opened the installation program in Wine.  The installation was successful, and the first run prompted for me to either enter the registration key, or connect to the Internet to find the registration key.  I decided to do the latter, in order to test connectivity, and it worked fine.  Then it crashed and I was unable to get back into TaxCalc again.</p>

<h3 id="update-for-2010">Update for 2010</h3>

<p>A quick search on the <a href="http://appdb.winehq.org">WineHQ AppDB</a> showed that someone has successfully installed TaxCalc under Wine; however he has not tested the online submission, which is crucial for me.  Given that he has used winetricks to install IE6 under Wine, then there is a good chance that it will work.  If you try it, do update the <a href="http://appdb.winehq.org">WineHQ AppDB</a> and consider posting a comment in the new comments section below!</p>

<ul>
  <li><a href="http://appdb.winehq.org/objectManager.php?sClass=version&amp;iId=18299&amp;iTestingId=46244">TaxCalc 2009 under Wine</a></li>
</ul>

<h2 id="run-taxcalc-in-virtualbox">Run TaxCalc in VirtualBox</h2>

<p>It is outside of the scope of this document to describe this in detail, suffice to say it works flawlessly.  The downside is that you are effectively running under Windows, which can hardly be considered a success.</p>

<h2 id="conclusion">Conclusion</h2>

<p>So what have I decided?  Well this year I will again continue with TaxCalc, installed on Windows XP running through VirtualBox.  Yes I could give ftax a go, but I am fairly unimpressed with their website, and lack of any obvious linux help.  Also Googling for information on ftax and linux leads you back to this page - and, if this page really is the best help available for ftax and linux, then you’re in real trouble.</p>

<p>So the best hope for Linux users is HMRC’s own on-line service.  It is web-based and free, and whilst it does not promise Firefox support, I suspect that may not be an issue.  If you would like to be able to use TaxCalc natively under Linux, then why not let them know: by emailing them at sales@taxcalc.com.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Add Global OpenOffice.org Extensions</title>
      <link>https://chrisjrob.com/2009/11/21/add-global-openoffice-org-extensions/</link>
      <pubDate>Sat, 21 Nov 2009 11:33:43 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/11/21/add-global-openoffice-org-extensions</guid>
      <description>
       <![CDATA[
         
         <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># unopkg add --shared sun-pdfimport.oxt
</code></pre></div></div>

<p>For further information please visit:</p>

<ul>
  <li>http://api.openoffice.org/docs/DevelopersGuide/Extensions/Extensions.xhtml</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install SMR2000 under Wine</title>
      <link>https://chrisjrob.com/2009/11/20/install-smr2000-wine/</link>
      <pubDate>Fri, 20 Nov 2009 17:45:22 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/11/20/install-smr2000-wine</guid>
      <description>
       <![CDATA[
         
         <p>I managed to install the Honda menu-pricing SMR2000 program on Wine:</p>

<ul>
  <li>Installed winetricks</li>
  <li>winetricks: fakeie, vb6run, mdac25, mdac28, jet40, vcrun6, wsh56, allfonts, riched30, mdac27, native_mdac, native_oldaut32, gecko</li>
  <li>Installed Adobe Reader 8.1.2 from Intranet Downloads</li>
  <li>Accepted Adobe licence via “wine regedit”, <code class="language-plaintext highlighter-rouge">HKEY_CURRENT_USER/Software/Adobe/Acrobat Reader/8.0/AdobeViewer</code>, add a DWORD “EULA” = “1”</li>
  <li>Installed SMR2000</li>
  <li>Updated SMR2000 by running update self-extracting zip files</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Optimise Firefox</title>
      <link>https://chrisjrob.com/2009/10/15/optimise-firefox/</link>
      <pubDate>Thu, 15 Oct 2009 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/10/15/optimise-firefox</guid>
      <description>
       <![CDATA[
         
         <p>Apparently Firefox uses sqlite for its databases, maintaining several <code class="language-plaintext highlighter-rouge">*.sqlite</code> files in your <code class="language-plaintext highlighter-rouge">.mozilla/</code> profile directory.  Over time these become cluttered and it helps if you vacuum it:</p>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install sqlite3
$ cd ~
$ find .mozilla/ -iname '*'.sqlite -exec sqlite3 "{}" VACUUM \;
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install IPCop Firewall</title>
      <link>https://chrisjrob.com/2009/10/12/install-ipcop-firewall/</link>
      <pubDate>Mon, 12 Oct 2009 11:42:39 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/10/12/install-ipcop-firewall</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/ipcop_logo.png" align="right" alt="Featured Image">
         
         <p>This document is for the purpose of building in IPCop Firewall onto a MSI Axis 700 barebones PC.  The firewall will also be used as a NTP time-server, Content-filtering proxy server and OpenVPN server.</p>

<!--more-->

<h2 id="requirements">Requirements</h2>

<p><img src="/assets/msi-axis-700.jpg" class="image-right" alt="MSI Axis 700" /></p>

<ul>
  <li>MSI C7 VIA CN700 5.1 Audio Lan DDRII quicklinx:<a href="https://www.dabs4work.com/productview.aspx?Quicklinx=4FY9">4FY9WS</a></li>
  <li>D-Link DFE 580TX - network adapter - 4 ports quicklinx:<a href="https://www.dabs4work.com/productview.aspx?QuickLinx=1YH9">1YH9WS</a></li>
  <li>LG Electronics DVD ROM 16X BLACK DRIVE ONLY quicklinx:<a href="https://www.dabs4work.com/productview.aspx?QuickLinx=4N6S">4N6SWS</a></li>
  <li>Seagate Barracuda 7200.10 80GB S300 8MB quicklinx:<a href="https://www.dabs4work.com/productview.aspx?QuickLinx=4MRK">4MRKWS</a></li>
  <li>Crucial 512MB 240Pin DIMM DDR2 PC2-4200 Non-ECC quicklinx: <a href="http://www.dabs4work.com/productview.aspx?Quicklinx=36TC">36TCWS</a></li>
</ul>

<p>N.B. I believe 512mb is insufficient and I would recommend purchasing Kingston Memory - KVR667D2NG/1G</p>

<h2 id="key-steps">Key Steps</h2>

<ul>
  <li>Assemble above</li>
  <li>Disable “EHCP on chip” under “Integrated peripherals” in BIOS (prevents NIC being loaded correctly)</li>
  <li>Disable “ACPI” under Power Management (from memory)</li>
  <li>Download IPCop at <a href="https://sourceforge.net/project/showfiles.php?group_id=40604">IPCop.org</a> and burn to CD</li>
  <li>Boot CD</li>
  <li>Follow prompts to install (you may find this <a href="http://www.howtoforge.net/perfect_linux_firewall_ipcop">Howtoforge</a> useful)</li>
  <li>Connect to web admin page</li>
  <li>Install Copfilter (for Virus protection and more)</li>
  <li>Install Advanced Proxy (for user authentication and control)</li>
  <li>Install URL Filter (for content filtering)</li>
  <li>Install Zerina OpenVPN</li>
  <li>Configure Zerina OpenVPN</li>
</ul>

<h2 id="install-copfilter">Install Copfilter</h2>

<p><a href="http://www.copfilter.org/downloads.php">Download Copfilter</a>.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># scp -P 222 copfilter-version.tgz root@ipcop_green_address:/root
# ssh -p 222 -l root ipcop_green_address
# cd /root
# tar xzvf copfilter-version.tgz
# cd copfilter-version
# ./install
</code></pre></div></div>

<p>This should complete with a message such as this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Copfilter ~version~ installation completed successfully!
</code></pre></div></div>

<h2 id="install-advanced-proxy">Install Advanced Proxy</h2>

<p><a href="http://www.advproxy.net/download.html">Download Advanced Proxy</a>.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># scp -P 222 ipcop-advproxy-version.tar.gz root@ipcop_green_address:/root
# ssh -p 222 -l root ipcop_green_address
# tar -xzf ipcop-advproxy-version.tar.gz
# ipcop-advproxy/install
</code></pre></div></div>

<h2 id="install-enhanced-proxy-log-viewer">Install Enhanced Proxy Log Viewer</h2>

<p><a href="http://www.advproxy.net/download.html">Download Advanced Proxy Log Viewer</a>.</p>

<p>This package enables the capability to show usernames within the proxy log viewer.</p>

<p>Copy the file <code class="language-plaintext highlighter-rouge">proxylog.dat</code> to the directory <code class="language-plaintext highlighter-rouge">/home/httpd/cgi-bin/logs.cgi</code> and set the file permissions to 755 (<code class="language-plaintext highlighter-rouge">rwxr-xr-x</code>).</p>

<h2 id="install-url-filter-add-on">Install URL Filter Add-on</h2>

<p><a href="http://www.urlfilter.net/download.html">Download URL Filter</a>.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># scp -P 222 ipcop-urlfilter-version.tar.gz root@ipcop_green_address:/root
# ssh -p 222 -l root ipcop_green_address
# tar -xzf ipcop-urlfilter-version.tar.gz
# ipcop-urlfilter/install
</code></pre></div></div>

<h2 id="install-zerina-openvpn">Install Zerina OpenVPN</h2>

<p><a href="http://www.openvpn.eu/index.php?id=35">Zerina OpenVPN</a>.</p>

<p>If you are updating, first stop the OpenVPN Server through the GUI.</p>

<p>These instruction include a dangerous bodge to arbitrarily alter the IPCop version requirement, only proceed if you are happy to accept the inherent risk in so doing.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># scp -P 222 ZERINA-version-Installer.tar.gz root@ipcop_green_address:/root
# ssh -p 222 -l root ipcop_green_address
# mkdir /root/zerina
# mv ZERINA-version-Installer.tar.gz /root/zerina/
# cd /root/zerina
# tar -xzvf ZERINA-version-Installer.tar.gz
# sed -i s/1\.4\.18/1.4.21/ install
# ./install
</code></pre></div></div>

<h2 id="configure-zerina-openvpn">Configure Zerina OpenVPN</h2>

<ul>
  <li><a href="http://www.zerina.de/zerina/?q=documentation/howto-roadwarrior">Zerina OpenVPN</a></li>
</ul>

<h2 id="configure-openvpn-for-network-manager">Configure OpenVPN for Network-Manager</h2>

<p>Download and extract the ZIP file from IPCOP OpenVPN, and extract the contents into (for example <code class="language-plaintext highlighter-rouge">~/.openvpn</code>).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install network-manager-openvpn
$ cd ~/.openvpn
$ sudo su
# openssl pkcs12 -nocerts -in default.p12 -out key.pem
# openssl pkcs12 -nokeys -clcerts -in default.p12 -out cert.pem
# openssl pkcs12 -nokeys -cacerts -in default.p12 -out ca.pem
# exit
</code></pre></div></div>

<p>These converted files can then be used in Network Manager.</p>

<p>If you’re struggling to connect to OpenVPN with Network Manager, consider that you need to ensure that the settings are mirrored on both IPCop and on the client’s Network Manager, for example I struggled to connect until I realised that LZO Compression was switched on on IPCop but off in Network Manager.</p>

<h2 id="static-routes">Static Routes</h2>

<p>There is no way to set this in the GUI, so connect via SSH (see above):</p>

<p>In <code class="language-plaintext highlighter-rouge">/etc/rc.d/rc.netaddress.up</code> add:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>if [ "$1" != "NOTGREEN" ]; then
if [ "$GREEN_DEV" != "" ]; then
    ifconfig $GREEN_DEV $GREEN_ADDRESS netmask $GREEN_NETMASK broadcast $GREEN_BROADCAST up

    ####CUSTOM EDIT FOR STATIC ROUTE####
    route add -net 10.100.1.0 netmask 255.255.255.0 gw 10.2.0.1
    ####CUSTOM EDIT FOR STATIC ROUTE####
</code></pre></div></div>

<h2 id="identifying-network-interfaces-in-linux">Identifying Network Interfaces in Linux</h2>

<p>If your network card supports it, you can blink the LED on the specified network interface in Linux like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># ethtool -p eth# 5
</code></pre></div></div>

<p>This blinks the LED on the interface for five seconds-without interrupting network traffic.</p>

<ul>
  <li><a href="http://www.coolcommands.com/index.php?option=com_cc&amp;task=display&amp;id=1287">Cool Command</a></li>
</ul>

<h2 id="flushing-the-dns-cache">Flushing the DNS Cache</h2>

<p>There may be times that you wish to flush the DNS cache.  IPCop uses dnsmasq, log onto ipcop using root and run the following:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># ps -ef | grep dnsmasq
# kill -s SIGHUP &amp;lt;PID&amp;gt; (replacing &amp;lt;PID&amp;gt; with the PID shown by the previous command)
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://ipcop.org/">IPCop.org</a>
    <ul>
      <li><a href="http://marc.info/?l=ipcop-user">User forum</a></li>
    </ul>
  </li>
  <li><a href="http://www.howtoforge.net/perfect_linux_firewall_ipcop">Howtoforge</a>
    <ul>
      <li><a href="http://howtoforge.net/perfect_linux_firewall_ipcop_p2">Continued…</a></li>
    </ul>
  </li>
  <li><a href="http://firewalladdons.sourceforge.net/cop.html">Addons</a></li>
  <li><a href="http://dansguardian.org/">DansGuardian</a></li>
  <li><a href="http://en.wikipedia.org/wiki/Iptables">IPTables on Wikipedia</a></li>
  <li><a href="http://www.securityfocus.com/infocus/1556">IPCop Review</a></li>
  <li><a href="http://www.snort.org/">Snort</a></li>
  <li><a href="http://ipcop.org/index.php?module=pnWikka&amp;tag=OpenVPNHowto">Installing OpenVPN</a></li>
  <li><a href="http://copfilter.endlich-mail.de/viewtopic.php?t=1069&amp;highlight=havp+dansguardian">Resolving add-on conflicts</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | DD over SSH</title>
      <link>https://chrisjrob.com/2009/10/09/dd-over-ssh/</link>
      <pubDate>Fri, 09 Oct 2009 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/10/09/dd-over-ssh</guid>
      <description>
       <![CDATA[
         
         <p>Wow, can’t believe my last post was 4 months ago, well a quick tip to get me back into the blogging frame of mind.  If you wish to take a drive image copy over the network, then apparently you do not have to have an nfs share available.  Instead you can use ssh as follows:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ dd if=/dev/sda bs=1M | ssh root@blah "cat &gt; /root/disk.img"
</code></pre></div></div>

<!--more-->

<p>Haven’t tried it yet, but it sounds incredible.  The <code class="language-plaintext highlighter-rouge">bs=1M</code> is essential or the copy will take forever.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Apache SSL</title>
      <link>https://chrisjrob.com/2009/05/19/apache-ssl/</link>
      <pubDate>Tue, 19 May 2009 12:02:19 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/05/19/apache-ssl</guid>
      <description>
       <![CDATA[
         
         <p>How to enable Apache SSL:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># a2enmod ssl
# cd /etc/apache2/
# mkdir ssl
# openssl req -new -x509 -days 3650 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
# chmod 600 /etc/apache2/ssl/apache.pem
# /etc/init.d/apache2 restart
</code></pre></div></div>

<!--more-->

<p><strong>When generating the certificate it prompts for “Your name”, this should be the name of your site e.g. host.example.com.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Huawei E220 3G USB Modem</title>
      <link>https://chrisjrob.com/2009/05/11/install-huawei-e220-3g-usb-modem/</link>
      <pubDate>Mon, 11 May 2009 08:34:15 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/05/11/install-huawei-e220-3g-usb-modem</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/huawei-e220.jpg" align="right" alt="Featured Image">
         
         <h2 id="introduction">Introduction</h2>

<p>Following a failure of our Internet connection, I hastily cobbled together a new proxy server using my 3G modem.  The reason I did not simply add the modem to our existing IPCop solution, was because IPCop currently only supports a single Red/WAN interface.  The IPCop FAQs specifically warn against attempting multiple interfaces.</p>

<!--more-->

<p>There were many instructions on the Internet, but in reality it proved to be quite straightforward.  I followed these instructions, varying them slightly for Vodafone:</p>

<ul>
  <li><a href="http://www.richs.me.uk/content/view/132/51/">http://www.richs.me.uk/content/view/132/51/</a></li>
</ul>

<p>This was tested on IPCOP version 1.4.18, older versions may not work.</p>

<h2 id="warning">Warning</h2>

<p>These are my own personal notes, they relate to a UK Vodafone install, you would need to alter instructions for your location and telco.</p>

<h2 id="configure-kernel-modules">Configure Kernel modules</h2>

<p>When building your IPCOP, you need to set the IPCOP to use a network adaptor for the Green Interface and a Modem to use as the Red Interface.</p>

<p>From the command prompt logged on as root on the IPCOP you need to edit the /etc/modules.conf file.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># nano /etc/modules.conf
</code></pre></div></div>

<p>Add the following lines at the bottom:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>alias char-major-188 usbserial
options usbserial vendor=0x12d1 product=0x1003 maxSize=4096
</code></pre></div></div>

<p>Then save the file and access (Press CTRL + O and press enter then press CTRL + X).</p>

<h2 id="web-console---modem">Web Console - Modem</h2>

<p>Log onto the web console and choose the Network menu and Modems.  Change INIT to:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>AT+CGDCONT=16,"IP","internet"
</code></pre></div></div>

<h2 id="web-console---dial-up">Web Console - Dial-up</h2>

<p>Now select Dial-Up.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Interface = "Modem on USB0"
Enter Number = "*99#"
Username = internet
Password = internet
Authentication method = PAP
DNS = Automatic
Profile name = Vodafone
</code></pre></div></div>

<p>Press “Save”.</p>

<h2 id="test">Test</h2>

<p>Connect your 3G modem into the IPCOP box and reboot.</p>

<p>You should now be able to connect to the net using your 3G dongle.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.richs.me.uk/content/view/132/51/">http://www.richs.me.uk/content/view/132/51/</a></li>
</ul>

<h2 id="conclusion">Conclusion</h2>

<p>Amazingly it only took a couple of hours, including building a new PC, and it worked beautifully.  Unfortunately, or perhaps that’s fortunately, no-one will ever know how good it was, because our Internet connection started working again about 15-minutes after I had completed it!</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Analyse Boot Speed</title>
      <link>https://chrisjrob.com/2009/04/29/analyse-boot-speed/</link>
      <pubDate>Wed, 29 Apr 2009 19:45:16 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/04/29/analyse-boot-speed</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/bootchart.png" align="right" alt="Featured Image">
         
         <h2 id="step-1---install-bootchart">Step 1 - Install bootchart</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># aptitude install bootchart
</code></pre></div></div>

<h2 id="step-2---update-grub">Step 2 - Update Grub</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># nano /boot/grub/menu.lst
</code></pre></div></div>

<!--more-->

<p>Look for a line that looks like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># altoptions=(single-user mode) single
</code></pre></div></div>

<p>And add a similar line after it that looks like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># altoptions=(single-user mode) single
# altoptions=(bootchart) init=/sbin/bootchartd
</code></pre></div></div>

<p>Then update your grub entries by typing:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># update-grub
</code></pre></div></div>

<h2 id="step-3---reboot">Step 3 - Reboot</h2>

<p>Reboot, making sure that you select the bootchart option from the grub menu.</p>

<p>Once the boot has finished, open a terminal and type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ bootchart
</code></pre></div></div>

<h2 id="step-4---analyse">Step 4 - Analyse</h2>

<p>You chould find a new png image in your current directory (the one you ran the bootchart command from) called bootchart.png.  Open it, analyse it and write a really good howto on how to optimise your system, and then publish it on the web!</p>

<p>Good luck!</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Citrix Presentation Server Client</title>
      <link>https://chrisjrob.com/2009/04/24/install-citrix-presentation-server-client/</link>
      <pubDate>Fri, 24 Apr 2009 14:36:46 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/04/24/install-citrix-presentation-server-client</guid>
      <description>
       <![CDATA[
         
         <h2 id="install-openmotif">Install OpenMotif</h2>

<p>Before installing Citrix presentation server, you need to install OpenMotif.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get libmotif3
</code></pre></div></div>

<p>Unfortunately this is not available in Etch, so you have to get it from unstable. Add unstable to the source.list and install as follows:</p>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get -t "sid" libmotif3
</code></pre></div></div>

<h2 id="create-a-dummy-libxmso4">Create a dummy libXm.so.4</h2>

<p>libmotif3 only provides libXm.so.3, but libXm.so.4 is required:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo ln -s /usr/lib/libXm.so.3 /usr/lib/libXm.so.4
</code></pre></div></div>

<h2 id="download-client-from-citrix">Download client from Citrix</h2>

<p>Decide whether you wish to do an alien/rpm install, which will give you an easy uninstall method, or a standard binary installation. Currently my preference is the binary installation using checkinstall. Download the appropriate file from:</p>

<ul>
  <li>http://www.citrix.com/English/SS/downloads/details.asp?downloadID=3323&amp;productID=-1</li>
</ul>

<h2 id="binary-installation">Binary Installation</h2>

<p>If you decide to do a simple binary install, then simply extract the downloaded file and execute setup/install executable.  I suggest you use the checkinstall program.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo checkinstall ./setupwfc
</code></pre></div></div>

<h2 id="alien-installation">Alien Installation</h2>

<p><strong>I have not tested this method for the latest Citrix Receiver 11 software.</strong></p>

<p>Alternatively download the rpm package and convert using alien:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># sudo alien ICAClient-10.6-1.i386.rpm
# sudo dpkg --install icaclient_10.6-2_i386.deb
# /usr/lib/ICAClient/wfcmgr
</code></pre></div></div>

<h2 id="client-hostname">Client Hostname</h2>

<p><em>Is the client name configurable in UNIX clients or must it assume the host name?</em></p>

<p>The client name can be configured (though not through the user interface). A ClientName= entry can be placed in either the [WFClient] section of wfclient.ini, in the relevant description section of appsrv.ini, or in both. An appsrv.ini entry takes precedence over any wfclient.ini entry. If no name is specified, the default name is the host name.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd ~/.ICAClient
$ cat wfclient.ini | grep Name
ClientName=ltsp_cjr    
</code></pre></div></div>

<h2 id="sound">Sound</h2>

<ul>
  <li>http://ltsp.sourceforge.net/contrib/ica/ica-howto.html#audio</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Determine vendor-class-identifier</title>
      <link>https://chrisjrob.com/2009/04/14/determine-vendor-class-identifier/</link>
      <pubDate>Tue, 14 Apr 2009 07:49:13 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/04/14/determine-vendor-class-identifier</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>All the advice about DHCP and PXEClient tells you about the ability to configure based on the client’s vendor-class-identifier string, but nowhere tells you how to find out the contents of this magical string.  In fact it couldn’t really be easier, as the following instructions explain:</p>

<h2 id="step-1---update-dhcp-server">Step 1 - Update DHCP Server</h2>

<!--more-->

<p>Simply modify <code class="language-plaintext highlighter-rouge">/etc/dhcp3/dhcpd.conf</code> on your DHCP server and add the following somewhere near the top:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># So that the vendor-class-identifier shows in dhcpd.leases file
set vendor-string = option vendor-class-identifier;
</code></pre></div></div>

<h2 id="step-2---restart-your-dhcp-server">Step 2 - Restart your DHCP server</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># /etc/init.d/dhcp3-server restart
</code></pre></div></div>

<h2 id="step-3---test-boot-a-client">Step 3 - Test Boot a Client</h2>

<p>Then boot a client and look at the contents of the <code class="language-plaintext highlighter-rouge">/var/lib/dhcp3/dhcpd.leases</code> file, you should find entries like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lease 192.168.0.174 {
    starts 2 2009/04/14 07:40:21;
    ends 2 2009/04/14 13:40:21;
    binding state active;
    next binding state free;
    hardware ethernet 00:fb:3d:5f:fg:7e;
    set vendor-string = "PXEClient:Arch:00000:UNDI:002001";
}
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Create a Virtual Machine in KVM</title>
      <link>https://chrisjrob.com/2009/04/09/create-a-virtual-machine-in-kvm/</link>
      <pubDate>Thu, 09 Apr 2009 19:26:35 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/04/09/create-a-virtual-machine-in-kvm</guid>
      <description>
       <![CDATA[
         
         <h2 id="creating-a-disk-image-for-the-guest">Creating a disk image for the guest</h2>

<p>The following command will create a resizing 10G image in your current directory:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># /usr/bin/qemu-img create -f qcow2 vdisk.img 10G
</code></pre></div></div>

<!--more-->

<h2 id="booting-from-cdrom">Booting from CDROM</h2>

<p>I struggled on our LTSP server to boot from CDROM, but found that I could boot easily from the downloaded IMG files (from Microsoft).</p>

<p>Boot from first CD image:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ kvm -no-acpi -m 512 -cdrom /home/username/vdisks/w2k3/iso/X13-04874.img -boot d -hda w2k3.img -k en-gb -smp 2
</code></pre></div></div>

<p>Boot from second CD image:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ kvm -no-acpi -m 512 -cdrom /home/username/vdisks/w2k3/iso/X13-04795.img -boot d -hda w2k3.img -k en-gb -smp 2
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li>http://kvm.qumranet.com/kvmwiki/HOWTO</li>
  <li>http://www.debian-administration.org/articles/545</li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Uninstall applications installed from source</title>
      <link>https://chrisjrob.com/2009/04/03/uninstall-applications-installed-from-source/</link>
      <pubDate>Fri, 03 Apr 2009 09:21:03 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/04/03/uninstall-applications-installed-from-source</guid>
      <description>
       <![CDATA[
         
         <h2 id="the-problem">The Problem</h2>

<p>Sometimes you have to compile and install packages from source.  Other times you have to install an application from a tarball.  But how do you uninstall it?</p>

<h2 id="automated-uninstall-method">Automated uninstall method</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /usr/src/&lt;yourapp&gt;
$ make uninstall
</code></pre></div></div>

<!--more-->

<p>This will probably fail with make:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>*** No rule to make target `uninstall'.  Stop.
</code></pre></div></div>

<h2 id="manual-uninstall-method">Manual uninstall method</h2>

<p>In which case your only recourse is to manually unpick the application. One way to do this is to run the following:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /usr/src/package &amp;larr; assuming you still have the source
$ sudo make -n install &gt; install.log
</code></pre></div></div>

<p>I.e. reinstall the application (if you still have the source code) and then read the install.log file and work backwards unpicking the changes made by the installation.</p>

<h2 id="checkinstall">Checkinstall</h2>

<p>As usual prevention is better than cure, and in this case the answer is to always install applications with checkinstall (available in the Debian repositories).  This converts an installer into debian package, which can then be installed and uninstalled like any other debian package.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install checkinstall
$ man checkinstall
</code></pre></div></div>

<p>Then to use checkinstall, you simply prefix your install command with “checkinstall”.  So compiling an application from source would look like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ./configure
$ make
$ sudo checkinstall make install
</code></pre></div></div>

<p>Or if you are installing from a ./install.sh or some such, just prefix this with “checkinstall” - e.g.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo checkinstall ./install.sh
</code></pre></div></div>

<p>This will result in the creation and installation of a “deb” package.  This means that you can upgrade or simply remove the package simply using the “dpkg -r packagename” command.</p>

<p><strong>If you’re not on a Debian-based system, then just add the relevant switch for rpm or slackware packages (read the man page).</strong></p>

<h2 id="warning">Warning</h2>

<p>In theory you could upgrade a package installed by checkinstall, once an application enters the standard repos, in practice you might get messed up; as checkinstall is quite likely to install stuff in different locations to a standard debian/ubuntu package.  In practice this issue only arises very occasionally (there is a reason why you installed the package from source/tarball).  But if it does happen, then you are probably best advised to remove the package using “dpkg -r” and then install it from the repos in the usual way.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.asic-linux.com.mx/~izto/checkinstall/">Checkinstall Homepage</a></li>
  <li><a href="http://www.debian-administration.org/articles/147">Debian Tutorial</a></li>
  <li><a href="http://www.falkotimme.com/howtos/checkinstall/index.php">Falko Timme’s Tutorial</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Unmount a share which fails</title>
      <link>https://chrisjrob.com/2009/03/21/unmount-a-share-which-fails/</link>
      <pubDate>Sat, 21 Mar 2009 06:23:50 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/unmount-a-share-which-fails</guid>
      <description>
       <![CDATA[
         
         <p>Unmounting a share fails with error message:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Could not unmount &lt;PATH&gt;: Device or resource busy
</code></pre></div></div>

<p>First of all, check that you are not accessing any directory or file of the share with any program, or on any screen. 
If this isn’t the case, you might have encountered a problem, that is known but not related to Smb4K. It seems that under certain circumstances (that we could not figure out exactly) kdeinit background processes access files and/or directories of the share and keep them open (KDE &lt; 3.4). Unmounting is not possible unless you send…</p>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ kill -HUP PID
</code></pre></div></div>

<p>… to each kdeinit instance that has access to the share or its files. Replace PID by the pid of the kdeinit instance. You can find it out by using e. g. KSysguard.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Microsoft Outlook</title>
      <link>https://chrisjrob.com/2009/03/21/transfer-emails-from-microsoft-outlook/</link>
      <pubDate>Sat, 21 Mar 2009 06:23:08 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/transfer-emails-from-microsoft-outlook</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>Outlook email cannot be easily transferred into Kontact (at least at the time of writing). There are a couple of applications that might work, but the best solution at present is to use Mozilla Thunderbird as a conduit for emails and contacts, and Outport for Calendar. At the time of writing I have found no easy solution for Notes or Tasks, so at present the only solution for these is a re-key.</p>

<p><strong>This method can only be performed on a Windows system, with Outlook installed and working on the same client as you install Thunderbird.  This is because Thunderbird uses Outlook itself to perform the data exchange.  This means that you cannot just copy across a PST and expect Thunderbird to be able to import it - you must have a running Outlook session on the client.</strong></p>

<!--more-->

<h2 id="step-1-prepare-outlook">Step 1 Prepare Outlook</h2>

<p>Move any emails, calendar entries, tasks, contacts etc that are currently in your archive folder back into your main “Outlook today” Personal Folder.</p>

<p>In case you wish to refer to your Outlook folders again, I recommend that you make the following changes:</p>

<ul>
  <li>Switch off send/receive at start-up</li>
  <li>Switch off interval check</li>
  <li>Switch on “leave mail on host”</li>
</ul>

<p>This will enable to refer to your Outlook folders, and even collect your mail, without losing the mail on your Linux box.</p>

<h2 id="step-2-outport">Step 2 Outport</h2>

<p>Download:</p>

<ul>
  <li>http://outport.sourceforge.net/</li>
</ul>

<p>Check/tick your Calendar folder on the left-hand-side of Outport, and ensure that the chosen conversion format is:</p>

<ul>
  <li>Calendar: Evolution Calendar</li>
</ul>

<p>Originally I thought I wanted iCalendar, but this created individual files for every event; but, thanks to a tiny bug in Outport, occasionally it did not remember the setting that I had made, and instead defaulted to Evolution Calendar.  For ages I couldn’t understand why sometimes it would work perfectly and other times it would not!  Eventually I realised what was happening and accordingly have updated these instructions. Phew!</p>

<h2 id="step-3-thunderbird-import">Step 3 Thunderbird Import</h2>

<p>Download Mozilla Thunderbird and run it.</p>

<p><strong>If you have used Thunderbird before on this PC, then you need to erase “C:\Documents and Settings\USERID\Application Data\Thunderbird” folder (which will lose that data).</strong></p>

<p>Follow the prompts to import from Outlook, if the import prompt does not occur, then erase the folder (see above tip).  Be warned, this import process may take a long time (especially with 1gb plus pst files!)</p>

<p>Once complete, Thunderbird has the emails, but has not created index files for each folder.  If you click on each folder it will do this for you, but I have found that it crashes if you select empty folders.  Instead I have found that it is best to stay out of the folders.</p>

<p><strong>Don’t bother marking messages as read, as they will be transferred as unread to Kmail anyway.</strong></p>

<h2 id="step-4-export-thunderbird-address-book">Step 4 Export Thunderbird Address Book</h2>

<p>Access the Thunderbird address book, click into the correct folder, so that you can see all your contacts on the right-hand-side, and take option to export to LDIF.</p>

<h2 id="step-5-transfer-to-linux">Step 5 Transfer to Linux</h2>

<p>Transfer the exported iCalendar file, the exported LDIF address book, and the Thunderbird data store (e.g. <code class="language-plaintext highlighter-rouge">C:\Documents and Settings\USERID\Application Data\Thunderbird\Profiles\qmrx14h2.default\Mail\Local Folders</code>) to one of the user’s folders on the Linux system.  You’ll need to be able to access these from the user’s account, so somewhere logical might be /home/username/imported.</p>

<h2 id="step-6-convert-address-book">Step 6 Convert Address Book</h2>

<p>Two problems with the Thunderbird exported LDIF:</p>

<ul>
  <li>Uses “company”, whereas Kmail uses “organization” for the company name.</li>
  <li>Uses “cn” for contact names, whereas Kmail uses “formatted name”.</li>
</ul>

<p>You can change these manually, or a simple script:</p>

<h3 id="example-script">Example script</h3>

<p>The following script will replace “company: “ with “organization: “ and will update “cn: “ with a formatted name in the format “sn, givenName”, if givenName is available, or fall back on just “sn” if not. This worked for us, but you might have to tailor this to your requirements.</p>

<div class="language-pl highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">#!/usr/bin/perl</span>
<span class="c1"># thunder2kab</span>
<span class="c1"># Converts Thunderbird LDIF file into Kmail LDIF format</span>

<span class="k">my</span> <span class="nv">$count</span> <span class="o">=</span> <span class="nv">@ARGV</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$count</span> <span class="o">!=</span> <span class="mi">2</span><span class="p">)</span> <span class="p">[</span>
	<span class="k">print</span> <span class="p">"</span><span class="s2">Usage: thunder2kab source destination</span><span class="se">\n</span><span class="p">";</span>
	<span class="nb">exit</span><span class="p">;</span>
<span class="p">}</span>

<span class="nv">PrivoxyWindowOpen</span><span class="p">(</span><span class="nv">IN</span><span class="p">,</span> <span class="nv">$ARGV</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">](</span><span class="o">|</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Cannot open </span><span class="si">$ARGV</span><span class="s2">[0] for reading: $!</span><span class="p">";</span>
<span class="nv">PrivoxyWindowOpen</span><span class="p">(</span><span class="nv">OUT</span><span class="p">,</span> <span class="p">"</span><span class="s2">&gt;</span><span class="si">$ARGV</span><span class="s2">[1]</span><span class="p">")</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Cannot create </span><span class="si">$ARGV</span><span class="s2">[1] for writing: $!</span><span class="p">";</span>

<span class="k">my</span> <span class="p">(</span><span class="nv">$surname</span><span class="p">,</span> <span class="nv">$givenname</span><span class="p">,</span> <span class="nv">$formattedname</span><span class="p">);</span>
<span class="k">while</span> <span class="p">(</span><span class="nb">defined</span> <span class="p">(</span><span class="k">my</span> <span class="nv">$line</span> <span class="o">=</span> <span class="o">&lt;</span><span class="nv">IN</span><span class="o">&gt;</span><span class="p">))</span> <span class="p">{</span>
	<span class="c1"># Superchomp to cope with Windows nonsense</span>
	<span class="nv">$line</span> <span class="o">=*</span> <span class="sr">s/[\r\n]*$//</span><span class="p">;</span>

	<span class="c1"># givenName: Terry</span>
	<span class="c1"># sn: McCarthy</span>

	<span class="k">if</span> <span class="p">(</span><span class="nv">$line</span> <span class="ow">eq</span> <span class="nb">undef</span><span class="p">)</span> <span class="p">{</span>
		<span class="nb">undef</span> <span class="p">(</span><span class="nv">$surname</span><span class="p">);</span>
		<span class="nb">undef</span> <span class="p">(</span><span class="nv">$givenname</span><span class="p">);</span>
		<span class="nb">undef</span> <span class="p">(</span><span class="nv">$formattedname</span><span class="p">);</span>
	<span class="p">)</span> <span class="k">elsif</span> <span class="p">(</span><span class="nv">$line</span> <span class="o">=*</span> <span class="sr">/^givenName\: (.+)$/</span><span class="p">)</span> <span class="p">{</span>
		<span class="nv">$givenname</span> <span class="o">=</span> <span class="err">$</span><span class="mi">1</span><span class="p">;</span>
	<span class="p">}</span> <span class="k">elsif</span> <span class="p">(</span><span class="nv">$line</span> <span class="o">=*</span> <span class="sr">/^sn\: (.+)$/</span><span class="p">)</span> <span class="p">{</span>
		<span class="nv">$surname</span> <span class="o">=</span> <span class="err">$</span><span class="mi">1</span><span class="p">;</span>
	<span class="p">}</span> <span class="k">elsif</span> <span class="p">(</span><span class="nv">$line</span> <span class="o">=*</span> <span class="sr">/^cn\: /</span><span class="p">)</span> <span class="p">{</span>
		<span class="k">if</span> <span class="p">((</span><span class="nv">$givenname</span> <span class="ow">ne</span> <span class="nb">undef</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nv">$surname</span> <span class="ow">ne</span> <span class="nb">undef</span><span class="p">))</span> <span class="p">{</span>
			<span class="nv">$line</span> <span class="o">=</span> <span class="p">"</span><span class="s2">cn: </span><span class="si">$surname</span><span class="s2">, </span><span class="si">$givenname</span><span class="p">";</span>
		<span class="p">}</span> <span class="k">elsif</span> <span class="p">(</span><span class="nv">$surname</span> <span class="ow">ne</span> <span class="nb">undef</span><span class="p">)</span> <span class="p">{</span>
			<span class="nv">$line</span> <span class="o">=</span> <span class="p">"</span><span class="s2">cn: </span><span class="si">$surname</span><span class="p">";</span>
		<span class="p">}</span>
	<span class="p">}</span>
			
	<span class="nv">$line</span> <span class="o">=~</span> <span class="sr">s/^company\: /organization\: /</span><span class="p">;</span>

	<span class="k">print</span> <span class="nv">OUT</span> <span class="nv">$line</span><span class="p">,</span> <span class="p">"</span><span class="se">\n</span><span class="p">";</span>

<span class="p">}</span>

<span class="nb">close</span> <span class="p">(</span><span class="nv">OUT</span><span class="p">)</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Cannot close </span><span class="si">$ARGV</span><span class="s2">[1]: $!</span><span class="p">";</span>
<span class="nb">close</span> <span class="p">(</span><span class="nv">IN</span><span class="p">)</span> <span class="o">||</span> <span class="nb">die</span> <span class="p">"</span><span class="s2">Cannot close </span><span class="si">$ARGV</span><span class="s2">[0]: $!</span><span class="p">";</span>

<span class="nb">exit</span><span class="p">;</span>
</code></pre></div></div>

<p><strong>Please change the PrivoxyWindowOpen command for just a plain “open” - this is just our http proxy trying to protect us and getting it wrong!</strong></p>

<h2 id="step-7-import-into-kontact">Step 7 Import into Kontact</h2>

<p>Oh joy, the final steps, and the good news is that this bit is really simple (hopefully).</p>

<ul>
  <li>Run Kontact, click on Contacts and take option to import from your converted LDIF.</li>
  <li>Click on Mail and take opion to import from Thunderbird mail structure.</li>
  <li>Click on Calendar and take option to import from the transferred iCalendar file.</li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Transfer Emails from Windows to Linux</title>
      <link>https://chrisjrob.com/2009/03/21/transfer-emails-from-windows-to-linux/</link>
      <pubDate>Sat, 21 Mar 2009 06:22:56 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/transfer-emails-from-windows-to-linux</guid>
      <description>
       <![CDATA[
         
         <p>These instructions explain how to transfer emails from a Windows email client to Linux Kmail.  This document has a number of provisos:</p>

<ol>
  <li>If your mailserver is running IMAP, then what are you doing here?  Just connect your Linux mail client to your IMAP server and you’re good to go!</li>
  <li>If you are running a common mail client on Windows, then consider installing Mozilla Thunderbird on Windows and importing your emails into that…
a. See <a href="/2009/03/21/transfer-emails-from-microsoft-outlook/">Transfer Emails from Microsoft Outlook</a></li>
  <li>If you are running Mozilla Thunderbird on Windows, then you can simply copy the files onto Linux and use Mozilla Thunderbird on Linux - job done.</li>
  <li>If your Windows email client stores in mbox format (unlikely) then again you should be able to simply copy the mail store to Linux.</li>
  <li>Check whether you have any export options and see if you can export into an easier format, e.g. Thunderbird/MBOX.</li>
  <li>If your Windows email client does not support IMAP, then you will need to upgrade it to a more recent version that does before proceeding.</li>
  <li>If your Windows email client does support IMAP, then let’s continue…</li>
</ol>

<!--more-->

<h2 id="install-courier-imap-on-server">Install Courier-IMAP on server</h2>

<p>See <a href="/2009/03/21/install-courier-imap-server/">Install Courier-IMAP Server</a></p>

<h2 id="create-ltsp-user">Create LTSP User</h2>

<p>In KUserManager create the user, and add to the following groups:</p>

<ul>
  <li>kiosk-standard</li>
  <li>Staff</li>
  <li>Users</li>
  <li>Fuse (only if you want them to be able to access USB devices)</li>
  <li>Saned (only if you want them to be able to use scanning)</li>
</ul>

<p><strong>Take a note of UID and GID before exiting KUserManager</strong></p>

<h2 id="create-imap-account">Create IMAP Account</h2>

<p><strong>You need to have installed an IMAP server first - see page Install Courier-IMAP Server</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo userdb USERNAME set uid=9999 gid=9999 shell=/bin/bash home=/opt/imap-mail/USERNAME
</code></pre></div></div>

<p>*Replace USERNAME and 9999 for actual username, uid and gid</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo userdbpw -md5 | sudo userdb USERNAME set systempw
$ sudo mkdir -p /opt/imap-mail/USERNAME
$ sudo maildirmake /opt/imap-mail/USERNAME/Maildir
$ sudo chown -R 9999:9999 /opt/imap-mail/USERNAME
$ sudo makeuserdb
$ sudo /etc/init.d/courier-authdaemon stop
$ sudo /etc/init.d/courier-imap stop
$ sudo /etc/init.d/courier-authdaemon start
$ sudo /etc/init.d/courier-imap start
</code></pre></div></div>

<p>*Replace USERNAME and 9999 for actual username, uid and gid</p>

<h2 id="key-steps">Key steps</h2>

<p>The rest of the process is simple enough, that hopefully I do not need to go through it in detail.  Briefly:</p>

<ul>
  <li>Install Courier-IMAP Server</li>
  <li>Create IMAP account in Windows email client</li>
  <li>Log onto LTSP</li>
  <li>Kontact → Mail → Create IMAP account</li>
  <li>Transfer each mail folder into IMAP Inbox then transfer each IMAP folder into Kmail folder</li>
  <li>Repeat last step for each folder</li>
</ul>

<p><strong>Change each client to work off-line between transfers - you don’t really want both clients connected to the same IMAP mailbox at the same time</strong></p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Synchronise files with Unison</title>
      <link>https://chrisjrob.com/2009/03/21/synchronise-files-with-unison/</link>
      <pubDate>Sat, 21 Mar 2009 06:22:37 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/synchronise-files-with-unison</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/unison_logo.png" align="right" alt="Featured Image">
         
         <h2 id="installing-unison">Installing Unison</h2>

<p>You need to install unison on both machines, unison-gtk probably only on the client.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install unison unison-gtk
</code></pre></div></div>

<!--more-->

<p>N.B. unison-gtk is an optional component - if you are comfortable working from the command line.</p>

<h2 id="using-unison">Using Unison</h2>

<p>Under KMenu / Utilities there should be an option for Unison File Synchronisation.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd ~
$ mkdir unison
</code></pre></div></div>

<p>A sample <code class="language-plaintext highlighter-rouge">~/.unison/default.prf</code> config file is shown here:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Unison preferences file
root = /home/user/unison
root = ssh://user@remote.server/unison
follow = Regex .*
</code></pre></div></div>

<p>This is a simple configuration which will synchronise a directory called “unison” under the user’s home directory to a users “unison” directory on “remote.server”.  If the unison directory includes symbolic links, then it will follow the link and copy the actual file, if this is not what you want, simply delete the “follow” line.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Send Files by Email</title>
      <link>https://chrisjrob.com/2009/03/21/send-files-by-email/</link>
      <pubDate>Sat, 21 Mar 2009 06:21:16 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/send-files-by-email</guid>
      <description>
       <![CDATA[
         
         <h2 id="explanation">Explanation</h2>

<p>Oddly enough, there is no option, when browsing folders, to right-click and send by email - something Windows users take for granted. Fortunately this omission may be easily corrected as follows.</p>

<p>These instructions are for Kmail, if you are not using Kmail (or KDE Kontact PIM) then these instructions will need to be modified for the command line of your email client.</p>

<!--more-->

<h2 id="installation">Installation</h2>

<p>Create the following file and save as “kmail.desktop” in the folder <code class="language-plaintext highlighter-rouge">/usr/share/apps/konqueror/servicemenus</code> (for all users on your system).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
Encoding=UTF-8
ServiceTypes=all/allfiles
Actions=Email;

[Desktop Action Email]
Name=Send file(s) with KMail
Exec=kmail --attach %F
Icon=kmail
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Recover Data from a Hard Disk</title>
      <link>https://chrisjrob.com/2009/03/21/recover-data-from-a-hard-disk/</link>
      <pubDate>Sat, 21 Mar 2009 06:21:01 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/recover-data-from-a-hard-disk</guid>
      <description>
       <![CDATA[
         
         <p>This is how I recovered data from an NTFS partitioned hard disk, I am not a recovery expert, and it would irresponsible of me to recommend that you follow these instructions.</p>

<h2 id="boot-in-ubuntu-live-cd">Boot in Ubuntu Live CD</h2>

<ul>
  <li>Boot onto a live CD</li>
  <li>Configure networking</li>
  <li>Uncomment repositories in <code class="language-plaintext highlighter-rouge">/etc/apt/sources.list</code></li>
</ul>

<!--more-->

<h2 id="mount-destination-drive">Mount destination drive</h2>

<p>You need access to a hard drive that is able to support large files.  I started with fat32 and came a cropper when it hit 4gb.  I replaced that with an NFS share on my desktop PC and it worked beautifully.  Mount it ready for action.</p>

<p>I will assume that the destination drive has been mounted at <code class="language-plaintext highlighter-rouge">/mnt/destination</code></p>

<p>Ensure that the source (broken) drive is not mounted (it shouldn’t be unless you mounted it).</p>

<h2 id="determine-source-drive-id">Determine source drive id</h2>

<p>You need to find out the id of the source drive.  This will be listed under <code class="language-plaintext highlighter-rouge">/dev</code> and if it’s your primary drive will probably be <code class="language-plaintext highlighter-rouge">/dev/sda</code> or <code class="language-plaintext highlighter-rouge">/dev/hda</code>.  If you’re not confident, do not proceed.</p>

<h2 id="install-gnu-ddrescue">Install GNU ddrescue</h2>

<p>Note for historical (and hysterical) reasons, the package is named gddrescue in Debian and Ubuntu.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo aptitude install gddrescue
$ man ddrescue
</code></pre></div></div>

<h2 id="run-gnu-ddrescue">Run GNU ddrescue</h2>

<p>Replace <code class="language-plaintext highlighter-rouge">/dev/sda</code> for actual source drive, and <code class="language-plaintext highlighter-rouge">/mnt/destination</code> for action destination drive.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo ddrescue -n /dev/sda /mnt/destination/recovered.img /mnt/destination/recovered.log
</code></pre></div></div>

<p>The “-n” should run faster as it will skip over the errors (although it seemed just as slow to me).</p>

<p>Data recovered is not a fast process, and it will probably take a few days.  The great thing about ddrescue is that you can abort at any time and recommence from where you left off.  You can also skip forward by adding the switch “-i” followed by the number bytes into the disk, e.g. to start from 10gb:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo ddrescue -n -i 10000000000 /dev/sda /mnt/destination/recovered.img /mnt/destination/recovered.log
</code></pre></div></div>

<p>My tip is to keep aborting (Ctrl+C) and skip forward until you pass the area of the disk which is causing problems.  Then, once the bulk of the drive has been recovered you can go back to the sections you skipped, or just move onto the second pass (see next section).</p>

<p>ddrescue will not replace data already recovered, so you can do this safely.</p>

<h2 id="run-gnu-ddrescue-again">Run GNU ddrescue again</h2>

<p>This time replacing the -n with “-r 1” or perhaps “-r 3” to try more than once to recover the data.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo ddrescue -r 1 /dev/sda /mnt/destination/recovered.img /mnt/destination/recovered.log
</code></pre></div></div>

<h2 id="copy-the-destination-image">Copy the destination image</h2>

<p>You don’t want to mess up your hard earned image - so copy it and work on the copy.</p>

<h2 id="install-sleuthkit">Install sleuthkit</h2>

<p>On the destination PC, install sleuthkit:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo aptitude install sleuthkit
$ man mmls
</code></pre></div></div>

<h2 id="run-mmls">Run mmls</h2>

<p>Simply</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mmls copy.img

DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors

    Slot    Start        End          Length       Description
00:  -----   0000000000   0000000000   0000000001   Primary Table (#0)
01:  -----   0000000001   0000000062   0000000062   Unallocated
02:  00:00   0000000063   0117195119   0117195057   NTFS (0x07)
03:  -----   0117195120   0117210239   0000015120   Unallocated
</code></pre></div></div>

<h2 id="calculate-offset">Calculate Offset</h2>

<p>This shows several partitions. In this example, we want to mount the NTFS partition starting at block 63. To calculate the number of bytes, multiply by 512:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>63 x 512 = 32256
</code></pre></div></div>

<h2 id="mount-partition">Mount partition</h2>

<p>For a DOS partition:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mount -o loop,offset=16384 copy.img mountpoint
</code></pre></div></div>

<p>For an NTFS partition:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo aptitude install ntfs-3g
$ sudo mount -t ntfs-3g -o ro,force,loop,offset=32256 copy.img mountpoint
</code></pre></div></div>

<p>I appreciate that ntfs-3g provides write access, which we do not need, but “-t ntfs” sinmply would not mount the image.</p>

<p>If it won’t mount, then the NTFS partition is probably corrupted (not surprisingly).  Try installing testdisk and then running:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ testdisk copy.img
</code></pre></div></div>

<h2 id="extracting-files-from-the-disk-image">Extracting files from the disk image</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#### Foremost directory contents
drwxr-xr-x 30 root root   4096 2009-01-08 18:04 .
drwxrwxrwx  5 root root   4096 2009-01-08 18:03 ..
-rw-r--r--  1 root root 888832 2009-01-08 18:15 audit.txt
drwxr-xr--  2 root root  12288 2009-01-08 18:15 avi
drwxr-xr--  2 root root  12288 2009-01-08 18:15 bmp
drwxr-xr--  2 root root  69632 2009-01-08 18:15 dll
drwxr-xr--  2 root root   4096 2009-01-08 18:10 doc
drwxr-xr--  2 root root  20480 2009-01-08 18:15 exe
drwxr-xr--  2 root root 139264 2009-01-08 18:15 gif
drwxr-xr--  2 root root  20480 2009-01-08 18:15 htm
drwxr-xr--  2 root root   4096 2009-01-08 18:13 jar
drwxr-xr--  2 root root 135168 2009-01-08 18:15 jpg
drwxr-xr--  2 root root   4096 2009-01-08 18:04 mbd
drwxr-xr--  2 root root   4096 2009-01-08 18:15 mov
drwxr-xr--  2 root root   4096 2009-01-08 18:04 mpg
drwxr-xr--  2 root root   4096 2009-01-08 18:14 ole
drwxr-xr--  2 root root   4096 2009-01-08 18:14 pdf
drwxr-xr--  2 root root  57344 2009-01-08 18:15 png
drwxr-xr--  2 root root   4096 2009-01-08 18:04 ppt
drwxr-xr--  2 root root   4096 2009-01-08 18:14 rar
drwxr-xr--  2 root root   4096 2009-01-08 18:04 rif
drwxr-xr--  2 root root   4096 2009-01-08 18:04 sdw
drwxr-xr--  2 root root   4096 2009-01-08 18:04 sx
drwxr-xr--  2 root root   4096 2009-01-08 18:04 sxc
drwxr-xr--  2 root root   4096 2009-01-08 18:04 sxi
drwxr-xr--  2 root root   4096 2009-01-08 18:04 sxw
drwxr-xr--  2 root root   4096 2009-01-08 18:04 vis
drwxr-xr--  2 root root  12288 2009-01-08 18:15 wav
drwxr-xr--  2 root root   4096 2009-01-08 18:15 wmv
drwxr-xr--  2 root root   4096 2009-01-08 18:13 xls
drwxr-xr--  2 root root   4096 2009-01-08 18:14 zip
</code></pre></div></div>

<p>If it still won’t mount, then the general advice seems to be to copy the image to clean hardware and use a Windows recovery disk to boot.  Failing that, all is not lost, there are a number of tools that will search disk images for files.  I played with photorec, but whilst it recovered loads of cached images from IE, it failed to recover more than a handful of proper photos.  Foremost on the other hand seemed to be more successful.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ foremost -i copy.img -o output-folder
</code></pre></div></div>

<p>With luck this will give you a folder that looks like the one to the right.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Reconfigure Display Settings</title>
      <link>https://chrisjrob.com/2009/03/21/reconfigure-display-settings/</link>
      <pubDate>Sat, 21 Mar 2009 06:20:45 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/reconfigure-display-settings</guid>
      <description>
       <![CDATA[
         
         <h2 id="configuring-your-display">Configuring your display</h2>

<p>If the display resolution is VGA, the run:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ dpkg-reconfigure xserver-xorg
</code></pre></div></div>

<p><strong>When configuring XORG, do ensure that the maximum resolution is as you want it, as this will be the default resolution for every boot.</strong></p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Protect against rootkits</title>
      <link>https://chrisjrob.com/2009/03/21/protect-against-rootkits/</link>
      <pubDate>Sat, 21 Mar 2009 06:20:17 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/protect-against-rootkits</guid>
      <description>
       <![CDATA[
         
         <p>Apparently <strong>Rootkits</strong> are a major problem in the linux world.  Unlike viruses, you are much more likely to be infected without realising that you even have a problem.  The purpose of this document is twofold:</p>

<ol>
  <li>Check for existing infection</li>
  <li>Protect against future infection</li>
</ol>

<p>If you are unsure what a Rootkit is, then please read the <a href="https://en.wikipedia.org/wiki/Rootkit">Rootkit Wikipedia page</a> before continuing.</p>

<!--more-->

<h2 id="warning">Warning</h2>

<p><strong>This is how I checked and protected against rootkits and is not how I would recommend that anyone else should do so.</strong></p>

<h2 id="step-1-rkhunter">Step 1: rkhunter</h2>

<p>I suggest you visit the rkhunter website at: http://rkhunter.sourceforge.net/</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install rkhunter
$ sudo rkhunter --upgrade
$ sudo rkhunter --checkall --createlogfile
</code></pre></div></div>

<p>Read the output and take corrective action as required.</p>

<h2 id="step-2-chkrootkit">Step 2: chkrootkit</h2>

<p>I suggest you visit the chkrootkit website at:</p>

<ul>
  <li>http://www.chkrootkit.org</li>
</ul>

<p>In particular, <a href="http://www.chkrootkit.org/faq/#9">the FAQS</a> would suggest that you shouldn’t trust the chkrootkit to use the commands on your system, bearing in mind that you suspect that they might be compromised; I chose not to take this additional precaution - you should make your decision based on the exposure of your server to the Internet and your assessment of the likelihood of your having a rootkit.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install chkrootkit
$ sudo chkrootkit
</code></pre></div></div>

<h2 id="step-4-tripwire">Step 4: tripwire</h2>

<ul>
  <li>http://sourceforge.net/projects/tripwire/</li>
</ul>

<p>Tripwire creates a database of your system files and then tracks any changes to them.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install tripwire
</code></pre></div></div>

<p>Follow all the prompts, which will require you to create a Site Key Pass-phrase and a Local key Pass-phrase.  Next we need to create the database:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo tripwire --init
Wrote database file: /var/lib/tripwire/hostname.domain.com.twd
The database was successfully generated.
</code></pre></div></div>

<p>Next we run a first check:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo tripwire --check
</code></pre></div></div>

<p>This will doubtless come back with far more information than you really want.  For example I received loads of lines about “/proc/PIDNO/”.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://sourceforge.net/docman/display_doc.php?docid=2078&amp;group_id=3130">Implementing Tripwire</a></li>
  <li><a href="http://www.alwanza.com/howto/linux/tripwire.html">Howto Linux - Tripwire</a></li>
</ul>

<h2 id="a-better-way">A better way</h2>

<ul>
  <li><a href="http://linuxgazette.net/issue98/moen.html">Combining AIDE and Tripwire</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Open Multipage TIFFs in KDE</title>
      <link>https://chrisjrob.com/2009/03/21/open-multipage-tiffs-in-kde/</link>
      <pubDate>Sat, 21 Mar 2009 06:19:53 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/open-multipage-tiffs-in-kde</guid>
      <description>
       <![CDATA[
         
         <h2 id="the-issue">The Issue</h2>

<p>Most image viewers only show the first page of a multi-page <code class="language-plaintext highlighter-rouge">TIFF</code>.  The KDE document viewers, of which there are many (KView, KFax, KDVI) will not open them, stating “This version can only handle fax files”.</p>

<!--more-->

<h2 id="the-explanation">The Explanation</h2>

<p>Wikipedia states that: -“Programmers were free to specify new tags and options, but not all implemented programs supported all created tags. As a result, TIFF soon became the lowest common denominator. Today, the majority of TIFF images and readers are still based on uncompressed 32-bit CMYK or 24-bit RGB images.”~</p>

<p>The end result is that the KDE document viewers except a CCITT Group 4 compressed monochrome document, whilst ImageMagick creates a JPEG compressed document.</p>

<h2 id="the-solution">The Solution</h2>

<p>Currently my solution is simply to convert the document as required (you will need ImageMagick on your system):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ convert source.tif -monochrome -compress group4 destination.tif
</code></pre></div></div>

<h2 id="further-thoughts">Further Thoughts</h2>

<p>This fix is fine for geeks, but not much use for mere mortals.  My thought is to create a script which uses ImageMagick to interrogate the TIFF file, convert it, if required, into a temporary location, and then open it in one of the KDE document viewers.  Then associate the file-type with that script.</p>

<h2 id="references">References</h2>

<ul>
  <li>http://www.imagemagick.org/Usage/formats/#tiff</li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install WebDAV on ISPConfig</title>
      <link>https://chrisjrob.com/2009/03/21/install-webdav-on-ispconfig/</link>
      <pubDate>Sat, 21 Mar 2009 06:16:34 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-webdav-on-ispconfig</guid>
      <description>
       <![CDATA[
         
         <h2 id="step-1-create-a-web">Step 1: Create a web</h2>

<p>This is not an ISPConfig tutorial, so it is supposed that you know how to do this.</p>

<p><strong>Use the ISPConfig web interface. Probably sensible to make the site a maximum size.</strong></p>

<!--more-->

<h2 id="step-2-create-data-folder">Step 2: Create data folder</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ mkdir /var/www/webXX/web/webdav
$ chown webXX_trident:webXX /var/www/webXX/web/webdav
$ chmod o+w /var/www/webXX/web/webdav
</code></pre></div></div>

<h2 id="step-3-create-lock-folder">Step 3: Create lock folder</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ mkdir /var/www/webXX/DAVlocks
$ chown www-data:www-data /var/www/webXX/DAVlocks
$ chmod o+w /var/www/webXX/DAVlocks
</code></pre></div></div>

<h2 id="step-4-download-and-install">Step 4: Download and install</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get install libapache-mod-dav
$ a2enmod dav
$ a2enmod dav_fs
</code></pre></div></div>

<h2 id="step-5-create-user">Step 5: Create user</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ htpasswd -c /var/www/webXX/.DAVlogin username
</code></pre></div></div>

<h2 id="step-6-add-apache-directives-to-ispconfig-site">Step 6: Add Apache Directives to ISPConfig site</h2>

<p><strong>Use the web interface and browse to Sites.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DavLockDB /var/www/webXX/DAVlocks/DAVlocks
Alias /webdav /var/www/webXX/web/webdav
&lt;Location /webdav/&gt;
    DAV On
    AuthType Basic
    AuthName 'username'
    AuthUserFile /var/www/webXX/.DAVlogin
    &lt;LimitExcept GET POST PUT DELETE CONNECT OPTIONS PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK&gt;
        Require valid-user
    &lt;/LimitExcept&gt;
&lt;/Location&gt;
</code></pre></div></div>

<p>Restart apache service.</p>

<h2 id="step-7-install-cadaver-for-testing">Step 7: Install Cadaver for testing</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get install cadaver
$ cadaver http://webdav.tridentgarages.co.uk/webdav/
Username: username
Password: p455w0rd
dav:/webdav/&gt; put test.file
dav:/webdav/&gt; ls
dav:/webdav/&gt; get test.file
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Scanning in Wine</title>
      <link>https://chrisjrob.com/2009/03/21/install-scanning-in-wine/</link>
      <pubDate>Sat, 21 Mar 2009 06:16:07 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-scanning-in-wine</guid>
      <description>
       <![CDATA[
         
         <p>Ensure you install the same version as wine.  For me that meant installing as follows:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install -t 'etch-backports' libwine-sane
</code></pre></div></div>

<!--more-->

<p>This worked to a fashion for me; in that it brought up a rather poor scanner dialog, and triggered the scanner, but never completed the scan job.  That said, I was using saned on LTSP (i.e. via network) which may be a step too far for libwine-sane!</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Samba to Access Windows Shares</title>
      <link>https://chrisjrob.com/2009/03/21/install-samba-to-access-windows-shares/</link>
      <pubDate>Sat, 21 Mar 2009 06:15:07 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-samba-to-access-windows-shares</guid>
      <description>
       <![CDATA[
         
         <p>If you are looking for a full Samba LDAP installation, please look elsewhere, this is a simple set-up to access files from an existing Windows or Samba server.</p>

<h2 id="installation">Installation</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install smbfs smbclient
</code></pre></div></div>

<!--more-->

<h2 id="create-password-file">Create password file</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ echo "username=abc" &gt;&gt; /home/username/.smbpassword
$ echo "password=p455w0rd" &gt;&gt; /home/username/.smbpassword
$ chmod go-rwx /home/username/.smbpassword
</code></pre></div></div>

<h2 id="add-network-drives">Add network drives</h2>

<p>Edit /etc/fstab:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># /etc/fstab: static file system information.
#
# &lt;file system&gt; &lt;mount point&gt;      &lt;type&gt;      &lt;options&gt;                    &lt;dump&gt;  &lt;pass&gt;
proc            /proc              proc        defaults                     0       0
/dev/sda1       /                  ext3        defaults,errors=remount-ro   0       1
/dev/sda5       none               swap        sw                           0       0
/dev/scd0       /media/cdrom0      udf,iso9660 user,noauto                  0       0
//hostname/D$   /media/shared      cifs        auto,rw,uid=trident,gid=users,fmask=0664,dmask=0775,iocharset=iso8859-15,credentials=/home/user/.smbpassword 0 0
</code></pre></div></div>

<p>Having done this, I find that you have to issue a:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mount -a
</code></pre></div></div>

<p>This simply remounts any unmounted filesystems from /etc/fstab.</p>

<h2 id="mount-directly">Mount directly</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mount -t cifs //hostname/D$ /media/drive_d -o username=..,password=...,auto,rw,uid=...,gid=...,file_mode=0664,dir_mode=0775,iocharset=iso8859-15
$ sudo mount -t cifs //hostname/D$ /media/drive_d -o auto,rw,uid=...,file_mode=0664,dir_mode=0775,iocharset=iso8859-15,credentials=/home/user/.smbpasswd
$ sudo umount /media/drive_d
</code></pre></div></div>

<h2 id="unmount">Unmount</h2>

<p>You unmount by referencing the mount point.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo umount /media/drive_d
</code></pre></div></div>

<h2 id="openoffice">OpenOffice</h2>

<p>There is a bug in OpenOffice which prevents you from being able to open documents by clicking on the file from within a Samba share. To fix this replace the default %U switch with %f in the KDE Menu configuration editor - right click over the KDE start menu → Menu Editor; next find every occurrence of the OO suite and replace %U with %f.</p>

<h2 id="references">References</h2>

<ul>
  <li>http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html</li>
  <li>http://www.linuxquestions.org/questions/linux-newbie-8/mounting-an-smbfs-using-fstab-461202/</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Print System</title>
      <link>https://chrisjrob.com/2009/03/21/install-print-system/</link>
      <pubDate>Sat, 21 Mar 2009 06:06:29 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-print-system</guid>
      <description>
       <![CDATA[
         
         <p>This document is certainly incomplete and possible inaccurate, please proceed with caution:</p>

<h2 id="install-cups-print-system">Install Cups Print System</h2>

<p>This also installs printer libraries, printing for GIMP, additional fonts etc.</p>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install cupsys cupsys-client cupsys-bsd cupsys-driver-gimpprint cups-pdf cupsys-pt cupsys-driver-gutenprint libgutenprint2 gutenprint-doc gutenprint-locales foomatic-db-gutenprint foomatic-db-engine foomatic-db foomatic-db-hpijs foomatic-filters foomatic-filters-ppds hplip hplip-doc hp-ppd hpijs hpijs-ppds hplip-data python-qt3 python-sip4 psfontmgr ttf-kochi-mincho ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-baekmuk gs-cjk-resource xpp linuxprinting.org-ppds 
</code></pre></div></div>

<h2 id="wine-printing">Wine Printing</h2>

<p>See: http://frankscorner.org</p>

<p>Another way to print in Wine, steps:</p>

<ul>
  <li>regedit</li>
  <li>in <code class="language-plaintext highlighter-rouge">HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Printers\~cups_printer_name~</code></li>
  <li>find the key “Port”</li>
  <li>change it’s value to <code class="language-plaintext highlighter-rouge">|kprinter</code> for KDE</li>
</ul>

<p>When the user wants to print, the standard print dialog appears.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install NTP time server or client</title>
      <link>https://chrisjrob.com/2009/03/21/install-ntp-time-server-or-client/</link>
      <pubDate>Sat, 21 Mar 2009 06:06:08 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-ntp-time-server-or-client</guid>
      <description>
       <![CDATA[
         
         <p>I am not going to reinvent the wheel - the following link is excellent:</p>

<ul>
  <li><a href="http://www.debianadmin.com/ntp-server-and-client-configuration-in-debian.html">NTP Server and Client Configuration in Debian</a></li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Microsoft Fonts</title>
      <link>https://chrisjrob.com/2009/03/21/install-microsoft-fonts/</link>
      <pubDate>Sat, 21 Mar 2009 06:05:43 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-microsoft-fonts</guid>
      <description>
       <![CDATA[
         
         <h2 id="quick-installation">Quick Installation</h2>

<p>Should be able to install simply by:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install msttcorefonts
# dpkg-reconfigure --force msttcorefonts
</code></pre></div></div>

<!--more-->

<h2 id="manual-installation">Manual Installation</h2>

<p>Alternatively download each font as an .exe file and extract TTF contents (Konqueror → Actions → Extract):</p>

<ul>
  <li>http://sourceforge.net/project/showfiles.php?group_id=34153&amp;release_id=105355</li>
</ul>

<p>Then in KDE Control Center take option to Add Fonts.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install KeePassX on Debian Etch</title>
      <link>https://chrisjrob.com/2009/03/21/install-keepassx-on-debian-etch/</link>
      <pubDate>Sat, 21 Mar 2009 06:03:30 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-keepassx-on-debian-etch</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/debian_logo.png" align="right" alt="Featured Image">
         
         <p>KeePassX cannot be installed on Debian Etch, because of some dependency issues:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Version: 0.3.1-1
Depends: libc6 (&gt;= 2.7-1), libgcc1 (&gt;= 1:4.1.1-21), libqt4-core (&gt;= 4.3.4), libqt4-gui (&gt;= 4.3.4), libstdc++6 (&gt;= 4.2.1-4), libx11-6, libxtst6
</code></pre></div></div>

<!--more-->

<h2 id="the-solution">The Solution</h2>

<p>The solution is to install from source.  These instructions were borrowed from the following comment (thank you “John”):</p>

<ul>
  <li>http://www.keepassx.org/howto/setup/inst_source_tar#comment-15355</li>
</ul>

<h3 id="install-recent-version-of-qt4">Install recent version of qt4</h3>

<p>I installed from lenny, which is not ideal.  The above instructions do not say to do this, but I had already done it to resolve stability problems (see Install italc notes).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install qt4-dev qt4-dev-tools qt4-designer
</code></pre></div></div>

<h3 id="install-source-repositories">Install Source Repositories</h3>

<p>You may need to add the lenny source repositories to <code class="language-plaintext highlighter-rouge">/etc/apt/sources.list</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>deb-src http://ftp.uk.debian.org/debian/ lenny main non-free contrib
</code></pre></div></div>

<h3 id="download-source">Download Source</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd
$ mkdir keepassx
$ cd keepassx
$ apt-get source keepassx
</code></pre></div></div>

<h3 id="make">Make</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd keepass*
$ qmake-qt4
Project MESSAGE: See 'INSTALL' for configuration options.
Project MESSAGE: Install Prefix: /usr
Project MESSAGE: *** Makefile successfully generated.
Project MESSAGE: *** Start make now.
$ make
</code></pre></div></div>

<p><strong>If you downloaded the source from <a href="http://www.keepassx.org/">KeePassX</a> itself, then you will probably need to cd into the src directory, delete the Makefile that was created and run qmake-qt4 again from there (ie: qmake-qt4; cd src; rm Makefile ; qmake-qt4 ; cd ..</strong></p>

<h3 id="errors">Errors</h3>

<p>If the above still gives an error about libXtst (and mind didn’t), you can either fix the source code, or simply:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo ln -s /usr/lib/libXtst.so.6 /usr/lib/libXtst.so
$ make
</code></pre></div></div>

<p><strong>This section has not been tested by the author</strong></p>

<h3 id="install">Install</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo make install
</code></pre></div></div>

<h3 id="test">Test</h3>

<p>You should see it installed under your Utilities menu, but you may need to log off/on for this to appear.  Alternatively I usually find editing the menu and resaving has the same effect.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.keepassx.org/">KeePassX</a>
    <ul>
      <li><a href="http://www.keepassx.org/howto/setup/inst_source_tar#comment-15355">Forum post detailing install method</a></li>
    </ul>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install ImageMagick</title>
      <link>https://chrisjrob.com/2009/03/21/install-imagemagick/</link>
      <pubDate>Sat, 21 Mar 2009 06:02:20 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-imagemagick</guid>
      <description>
       <![CDATA[
         
         <h2 id="quick-installation">Quick Installation</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get build-dep imagemagick
# apt-get install imagemagick perlmagick html2ps lpr libwmf-bin
</code></pre></div></div>

<p>See <a href="#testing">Testing</a> below.</p>

<!--more-->

<h2 id="manual-installation">Manual Installation</h2>

<h3 id="references">References</h3>

<ul>
  <li>http://www.imagemagick.org/script/install-source.php#unix
    <ul>
      <li>http://www.imagemagick.org/script/advanced-unix-installation.php</li>
    </ul>
  </li>
</ul>

<h3 id="download">Download</h3>

<ul>
  <li>http://www.imagemagick.org/script/install-source.php#unix</li>
</ul>

<h3 id="installing-image-libraries">Installing Image Libraries</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install libjpeg62-dev libpng12-dev libtiff4-dev
</code></pre></div></div>

<p>Alternatively the following should install everything needed by ImageMagick:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get build-dep imagemagick
</code></pre></div></div>

<p>I think its a good idea to remove the apt-get installed version of ImageMagick, if indeed it exists:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get remove imagemagick
</code></pre></div></div>

<p>Don’t worry about Ghostscript, if gslib is unavailable it will fall back on the Ghostscript binary.</p>

<h3 id="installation">Installation</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ gunzip -c ImageMagick-6.x.x.tar.gz | tar xvf -
$ cd ImageMagick-6.x.x
$ ./configure --without-x
$ make
$ make install
$ make clean
$ ldconfig /usr/local/lib
</code></pre></div></div>

<p><strong>To make ldconfig remember this change permanently, simply add <code class="language-plaintext highlighter-rouge">/usr/local/lib</code> to <code class="language-plaintext highlighter-rouge">/etc/ld.so.conf</code></strong></p>

<h2 id="testing">Testing</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd..
$ convert -version
$ convert logo: logo.gif
</code></pre></div></div>

<h2 id="support">Support</h2>

<ul>
  <li>http://studio.imagemagick.org/mailman/listinfo/magick-users
    <ul>
      <li>http://www.nabble.com/Magick-users-f13962.html</li>
    </ul>
  </li>
  <li>http://studio.imagemagick.org/magick/viewforum.php?f=7</li>
</ul>

<h2 id="tips">Tips</h2>

<p>PDF Thumbnails:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># convert "Trident Honda Fax Header.pdf[0]" -thumbnail "200x200" test.gif
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install IES4Linux on LTSP</title>
      <link>https://chrisjrob.com/2009/03/21/install-ies4linux-on-ltsp/</link>
      <pubDate>Sat, 21 Mar 2009 06:02:07 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-ies4linux-on-ltsp</guid>
      <description>
       <![CDATA[
         
         <h2 id="ies4linux">IES4Linux</h2>

<p>Internet Explorer for Linux</p>

<h2 id="recent-developments">Recent developments</h2>

<h3 id="bugs">Bugs</h3>

<p>Versions of Wine greater than 0.92 seem to cause IES4Linux to consume vast amounts of CPU both for wineserver and iexplore.exe. This problem seems to occur when accessing SSL pages (possibly Active-X pages).  Bugs have been <a href="https://bugs.launchpad.net/bugs/205895">logged with Ubuntu</a> which was quite rightly <a href="http://bugs.winehq.org/show_bug.cgi?id=13687">redirected to Wine</a>, which was rejected pending a <a href="http://bugs.winehq.org/show_bug.cgi?id=13734">regression test</a>, which in turn was redirected to IES4Linux.  The issue seems to be that Wine do not support native DLLs, but these are essential in making IE work under Linux.</p>

<!--more-->

<h3 id="deb-package">Deb package</h3>

<p>There <em>may</em> be a multi-user install deb package (for Ubuntu at least):</p>

<ul>
  <li>http://ubuntuforums.org/showthread.php?t=636758</li>
</ul>

<h2 id="install-wine">Install Wine</h2>

<p>Make sure you’ve installed Wine.</p>

<h2 id="read-debian-installation">Read Debian Installation</h2>

<ul>
  <li>http://www.tatanka.com.br/ies4linux/page/Installation:Debian</li>
</ul>

<h2 id="master-installation-ies4linux">Master Installation IES4Linux</h2>

<p>First you must create a master installation of ies4linux under <code class="language-plaintext highlighter-rouge">/usr/local</code>. To create the master copy, perform a standard ies4linux install as an ordinary desktop user (i.e. unpack the tarball, run <code class="language-plaintext highlighter-rouge">./ies4linux</code>):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
$ tar zxvf ies4linux-latest.tar.gz
$ cd ies4linux-*
$ ./ies4linux
</code></pre></div></div>

<h2 id="convert-to-multi-user-system">Convert to Multi-user System</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd
$ rm bin/ie{5,55,6}
$ sudo mkdir -p /usr/local/share
$ sudo chmod a+rX /usr/local/share
$ sudo mv .ies4linux /usr/local/share/ies4linux
$ sudo chown -R root:root /usr/local/share/ies4linux
$ sudo chmod -R a+rX /usr/local/share/ies4linux
</code></pre></div></div>

<ul>
  <li>http://www.tatanka.com.br/ies4linux/forum/viewtopic.php?t=431</li>
</ul>

<p>Then install this script as any or all of <code class="language-plaintext highlighter-rouge">/usr/local/bin/ie{5,55,6}</code> and let your users run it:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="c"># Launch script for multiuser ies4linux, master copy in /usr/local/share.</span>
<span class="c"># Install as /usr/local/bin/ie6 (or ie55 or ie5)</span>
<span class="c">#</span>
<span class="c"># Blame Andrew Chadwick &lt;andrewc-ies4linux0606@piffle.org&gt;, not Sergio.</span>
<span class="c">#</span>
<span class="c"># Released under the GNU GPL version 2 (or later, your call).</span>
<span class="c"># See ies4linux's own LICENSE or COPYING file for more information.</span>
<span class="c">####################################################</span>

<span class="nv">IE</span><span class="o">=</span><span class="sb">`</span><span class="nb">basename</span> <span class="s2">"</span><span class="nv">$0</span><span class="s2">"</span><span class="sb">`</span>
<span class="nv">MASTERPREFIX</span><span class="o">=</span><span class="s2">"/usr/local/share/ies4linux/</span><span class="nv">$IE</span><span class="s2">"</span>
<span class="nv">WINEPREFIX</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">HOME</span><span class="k">}</span><span class="s2">/.ies4linux/</span><span class="nv">$IE</span><span class="s2">"</span>

<span class="c"># If we're not set up, create the user's magic symlink-copy of the master</span>
<span class="c"># installation.</span>

<span class="k">if</span> <span class="o">!</span> <span class="nb">test</span> <span class="nt">-d</span> <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">"</span><span class="p">;</span> <span class="k">then
    if</span> <span class="o">!</span> <span class="nb">mkdir</span> <span class="nt">-p</span> <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">"</span><span class="p">;</span> <span class="k">then
        </span><span class="nb">echo</span> <span class="s2">"mkdir </span><span class="nv">$WINEPREFIX</span><span class="s2"> failed"</span>
        <span class="nb">exit </span>1
    <span class="k">fi
    if</span> <span class="o">!</span> lndir <span class="s2">"</span><span class="nv">$MASTERPREFIX</span><span class="s2">"</span> <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">"</span><span class="p">;</span> <span class="k">then
        </span><span class="nb">echo</span> <span class="s2">"lndir failed: is xutils installed?"</span>
        <span class="nb">exit </span>1
    <span class="k">fi</span>

    <span class="c"># The profile directory will be recreated automatically by wine on the</span>
    <span class="c"># first run, so it's OK to blow away eny existing copy hanging around in</span>
    <span class="c"># unwritable symlink form from the install, and it's OK to just create a</span>
    <span class="c"># blank one.</span>
   
    <span class="nv">PROFILES</span><span class="o">=</span><span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">/drive_c/windows/profiles"</span>
    <span class="nb">rm</span> <span class="nt">-fr</span> <span class="s2">"</span><span class="nv">$PROFILES</span><span class="s2">"</span>
    <span class="nb">mkdir</span> <span class="nt">-p</span> <span class="s2">"</span><span class="nv">$PROFILES</span><span class="s2">"</span>

    <span class="c"># WINE needs to be able to write to the following files, so they can't be</span>
    <span class="c"># symlinks to root-owned ones.</span>
   
    <span class="k">for </span>file <span class="k">in</span> .no_prelaunch_window_flag system.reg userdef.reg user.reg<span class="p">;</span> <span class="k">do
        if </span><span class="nb">test</span> <span class="nt">-L</span> <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">/</span><span class="nv">$file</span><span class="s2">"</span><span class="p">;</span> <span class="k">then
            </span><span class="nb">rm</span> <span class="nt">-f</span> <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">/</span><span class="nv">$file</span><span class="s2">"</span>
            <span class="nb">cp</span> <span class="s2">"</span><span class="nv">$MASTERPREFIX</span><span class="s2">/</span><span class="nv">$file</span><span class="s2">"</span> <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">/</span><span class="nv">$file</span><span class="s2">"</span>
        <span class="k">fi
    done
    </span><span class="nb">chmod</span> <span class="nt">-R</span> og-rwx <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">"</span>
<span class="k">fi

</span><span class="nb">export </span>WINEPREFIX
<span class="nb">exec </span>wine <span class="s2">"</span><span class="nv">$WINEPREFIX</span><span class="s2">/drive_c/Program Files/Internet Explorer/IEXPLORE.EXE"</span>
<span class="nb">echo</span> <span class="s2">"Failed to launch WINE: see above for details"</span>
<span class="nb">exit </span>1
</code></pre></div></div>

<p>Run the script above as an ordinary desktop user. When it runs, this script tries to create a WINE prefix location under the user’s home, consisting mainly of symlinks to the master copy’s files. It then launches IE in the normal way.</p>

<p>If it screws up, delete your <code class="language-plaintext highlighter-rouge">~/.ies4linux</code> directory and try again.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Flashplayer</title>
      <link>https://chrisjrob.com/2009/03/21/install-flashplayer/</link>
      <pubDate>Sat, 21 Mar 2009 06:01:08 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-flashplayer</guid>
      <description>
       <![CDATA[
         
         <h2 id="install-flashplayer-on-debian-etch">Install Flashplayer on Debian Etch</h2>

<p>You should be able to install from Backports:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get -t "etch-backports" install flashplugin-nonfree
</code></pre></div></div>

<!--more-->

<p>If this fails, then leave it installed and manually download from Adobe:</p>

<ul>
  <li>http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&amp;P2_Platform=Linux</li>
</ul>

<p>Then extract contents and copy <code class="language-plaintext highlighter-rouge">libflashplayer.so</code> into <code class="language-plaintext highlighter-rouge">/usr/lib/flashplugin-nonfree/</code>. The failed install should have created all the necessary symlinks.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install Courier-IMAP Server</title>
      <link>https://chrisjrob.com/2009/03/21/install-courier-imap-server/</link>
      <pubDate>Sat, 21 Mar 2009 06:00:37 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-courier-imap-server</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>Courier-IMAP is quick and easy to install, but is probably not your best option for running a first class IMAP server.  In particularly I have been strongly recommended <code class="language-plaintext highlighter-rouge">Cyrus IMAP server</code>.  The big advantage to Courier-IMAP is that it can be very easily installed on your LTSP server as a temporary migration tool for email, i.e. to transfer users from Windows to Linux.</p>

<h2 id="install-imap">Install IMAP</h2>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install courier-imap
</code></pre></div></div>

<p>This will prompt whether to create files for use by the web interfaces; it is safe to select “No” here.</p>

<p>Now you need to choose a directory where your mail will live:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mkdir -p /opt/imap-mail
</code></pre></div></div>

<p>Now we need to define our users in the courier-imap user database. There are several ways to do this, including mass conversion of all your users in /etc/passwd using the pw2userdb tool as mentioned in the courier FAQ. Here is what we do to create a single user:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo touch /etc/courier/userdb
$ sudo chmod 600 /etc/courier/userdb
$ sudo userdb ~userid~ set uid=&lt;1000&gt; gid=&lt;1000&gt; shell=/bin/bash home=/opt/imap-mail/~userid~
</code></pre></div></div>

<p>*Edit the final line as appropriate.</p>

<p>Now you need to set the users password and create the directory that will store all our e-mail:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo userdbpw -md5 | sudo userdb &lt;peanut&gt; set systempw
$ sudo mkdir -p /opt/imap-mail/&lt;userid&gt;
$ sudo maildirmake /opt/imap-mail/&lt;userid&gt;/Maildir
$ sudo chown -R &lt;1000&gt;:&lt;1000&gt; /opt/imap-mail/&lt;userid&gt;
</code></pre></div></div>

<p>In the <code class="language-plaintext highlighter-rouge">/etc/courier/authdaemonrc</code> file, make sure you set the following value:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>authmodulelist="authuserdb"
</code></pre></div></div>

<p>Note that you may need to replace the existing authmodulelist value. Now prepare the user DB and restart the entire system:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo makeuserdb
$ sudo /etc/init.d/courier-authdaemon stop
$ sudo /etc/init.d/courier-imap stop
$ sudo /etc/init.d/courier-authdaemon start
$ sudo /etc/init.d/courier-imap start 
</code></pre></div></div>

<p>The IMAP system is now ready.</p>

<h2 id="references">References</h2>

<ul>
  <li>http://www.howtoforge.com/converting_outlook_pst_to_maildir</li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install 2x Client</title>
      <link>https://chrisjrob.com/2009/03/21/install-2x-client/</link>
      <pubDate>Sat, 21 Mar 2009 05:59:44 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-2x-client</guid>
      <description>
       <![CDATA[
         
         <h2 id="download-2x-client">Download 2x Client</h2>

<p>At the time of writing there are no Debian-based packages, so download the RPM client from the 2x website:</p>

<ul>
  <li>http://www.2x.com/</li>
</ul>

<h2 id="installing-2x-client">Installing 2x Client</h2>

<!--more-->

<h3 id="alien-installation">Alien Installation</h3>

<p>In order to convert the RPM package into a DEB package, we need to install alien:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># alien --scripts -i 2xApplicationServerClient3.i386.rpm
</code></pre></div></div>

<p>By installing the rpm this way on a Debian based system it can be removed later through your package manager or using apt-get. The package name is applicationserverclient.</p>

<p>If you get an error from the running the scripts you will need to install the .bz2 version instead.</p>

<h3 id="alternative-binary-installation">Alternative Binary Installation</h3>

<p>To do that, download the file into your home directory and run the following commands.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># tar xvjf 2xApplicationServerClient3.tar.bz2
# cd opt/2X/applicationserverclient/scripts
# chmod 755 install.sh
# ./install.sh
</code></pre></div></div>

<p>Assuming you are still in the scripts directory, type the following command to get to the bin directory.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># cd ../bin
</code></pre></div></div>

<h2 id="usage">Usage</h2>

<p>Next you need to start the client and connect to the ApplicationServer. The first line below shows the syntax you need to use and the second is an example. You’ll need to adjust the values to match your system.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># ./appserverclient -s"Server IP" -a"Application Name" -u"User Name" -p"Password"
# ./appserverclient -s192.168.1.5 -a"Internet Explorer" -uAdministrator -ppassword
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li>http://www.2x.com/applicationserver/downloadlinks.html</li>
  <li>Beta releases:
    <ul>
      <li>http://downloads.2x.com/AppServer-LoadBalancer/betaversion/</li>
    </ul>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Download Debian with Jigdo</title>
      <link>https://chrisjrob.com/2009/03/21/download-debian-with-jigdo/</link>
      <pubDate>Sat, 21 Mar 2009 05:59:30 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/download-debian-with-jigdo</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/debian_logo.png" align="right" alt="Featured Image">
         
         <p>Just do an <code class="language-plaintext highlighter-rouge">sudo apt-get jigdo-file</code> and read the following:</p>

<ul>
  <li><a href="http://tldp.org/HOWTO/Debian-Jigdo/index.html">Debian Jigdo</a></li>
</ul>

<!--more-->

<h2 id="where-to-get-downloads">Where to get downloads</h2>

<p>Download the appropriate .jigdo and .template file into a suitable directory on your system.</p>

<ul>
  <li><a href="http://www.debian.org/CD/jigdo-cd/">Jigdo Releases</a></li>
</ul>

<h2 id="reducing-your-download">Reducing your download</h2>

<p>Pretty much the raison-d’etre of Jigdo is the ability to re-use an existing CD to reduce the number of files to be downloaded.  But if you’re anything like me it’s much easier to use an ISO:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo mkdir /mnt/cdrom
$ sudo mount -o loop debian-LennyBeta2-i386-kde-CD-1.iso /mnt/cdrom
</code></pre></div></div>

<p>Now just enter <code class="language-plaintext highlighter-rouge">/mnt/cdrom</code> as the path to the CD to use</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://tldp.org/HOWTO/Debian-Jigdo/index.html">Debian Jigdo</a></li>
  <li><a href="http://www.electrictoolbox.com/how-to-use-jigdo-lite/">How to use Jigdo Lite</a></li>
</ul>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Debug Debian Sound</title>
      <link>https://chrisjrob.com/2009/03/21/debug-debian-sound/</link>
      <pubDate>Sat, 21 Mar 2009 05:58:43 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/debug-debian-sound</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/debian_logo.png" align="right" alt="Featured Image">
         
         <p>Sound is one of those things in Linux which either works out-of-the-box, or drives you berserk. The following instructions did not solve my problems, but I leave them here for future reference.</p>

<p>The gospel for sound according to Debian:</p>

<ul>
  <li>http://www.debianhelp.co.uk/sound.htm</li>
</ul>

<!--more-->

<h2 id="step-1-make-sure-you-have-the-sound-system-fully-installed">Step 1: Make sure you have the sound system fully installed</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install alsa-base alsa-oss alsa-source alsa-utils
# apt-get install alsamixergui alsaplayer alsaplayer-common alsaplayer-gtk alsaplayer-jack
# apt-get install alsaplayer-oss snd-gtk-alsa vlc-plugin-alsa alsaplayer-jack jack jackd
</code></pre></div></div>

<h2 id="step-2-determine-your-sound-card">Step 2: Determine your sound card</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># lspci -v | grep -A 6 Audio
00:14.2 Audio device: ATI Technologies Inc SB600 Azalia
        Subsystem: Micro-Star International Co., Ltd. Unknown device 7297
        Flags: bus master, slow devsel, latency 64, IRQ 22
        Memory at fe020000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
</code></pre></div></div>

<h2 id="step-3-run-module-assistant">Step 3: Run module-assistant</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install module-assistant
# module-assistant
</code></pre></div></div>

<p>If this fails stating cannot find <code class="language-plaintext highlighter-rouge">config.h</code>, then:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># cd /usr/src/linux-headers/linux-headers-2.6.21-2-k7/include/linux
# ln -s autoconf.h config.h
</code></pre></div></div>

<p>Next run:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># alsaconf
</code></pre></div></div>

<p>The solution to the problem is often as simple as adding a line at the end of <code class="language-plaintext highlighter-rouge">/etc/modprobe.d/alsa-base</code> along the lines of:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ options snd-hda-intel model=xyz
</code></pre></div></div>

<p>To determine sound chip model:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC861VD Analog [ALC861VD Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

# cat /proc/asound/cards
0 [SB             ]: HDA-Intel - HDA ATI SB
                    HDA ATI SB at 0xfe020000 irq 22
</code></pre></div></div>

<p>Then gunzip <code class="language-plaintext highlighter-rouge">/usr/share/doc/alsa-base/driver/ALSA-Configuration.txt.gz</code>. Open with nano and search for your soundcard chip as shown above.</p>

<p><code class="language-plaintext highlighter-rouge">options snd-hda-intel model=3stack</code> works for many motherboard integrated chips with shared surrounds. Sometimes it is also possible to use the more generic <code class="language-plaintext highlighter-rouge">options snd-hda-intel model=ref</code>, which the hda driver uses to load manufacturer specfic presets (SigmaTel, Realtek, etc.). The full list is available in ALSA-Configuration.txt in the driver tarball under alsa-kernel/Documentation/.</p>

<h2 id="restart-sound-system">Restart sound system</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># cd /etc/init.d
# then ./alsasound restart
</code></pre></div></div>

<h2 id="play-test-sound">Play Test Sound</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># locate *.wav
/usr/share/sounds/KDE_Beep_RingRing.wav
/usr/share/sounds/KDE_Beep_ShortBeep.wav

# aplay /usr/share/sounds/KDE_Beep_RingRing.wav
Playing WAVE '/usr/share/sounds/KDE_Beep_RingRing.wav' : Unsigned 8 bit, Rate 22254 Hz, Mono
</code></pre></div></div>

<h2 id="external-references">External references</h2>

<ul>
  <li>http://www.debianhelp.co.uk/sound.htm</li>
  <li>http://ubuntuforums.org/showthread.php?t=205449</li>
  <li>http://bugs.archlinux.org/task/6978</li>
  <li>http://ubuntuforums.org/showthread.php?t=314383</li>
  <li>http://ubuntuforums.org/showthread.php?p=3267595</li>
  <li>https://wiki.ubuntu.com/LaptopTestingTeam/Lenovo3000C200_89224MG</li>
  <li>https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/107821</li>
  <li>https://help.ubuntu.com/community/HdaIntelSoundHowto</li>
  <li>https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/85869</li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Copy Directories &amp; Preserve Permissions</title>
      <link>https://chrisjrob.com/2009/03/21/copy-directories-and-preserve-permissions/</link>
      <pubDate>Sat, 21 Mar 2009 05:58:15 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/copy-directories-and-preserve-permissions</guid>
      <description>
       <![CDATA[
         
         <h2 id="the-command">The Command</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /
$ tar cf - opt | (cd /archive; tar xf - )
</code></pre></div></div>

<p><strong>You cannot run this command as “sudo”, if you need root access for your copy, then you will need to execute a “sudo su” or log in as root.</strong></p>

<!--more-->

<h2 id="what-the-command-will-do">What the command will do</h2>

<p>With any command that you are given by someone, you should always check what that command will do:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ tar cf - opt | (cd /archive; tar xf - )
c = create
f - = file stdout
opt = source path
| = pipe all above to...
(
cd /archive;
x = extract
f - = file stdin
)
</code></pre></div></div>

<p>So this command will pipe a new archive from opt to stdout, which it will then recreate in /archive.</p>

<p>This  will copy <code class="language-plaintext highlighter-rouge">/opt</code> into <code class="language-plaintext highlighter-rouge">/archive/opt</code>, preserving permissions, file modification times etc.</p>

<p>Read man tar for more details.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Convert Quicktime MOV to AVI</title>
      <link>https://chrisjrob.com/2009/03/21/convert-quicktime-mov-to-avi/</link>
      <pubDate>Sat, 21 Mar 2009 05:57:44 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/convert-quicktime-mov-to-avi</guid>
      <description>
       <![CDATA[
         
         <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ffmpeg -i "source.mov" -sameq -vcodec msmpeg4v2 -acodec pcm_u8 "output.avi"
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Connect KAddressBook to ActiveDirectory</title>
      <link>https://chrisjrob.com/2009/03/21/connect-kaddressbook-to-activedirectory/</link>
      <pubDate>Sat, 21 Mar 2009 05:57:18 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/connect-kaddressbook-to-activedirectory</guid>
      <description>
       <![CDATA[
         
         <p>In Kmail, under Contacts, in the lower half of the screen press button to [Add]. Select LDAP.</p>

<!--more-->

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Value</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Name</td>
      <td>Enter the resource name here</td>
    </tr>
    <tr>
      <td>Read only</td>
      <td>[x]</td>
    </tr>
    <tr>
      <td>User</td>
      <td>ADDOMAIN~username~</td>
    </tr>
    <tr>
      <td>Bind DN</td>
      <td>ADDOMAIN</td>
    </tr>
    <tr>
      <td>Realm</td>
      <td> </td>
    </tr>
    <tr>
      <td>Password</td>
      <td>~userpass~</td>
    </tr>
    <tr>
      <td>Host</td>
      <td>hostname.domain.co.uk</td>
    </tr>
    <tr>
      <td>Port</td>
      <td>3268 (this is the port used by ActiveDirectory)</td>
    </tr>
    <tr>
      <td>LDAP</td>
      <td>3</td>
    </tr>
    <tr>
      <td>Size limit</td>
      <td>default</td>
    </tr>
    <tr>
      <td>Time limit</td>
      <td>default</td>
    </tr>
    <tr>
      <td>DN</td>
      <td>OU=Exact ActiveDirectory Name,DC=domain,DC=co,DC=uk</td>
    </tr>
    <tr>
      <td>Security</td>
      <td>NO</td>
    </tr>
    <tr>
      <td>Authentication</td>
      <td>Simple</td>
    </tr>
    <tr>
      <td>Subtree query</td>
      <td>[x]</td>
    </tr>
    <tr>
      <td>Offline use</td>
      <td>Use local copy if no connection</td>
    </tr>
  </tbody>
</table>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Configure KNetwork Manager</title>
      <link>https://chrisjrob.com/2009/03/21/configure-knetwork-manager/</link>
      <pubDate>Sat, 21 Mar 2009 05:57:01 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/configure-knetwork-manager</guid>
      <description>
       <![CDATA[
         
         <h2 id="the-issue">The Issue</h2>

<p>KNetworkManager does not like inheriting a pre-existing <code class="language-plaintext highlighter-rouge">/etc/network/interfaces</code> file.</p>

<h2 id="the-solution">The Solution</h2>

<p>Comment out all but the following from your <code class="language-plaintext highlighter-rouge">/etc/network/interfaces</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>auto lo
iface lo inet loopback
</code></pre></div></div>

<!--more-->

<p>Add the user to the <code class="language-plaintext highlighter-rouge">netdev</code> group:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo adduser your_username netdev
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Configure Iceweasel to print via Kprinter</title>
      <link>https://chrisjrob.com/2009/03/21/configure-iceweasel-to-print-via-kprinter/</link>
      <pubDate>Sat, 21 Mar 2009 05:56:39 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/configure-iceweasel-to-print-via-kprinter</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>Iceweasel and Firefox do not use the KDE Print system, but instead print directly to CUPs.  This works fine, but can be confusing, as it looks different and doesn’t offer all the same functions, like PDF etc.</p>

<p>Trying to resolve this issue, I came across this posting:</p>

<ul>
  <li><a href="http://ubuntuforums.org/showthread.php?t=205050">How To: Make Firefox / Thunderbird print to kprinter automatically in KDE / Kubuntu</a> by msak007</li>
</ul>

<!--more-->

<h2 id="single-user">Single User</h2>

<h3 id="step-1-print-to-postscript">Step 1 Print to Postscript</h3>

<p>First, if you haven’t done so, you need to print to PostScript in order for the needed entry in <code class="language-plaintext highlighter-rouge">prefs.js</code> to be populated. This will be done automatically the first time you print. Open any web page and go to:</p>

<p>File → Print → choose PostScript/default (it should be the default if you haven’t installed any printers yet) → click “Print”</p>

<p>Once you have done this and it prints, it’ll add the PostScript entry you need to edit.</p>

<h3 id="step-2-change-default-postscript-printer">Step 2 Change default postscript printer</h3>

<p>In the URL bar, open the config by typing:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>about:config
</code></pre></div></div>

<p>In the “Filter” bar, type</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>print.printer_PostScript/default.print_command
</code></pre></div></div>

<p>This should filter everything out but that line.</p>

<p>Right-click on the line, click on “Modify”, and change the entry from:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lpr ${MOZ_PRINTER_NAME:+-P"$MOZ_PRINTER_NAME"}
</code></pre></div></div>

<p>to:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kprinter
</code></pre></div></div>

<p>Then click OK. This will make Iceweasek print to kprinter any time you select the “PostScript/default” printer.</p>

<h3 id="step-3-set-it-to-print-automatically">Step 3 Set it to print automatically</h3>

<p>Right-click anywhere in the white space, then click on “New → Boolean” to add a new Boolean entry. Type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>print.always_print_silent
</code></pre></div></div>

<p>And set its value to “true”. This will force Iceweasel to print to the default printer without prompting you.</p>

<h3 id="step-4-disable-cups">Step 4 Disable CUPs</h3>

<p>If “PostScript/default” is the only printer you have and there are no local / network printers, it works great and you can stop here. But if you installed a printer through CUPS, it complicates things as Iceweasel will want to use that as a default and all your prints will go there without prompting you! So even if you don’t have a local printer, it’s a good idea to add the following line in case you add one later.</p>

<p>Once again, right-click and choose “New → Boolean”. Type:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>print.postscript.cups.enabled
</code></pre></div></div>

<p>And set its value to “false”. That will disable CUPS printing in Iceweasel, and it will default to the “PostScript/default” printer. And since you’ve changed the output of that to kprinter, you’ll see a “processing” dialog for a split second when you print, after which kprinter will open up. There you can choose all your printers, including PDF, PostScript, and any CUPS installed printers.</p>

<h2 id="multi-user">Multi-user</h2>

<p>There is a file that controls global settings, but it’s not <code class="language-plaintext highlighter-rouge">prefs.js</code> - it’s called (ironically) <code class="language-plaintext highlighter-rouge">firefox.js</code>, and is located in:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/share/iceweasel/defaults/pref
</code></pre></div></div>

<p>Make sure you have Firefox closed and edit the file using your favorite editor.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd /usr/share/iceweasel/defaults/pref/
$ sudo cp firefox.js firefox.js.backup
$ kdesu kate firefox.js
</code></pre></div></div>

<p>Enter your password, and when Kate opens up add the following to the very end of the file:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// Print to kprinter by default for all users
pref("print.postscript.print_command", "kprinter");
pref("print.print_command", "kprinter");
pref("print.always_print_silent", true);
pref("print.postscript.cups.enabled", false);
</code></pre></div></div>

<p>Save the file and launch Firefox. This will not overwrite or modify and user set entries (the entries in bold in about:config), so it will only affect new profiles. If you’ve already modified your profile, this will not change any of the settings in it.</p>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Configure apt-get</title>
      <link>https://chrisjrob.com/2009/03/21/configure-apt-get/</link>
      <pubDate>Sat, 21 Mar 2009 05:55:33 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/configure-apt-get</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/debian_logo.png" align="right" alt="Featured Image">
         
         <h2 id="remove-cdrom-installation">Remove CDROM installation</h2>

<p>Firstly comment out the CDROM installation from <code class="language-plaintext highlighter-rouge">/etc/apt/sources.list</code>.  This seems to be done automatically from Lenny.</p>

<p>Next change any references to “stable” are replaced with the name of the current stable release, currently “Lenny”.  If we don’t do this, then when the next release “Squeeze” goes “stable”, suddenly your system will be upgraded next time you do an apt-get upgrade.</p>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ apt-get update
</code></pre></div></div>

<h2 id="proxy-server">Proxy Server</h2>

<p>If it didn’t work, then you may need to configure apt with your proxy server.</p>

<h3 id="option-1---edit-aptconf">Option 1 - Edit apt.conf</h3>

<p>The usual method is to add the following line to <code class="language-plaintext highlighter-rouge">/etc/apt/apt.conf</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ nano /etc/apt/apt.conf
Apt.conf:
Acquire::http::Proxy "http://admin:password@proxy:port/"
</code></pre></div></div>

<p>Obviously it is not generally a good idea to have a username and password in plain text form in this way.</p>

<h3 id="option-2---environment-variable">Option 2 - Environment Variable</h3>

<p>It is also possible to add the proxy server to the environment variables:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ export http_proxy="http://admin:password@proxy:port/"
$ export ftp_proxy="http://admin:password@proxy:port/"
</code></pre></div></div>

<p>Obviously this will be lost when you close the current console.  Again it is not a good idea to enter usernames and passwords as command line arguments, so you should clear your bash_history.</p>

<h3 id="option-3---update-proxy-server">Option 3 - Update Proxy Server</h3>

<p>Ideally you need to change your proxy server to allow traffic without the need to specify a username and password.</p>

<h2 id="add-backports">Add Backports</h2>

<p>In many cases you will require newer packages than are afforded by stable alone, and for that purpose you need Debian Backports.  To add backports, visit:</p>

<ul>
  <li>http://www.backports.org/dokuwiki/doku.php?id=instructions</li>
</ul>

<p>And follow the instructions on that page to add the repository to your sources, and add the security keyring.</p>

<h2 id="pinning">Pinning</h2>

<p>If you have multiple sources in your sources.list, then in general the latest package will be selected by default.  You can change this behaviour by creating a file <code class="language-plaintext highlighter-rouge">/etc/apt/preferences</code>.  This is called “pinning”.</p>

<p>Save as <code class="language-plaintext highlighter-rouge">/etc/apt/preferences</code>…</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Package: *
Pin: release o=Debian,a=stable
Pin-Priority: 900

Package: *
Pin: origin www.backports.org
Pin-Priority: 600

Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 400

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 300

Package: *
Pin: release o=Debian
Pin-Priority: -1
</code></pre></div></div>

<p>For a fuller description of pinning see the following page:</p>

<ul>
  <li>http://wiki.debian.org/AptPinning</li>
</ul>

<h2 id="saving-and-restoring-package-selections">Saving and restoring package selections</h2>

<p>To save your package selections:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ dpkg --get-selections &gt;filename
</code></pre></div></div>

<p><strong>Remember to save your sources.list and preferences.</strong></p>

<p>To restore your package selections:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ dpkg --set-selections &lt; filename
$ apt-get upgrade-dselect
</code></pre></div></div>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Build VirtualBox from Source</title>
      <link>https://chrisjrob.com/2009/03/21/build-virtualbox-from-source/</link>
      <pubDate>Sat, 21 Mar 2009 05:33:10 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/build-virtualbox-from-source</guid>
      <description>
       <![CDATA[
         
         <h2 id="download">Download</h2>

<p>Download Open Source Edition (OSE) from VirtualBox:</p>

<ul>
  <li>http://www.virtualbox.org/wiki/Downloads</li>
</ul>

<!--more-->

<h2 id="pre-requisites">Pre-requisites</h2>

<p>Install the following pre-requisites:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># apt-get install gcc g++ bcc iasl xsltproc xalan libxalan110-dev uuid-dev zlib1g-dev libidl-dev libsdl1.2-dev libxcursor-dev libqt3-headers libqt3-mt-dev libasound2-dev libstdc++5 libhal-dev
</code></pre></div></div>

<h2 id="compile">Compile</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># sudo su
# ./configure
# . env.sh  &lt;&lt; Note the space between the '.' and 'env'
# kmk all
</code></pre></div></div>

<h2 id="installation">Installation</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># cd out/linux.x86/release/bin/src
# make
# make install
# cd ..
</code></pre></div></div>

<h2 id="references">References</h2>

<p>This document has been copied from the following, which you should read as your primary source.</p>

<ul>
  <li>http://www.virtualbox.org/wiki/Linux%20build%20instructions</li>
</ul>

<p>I also found the following (suitably adapted for Debian) to be most useful:</p>

<ul>
  <li>http://www.howtoforge.com/virtualbox_ubuntu</li>
</ul>

<p>Although I could not get subversion working from behind our proxy server, the source for 1.5.2 was downloadable at the above site.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | VirtualBox</title>
      <link>https://chrisjrob.com/2009/03/21/virtualbox/</link>
      <pubDate>Sat, 21 Mar 2009 05:32:58 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/virtualbox</guid>
      <description>
       <![CDATA[
         
         <p><strong>The VirtualBox Open Source Edition is now in the Debian and Ubuntu repositories, so these instructions are largely redundant.</strong></p>

<h2 id="licensing">Licensing</h2>

<p>The full product is not open source, only free for personal and evaluation use. They do offer an open source version, but this requires compiling from source and does not include headless VRDP or automated set-up, nor USB support.</p>

<!--more-->

<h2 id="performance">Performance</h2>

<p>The good news is that VirtualBox is very fast indeed, and you can activate the CPU virtual threading to make it even faster.</p>

<h2 id="installing-the-full-product">Installing the Full Product</h2>

<p>So simple, in comparison to the alternatives.</p>

<ol>
  <li>Either download from http://www.virtualbox.org/wiki/Downloads or follow instructions to add to apt sources</li>
  <li>Install in the normal Debian way</li>
</ol>

<h2 id="creating-a-virtual-machine">Creating a virtual machine</h2>

<p>So intuitive, you can work it out for yourself.</p>

<p><strong>VirtualBox requires ISO files. If you have IMG files, they can simply be renamed</strong></p>

<p><strong>Don’t forget to turn on CPU virtual threading, if you have a suitable CPU</strong></p>

<h2 id="simple-networking">Simple networking</h2>

<p>See <a href="/2009/03/21/simple-networking-in-kvm/">Simple networking in KVM</a> for more information on this method.</p>

<p>Simply add the two scripts below to your .VirtualBox folder (or a place of your choosing) and in the VirtualBox GUI interface, edit the settings of your virtual machine and change the networking to host networking, give the interface the name “tap0” and add the scripts below in the relevant fields.</p>

<ul>
  <li>Host IP: 192.168.0.17</li>
  <li>TUN Interface IP: 192.168.0.18</li>
  <li>Guest Interface IP: 192.168.0.19</li>
</ul>

<h3 id="create-interface">Create interface</h3>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="c"># vbox-ifup.sh</span>

<span class="c"># configure tun0 device (UML and newer versions of Qemu use tap0 here!)</span>
<span class="nb">sudo</span> /sbin/ifconfig tap0 192.168.0.18

<span class="c"># activate ip forwarding</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 1 &gt; /proc/sys/net/ipv4/ip_forward'</span>

<span class="c"># set up routing to the guest IP</span>
<span class="nb">sudo </span>route add <span class="nt">-host</span> 192.168.0.19 dev tap0

<span class="c"># activate ARP proxy to "spoof" arp address</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 1 &gt; /proc/sys/net/ipv4/conf/tap0/proxy_arp'</span>

<span class="c"># set "spoofed" arp address</span>
<span class="nb">sudo </span>arp <span class="nt">-Ds</span> 192.168.0.19 eth0 pub
</code></pre></div></div>

<h3 id="close-interface">Close interface</h3>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="c"># vbox-ifdown.sh</span>

<span class="c"># delete "spoofed" arp address</span>
<span class="nb">sudo </span>arp <span class="nt">-d</span> 192.168.0.19

<span class="c"># deactivate ARP proxy to "spoof" arp address</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 0 &gt; /proc/sys/net/ipv4/conf/tap0/proxy_arp'</span>

<span class="c"># remove routing to the guest IP</span>
<span class="nb">sudo </span>route del <span class="nt">-host</span> 192.168.0.19 dev tap0

<span class="c"># deactivate ip forwarding</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 0 &gt; /proc/sys/net/ipv4/ip_forward'</span>

<span class="c"># remove tun0 device (UML and newer versions of Qemu use tap0 here!)</span>
<span class="nb">sudo</span> /sbin/ifconfig <span class="nv">$1</span> down
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li><a href="https://help.ubuntu.com/community/VirtualBox#head-ac88c03223e773c78dbb46b4b13c109de1143a03">Build VirtualBox</a></li>
  <li><a href="http://ubuntuforums.org/archive/index.php/t-346185.html">Complete Host Networking</a></li>
  <li><a href="http://www.cendio.com/seamlessrdp/">Install SeamlessRDP</a></li>
  <li><a href="http://ubuntuforums.org/showthread.php?t=433359">Configure for seamless and headless operation</a></li>
  <li><a href="http://ubuntuforums.org/showthread.php?t=433359&amp;page=11">Fix for multiple windows</a>
    <ul>
      <li>http://ubuntuforums.org/showthread.php?t=224212</li>
      <li>http://www.fontis.com.au/rdesktop</li>
    </ul>
  </li>
  <li><a href="http://www.virtualbox.org/download/UserManual.pdf">VirtualBox Manual</a></li>
  <li><a href="http://sig9.com/articles/concurrent-remote-desktop">Concurrent Users</a>
    <ul>
      <li>http://concurrentremotesessions.netfirms.com/</li>
      <li>http://sala.pri.ee/terminal-server-patch/</li>
    </ul>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Simple networking in KVM</title>
      <link>https://chrisjrob.com/2009/03/21/simple-networking-in-kvm/</link>
      <pubDate>Sat, 21 Mar 2009 05:32:36 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/simple-networking-in-kvm</guid>
      <description>
       <![CDATA[
         
         <p>Most instructions on the web are suggesting setting up bridging and setting the interface to work in promiscuous mode; which I understand has security implications. I came across <a href="http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/QemuOnLinux">this website</a> which seemed to promise a simple alternative, by which instead of bridging the networks we just advertise the presence of the guest interface. It seems to work well as far as I can tell.</p>

<!--more-->

<h2 id="configuration">Configuration</h2>

<ul>
  <li>Host IP: 192.168.0.17</li>
  <li>TUN Interface IP: 192.168.0.18</li>
  <li>Guest Interface IP: 192.168.0.19</li>
</ul>

<p>I went into windows and provisioned the emulated ethernet interface with an IP address of 192.168.0.19; along with appropriate DNS settings and default gateway settings. I’ve also reserved the address 192.168.0.18 for use by the tunnel device.</p>

<p>My <code class="language-plaintext highlighter-rouge">/etc/qemu-ifup</code> looks like this:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="c"># configure tun0 device (UML and newer versions of Qemu use tap0 here!)</span>
<span class="nb">sudo</span> /sbin/ifconfig <span class="nv">$1</span> 192.168.0.18

<span class="c"># activate ip forwarding</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 1 &gt; /proc/sys/net/ipv4/ip_forward'</span>

<span class="c"># set up routing to the guest IP</span>
<span class="nb">sudo </span>route add <span class="nt">-host</span> 192.168.0.19 dev tap0

<span class="c"># activate ARP proxy to "spoof" arp address</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 1 &gt; /proc/sys/net/ipv4/conf/tap0/proxy_arp'</span>

<span class="c"># set "spoofed" arp address</span>
<span class="nb">sudo </span>arp <span class="nt">-Ds</span> 192.168.0.19 eth0 pub
</code></pre></div></div>

<p>Thats it… The bridging is done only for a single IP address by installing a proxy ARP.</p>

<h2 id="running">Running</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo kvm -hda w2k3.img -smp 2 -m 512 -no-acpi -k en-gb -net nic,model=rtl8139 -net tap,script=/etc/qemu-ifup -usb -usbdevice tablet -snapshot
</code></pre></div></div>

<ul>
  <li>Note that you must sudo the command, as root priority is required for the qemu-ifup script.</li>
  <li>Note also that for some reason under KVM you need to specify the qemu-ifup script, as it does not default to that. I suspect that it defaults to kvm-ifup, but I have not looked into this further.</li>
  <li>The USB switch is useful in that it enables the mouse to leave the virtual window, and also seems to synchronise the host/guest cursors, which was a problem on our installation.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://fabrice.bellard.free.fr/qemu/">QEMU</a></li>
  <li><a href="http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/QemuOnLinux">QEMU Networking</a>
    <ul>
      <li><a href="http://www.cnpbagwell.com/QEMU/HomePage">QEMU Setup Hints</a></li>
    </ul>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Install KVM</title>
      <link>https://chrisjrob.com/2009/03/21/install-kvm/</link>
      <pubDate>Sat, 21 Mar 2009 05:32:12 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/install-kvm</guid>
      <description>
       <![CDATA[
         
         <h2 id="check-cpu-supports-kvm">Check CPU supports KVM</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># egrep '^flags.*(vmx|svm)' /proc/cpuinfo 
</code></pre></div></div>

<p>If nothing is displayed, then you do not have a CPU that supports KVM. If lines are output that include the text “vmx” then you have an Intel CPU that supports KVM, if “svm” then an AMD CPU that supports KVM.</p>

<!--more-->

<h2 id="check-kernel">Check Kernel</h2>

<p>In order to run KVM you must be running 2.6.20 or higher. You can check this by running the following command:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># uname -r
2.6.26-1-686
</code></pre></div></div>

<h2 id="install-prerequisites">Install Prerequisites</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># aptitude install gcc-3.4 libsdl1.2-dev zlib1g-dev libasound2-dev linux-kernel-headers pkg-config libgnutls-dev
</code></pre></div></div>

<h2 id="install-kvm">Install KVM</h2>

<p><strong>Make sure that you have Backports installed if you are running Etch.</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># aptitude install kvm qemu
</code></pre></div></div>

<p><strong>You need QEMU in order to create disk images.</strong></p>

<h2 id="add-user-to-kvm">Add User to KVM</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># adduser $USER kvm
</code></pre></div></div>

<h2 id="load-kvm-modules">Load KVM Modules</h2>

<p>Decide whether you have an Intel or AMD CPU (see Step 1).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># modprobe kvm
# modprobe kvm-intel or kvm-amd (depending on CPU type)
</code></pre></div></div>

<p>If this fails then try</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># dmesg | grep kvm
</code></pre></div></div>

<p>If it states “kvm disabled in BIOS” then you will need to boot into the BIOS and switch on VT support (probably under advanced processor options).</p>

<p>You can check that the modules are enabled by running:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># lsmod | grep kvm
</code></pre></div></div>

<h2 id="set-kvm-modules-to-autoload">Set KVM modules to autoload</h2>

<p>Add the modules to /etc/modules to ensure that they load upon the next reboot.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># echo "kvm" &gt;&gt; /etc/modules
# echo "kvm-intel" &gt;&gt; /etc/modules
</code></pre></div></div>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://kvm.qumranet.com/kvmwiki/HOWTO">KVM Wiki Howto</a></li>
  <li><a href="http://wiki.debian.org/KVM">KVM on Debian Wiki</a></li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Create Thumbnails from Movies</title>
      <link>https://chrisjrob.com/2009/03/15/create-thumbnails-from-movies/</link>
      <pubDate>Sun, 15 Mar 2009 20:08:39 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/15/create-thumbnails-from-movies</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>Sometimes you want to catalogue your movies with thumbnail images from the movie.</p>

<h2 id="the-solution">The Solution</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ffmpeg -itsoffset -240  -i themovie.mpg -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 thumbnail.jpg
$ ffmpeg -itsoffset -240  -i themovie.mpg -vcodec png -vframes 1 -an -f rawvideo -s 320x240 thumbnail.png
</code></pre></div></div>

<!--more-->

<h2 id="example-script">Example Script</h2>

<p>The following example script should be saved in <code class="language-plaintext highlighter-rouge">/usr/local/bin</code> or somewhere in your path.  As you can see, this script will run through all the movies in the current directory and create thumbnails in the default mythtv MythVideo directory.</p>

<p>This script was written to perform a particular task, and a more generic script would be better.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="c"># Creates a thumbnail of an mpeg</span>

<span class="k">for </span>a <span class="k">in</span> <span class="k">*</span>.mpg<span class="p">;</span> <span class="k">do
    if</span> <span class="o">[</span> <span class="nt">-f</span> <span class="s2">"</span><span class="nv">$a</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
        </span><span class="nv">b</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">a</span><span class="p">%.mpg</span><span class="k">}</span><span class="s2">"</span>
        <span class="k">if</span> <span class="o">[</span> <span class="nt">-f</span> <span class="s2">"/home/mythtv/.mythtv/MythVideo/</span><span class="k">${</span><span class="nv">b</span><span class="k">}</span><span class="s2">.jpg"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
            </span><span class="nb">echo</span> <span class="s2">"/home/mythtv/.mythtv/MythVideo/</span><span class="k">${</span><span class="nv">b</span><span class="k">}</span><span class="s2">.jpg already exists"</span>
        <span class="k">else
            </span>ffmpeg <span class="nt">-itsoffset</span> <span class="nt">-240</span>  <span class="nt">-i</span> <span class="s2">"</span><span class="nv">$a</span><span class="s2">"</span> <span class="nt">-vcodec</span> mjpeg <span class="nt">-vframes</span> 1 <span class="nt">-an</span> <span class="nt">-f</span> rawvideo <span class="nt">-s</span> 320x240 <span class="s2">"/home/mythtv/.mythtv/MythVideo/</span><span class="k">${</span><span class="nv">b</span><span class="k">}</span><span class="s2">.jpg"</span>
        <span class="k">fi
    fi
done</span>
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Convert DVR-MS to MPEG</title>
      <link>https://chrisjrob.com/2009/03/10/convert-dvr-ms-to-mpeg/</link>
      <pubDate>Tue, 10 Mar 2009 22:02:23 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/10/convert-dvr-ms-to-mpeg</guid>
      <description>
       <![CDATA[
         
         <h2 id="simple-bash-script-to-convert-all-dvr-ms-files-in-a-directory">Simple bash script to convert all dvr-ms files in a directory</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#! /bin/bash</span>
<span class="k">for </span>a <span class="k">in</span> <span class="k">*</span>.dvr-ms<span class="p">;</span> <span class="k">do
    if</span> <span class="o">[</span> <span class="nt">-f</span> <span class="s2">"</span><span class="nv">$a</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
        </span><span class="nv">b</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">a</span><span class="p">%.dvr-ms</span><span class="k">}</span><span class="s2">"</span>
        ffmpeg <span class="nt">-i</span> <span class="s2">"</span><span class="nv">$a</span><span class="s2">"</span> <span class="nt">-vcodec</span> copy <span class="nt">-acodec</span> copy <span class="s2">"</span><span class="k">${</span><span class="nv">b</span><span class="k">}</span><span class="s2">.mpg"</span>
    <span class="k">fi
done</span>
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
