<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Software updates by Troy D. Hanson</title>
	<atom:link href="http://troydhanson.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://troydhanson.wordpress.com</link>
	<description>C, &#38;c.</description>
	<lastBuildDate>Wed, 10 Apr 2013 04:08:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='troydhanson.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Software updates by Troy D. Hanson</title>
		<link>http://troydhanson.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://troydhanson.wordpress.com/osd.xml" title="Software updates by Troy D. Hanson" />
	<atom:link rel='hub' href='http://troydhanson.wordpress.com/?pushpress=hub'/>
		<item>
		<title>uthash 1.9.8 released</title>
		<link>http://troydhanson.wordpress.com/2013/03/10/uthash-1-9-8-released/</link>
		<comments>http://troydhanson.wordpress.com/2013/03/10/uthash-1-9-8-released/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 09:59:50 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=157</guid>
		<description><![CDATA[uthash v1.9.8 has been released. What&#8217;s in version 1.9.8 (2013-03-10) We now have a HASH_REPLACE macro (thanks, Nick Vatamaniuc!) fixed clang warnings (thanks wynnw!) fixed utarray_insert when inserting past array end (thanks Rob Willett!) you can now find uthash on GitHub there&#8217;s a uthash Google Group On GitHub&#8230;The official home of uthash is now the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=157&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<div> <img src="http://troydhanson.files.wordpress.com/2013/03/uthash-mini.png?w=420" style="border-width:0;" alt="uthash-mini.png"> </div>
<p><a href="http://troydhanson.github.com/uthash/">uthash v1.9.8</a> has been released.</p>
<hr />
<h2><a name="_what_8217_s_in_version_1_9_8_2013_03_10"></a>What&#8217;s in version 1.9.8 (2013-03-10)</h2>
<ul>
<li> We now have a <code>HASH_REPLACE</code> macro (thanks, Nick Vatamaniuc!) </li>
<li> fixed clang warnings (thanks wynnw!) </li>
<li> fixed <code>utarray_insert</code> when inserting past array end (thanks Rob Willett!) </li>
<li> you can now find <a href="http://troydhanson.github.com/uthash/">uthash on GitHub</a> </li>
<li> there&#8217;s a <a href="https://groups.google.com/d/forum/uthash">uthash Google Group</a> </li>
</ul>
<p><b>On GitHub&#8230;</b><br />The official home of uthash is now the Github site. You can go there to clone it, grab a zipfile, or to contribute changes back as a pull request.</p>
<p><b>Google Group</b><br />The uthash Google Group is the new &#8220;go-to&#8221; place, to ask questions.  Please ask them there first- and help me answer them there, if you can help!</p>
<p><b>Simplifying</b><br />Regarding versioned releases- it&#8217;s much easier to just merge changes, than to also bump version numbers and do announcements. Going forward I may only bump version numbers rarely and keep the master branch as a rolling current release.</p>
<p>I&#8217;ve also removed a few things&#8211; the PDF version of the documentation, and the tarball of the sources. Long live the tarball.</p>
<p><b>I&#8217;m bad at replying to people</b><br />An apology to people who have sent contributions and questions and didn&#8217;t hear back from me for weeks or months at a time: sorry! My life, and probably yours, is hectic. I hope the Google Group and the pull queue on Github help.</p>
<p><b>Twitter</b><br />You can follow me at <a href="https://twitter.com/troydhanson">@troydhanson</a> for this kind of news too.</p>
<p>Thanks, again, to everyone who helps keep uthash going.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=157&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2013/03/10/uthash-1-9-8-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>

		<media:content url="http://troydhanson.files.wordpress.com/2013/03/uthash-mini.png" medium="image">
			<media:title type="html">uthash-mini.png</media:title>
		</media:content>
	</item>
		<item>
		<title>uthash 1.9.7 released</title>
		<link>http://troydhanson.wordpress.com/2012/10/09/uthash-1-9-7-released/</link>
		<comments>http://troydhanson.wordpress.com/2012/10/09/uthash-1-9-7-released/#comments</comments>
		<pubDate>Tue, 09 Oct 2012 07:01:00 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[technotes]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=153</guid>
		<description><![CDATA[uthash v1.9.7 has been released. A lot of people have sent me patches for uthash, utlist and utstring that have been building up for a while now. So- without further ado, here&#8217;s uthash 1.9.7: Version 1.9.7 (2012-10-09) utstring now supports substring search using utstring_find (thanks, Joe Wei!) utlist can now prepend and replace elements (thanks, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=153&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<div> <img src="http://troydhanson.files.wordpress.com/2012/10/uthash-mini.png?w=420" style="border-width:0;" alt="uthash-mini.png"> </div>
<p><a href="http://uthash.sourceforge.net">uthash v1.9.7</a> has been released.</p>
<p>A lot of people have sent me patches for uthash, utlist and utstring that have been building up for a while now. So- without further ado, here&#8217;s uthash 1.9.7:</p>
<hr />
<h2><a name="_version_1_9_7_2012_10_09"></a>Version 1.9.7 (2012-10-09)</h2>
<ul>
<li> utstring now supports substring search using <tt>utstring_find</tt> (thanks, Joe Wei!) </li>
<li> utlist can now prepend and replace elements (thanks, Zoltán Lajos Kis!) </li>
<li> utlist prev/next fields can now have any names (thanks, Pawel S. Veselov!) </li>
<li> uthash quiets a clang warning (thanks, Roman Divacky and Baptiste Daroussin!) </li>
<li> uthash userguide example shows key uniqueness check (thanks, Richard Cook!) </li>
<li> uthash HASH_MUR compiles under MSVC++ 10 in C mode (thanks, Arun Kirthi Cherian!) </li>
<li> utstring now supports format checking in <tt>utstring_printf</tt> (thanks, Donald Carr!) </li>
</ul>
<h3><a name="_what_is_uthash"></a>What is uthash?</h3>
<p>If you&#8217;re new here, welcome. Uthash is a hash table for C structures. It&#8217;s implemented entirely as a single header file, uthash.h. In the same spirit, it includes a dynamic string implementation in utstring.h, a set of linked list tools in utlist.h and a dynamic array in utarray.h. They&#8217;re all in C, dependency-free, and open-source.</p>
<p>For docs and download links see the <a href="http://uthash.sourceforge.net">uthash website</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=153&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2012/10/09/uthash-1-9-7-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>

		<media:content url="http://troydhanson.files.wordpress.com/2012/10/uthash-mini.png" medium="image">
			<media:title type="html">uthash-mini.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Running Minecraft &amp; Mumble Servers under pmtr</title>
		<link>http://troydhanson.wordpress.com/2012/09/04/running-minecraft-mumble-servers-under-pmtr/</link>
		<comments>http://troydhanson.wordpress.com/2012/09/04/running-minecraft-mumble-servers-under-pmtr/#comments</comments>
		<pubDate>Wed, 05 Sep 2012 03:26:05 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[technotes]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=149</guid>
		<description><![CDATA[From the something-completely-different department: What do you get when you mix a holiday weekend, with a cold and fever and a son who likes Minecraft? A lot of fun actually. As a dad and son activity, we set up a Minecraft server. To take it up a notch, we threw in a Mumble server for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=149&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<p>From the something-completely-different department:</p>
<p>What do you get when you mix a holiday weekend, with a cold and fever and a son who likes Minecraft? A lot of fun actually. As a dad and son activity, we set up a Minecraft server. To take it up a notch, we threw in a Mumble server for voice chat. It&#8217;s one thing to start them manually (or via GUI in the case of the Minecraft server). But I wanted to put them on a server without GUI access, and install them as services- so they&#8217;d restart if they die, or if the box reboots. There&#8217;s <a href="http://troydhanson.wordpress.com/2012/08/21/minimal-sysvinit-launchd-and-upstart/">various ways</a> to do this but I decided to run both servers under my <a href="http://tkhanson.net/pmtr">pmtr process monitor</a>.</p>
<p>Here&#8217;s my configuration from /etc/pmtr.conf:</p>
<pre style="padding:.5em;color:gray;">job {
 name minecraft-server
 dir /home/mc/minecraft
 cmd /usr/bin/java -Xms32M -Xmx292M -jar minecraft_server.jar nogui
 user minecraft
}</pre>
<pre style="padding:.5em;color:gray;">job {
 name murmur-server
 dir /home/mc/murmur
 cmd /usr/bin/murmurd -fg -ini murmur.ini
 user minecraft
}</pre>
<p>I grabbed the <a href="http://www.minecraft.net/download">minecraft_server.jar</a>, the <a href="http://mumble.sourceforge.net/">Murmur</a> binaries (the server for Mumble voice chat clients), a Linux box, put <a href="http://tkhanson.net/pmtr">pmtr</a> on it, and edited some config files. (Minecraft has server.properties, Murmur has murmur.ini, and pmtr has pmtr.conf). My son got to see under the hood of a Linux server, and then as the fruits of our labors we could enjoy some Minecraft with friends.</p>
<p>On a final note- I&#8217;m blown away with the artistry of Minecraft and the quality of Mumble. I even asked my son to turn his Minecraft guy so we could watch the Minecraft sunset- the gradients are just beautiful!, the falling snow or the rain.  Mumble (which is free) makes our voice chats sound like we&#8217;re in recording studios. Great work by talented developers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=149&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2012/09/04/running-minecraft-mumble-servers-under-pmtr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>
	</item>
		<item>
		<title>Minimal sysvinit, launchd and upstart</title>
		<link>http://troydhanson.wordpress.com/2012/08/21/minimal-sysvinit-launchd-and-upstart/</link>
		<comments>http://troydhanson.wordpress.com/2012/08/21/minimal-sysvinit-launchd-and-upstart/#comments</comments>
		<pubDate>Tue, 21 Aug 2012 15:47:22 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=138</guid>
		<description><![CDATA[Here&#8217;s a quick example of how to run a daemon process at boot on four platforms: Ubuntu, using upstart CentOS/RHEL, using sysvinit Debian, using sysvinit Mac OS X, using launchd Typically your system services- web servers, etc, start up through these mechanisms. The idea across all these platforms is that you put a script or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=138&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<p>Here&#8217;s a quick example of how to run a daemon process at boot on four platforms:</p>
<ul>
<li> Ubuntu, using <em>upstart</em> </li>
<li> CentOS/RHEL, using <em>sysvinit</em> </li>
<li> Debian, using <em>sysvinit</em> </li>
<li> Mac OS X, using <em>launchd</em> </li>
</ul>
<p>Typically your system services- web servers, etc, start up through these mechanisms. The idea across all these platforms is that you put a script or text file describing your service in the right place, and the OS init apparatus starts everything.</p>
<p>Caveat: I&#8217;m not a initscript expert by any means. There are many options that vary across these platforms. What I&#8217;ve written here is a quick glance.</p>
<p>For the examples here &#8211; imagine we have a daemon called <tt>exd</tt> that we want to run at boot. The settings used in the initscripts here expect <tt>exd</tt> to stay in init&#8217;s foreground (that is, it doesn&#8217;t daemonize by forking again).</p>
<table bgcolor="#ffffee" width="100%" style="margin:.2em 0;">
<tr>
<td style="padding:.5em;">
<p style="margin-top:0;"><b>An easier way?</b></p>
<p>You might find my <a href="http://tkhanson.net/pmtr">pmtr tool</a> much easier to use than writing an initscript.</p>
</td>
</tr>
</table>
<h3><a name="_ubuntu"></a>Ubuntu</h3>
<p>Ubuntu uses &#8220;upstart&#8221; to manage jobs (at least for the modern releases).</p>
<ol type="1">
<li> Place <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/init/ubuntu-exd.conf">this script</a> in <tt>/etc/init/exd.conf</tt>. </li>
<li> It&#8217;s all ready to go. Start it up: <tt>start exd</tt> </li>
</ol>
<h3><a name="_centos_rhel"></a>CentOS/RHEL</h3>
<p>This platform uses sysvinit-style scripts.</p>
<ol type="1">
<li> Place <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/init/centos-exd">this script</a> in <tt>/etc/rc.d/init.d/exd</tt>. </li>
<li> Symlink it to the runlevel-specific directories: <tt>chkconfig --add exd</tt> </li>
<li> Start up the job (on reboot it&#8217;ll be automatic): <tt>/etc/init.d/exd start</tt> </li>
</ol>
<h3><a name="_debian"></a>Debian</h3>
<ol type="1">
<li> Place <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/init/debian-exd">this script</a> in <tt>/etc/init.d/exd</tt> </li>
<li> Symlink it into place: <tt>/usr/sbin/update-rc.d exd defaults</tt> </li>
<li> Start it: <tt>/usr/sbin/service exd start</tt> </li>
</ol>
<h3><a name="_mac_os_x"></a>Mac OS X</h3>
<p>Mac uses &#8220;launchd&#8221; to start daemons.</p>
<ol type="1">
<li> Place <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/init/mac-exd.plist">this file</a> in <tt>/Library/LaunchDaemons/exd.plist</tt> </li>
<li> Load and start it: <tt>launchctl load /Library/LaunchDaemons/exd.plist</tt> </li>
</ol>
<h3><a name="_that_8217_s_it"></a>That&#8217;s it</h3>
<p>That&#8217;s a minimalistic look at initscripts on four platforms.</p>
<p><em>Edited to add</em>: Debian example and replace the inline files with links.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=138&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2012/08/21/minimal-sysvinit-launchd-and-upstart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>
	</item>
		<item>
		<title>uthash 1.9.6 released</title>
		<link>http://troydhanson.wordpress.com/2012/04/28/uthash-1-9-6-released/</link>
		<comments>http://troydhanson.wordpress.com/2012/04/28/uthash-1-9-6-released/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 07:19:02 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=135</guid>
		<description><![CDATA[Six years of uthash I noticed on SourceForge that it&#8217;s been six years and a month since uthash was first released on March 28, 2006. Their counter shows 23,421 downloads. Thanks to everyone who has contributed features and suggestions. Over the years uthash grew offshoots, the &#8220;bonus&#8221; headers for dynamic strings, arrays and lists. These [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=135&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<div> <img src="http://troydhanson.files.wordpress.com/2012/04/uthash-mini.png?w=420" style="border-width:0;" alt="uthash-mini.png"> </div>
<hr />
<h2><a name="_six_years_of_uthash"></a>Six years of uthash</h2>
<p>I noticed on SourceForge that it&#8217;s been six years and a month since uthash was first released on March 28, 2006. Their counter shows 23,421 downloads. Thanks to everyone who has contributed features and suggestions. Over the years uthash grew offshoots, the &#8220;bonus&#8221; headers for dynamic <a href="http://uthash.sourceforge.net/utstring.html">strings</a>, <a href="http://uthash.sourceforge.net/utarray.html">arrays</a> and <a href="http://uthash.sourceforge.net/utlist.html">lists</a>. These have become handy tools in their own right, judging by the emails I&#8217;ve received.</p>
<p>There&#8217;s more options for C hash libraries now than there were in 2006.  It would be tempting to keep sharpening the axe and make a shiny new uthash, but API compatibility and time have kept things to incremental changes. So it is with the release of <a href="http://uthash.sourceforge.net">uthash v1.9.6</a>.</p>
<p>This is a minor release of uthash with a few bug fixes and edits to the documentation in response to questions I&#8217;d received.</p>
<hr />
<h2><a name="_version_1_9_6_2012_04_28"></a>Version 1.9.6 (2012-04-28)</h2>
<ul>
<li> add <tt>utarray_prev</tt> (thanks, Ben Hiett!) </li>
<li> add parens/casts for greater compatibility (thanks, Atis, Debasis Ganguly, and Steve McClellan!) </li>
<li> added ifndef to uthash_malloc and related hooks (thanks, Holger Machens!) </li>
<li> edit examples so they do not leak memory (thanks, 任晶磊!) </li>
</ul>
<p>Apparently, I forgot to post about the previous minor version, so for the record:</p>
<hr />
<h2><a name="_version_1_9_5_2011_11_16"></a>Version 1.9.5 (2011-11-16)</h2>
<ul>
<li> added <tt>utarray_renew</tt> </li>
<li> fixed memory leak in <tt>uthash_clear</tt> when using Bloom filter (thanks, Jan Hättig!) </li>
<li> utarray now copies the UT_icd on array creation rather than storing a pointer </li>
<li> add parentheses to <tt>HASH_ADD</tt> to fix preprocessing of certain arguments (thanks, Aaron Rosen!) </li>
<li> more parenthesizations for greater macro argument flexibility </li>
</ul>
<p>With that, I&#8217;m off to Hawaii. Aloha!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=135&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2012/04/28/uthash-1-9-6-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>

		<media:content url="http://troydhanson.files.wordpress.com/2012/04/uthash-mini.png" medium="image">
			<media:title type="html">uthash-mini.png</media:title>
		</media:content>
	</item>
		<item>
		<title>kvspool: a tool for data streams</title>
		<link>http://troydhanson.wordpress.com/2012/03/02/kvspool-a-tool-for-data-streams/</link>
		<comments>http://troydhanson.wordpress.com/2012/03/02/kvspool-a-tool-for-data-streams/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 04:54:06 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=130</guid>
		<description><![CDATA[I&#8217;ve placed my kvspool library on GitHub. kv-spool (&#8220;key-value&#8221; spool) a Linux-based C library, with Perl, Python and Java bindings, to stream data between programs as key-value dictionaries. The data stream is backed to disk, supports rewind, snapshot, network replication, and bounded disk consumption. It&#8217;s a tiny API. It&#8217;s been useful to me in streaming [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=130&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<div> <img src="http://troydhanson.files.wordpress.com/2012/03/kvspool-mini.png?w=420" style="border-width:0;" alt="kvspool"> </div>
<p>I&#8217;ve placed my <a href="http://troydhanson.github.com/kvspool/">kvspool library</a> on GitHub.</p>
<dl>
<dt> kv-spool (&#8220;key-value&#8221; spool) </dt>
<dd> a Linux-based C library, with Perl, Python and Java bindings, to stream data between programs as key-value dictionaries. The data stream is backed to disk, supports rewind, snapshot, network replication, and bounded disk consumption. </dd>
</dl>
<p>It&#8217;s a tiny API. It&#8217;s been useful to me in streaming data applications, where you have a never-ending event stream. Besides making it trivial to generate or consume the event stream between different programs in different languages- I wanted kvspool to enable me to &#8220;copy off&#8221; a sample from a running stream, take it back to a laptop as canned data, and &#8220;rewind&#8221; and &#8220;replay&#8221; while developing newer versions of software that consumes the stream.</p>
<p>I also wanted to send the event stream over a network, effortlessly- in fact, invisibly- to the programs that generate or consume the events.</p>
<p>So <a href="http://troydhanson.github.com/kvspool/">there it is</a>.</p>
<p>Thanks to the awesome Trevor Adams for his help on this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=130&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2012/03/02/kvspool-a-tool-for-data-streams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>

		<media:content url="http://troydhanson.files.wordpress.com/2012/03/kvspool-mini.png" medium="image">
			<media:title type="html">kvspool</media:title>
		</media:content>
	</item>
		<item>
		<title>pmtr: a process monitor</title>
		<link>http://troydhanson.wordpress.com/2011/11/08/pmtr-a-process-monitor/</link>
		<comments>http://troydhanson.wordpress.com/2011/11/08/pmtr-a-process-monitor/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 05:49:08 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=127</guid>
		<description><![CDATA[Starting processes at boot time, and keeping them running, is not glamorous but it&#8217;s important (if your computer gets power cycled, it&#8217;s nice to have your applications bounce right back&#8230; but I&#8217;m sure you already do this). I put together a utility called pmtr (process monitor) to run my application daemons at boot time, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=127&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="preamble"></a>
<p>Starting processes at boot time, and keeping them running, is not glamorous but it&#8217;s important (if your computer gets power cycled, it&#8217;s nice to have your applications bounce right back&#8230; but I&#8217;m sure you already do this).</p>
<p>I put together a utility called <tt>pmtr</tt> (process monitor) to run my application daemons at boot time, and restart them as needed. I wanted to keep all of these jobs defined in one place&#8211; one configuration file. No rooting around in sysvinit files. Just my application&#8217;s jobs, all in one place. Like this,</p>
<p><b>/etc/pmtr.conf</b></p>
<table border="0" bgcolor="#e8e8e8" width="100%" style="margin:.2em 0;">
<tr>
<td style="padding:.5em;">
<pre style="margin:0;padding:0;">  job {
    name weather-server
    cmd /usr/local/bin/weather -v
  }

  # this one keeps stderr and stdout
  job {
    name doppler-update
    cmd /usr/bin/dop-up
    dir /var/log
    err dop.err
    out dop.out
  }</pre>
</td>
</tr>
</table>
<p>That&#8217;s a simple <tt>pmtr.conf</tt> with just two jobs. No rocket science &#8211; just two jobs, in one place. There&#8217;s a handful of job configuration <a href="http://troydhanson.github.com/pmtr/#options">options</a> it supports.</p>
<p>A friend asked me to support &#8220;deltas&#8221; if you change the configuration file- and this turned into one of the most useful features. It&#8217;s really two handy features that go together: <tt>pmtr</tt> monitors the file (using inotify) for changes so you don&#8217;t have to signal it when you make a change; then, when it rescans the configuration, it only fiddles with the jobs you&#8217;ve actually changed.  You can disable or reconfigure jobs, or add new ones, and have that take effect without disrupting the other ones.</p>
<p>It&#8217;s not sysvinit, it&#8217;s not upstart, it&#8217;s not sophisticated. It&#8217;s just &#8230; handy.</p>
<p>You can <a href="http://troydhanson.github.com/pmtr/">read more about pmtr</a> on it&#8217;s GitHub page.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=127&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2011/11/08/pmtr-a-process-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>
	</item>
		<item>
		<title>ZeroMQ control port</title>
		<link>http://troydhanson.wordpress.com/2011/10/30/zeromq-control-port/</link>
		<comments>http://troydhanson.wordpress.com/2011/10/30/zeromq-control-port/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 22:41:40 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=121</guid>
		<description><![CDATA[I&#8217;ve posted my ØMQ zcontrol control port library to GitHub tonight. This makes it easy to embed an interactive control port in your ØMQ (v2 or v3)-based C programs. Example of using a control port % ./zcon -e tcp://127.0.0.1:3333 Connecting to tcp://127.0.0.1:3333. zcon&#62; help help this text version version info shutdown shutdown server quit close [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=121&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve posted my ØMQ <a href="http://troydhanson.github.com/zcontrol/">zcontrol control port library</a> to GitHub tonight. This makes it easy to embed an interactive control port in your ØMQ (v2 or v3)-based C programs.</p>
<p><b>Example of using a control port</b></p>
<table border="0" bgcolor="#e8e8e8" width="100%" style="margin:.2em 0;">
<tr>
<td style="padding:.5em;">
<pre style="margin:0;padding:0;">% ./zcon -e tcp://127.0.0.1:3333
Connecting to tcp://127.0.0.1:3333.
zcon&gt; help
help                 this text
version              version info
shutdown             shutdown server
quit                 close session

zcon&gt; version
Current 0MQ version is 3.0.3

zcon&gt; quit</pre>
</td>
</tr>
</table>
<p>You can add commands, for example&#8201;&#8212;&#8201;to control or monitor your program&#8201;&#8212;&#8201;using the zcontrol API. Use the <tt>zcon</tt> client shown above to run these commands interactively. Or, you can invoke them from any ØMQ <tt>req</tt> socket. I&#8217;ve used zcontrol both ways, e.g. manually and from a PHP script.</p>
<p>For further information please see,</p>
<ul>
<li> the zcontrol documentation: <a href="http://troydhanson.github.com/zcontrol/">http://troydhanson.github.com/zcontrol/</a> </li>
<li> or <tt>git clone git://github.com/troydhanson/zcontrol.git</tt> </li>
</ul>
<p>Feedback or suggestions are welcome- feel free to leave comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=121&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2011/10/30/zeromq-control-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>
	</item>
		<item>
		<title>Data streams, ZeroMq, entropy</title>
		<link>http://troydhanson.wordpress.com/2011/10/09/data-streams-zeromq-entropy/</link>
		<comments>http://troydhanson.wordpress.com/2011/10/09/data-streams-zeromq-entropy/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 05:13:45 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[Software updates]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=116</guid>
		<description><![CDATA[kvspool, coming soon Pending some final approvals, I&#8217;m looking forward to releasing a new library this week for streaming data processing. It&#8217;s a small API for spooling off events (key-value sets, aka a dictionary, hash, etc). From there, other programs can consume them (possibly at a slower rate, hence you can couple fast and slow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=116&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h3><a name="_kvspool_coming_soon"></a>kvspool, coming soon</h3>
<p>Pending some final approvals, I&#8217;m looking forward to releasing a new library this week for streaming data processing. It&#8217;s a small API for spooling off events (key-value sets, aka a dictionary, hash, etc). From there, other programs can consume them (possibly at a slower rate, hence you can couple fast and slow processes, while limiting the total resource consumption of the buffer). Or you can publish the stream to remote subscribers, and it will continuously receive the events written to the local stream. It&#8217;s a tiny API in C, Python, Perl and Java.</p>
<h3><a name="_zero_mq"></a>Zero MQ</h3>
<p>Just a few words of appreciation for Zero MQ (sorry, &#8220;ØMQ&#8221;). <a href="http://zero.mq">These guys</a> have taken a new conceptual approach to sockets (layering an API over standard TCP/IP sockets) that takes care of most of the headaches in network programs. I won&#8217;t go into detail but I immediately used pub-sub, went from there to using req-rep, to push-pull, and I love that the API is tiny, the docs are great (I love the ASCII diagrams rendered nicely as PNG, I discovered they are using <a href="http://ditaa.sourceforge.net">ditaa</a> for that, by the way). I ported my <a href="http://tkhanson.net/cgit.cgi/misc.git/tree/controlport">controlport</a> library for use with ZeroMq-message-loop based programs. Hope to post it here soon.</p>
<h3><a name="_entropy"></a>Entropy</h3>
<p>For those who appreciate a dose of theory with their morning coffee, my notes about measuring <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/entropy/Entropy.html">entropy of a byte stream</a> are on on <a href="http://tkhanson.net/misc/">Scripts &amp; Snippets</a>. Since I&#8217;m more interested in practical applications, here&#8217;s a <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/entropy/shlimit.c">program</a> that calculates the ultimate percentage to which an input file could be compressed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=116&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2011/10/09/data-streams-zeromq-entropy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>
	</item>
		<item>
		<title>UNIX domain sockets</title>
		<link>http://troydhanson.wordpress.com/2011/07/02/unix-domain-sockets/</link>
		<comments>http://troydhanson.wordpress.com/2011/07/02/unix-domain-sockets/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 00:35:55 +0000</pubDate>
		<dc:creator>troydhanson</dc:creator>
				<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://troydhanson.wordpress.com/?p=113</guid>
		<description><![CDATA[My notes about UNIX domain sockets are now on Scripts &#38; Snippets. Here&#8217;s the condensed version. Communication within a host UNIX domain sockets are a method by which processes on the same host can communicate. Communication is bidirectional with stream sockets and unidirectional with datagram sockets. Identity Instead of identifying a server by an IP [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=113&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div> <img src="http://troydhanson.files.wordpress.com/2011/07/snippets.png?w=420" style="border-width:0;" alt="scripts and snippets"> </div>
<p>My notes about <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/unixdomain/Unix_domain_sockets.html">UNIX domain sockets</a> are now on <a href="http://tkhanson.net/misc/">Scripts &amp; Snippets</a>. Here&#8217;s the condensed version.</p>
<hr />
<h2><a name="_communication_within_a_host"></a>Communication within a host</h2>
<p>UNIX domain sockets are a method by which processes on the same host can communicate. Communication is bidirectional with stream sockets and unidirectional with datagram sockets.</p>
<h3><a name="_identity"></a>Identity</h3>
<p>Instead of identifying a server by an IP address and port, a UNIX domain socket is known by a pathname. Obviously the client and server have to agree on the pathname for them to find each other. The server binds the pathname to the socket.</p>
<h3><a name="_file_permissions_control_who_can_connect"></a>File permissions control who can connect</h3>
<p>For UNIX domain sockets, file and directory permissions restrict which processes on the host can open the file, and thus communicate with the server.  Therefore, UNIX domain sockets provide an advantage over Internet sockets (to which anyone can connect, unless extra authentication logic is implemented).</p>
<h3><a name="_comparison_with_named_pipes_for_ipc"></a>Comparison with named pipes for IPC</h3>
<p>IPC within a UNIX host by may be accomplished by several other means including named pipes.  What circumstances favor UNIX domain sockets versus pipes? The choice is influenced by these factors:</p>
<dl>
<dt> Duplex </dt>
<dd> Stream sockets provide bi-directional communication while named pipes are uni-directional. </dd>
<dt> Distinct clients </dt>
<dd> Clients using sockets each have an independent connection to the server. With named pipes, many clients may write to the pipe, but the server cannot distinguish the clients from each other&#8211; the server has only one descriptor to read from the named pipe. Because the named pipe has only read descriptor and possibly-multiple writers, random interleaving can also occur if a client writes more than <tt>PIPE_BUF</tt> bytes in one operation. Since pipes have these limitations, UNIX domain sockets should be used if there are multiple clients that need to be distinguishable or which write long messages to the server. </dd>
<dt> Method of creating and opening </dt>
<dd> Sockets are created using <tt>socket</tt> and assigned their identity via <tt>bind</tt>. Named pipes are created using <tt>mkfifo</tt>. To connect to a UNIX domain socket the normal <tt>socket</tt>/<tt>connect</tt> calls are used, but a named pipe is written using regular file <tt>open</tt> and <tt>write</tt>. That makes them easier to use from a shell script for example. </dd>
</dl>
<h3><a name="_linux_abstract_socket_namespace"></a>Linux Abstract Socket Namespace</h3>
<p>Linux has a special feature: if the pathname for a UNIX domain socket begins with a null byte <em></em>, its name is not mapped into the filesystem. Thus it won&#8217;t collide with other names in the filesystem.  Also, when a server closes its UNIX domain listening socket in the abstract namespace, its file is deleted; with regular UNIX domain sockets, the file persists after the server closes it.</p>
<hr />
<h2><a name="_resources"></a>Resources</h2>
<p>Here are <a href="http://tkhanson.net/cgit.cgi/misc.git/tree/unixdomain/">some C programs</a> that implement a UNIX domain socket client and server. These are placed in the public domain.</p>
<ul>
<li> A <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/unixdomain/srv.c">server</a> example </li>
<li> A <a href="http://tkhanson.net/cgit.cgi/misc.git/plain/unixdomain/cli.c">client</a> example </li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/troydhanson.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/troydhanson.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=troydhanson.wordpress.com&#038;blog=6309572&#038;post=113&#038;subd=troydhanson&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://troydhanson.wordpress.com/2011/07/02/unix-domain-sockets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8520d3f7da902afea5eedab6d9bd6f67?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">troydhanson</media:title>
		</media:content>

		<media:content url="http://troydhanson.files.wordpress.com/2011/07/snippets.png" medium="image">
			<media:title type="html">scripts and snippets</media:title>
		</media:content>
	</item>
	</channel>
</rss>
