<?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>udayv . soundc &#187; linux</title>
	<atom:link href="http://www.soundc.de/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.soundc.de/blog</link>
	<description>Electronic Music, Programming</description>
	<lastBuildDate>Tue, 04 May 2010 14:36:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Server from Ubuntu to Arch</title>
		<link>http://www.soundc.de/blog/2010/01/09/server-from-ubuntu-to-arch/</link>
		<comments>http://www.soundc.de/blog/2010/01/09/server-from-ubuntu-to-arch/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:35:17 +0000</pubDate>
		<dc:creator>verma</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.soundc.de/blog/?p=196</guid>
		<description><![CDATA[I had been a happy customer of Ubuntu 8.04 server edition for quite some time.  It was stable, ran without problems, and got me as far as 130 days (power failure :() without requiring a restart, and that too on my old box which can hardly handle anything else.
But 8.04 was fading out (not being [...]]]></description>
			<content:encoded><![CDATA[<p>I had been a happy customer of Ubuntu 8.04 server edition for quite some time.  It was stable, ran without problems, and got me as far as 130 days (power failure :() without requiring a restart, and that too on my old box which can hardly handle anything else.</p>
<p>But 8.04 was fading out (not being a LTS version), so I thought may be I should dist-upgrade to 9.04.  Well I did and, to say the least, things have been pretty rough.</p>
<p>The server has not been as stable as I&#8217;d would like, my iptables rules don&#8217;t load well anymore, I just keep loosing internet connectivity at least once every hour, my ssh connections to the box just keep getting terminated and I need a restart almost once a week to bring my file transfers upto speed.</p>
<p>So I think its now time to abandon Ubuntu and move to my Linux of choice.</p>
<p>Arch Linux offers what I need from my server system.</p>
<ul>
<li><strong>Rolling release cycles</strong> &#8211; So I probably wont need a system-wide upgrade, just an update once every now and then to get my packages updated.</li>
<li><strong>Minimal Linux</strong> &#8211; So I know exactly what is going on on my system.  Easy to configure, easier to find problems.</li>
<li><strong>Recent software releases</strong> - Arch Linux community is pretty good at keeping up with new releases, you almost always have the latest release of a software available through pacman or, if not, through ABS.  Not always good for server systems, but always good when bug-fixes are being pushed out.</li>
<li>I use it as my primary operating system on my desktop and I love it.</li>
</ul>
<div>Its not going to be easy though.  I have a whole bunch of systems running on my server system and re-configuring them to what they do now is going to me a laborious task.</div>
<div></div>
<div>But well, what the heck.</div>
<div></div>
<div>/</div>
]]></content:encoded>
			<wfw:commentRss>http://www.soundc.de/blog/2010/01/09/server-from-ubuntu-to-arch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interprocess Synchronization in Python/Linux</title>
		<link>http://www.soundc.de/blog/2008/10/21/interprocess-synchronization-in-pythonlinux/</link>
		<comments>http://www.soundc.de/blog/2008/10/21/interprocess-synchronization-in-pythonlinux/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 00:48:15 +0000</pubDate>
		<dc:creator>verma</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[interprocess]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[syncrhonization]]></category>

		<guid isPermaLink="false">http://www.soundc.de/blog/?p=103</guid>
		<description><![CDATA[I had been looking for a way to synchronize my python cgi scripts (several, or several instances of one) so that only one of them could access a particular table in a database at one time.  I looked around on the internet but didn&#8217;t find a concrete class that could do this.  I was writing [...]]]></description>
			<content:encoded><![CDATA[<p>I had been looking for a way to synchronize my python cgi scripts (several, or several instances of one) so that only one of them could access a particular table in a database at one time.  I looked around on the internet but didn&#8217;t find a concrete class that could do this.  I was writing my scripts for a linux based apache server, so portability didn&#8217;t matter.  So here it is.</p>
<pre class="brush: python;">
#!/usr/bin/python
#
import os
import fcntl

class lock:
        def __init__(self):
                self.lockf = 0
                self.file = 0

        def lock(self):
                self.lockf = open ('/tmp/mytmpfilename.1001', 'a')
                fcntl.flock (self.lockf, fcntl.LOCK_EX)
                self.file = open ('/tmp/mytmpfilename.1001','w')

        def unlock(self):
                self.file.close ()
                self.lockf.close ()

###
</pre>
<p>If you know of a better way of synchronizing processes, please let me know.</p>
<p>Edit.10/21/2008:</p>
<p>Here is more specifically what my scripts do.  Perhaps, this post makes more sense in the correct context.  The description below was taken from one of my comments.</p>
<p>All instances of my cgi script perform a read operation followed by a delete operation.  Essentially, my script reads the top row from the database. Right after the information is retrieved that particular row is deleted.  In other words, I am using my database as a FIFO buffer.  Now if several instances of my scripts are running, more than one of them could access the first row (read it), thereby letting two different processes fetch the same element from a FIFO.  One but all of them then fails with the deletion operation.  The whole idea behind this locking mechanism was to avoid this.  All instances of my script should always fetch a different item.</p>
<p>/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.soundc.de/blog/2008/10/21/interprocess-synchronization-in-pythonlinux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

