<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Durand&#039;s Home Page</title>
	<atom:link href="http://www.djm.co.za/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.djm.co.za</link>
	<description>Just another personal web page</description>
	<lastBuildDate>Mon, 29 Aug 2011 16:14:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Some Performance Tips for Magento</title>
		<link>http://www.djm.co.za/2011/08/29/some-performance-tips-for-magento/</link>
		<comments>http://www.djm.co.za/2011/08/29/some-performance-tips-for-magento/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 16:10:18 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=137</guid>
		<description><![CDATA[(In this post, I&#8217;m talking about Magento 1.5.1 and I had about 500,000+ products to import and maintain. These points are all related to these two facts.) I&#8217;ve spent the better part of two months learning and integrating with Magento eCommerce software. During this time I&#8217;ve bumped into several limitations and scaling issues because of [...]]]></description>
			<content:encoded><![CDATA[<p><em>(In this post, I&#8217;m talking about Magento 1.5.1 and I had about 500,000+ products to import and maintain. These points are all related to these two facts.)</em></p>
<p>I&#8217;ve spent the better part of two months learning and integrating with <a href="http://www.magentocommerce.com/" title="Magento">Magento</a> eCommerce software. During this time I&#8217;ve bumped into several limitations and scaling issues because of the particular problem domain I&#8217;m working in but, at the end of it all, there are a few tips and tricks I&#8217;ve discovered which have helped. I&#8217;ll just present them here in no particular order. Hopefully they help someone else in future.</p>
<p><strong>Avoid text attributes as much as reasonably possible.</strong> The text attributes you create for your products correspond to TEXT and/or BLOB data types in the MySQL database. When MySQL processes a query which generates a result set with a TEXT or BLOB column, it doesn&#8217;t use in-memory temporary tables because the MEMORY engine does not support those column types. These temporary tables are created on disk. This increased disk usage obviously results in increased disk IO which slows down everything on your server. So if you have significant amounts of Text attributes, you should make sure you have some quality high-speed disk systems or specify that temporary tables be created on a virtual file system backed up by memory. (Is ramdisk still the correct term? Am I getting old?)</p>
<p><strong>Implement your own RPC interface to speed up the SOAP or XML-RPC API interface.</strong> Why? Because it&#8217;s <em>sloooow</em>. My problem involved importing about 500,000 products into the Magento system and it was decided to use the API provided. Unfortunately, it took a long long time but that provided me with a lot of time to learn about Magento in my attempts to speed it up. Technically, you have two choices here: 1) delve straight into the database and build queries yourself; 2) Implement a small wrapper about the API calls to replace the existing API calls.</p>
<p>Choice #2 is the obvious one since it&#8217;s maintainable. What I did was to implement a small XML-RPC server in PHP with the same method signatures as the Magento API for the calls I needed (catalog_product.create, etc). My little stubs then imported the Mage system, instantiated an API class (Mage_Catalog_Model_Product_Api) and called the existing Magento logic for product creation. Rather oddly, this sped things up dramatically.</p>
<p><strong>Keep as little data within Magento as possible.</strong> Keep enough to display your products the way you want them to be displayed but no more. The Magento database schema is a bit unexpected; it has products split into several attribute tables based on the data type of the attribute. So there&#8217;s an integer table for integer attributes, a varchar table for varchar attributes, etc. This seems reasonable but it has a performance impact when your physical hardware can&#8217;t back it up. If you don&#8217;t have sufficient memory and quality disk systems, a single product lookup can result in an awful lot of disk access. Searches through all products can become impossible when you tend towards large amounts of data. So try to keep it down to a minimum or throw lots of hardware at the problem.</p>
<p>Eventually, our data was kept in a separate database designed specifically for that purpose and our internal systems queried and maintained that as the authoritative source &#8211; Magento served as the customer front-end and relative data was pushed to it when required. Much better for long-term possibilities and plans.</p>
<p><strong>Allocate as much memory as you have data and then some.</strong> The storage engine used by Magento is InnoDB. InnoDB needs a lot of memory. If you don&#8217;t have a lot of memory then disk access once again becomes and issue and your system starts becoming unusable. Make sure you have at least as much memory as you have data within your database. Allocate it all properly to the InnoDB engine. Use helper scripts like <a href="http://mysqltuner.pl/" title="mysqltuner.pl">mysqltuner.pl</a> to diagnose problems.</p>
<p><strong>Uploaded files and save locations.</strong> Not sure why but I guess the makers behing Magento assumed there would be a limited amount of images per product. So they used a 2-layer/depth file system for uploaded images. If your product image is called &#8220;myimage.jpg&#8221;, it would be uploaded to the &#8220;m/y/myimage.jpg&#8221; location beneath your media root. Each of the products in my local Magento could have 3 images and that totaled a possible 1.5 million files at least. If there was no file naming bias in the product image files, then you would be looking at directories with maybe 1K files. However, if your image files are all coded according to a logical scheme &#8211; as mine are &#8211; then there&#8217;s a significant bias and Magento&#8217;s 2-depth system results in several thousand files in a single directory.  I manually increased this to a 3-depth layer system by modifying the <em>getDispretionPath</em> function in <em>(ROOT)/lib/Varien/File/Uploader.php</em> to bring the count back down to sanity. Ideally, though, Magento makers should fix this and allocate directory trees based on a random number Magento generates (or hash, sha1, whatever). It won&#8217;t be easy to find your files again but it will allow Magento to scale a bit better.</p>
<p><strong>Keep your database as close as possible to your Magento installation.</strong> When it became obvious that Magento needed a lot of memory and power at my required usage levels, we tried to use Amazon RDS &#8211; which is really awesome and worked well &#8211; but it didn&#8217;t work out. Magento actively uses the database and each RPC call or operation performs several operations on the database. So the latency between the server and Amazon was suddenly the bottleneck. So keep your data close on a high-spec&#8217;d machine.</p>
<p><strong>Is Magento scalable?</strong> If you have the money to throw at hardware, I&#8217;m sure it will scale okay-ishly. I think it&#8217;ll scale vertically to a point. I believe the caching system they have was probably a response to the slow speed of the database system they built. I believe the caching is there to hide the speed issues when you have a lot of products. (I suppose that&#8217;s what all caching is for?)</p>
<p><strong>Do I recommend Magento?</strong>. Yes. My problems were just due to my large number of products and limited hardware due to budget constraints. If you don&#8217;t have both of those things, then I&#8217;m sure you&#8217;ll be fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2011/08/29/some-performance-tips-for-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Enum Class for Django</title>
		<link>http://www.djm.co.za/2011/07/26/python-enum-class-for-django/</link>
		<comments>http://www.djm.co.za/2011/07/26/python-enum-class-for-django/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 10:50:11 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=131</guid>
		<description><![CDATA[The following post may also be found at it&#8217;s original source: SMK Software For the last several months, I&#8217;ve been developing in Python for a Django project. Python is new to me but there&#8217;s something about it which just feels right. It&#8217;s clean, dynamic, powerful, comes with a full complement of tools and has already [...]]]></description>
			<content:encoded><![CDATA[<p>The following post may also be found at it&#8217;s original source: <a href="http://www.smksoftware.com/2011/07/26/python-enum-class-for-django/" title="Python Enum Class for Djano">SMK Software</a></p>
<p>For the last several months, I&#8217;ve been developing in Python for a Django project. Python is new to me but there&#8217;s something about it which just feels right. It&#8217;s clean, dynamic, powerful, comes with a full complement of tools and has already proven itself useful in the field with large proponents such as Google as well as my Linux distribution of choice &#8211; Gentoo &#8211; basing their system package manager off of it.</p>
<p>While I don&#8217;t post here often, I decided to share the Enum class I&#8217;ve been using with Django which is specifically used for the Django ModelFields when you specify the choices for an attribute of your Model.</p>
<p>For those who don&#8217;t know what the above means, Django uses a model approach in which you specify the data model you will be using &#8211; for example a User which could contain a username, password, etc &#8211; to represent the database schema.  So, you design a single Python class, say User, and you add the attributes of a username and password. Django then loads this class and creates the database schema for you. Also, because the schema is ultimately a Python class and based off of Django Model classes, you can use the class and manipulate it and the Django subsystem will know how to save, load and update the data stored in the database without you ever having to worry about SQL. Kinda like:</p>
<p><code></p>
<pre>
current = User.objects.get( id = 1 )
print "Hello {}".format( current.username )
current.username = 'NewName'
current.save()
</pre>
<p></code></p>
<p>Viola. Extremely convenient.</p>
<p>Some of the fields in your schema &#8211; or attributes of your Model &#8211; will have a limited amount of valid options. For example, an User account may be INACTIVE, ACTIVE or DISABLED. These states are the only possible states. So the User.state attribute should only be limited to those possible choices. You can specify this in django with the following:</p>
<p><code></p>
<pre>
USER_STATES = ( ( 0, 'Inactive' ), ( 1, 'Active' ), ( 2, 'Disabled' ) )

class User( models.Model ):
    ...
    state = models.IntegerField( choices = USER_STATES, default = 0 )
    ...
</pre>
<p></code></p>
<p>So now that Integer field will be validated against the allowed states. The problem is, you now have to refer to the states numerically from now on in your code:</p>
<p><code></p>
<pre>
if myuser.state == 0:
    do this
</pre>
<p></code></p>
<p>Or alternatively:</p>
<p><code></p>
<pre>
if myuser.state == USER_STATES[0][0]:
    do this
</pre>
<p></code></p>
<p>Both of which is really messy and bad. You want to be able to define the user states in a similar manner you do with other languages &#8211; using an Enum. Turns out it&#8217;s quite easy if you write your own Enum class. Here is the class I wrote:</p>
<p><strong>ChoicesEnum Class for Django</strong></p>
<p><code></p>
<pre>
class ChoicesEnum( object ):
    def __init__( self, *args, **kwargs ):
        super( ChoicesEnum, self ).__init__()
        vals = {}
        for key,val in kwargs.iteritems():
            vals[ key ] = val
        object.__setattr__( self, "_vals", vals )

    def choices( self ):
        cho = []
        vals = object.__getattribute__( self, "_vals" )
        for key, val in vals.iteritems():
            cho.append( val )
        cho.sort()
        return cho

    def __getattr__( self, name ):
        return object.__getattribute__( self, "_vals" )[ name ][ 0 ]

    def __setattr__( self, name, value ):
        object.__setattr__( self, "_vals" )[ name ][ 0 ] = value

    def __delattr__( self, name ):
        del object.__setattr__( self, "_vals" )[ name ]
</pre>
<p></code></p>
<p>And so usage would be as follows:</p>
<p><code></p>
<pre>
UserState = ChoicesEnum(
      INACTIVE = ( 0, 'Inactive' ),
      ACTIVE = ( 1, 'Active' ),
      DISABLED = ( 2, 'Disabled' ),
)

class User( models.Model ):
    ...
    state = models.IntegerField(
                     choices = UserState.choices(),
                     default = UserState.INACTIVE
                    )
    ...
</pre>
<p></code></p>
<p>And then you can use the UserState object as you would a normal Enum on most languages:</p>
<p><code></p>
<pre>
if myuser.state == UserState.INACTIVE:
    do this
</pre>
<p></code></p>
<p>It&#8217;s really quite nice and cleans up your code substantially.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2011/07/26/python-enum-class-for-django/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NAT Loopback for DOTA games</title>
		<link>http://www.djm.co.za/2009/09/29/nat-loopback-for-dota-games/</link>
		<comments>http://www.djm.co.za/2009/09/29/nat-loopback-for-dota-games/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 11:51:32 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=119</guid>
		<description><![CDATA[So I&#8217;ve had this problem for a while where if I hosted a DOTA (or W3..etc) Internet game on a server, none of my LAN friends could join the game. They could see the game but attempting to connect would timeout or reject, even though my ports were forwarded and random people could connect. Reason [...]]]></description>
			<content:encoded><![CDATA[<div>So I&#8217;ve had this problem for a while where if I hosted a DOTA (or W3..etc) Internet game on a server, none of my LAN friends could join the game. They could see the game but attempting to connect would timeout or reject, even though my ports were forwarded and random people could connect.</p>
<p><span style="text-decoration: underline;">Reason for Problem:</span></p>
<p>There are a few reasons for this:</p>
<ul>
<li>Some servers run a battle.net server clone using <a href="http://pvpgn.berlios.de/">PvPGN</a>. PvPGN has a &#8220;missing feature&#8221; when it comes to game advertising. The real Battle.Net servers are smart enough to recognize when two or more machines are trying to connect from a single IP address (ADSL connection, for example) and send back the internal IP of the host to its neighbours. The PvPGN server just sends back the Internet IP address to the host&#8217;s neighbours.</li>
<li>Routers have to be smart enough or configured to perform &#8220;NAT loopback&#8221; or &#8220;Reverse NAT&#8221; or &#8220;PAT&#8221; for connections originating from inside the local network to the router&#8217;s Internet addressable IP address and port.</li>
</ul>
<p>So if you are unfortunate enough to combine these two problems, your friends on your LAN won&#8217;t be able to join any Internet games you&#8217;re hosting.</p>
<p>Typical example in which your host&#8217;s IP address is 10.0.0.5 and your Router&#8217;s Internet IP is 66.1.1.2.</p>
<ul>
<li>Your host creates a game on the server.</li>
<li>The server lists the game and all other people joining are told to connect to 66.1.1.2:6112.</li>
<li>A buddy on your LAN (10.0.0.6) tries to join and is told to connect to 66.1.1.2:6112 as well. (A real Battle.Net server would tell it to go to 10.0.0.5:6112).</li>
<li>Your buddy&#8217;s game tries to connect&#8230; which means it tries to connect to your Router&#8217;s Internet IP.</li>
<li>The Router doesn&#8217;t have &#8220;NAT loopback&#8221; or &#8220;Reverse NAT&#8221; or &#8220;NAT on the inside&#8221; to forward internal requests (from 10.0.0./24) back into the network (to 10.0.0.5).</li>
<li>Your buddy&#8217;s connection attempt times out, is rejected or fails.</li>
<li>Your buddy goes back to his house to connect over the Internet. Everyone is sad.</li>
</ul>
<p><span style="text-decoration: underline;">Confirmed Working Router</span></p>
<p>I&#8217;ve found a good router which does NAT loopback out-of-the-box without any configuration.</p>
<p>It&#8217;s the <a href=" http://www.nivo.co.za/buy~billion.bipac.7300gra.adsl.2.wireless.adsl.modem.router~p12359">Billion 7300G (RA) &#8211; ADSL 2+ Wireless 802.11g ADSL Modem/Router, 4 Port</a></p>
<p>I can confirm that this router works perfectly.   <img title="Very Happy" src="http://forum.war3.co.za/images/smilies/icon_biggrin.gif" alt=":D" /> It&#8217;s also quite a nice router.</p>
<p><span style="text-decoration: underline;">Just Extra Stuff</span></p>
<p>Some routers will work automatically. Some will need to be configured. Some just won&#8217;t work. The thing with this is that it&#8217;s not really a feature that a router will advertise as having (like on the box or on it&#8217;s product page). You just have to know or test that it works.</p>
<p>Also, there are other methods for doing this &#8211; like setting your ADSL router into bridged mode &#8211; but this both increases the complexity of your network and exposes your internal machines directly to the Internet&#8230; so your security is compromised.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2009/09/29/nat-loopback-for-dota-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intrusion Detection with AIDE</title>
		<link>http://www.djm.co.za/2009/03/01/intrusion-detection-with-aide/</link>
		<comments>http://www.djm.co.za/2009/03/01/intrusion-detection-with-aide/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 20:18:41 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=107</guid>
		<description><![CDATA[Advanced Intrusion Detection Environment, or AIDE for short, is a handy little utility which you can use to detect an unwanted intrusion into your server.   The website is here: http://www.cs.tut.fi/~rammer/aide.html With computer security, you not only need to protect against incoming attacks but you also need to detect when an intrusion has taken place. AIDE [...]]]></description>
			<content:encoded><![CDATA[<p>Advanced Intrusion Detection Environment, or AIDE for short, is a handy little utility which you can use to detect an unwanted intrusion into your server.   The website is here: <a title="AIDE Home Page" href="http://www.cs.tut.fi/~rammer/aide.html">http://www.cs.tut.fi/~rammer/aide.html</a></p>
<p>With computer security, you not only need to protect against incoming attacks but you also need to detect when an intrusion has taken place. AIDE is good for detecting successful intrusions within a server.</p>
<p>It works by creating an initial database of checksums for the files you want to monitor. You can choose from a myriad of hashing algorithms including MD5 and SHA1.  From then on, you can have AIDE check all your current system files against the compiled database.  If a file has changed it will be detected and you can take appropriate action if any is required.</p>
<p>This is useful if your machine becomes infected with a trojan or virus &#8211; the kind that modifies the binaries to embed itself within the usual commands. For example, coreutils&#8217; ls, mkdir, etc.</p>
<p>The installation and setup is trivial, give or take the time you need to understand the configuration file and list the directories and files to monitor. So give it a go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2009/03/01/intrusion-detection-with-aide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geographic backups with rsync.net</title>
		<link>http://www.djm.co.za/2009/02/27/geographic-backups-with-rsyncnet/</link>
		<comments>http://www.djm.co.za/2009/02/27/geographic-backups-with-rsyncnet/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 11:40:21 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=103</guid>
		<description><![CDATA[My server where this site and others are hosted undergoes a routine backup every couple of days.  Not much needs to be backed up but I&#8217;ve reached the point where each backup is approximately 100 MB in size. This server is hosted in the United States. Here in South Africa, we have a monopolistic telecommunications [...]]]></description>
			<content:encoded><![CDATA[<p>My server where this site and others are hosted undergoes a routine backup every couple of days.  Not much needs to be backed up but I&#8217;ve reached the point where each backup is approximately 100 MB in size. This server is hosted in the United States.</p>
<p>Here in South Africa, we have a monopolistic telecommunications provider named Telkom which overcharges and underdelivers basic services such as ADSL. I have to pay R 70 (Approximately USD $7  at the moment) for each gigabyte.  Besides that, I have a monthly ADSL cap of 3 GB which is shared amongst 4 people in my household. Apart from stifling the development of internet-based services in South Africa (imagine YouTube having to pay $7 for every GB a user uploads or downloads to them), it also makes simple things like transferring my meagre 100 MB backups locally a little unpleasant.  Telkom also hasn&#8217;t seen the need to introduce speeds over 4 Mbps. I&#8217;m sitting on 386 Kbps which suites me just fine because, if I went any faster, I might be tempted to use my bandwith cap within a day.</p>
<p>So I saw an advert for <a title="rsync.net" href="http://rsync.net/">rsync.net</a> which advertised rather cheap and convenient storage space. They basically offer disk space and provide ssh, ftp, rsync, webdav and *insert your protocol here* access to it. Can it be more convenient? I signed up with them on Wednesday and modified my backup system to scp all backups to their servers in Switzerland.  The only issue with the sign up was the +- 12 hour wait for the system to become active. If they automated signup and I had had instant access to the space, it would have been terrific.  Otherwise, everything worked first time as it should.</p>
<p>If you need some space for backups and you enjoy geographic safety, go with them.  I&#8217;d recommend them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2009/02/27/geographic-backups-with-rsyncnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and Simple SOCKS tunnelling with tsocks and ssh</title>
		<link>http://www.djm.co.za/2009/01/22/quick-and-simple-socks-tunnelling-with-tsocks-and-ssh/</link>
		<comments>http://www.djm.co.za/2009/01/22/quick-and-simple-socks-tunnelling-with-tsocks-and-ssh/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 13:38:47 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=96</guid>
		<description><![CDATA[I found an awesome tool to quickly and simply set up a SOCKS tunnel from behind a firewall to an outside server. It&#8217;s called tsocks (http://tsocks.sourceforge.net/). Using this in combination with an ssh tunnel allowed me to tunnel all my traffic through our firewall and to a remote server over a secure link.  It was [...]]]></description>
			<content:encoded><![CDATA[<p>I found an awesome tool to quickly and simply set up a SOCKS tunnel from behind a firewall to an outside server. It&#8217;s called <a title="tsocks homepage" href="http://tsocks.sourceforge.net/">tsocks (http://tsocks.sourceforge.net/)</a>. Using this in combination with an ssh tunnel allowed me to tunnel all my traffic through our firewall and to a remote server over a secure link.  It was like working (browsing, for example) directly from the remote server.</p>
<p>You will probably want to use this technique if:</p>
<ul>
<li>Your firewall is preventing you from accessing what you need to access outside your network.</li>
<li>You don&#8217;t have control over the firewall to open up the ports you need.</li>
<li>You DO have access to an external server via ssh.</li>
<li>The ssh daemon on the remote server has been configured to allow this or you can configure it yourself.  (GatewayPorts = yes)</li>
</ul>
<p>I&#8217;ll just quickly go over the steps which will get you ready to run:</p>
<ol>
<li>Install tsocks.</li>
<li>Configure tsocks.  My configuration looks like this:
<p><em>local = 192.168.0.0/255.255.0.0<br />
server = 127.0.0.1<br />
server_type = 4<br />
server_port = 1080<br />
</em><br />
Which means that for all local addresses, it will go directly over the LAN. However, for everything else, it will tunnel to 127.0.0.1:1080 over SOCKS version 4.</li>
</ol>
<p>Now the only thing left is to create the SSH tunnel on a local port of 1080 (as configured in tsocks.conf) to your remote server:</p>
<p style="text-align: left;"><em>bash#  ssh -D 1080  &lt;username&gt;@&lt;server.com&gt;</em></p>
<p style="text-align: left;">Leave that running. It&#8217;s your link to the outside world. Now open up another terminal and do whatever you need to do. In this example, we&#8217;ll start firefox:  (make sure your firefox isn&#8217;t already running so that it&#8217;s a complete restart.)</p>
<p style="text-align: left;"><em>bash# source /usr/bin/tsocks on<br />
bash# firefox</em></p>
<p style="text-align: left;">And&#8230;. that&#8217;s pretty much it.</p>
<p style="text-align: left;">Tsocks preload&#8217;s itself as a library and implements it&#8217;s own network operations. (connect,  etc..).   So it works like magic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2009/01/22/quick-and-simple-socks-tunnelling-with-tsocks-and-ssh/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Efficiency of emerge depclean</title>
		<link>http://www.djm.co.za/2008/10/15/efficiency-of-emerge-depclean/</link>
		<comments>http://www.djm.co.za/2008/10/15/efficiency-of-emerge-depclean/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 09:52:28 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=67</guid>
		<description><![CDATA[So, I spent the weekend emerging all sorts of unfortunate things onto my laptop trying out all sort of music management software. These things included weird gtk, gnome, kde, mono and other stuff libraries. It was a mess everywhere and left me with an uneasy feeling in my stomach; I didn&#8217;t know what was on [...]]]></description>
			<content:encoded><![CDATA[<p>So, I spent the weekend emerging all sorts of unfortunate things onto my laptop trying out all sort of music management software. These things included weird gtk, gnome, kde, mono and other stuff libraries. It was a mess everywhere and left me with an uneasy feeling in my stomach; I didn&#8217;t know what was on my system. Fortunately, emerge has it&#8217;s depclean feature which removes all unused dependencies and extraneous files from your machine. But I&#8217;ve always wondered how well it works&#8230;</p>
<p>It turns out that it works quite well.</p>
<p>I used a combination of qlist, find, cat, sort and uniq to determine which files were orphans on my system.</p>
<blockquote><p>For all files which are supposed to be there: qlist -IC | xargs -n 1 qlist</p></blockquote>
<p>Apart from some cache files, tmp files, a few configuration files and some portage related stuff, nothing was out of place.</p>
<p>So it&#8217;s a very clean management system. Hooray.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2008/10/15/efficiency-of-emerge-depclean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Linux iPod management options</title>
		<link>http://www.djm.co.za/2008/10/14/my-linux-ipod-management-options/</link>
		<comments>http://www.djm.co.za/2008/10/14/my-linux-ipod-management-options/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 12:06:02 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ipod]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=64</guid>
		<description><![CDATA[So, it turns out there aren&#8217;t many options for me under Linux. In total it came out to zero. This is really due to the fact that my iPod Class version was released oh.. 35 days ago and the software versions are too new for the open-source Linux support. Have a look here: http://support.apple.com/kb/HT1353#iPod_classic_120GB If [...]]]></description>
			<content:encoded><![CDATA[<p>So, it turns out there aren&#8217;t many options for me under Linux.  In total it came out to zero. This is really due to the fact that my iPod Class version was released oh.. 35 days ago and the software versions are too new for the open-source Linux support. Have a look here: <a title="the version" href="http://support.apple.com/kb/HT1353#iPod_classic_120GB">http://support.apple.com/kb/HT1353#iPod_classic_120GB</a></p>
<p>If you mount your iPod under linux, you&#8217;ll notice straight away that they have some funny database system for storing the songs.  This database version and format actually changes between revisions of the iPod software release.  The open-source solutions are all capable of reading and writing the older versions because they&#8217;ve reverse engineered the format.  But they need some more time to get the new ones working. Unlucky for me.</p>
<p>As a result, most of the open-source solutions would actually copy the songs to the iPod but failed to update the iPod database. Oddly enough they didn&#8217;t complain about this. So I would just assume that it worked but the music didn&#8217;t show up in the iPod menu.</p>
<p>In the end, I tried the following solutions:</p>
<ul>
<li><a href="http://amarok.kde.org/">Amarok</a> &#8211; failed to install &#8216;cos I don&#8217;t have KDE installed and it was looking for something called kbuildsycoca on startup. Apparently it will wipe out your cover art on some iPods if you&#8217;re not careful.</li>
<li><a href="http://banshee-project.org/">Banshee</a> &#8211; I tried the stable 0.12.1 release in the portage tree. It&#8217;s okay. It&#8217;s the only open-source solution which actually downloaded cover art for my library. The next unstable release is 1.2.1-rc2 which was brilliant compared to the previous release. Unfortunately it didn&#8217;t work with my iPod version.</li>
<li><a href="http://www.gtkpod.org/">gtkpod</a> &#8211; Nice, convenient and small. Not too feature-full at all. I would have preferred to install and use this one because everything else required hundreds of other dependencies. Pity it didn&#8217;t work.</li>
<li><a href="http://www.gnome.org/projects/rhythmbox/">Rhythmbox</a> &#8211; Similar to banshee, smaller. Would have been nice if it had worked. I think this is the default manager on Ubuntu so it&#8217;s probably well supported and has a future.</li>
<li><a href="http://getsongbird.com/">Songbird</a> &#8211; Now this is my ideal manager. It&#8217;s very similar to iTunes and it didn&#8217;t require hundreds of dependencies. You can just download the binaries from their site and run it. Fantastic. It&#8217;s a professional product as well. All shiny. When they support my iPod, I&#8217;m switching to this.</li>
</ul>
<p>My conclusions and next steps:</p>
<ol>
<li>I&#8217;m going to use iTunes as a stop-gap until Songbird supports the new iPod Classic on Linux.</li>
<li>I need to convert my entire FLAC library to ALAC so that I can import my songs losslessly into iTunes until I get a linux client. (They all support my FLAC &#8216;cos I compiled it in everywhere.)</li>
<li>I polluted my nice clean gentoo install with hundreds of new dependencies and applications which didn&#8217;t work.  I&#8217;m now spending the day cleaning up all orphaned files which don&#8217;t belong. It gives me something to do.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2008/10/14/my-linux-ipod-management-options/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Drinking the Apple Kool-Aid</title>
		<link>http://www.djm.co.za/2008/10/13/drinking-the-apple-kool-aid/</link>
		<comments>http://www.djm.co.za/2008/10/13/drinking-the-apple-kool-aid/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 11:09:29 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ipod]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/?p=55</guid>
		<description><![CDATA[Well, I&#8217;m now the owner of one of those new, darn-fangled iPod Classics with 120 GB. I must say, it&#8217;s a fine looking piece of machinery and I have a beautiful dark-brown and orange leather pouch for it as well. It looks great. Haven&#8217;t been able to use it yet, though. And there&#8217;s a reason [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;m now the owner of one of those new, darn-fangled iPod Classics with 120 GB. I must say, it&#8217;s a fine looking piece of machinery and I have a beautiful dark-brown and orange leather pouch for it as well. It looks great. Haven&#8217;t been able to use it yet, though. And there&#8217;s a reason why: I can&#8217;t easily get my music onto it. <img src='http://www.djm.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The tricky part is the extreme lock-in by Apple which you only tend to discover afterwards and especially if you happen to be running Linux! Here are some poor actions and decisions on Apple&#8217;s part designed to lock you in, as well as some of the obstacles an awesome Linux user like me has encountered:</p>
<ul>
<li>An iPod registers itself as external USB storage when I plug it into the machine. Great. However, you can&#8217;t just copy your music files over. I have all my CDs saved in FLAC format on a file server with ID3 tags embedded. I was really just assuming that I could convert them to something more supported (MP3 or AAC or Apple&#8217;s Lossless aka ALAC) and copy them across. However, the iPod keeps all the music within a proprietary database format and you need specialized open-source applications which have reverse engineered the format to copy them in.</li>
<li>I like my open-source applications lean and mean. (I run Gentoo. I&#8217;m weird that way). The open-source applications available aren&#8217;t too lean and mean at all. I&#8217;m still trying them all out, one at a time, until I find one that a) works and b) is easy to use.</li>
<li>iTunes only runs on Windows and Mac. This is a huge problem, as far as I&#8217;m concerned because the authority on Apple formats and their own proprietary stuff is Apple themselves. Because they don&#8217;t support Linux, the support you can find on a Linux platform is all reverse engineered and not up to date. So, to do an iPod justice and get it working out the box, you kinda need iTunes here. Unless you&#8217;re willing to experiment with the open-source software mentioned above.</li>
<li>The iTunes store for South Africa doesn&#8217;t have any music! What the heck?</li>
<li>I imported several common CDs of mine into iTunes and the cover art wasn&#8217;t loaded even though I asked nicely. Bah humbug. What&#8217;s the point of the pretty screen without cover art? I think this may have to do with the fact that iTunes SA doesn&#8217;t have the music in the first place.</li>
</ul>
<p>Uh.. and that&#8217;s all. It&#8217;s a very pretty device. It would have been amazing if they didn&#8217;t lock it down the way they have. I&#8217;ll let you know what I find out about the open-source products.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2008/10/13/drinking-the-apple-kool-aid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating to a new server..</title>
		<link>http://www.djm.co.za/2008/02/21/migrating-to-a-new-server/</link>
		<comments>http://www.djm.co.za/2008/02/21/migrating-to-a-new-server/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 13:03:31 +0000</pubDate>
		<dc:creator>durand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.djm.co.za/2008/02/21/migrating-to-a-new-server/</guid>
		<description><![CDATA[Yup. I haven&#8217;t done much here for a while but I should. I&#8217;m going to initiate the server migration so there may be some lapse between DNS updates. But, I don&#8217;t think that will affect too many people. None in fact. I should make this an interesting blog.]]></description>
			<content:encoded><![CDATA[<p>Yup. I haven&#8217;t done much here for a while but I should.  I&#8217;m going to initiate the server migration so there may be some lapse between DNS updates.  But, I don&#8217;t think that will affect too many people. None in fact.   I should make this an interesting blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djm.co.za/2008/02/21/migrating-to-a-new-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

