<?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>DJS Consulting Tech Blog &#187; Programming</title>
	<atom:link href="http://techblog.djs-consulting.com/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://techblog.djs-consulting.com</link>
	<description>Technical Information You Can Use</description>
	<lastBuildDate>Mon, 02 Jan 2012 18:44:33 +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>Database Abstraction v0.8</title>
		<link>http://techblog.djs-consulting.com/2011/database-abstraction-v0-8.html</link>
		<comments>http://techblog.djs-consulting.com/2011/database-abstraction-v0-8.html#comments</comments>
		<pubDate>Sun, 23 Oct 2011 03:00:48 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[C# / .NET]]></category>
		<category><![CDATA[Database Abstraction]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[ado.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[linq to sql]]></category>
		<category><![CDATA[nhibernate]]></category>

		<guid isPermaLink="false">http://techblog.djs-consulting.com/?p=262</guid>
		<description><![CDATA[When we began developing C# web applications, we found ourselves in the position of determining what the best way of accessing the database is. Â We evaluated several technologies&#8230; NHibernate &#8211; May be very good, but it was overkill for what &#8230; <a href="http://techblog.djs-consulting.com/2011/database-abstraction-v0-8.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When we began developing C# web applications, we found ourselves in the position of determining what the best way of accessing the database is. Â We evaluated several technologies&#8230;</p>
<ul>
<li><strong>NHibernate</strong> &#8211; May be very good, but it was overkill for what we were trying to do.</li>
<li><strong>LINQ to SQL</strong> &#8211; This brings C#&#8217;s LINQ (Language-Integrated Query) to SQL databases. Â You create database-aware classes and use LINQ to select from collections, which LINQ to SQL converts to database access. Â This is a good abstraction, but it relies on SQL Server; as we typically deploy to PostgreSQL, this didn&#8217;t work. Â (We also couldn&#8217;t get DBLinq, a database-agnostic implementation, to work.)</li>
<li><strong>ADO.NET</strong> &#8211; This is the tried-and-true database access methodology, released as part of the initial release of the .NET framework. Â The downside to this is that it encourages SQL in the code at the point of data retrieval; it does not provide a clean separation of data access from data processing.</li>
<li><strong>EF Code First</strong> &#8211; This didn&#8217;t exist; it&#8217;s also very SQL Server-centric. Â Not faulting Microsoft for that, especially since they release a free version now; but, as we deploy on Linux, until they release a Linux version, SQL Server is not an option.</li>
</ul>
<p>With our PHP applications, we had written a database service that read queries from XML files. Â Then, queries were accessed by name, with parameters passed via arrays. Â The one thing that ADO.NET has that was useful was the fact that it is based on interfaces. Â This means that if we wrote something that exposed, manipulated, and depended on IDataConnection (instead of SqlConnection, the SQL Server implementation of that interface), we could support any implementation of database. Â The SqlDataReader implements IDataReader as well. Â Our solution was becoming apparent.</p>
<p>Over time, we developed what is now the <a title="Database Abstraction â€¢ CodePlex" href="http://dbabstraction.codeplex.com">Database Abstraction</a> project hosted on CodePlex. Â On Thursday, we released the first public release (although the DLLs are in the repository, and are usually current at every commit). Â If you are looking for a way to separate your data access from the rest of your code, or want a solution that&#8217;s database-agnostic, check it out. Â It supports SQL Server, MySQL, PostgreSQL, SQLite, and ODBC connections *, using the data provider name to derive the proper connection to implement. Â There is also a Mock implementation to support unit tests; this mock can provide data, providing a useful way to test methods. Â Finally, there is a membership and role provider based on Database Abstraction; simply configure the connection string, create the database tables, and away you go! **</p>
<p>A pre-released version is already in production use in our <a title="PrayerTracker" href="http://prayer.djs-consulting.com">PrayerTracker</a> application, and others are being built around it. Â If this sounds like something that could help your project, certainly feel free to <a title="Database Abstaction v0.8 â€¢ Database Abstraction" href="http://dbabstraction.codeplex.com/releases/view/75241">check it out</a>!</p>
<p><small><em>* Oracle is omitted from this list, as their DLL had redistribution restrictions; this meant that the source code repository, upon check-out, would have build errors. Â There may be an Oracle implementation in the future (it would be trivial), but there is not one now.</em></small></p>
<p><small><em>** The membership and role providers are untested; they will be tested and tweaked by version 0.9.</em></small></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2011/database-abstraction-v0-8.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HCSB Verse of the Day (Plus) 3.0.1 &#8211; WordPress Plug-In</title>
		<link>http://techblog.djs-consulting.com/2011/hcsb-verse-of-the-day-plus-3-0-1-wordpress-plug-in.html</link>
		<comments>http://techblog.djs-consulting.com/2011/hcsb-verse-of-the-day-plus-3-0-1-wordpress-plug-in.html#comments</comments>
		<pubDate>Sun, 04 Sep 2011 04:30:09 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>
		<category><![CDATA[esv]]></category>
		<category><![CDATA[hcsb]]></category>
		<category><![CDATA[kjv]]></category>
		<category><![CDATA[niv]]></category>
		<category><![CDATA[nkjv]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://techblog.djs-consulting.com/?p=252</guid>
		<description><![CDATA[After a nearly four-year run at version 2, the HCSB Verse of the Day plug-in has been updated to version 3. Â The latest version available is 3.0.1, which contains a quick fix that was found just after I had released &#8230; <a href="http://techblog.djs-consulting.com/2011/hcsb-verse-of-the-day-plus-3-0-1-wordpress-plug-in.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a nearly four-year run at version 2, the HCSB Verse of the Day plug-in has been updated to version 3. Â The latest version available is 3.0.1, which contains a quick fix that was found just after I had released version 3. Â When you see that &#8220;.0.1,&#8221; just think, &#8220;Oh, this was written by a human!&#8221;</p>
<p>Major changes in this version include:</p>
<ul>
<li>The addition of &#8220;(Plus)&#8221; to the name, as this version supports five different translations &#8211; in addition to the Holman Christian Standard Bible (HCSB), it now supports the English Standard Version (ESV), the New King James Version (NKJV), the New International Version (NIV), and the King James Version (KJV).</li>
<li>A new settings page, where you can select the version.</li>
<li>A widget, that will drop right in any widget zone.</li>
<li>The replacement of several function calls that have been deprecated in the WordPress API over the past 3 years and 8 months.</li>
<li>Formal dropping of support for PHP 4, following WordPress&#8217;s lead in 3.2.</li>
</ul>
<p>While a lot of the code is different, if you only used the template tags, you should notice nothing different with this release. Â You can <a title="HCSB Verse of the Day (Plus) â€¢ WordPress Plug-In Directory" href="http://wordpress.org/extend/plugins/hcsb-verse-of-the-day/">download HCSB Verse of the Day (Plus) 3.0.1</a> at the WordPress Plug-In Directory, or upgrade on the WordPress Plug-In Administration Page in your blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2011/hcsb-verse-of-the-day-plus-3-0-1-wordpress-plug-in.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tech Blog 3.0 (aka &#8220;You win, PHP&#8230;&#8221;)</title>
		<link>http://techblog.djs-consulting.com/2011/tech-blog-3-0.html</link>
		<comments>http://techblog.djs-consulting.com/2011/tech-blog-3-0.html#comments</comments>
		<pubDate>Thu, 25 Aug 2011 04:12:44 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[General Info]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[blogengine]]></category>
		<category><![CDATA[mpm]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pre-fork]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[worker]]></category>

		<guid isPermaLink="false">http://techblog.djs-consulting.com/?p=249</guid>
		<description><![CDATA[After a little over a year running on Tech Blog 2.0, you are now viewing version 3.0. Â For this version, we&#8217;ve returned to WordPress from BlogEngine. Â There are several issues that colluded to drive this change, most of which surrounded &#8230; <a href="http://techblog.djs-consulting.com/2011/tech-blog-3-0.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a little over a year running on <a title="Tech Blog 2.0 â€¢ DJS Consulting Tech Blog" href="http://techblog.djs-consulting.com/2010/tech-blog-2-0.html">Tech Blog 2.0</a>, you are now viewing version 3.0. Â For this version, we&#8217;ve returned to <a title="WordPress" href="http://wordpress.org">WordPress</a> from <a title="BlogEngine.NET" href="http://dotnetblogengine.net">BlogEngine</a>. Â There are several issues that colluded to drive this change, most of which surrounded PHP and its crazy behavior. Â (Geeky details follow &#8211; skip to the paragraph starting with &#8220;Bottom line:&#8221; if you don&#8217;t want the geek stuff. Â I bolded it so it would be easy to spot.)</p>
<p>PHP&#8217;s recommended configuration is to run under Apache using the pre-fork multi-processing module (MPM). Â The advantage to this is that Apache does not have to spin off another process to handle each request; it handles it in the same thread. Â However, this means that each instance of the server must have all enabled modules loaded. Â This means that each instance of the server (AKA &#8220;thread&#8221;) is very large, so the number of threads run is lower (typically 5-15 in a server the size we&#8217;re on). Â Also, this means that each thread can only handle one request at a time; if you have 7 threads configured, each serving one of 7 requests, and an 8th request comes it, it has to wait for one to finish. Â If the requests are served quickly, this may not be a problem; however, the avalanche of request that follow the typical front-page mention on mega-blogs can easily overwhelm it.</p>
<p>To fix this problem, there is another MPM, this one called worker. Â In this scenario, there are spare thread waiting to fill requests, and these can spawn other threads to do further work if required. Â So, the Apache threads would realize that a request needs to be handled by PHP, and pass it off to that process to be completed. Â The Apache memory footprint is much smaller; it serves the images, scripts, and other static files, and passes off the requests that require heavy lifting. Â PHP, then, has a (FastCGI) process where it receives these requests, processes them, and returns the response to the caller. Â Because each of these threads only has to load the PHP requirements, they are smaller too, so you can have more threads processing at the same time; you just might survive that front-page mention! Â (This is the same technique applied by LightTPD and Nginx, two other servers I tried at various times.)</p>
<p>It is in this scenario where PHP fails to live up to its expectations. Â These PHP processes would simply stop responding, but the controller thinks they&#8217;re still there. Â The end result to the user is a site that just sits and waits for output that will never come. Â Eventually, they may receive a Gateway Timeout or Bad Gateway error. Â The problem is worse on slower sites, but even popular sites seemed to fall victim to this from time to time. Â This was also a problem whether PHP controlled its threads, or Apache controlled them.</p>
<p>The one thing that really perturbs me is instability. Â If something is broken, I can fix it; if it works, I can fix it &#8217;til it&#8217;s broke. Â <img src='http://techblog.djs-consulting.com/wp-includes/images/smilies/' alt='' class='wp-smiley' />  Â But something that works sometimes, and other times doesn&#8217;t, simply won&#8217;t fly. Â I was able to introduce some stability by restarting the server 4 times a day, but that&#8217;s a band-aid, not a long term solution. Â I was tired of fighting.</p>
<p><strong>Bottom line</strong>: the configuration required for a stable server is in opposition to a lean-and-mean configuration. Â So, I installed the required Apache modules, and will continue to run my PHP-serving server at a configuration twice as large as it needs to be. Â I&#8217;ll eventually move the Mono (.NET) processes to another machine, where the fast configuration won&#8217;t stability problems.</p>
<p>But, PHP isn&#8217;t all. Â While I would still heartily recommend BlogEngine.NET to someone who was going to serve the blog from a Windows machine, but I had some issues getting upgrades to go smoothly under Mono. Â It also is optimized for fast serving, at the expense of RAM. Â At this point, that&#8217;s not the tradeoff we need.</p>
<p>Finally, with this update, the blog has received its first new theme. Â It&#8217;s a clean, clear theme that should serve the content well. Â Plus, the social media icons up in the corner are just too cool, IMO. Â I&#8217;ve also applied tags to all posts except the &#8220;My Linux Adventure&#8221; series, and this theme displays them. Â (Comments are not here now, but will be migrated shortly.)</p>
<p>So, there you have it. Â Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2011/tech-blog-3-0.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>40/40 Web Service</title>
		<link>http://techblog.djs-consulting.com/2010/4040-web-service.html</link>
		<comments>http://techblog.djs-consulting.com/2010/4040-web-service.html#comments</comments>
		<pubDate>Mon, 20 Sep 2010 01:55:34 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[erlc]]></category>
		<category><![CDATA[prayer]]></category>
		<category><![CDATA[sbc]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=198</guid>
		<description><![CDATA[The Ethics and Religious Liberty Commission of the Southern Baptist Convention is holding a &#8220;40/40 Prayer Vigil,&#8221; encouraging prayer through the end of October. Â While some of the prayer is focused on the upcoming elections, the focus is on national &#8230; <a href="http://techblog.djs-consulting.com/2010/4040-web-service.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <a title="The Ethics and Religious Liberty Commission of the Southern Baptist Convention" href="http://erlc.com">Ethics and Religious Liberty Commission</a> of the <a title="Southern Baptist Convention" href="http://www.sbc.net">Southern Baptist Convention</a> is holding a &#8220;<a title="40/40 Prayer Vigil" href="http://www.4040prayer.com">40/40 Prayer Vigil</a>,&#8221; encouraging prayer through the end of October. Â While some of the prayer is focused on the upcoming elections, the focus is on national revival. Â They have produced a prayer guide, which details suggestions for prayer over the course of 40 days, beginning September 20th, and for 40 hours, beginning October 29th at 4pm.</p>
<p>We have created a web service to break this guide up into day and hour-sized chunks. Â The service is at <a title="40/40 Prayer Vigil â€¢ DJS Consulting Web Services" href="http://services.djs-consulting.com/FortyForty.asmx">http://services.djs-consulting.com/FortyForty.asmx</a>. Â There are several ways to retrieve this information.</p>
<ul>
<li><strong>GetDay</strong><br />
This gets one of the 40 days, by the day number. Â (September 20th is 1, September 21st is 2, etc.) Â The &#8220;day&#8221; parameter controls which day is returned.</li>
<li><strong>GetHour</strong><br />
This gets one of the 40 hours, by the hour number (10/29 4pm is 1, 10/29 5pm is 2, etc.) Â The &#8220;hour&#8221; parameter controls which hour is returned.</li>
<li><strong>GetDate</strong><br />
This gets one of the 40 days, by the current date. Â The &#8220;date&#8221; parameter controls which day is returned. Â (The time portion may be given, but it is ignored.)</li>
<li><strong>GetTime</strong><br />
This gets one of the 40 hours, by the date/time. Â The &#8220;time&#8221; parameter controls which hour is returned.</li>
<li><strong>GetDayHTML</strong>, <strong>GetHourHTML</strong>, <strong>GetDateHTML</strong>, and <strong>GetTimeHTML</strong><br />
This is the same as the above 4 calls, except what is returned is a formatted block of text that can be displayed on a web page.</li>
</ul>
<p>In all cases, if the day/hour/date/time does not match a valid value for the vigil, a null is returned.</p>
<p>If you&#8217;re not interested in consuming the web service, but you&#8217;d like to see the suggested prayer each day, the <a title="Hoffmantown Prayer â€¢ Virtual Prayer Room" href="http://hoffmantownprayer.org">Hoffmantown Prayer</a> site is displaying the days and hours on Mountain Time. Â This information is on the front page with no login required.</p>
<p>This web service will be discontinued at some point after December 31, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2010/4040-web-service.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mono / FastCGI Startup Script</title>
		<link>http://techblog.djs-consulting.com/2010/mono-fastcgi-startup-script.html</link>
		<comments>http://techblog.djs-consulting.com/2010/mono-fastcgi-startup-script.html#comments</comments>
		<pubDate>Sat, 04 Sep 2010 01:28:15 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[C# / .NET]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[badgerports]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=196</guid>
		<description><![CDATA[We&#8217;ve begun running Mono on some DJS Consulting servers to enable us to support the .NET environment, in addition to the PHP environment most of our other applications use. Â While Ubuntu has nice packages (and Badgerports even brings them up &#8230; <a href="http://techblog.djs-consulting.com/2010/mono-fastcgi-startup-script.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve begun running Mono on some DJS Consulting servers to enable us to support the .NET environment, in addition to the PHP environment most of our other applications use. Â While Ubuntu has nice packages (and <a title="Badgerports" href="http://badgerports.org/">Badgerports</a> even brings them up to the latest release), one thing that we were missing was a &#8220;conf.d&#8221;-type of configuration; my &#8220;/applications=&#8221; clause of the command was getting really, really long. Â We decided to see if we could create something similar to Apache / Nginx&#8217;s sites-available/sites-enabled paradigm, and we have succeeded!</p>
<p>To begin, you&#8217;ll need to create the directories /etc/mono/fcgi/apps-available and /etc/mono/fcgi/apps-enabled. Â These directories will hold files that will be used define applications. Â The intent of these directories is to put the actual files in apps-available, then symlink the ones that are enabled from apps-enabled. Â These files have no name restrictions, but do not put an extra newline character in them. Â The script will concatenate the contents of that file to create the <a title="FastCGI â€¢ Mono Project" href="http://www.mono-project.com/FastCGI">MONO_FCGI_APPLICATIONS environment variable</a>, which tells the server what applications exist. Â (The syntax is the same as that for the &#8220;/applications=&#8221; clause &#8211; [domain]:[URL path]:[filesystem path].) Â Here&#8217;s how the site you&#8217;re reading now is configured (from the file djs-consulting.com.techblog.conf)&#8230;</p>
<pre>techblog.djs-consulting.com:/:/path/to/install/base/for/this/site</pre>
<p>Finally, what brings it all together is a shell script. Â This should be named &#8220;monoserve&#8221; and placed in /etc/init.d. Â (This borrows heavily from <a title="Linux startup script for mono FastCGI server â€¢ Keep Coding" href="http://tomi.developmententity.sk/Blog/Post/2">this script</a>, which we used until we wrote this one.) Â Note the group of variables surrounded by the &#8220;make changes here&#8221; notes &#8211; these are the values that are used in starting the server. Â They are at the top so that you can easily modify this for your own needs.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### BEGIN INIT INFO</span>
<span style="color: #666666; font-style: italic;"># Provides:          monoserve.sh</span>
<span style="color: #666666; font-style: italic;"># Required-Start:    $local_fs $syslog $remote_fs</span>
<span style="color: #666666; font-style: italic;"># Required-Stop:     $local_fs $syslog $remote_fs</span>
<span style="color: #666666; font-style: italic;"># Default-Start:     2 3 4 5</span>
<span style="color: #666666; font-style: italic;"># Default-Stop:      0 1 6</span>
<span style="color: #666666; font-style: italic;"># Short-Description: Start FastCGI Mono server with hosts</span>
<span style="color: #666666; font-style: italic;">### END INIT INFO</span>
&nbsp;
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #007800;">DAEMON</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mono
<span style="color: #007800;">NAME</span>=monoserver
<span style="color: #007800;">DESC</span>=monoserver
&nbsp;
<span style="color: #666666; font-style: italic;">## Begin -- MAKE CHANGES HERE --</span>
<span style="color: #007800;">PROGRAM</span>=fastcgi-mono-server2 <span style="color: #666666; font-style: italic;"># The program which will be started</span>
<span style="color: #007800;">ADDRESS</span>=127.0.0.1            <span style="color: #666666; font-style: italic;"># The address on which the server will listen</span>
<span style="color: #007800;">PORT</span>=<span style="color: #000000;">9001</span>                    <span style="color: #666666; font-style: italic;"># The port on which the server will listen</span>
<span style="color: #007800;">USER</span>=www-data                <span style="color: #666666; font-style: italic;"># The user under which the process will run</span>
<span style="color: #007800;">GROUP</span>=<span style="color: #007800;">$USER</span>                  <span style="color: #666666; font-style: italic;"># The group under which the process will run</span>
<span style="color: #666666; font-style: italic;">## End   -- MAKE CHANGES HERE --</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Determine the environment</span>
<span style="color: #007800;">MONOSERVER</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #007800;">$PROGRAM</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">MONOSERVER_PID</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">FCGI_CONFIG_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mono<span style="color: #000000; font-weight: bold;">/</span>fcgi<span style="color: #000000; font-weight: bold;">/</span>apps-enabled
&nbsp;
<span style="color: #666666; font-style: italic;"># Start up the Mono server</span>
start_up<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    get_pid
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MONOSERVER_PID</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Configured Applications&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-----------------------&quot;</span>
        <span style="color: #666666; font-style: italic;"># Construct the application list if the configuration directory exists</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$FCGI_CONFIG_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #007800;">MONO_FCGI_APPLICATIONS</span>=<span style="color: #ff0000;">&quot;&quot;</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #007800;">$FCGI_CONFIG_DIR</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MONO_FCGI_APPLICATIONS</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                    <span style="color: #007800;">MONO_FCGI_APPLICATIONS</span>=<span style="color: #007800;">$MONO_FCGI_APPLICATIONS</span>,
                <span style="color: #000000; font-weight: bold;">fi</span>
                <span style="color: #007800;">MONO_FCGI_APPLICATIONS</span>=<span style="color: #007800;">$MONO_FCGI_APPLICATIONS</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$FCGI_CONFIG_DIR</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$file</span><span style="color: #000000; font-weight: bold;">`</span>
            <span style="color: #000000; font-weight: bold;">done</span>
            <span style="color: #7a0874; font-weight: bold;">export</span> MONO_FCGI_APPLICATIONS
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #800000;">${MONO_FCGI_APPLICATIONS//,/&quot;\n&quot;}</span>
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;None (config directory <span style="color: #007800;">$FCGI_CONFIG_DIR</span> not found)&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Start the server</span>
        start-stop-daemon <span style="color: #660033;">-S</span> <span style="color: #660033;">-c</span> <span style="color: #007800;">$USER</span>:<span style="color: #007800;">$GROUP</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$MONOSERVER</span> <span style="color: #660033;">--</span> <span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">socket</span>=tcp:<span style="color: #007800;">$ADDRESS</span>:<span style="color: #007800;">$PORT</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mono FastCGI Server <span style="color: #007800;">$PROGRAM</span> started as <span style="color: #007800;">$USER</span> on <span style="color: #007800;">$ADDRESS</span>:<span style="color: #007800;">$PORT</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mono FastCGI Server is already running - PID <span style="color: #007800;">$MONOSERVER_PID</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Shut down the Mono server</span>
shut_down<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    get_pid
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MONOSERVER_PID</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #007800;">$MONOSERVER_PID</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mono FastCGI Server stopped&quot;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mono FastCGI Server is not running&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Refresh the PID</span>
get_pid<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">MONOSERVER_PID</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ps</span> auxf <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #007800;">$PROGRAM</span>.exe <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        start_up
    <span style="color: #000000; font-weight: bold;">;;</span>
    stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        shut_down
    <span style="color: #000000; font-weight: bold;">;;</span>
    restart<span style="color: #000000; font-weight: bold;">|</span>force-reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        shut_down
        start_up
    <span style="color: #000000; font-weight: bold;">;;</span>
    status<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        get_pid
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MONOSERVER_PID</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mono FastCGI Server is not running&quot;</span>
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mono FastCGI Server is running - PID <span style="color: #007800;">$MONOSERVER_PID</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: monoserve (start|stop|restart|force-reload|status)&quot;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>This needs to be owned by root and be executable (&#8220;chmod +x monoserve&#8221;). Â You can use &#8220;update-rc.d monoserve defaults&#8221; to set this to start at boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2010/mono-fastcgi-startup-script.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tech Blog 2.0</title>
		<link>http://techblog.djs-consulting.com/2010/tech-blog-2-0.html</link>
		<comments>http://techblog.djs-consulting.com/2010/tech-blog-2-0.html#comments</comments>
		<pubDate>Fri, 06 Aug 2010 01:09:54 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[C# / .NET]]></category>
		<category><![CDATA[General Info]]></category>
		<category><![CDATA[blogengine]]></category>
		<category><![CDATA[dot net]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=188</guid>
		<description><![CDATA[After three years on WordPress, the DJS Consulting Tech Blog has moved to BlogEngine.NET. Â There are several reasons for this change, some technical and some not. PHP&#8217;s Fast CGI processor has a problem where, if all of the processes are &#8230; <a href="http://techblog.djs-consulting.com/2010/tech-blog-2-0.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After three years on <a title="WordPress" href="http://wordpress.org">WordPress</a>, the DJS Consulting Tech Blog has moved to <a title="BlogEngine.NET" href="http://dotnetblogengine.net">BlogEngine.NET</a>. Â There are several reasons for this change, some technical and some not.</p>
<ul>
<li>PHP&#8217;s Fast CGI processor has a problem where, if all of the processes are busy, the server will simply time out. Â While this hasn&#8217;t afflicted my server as much as others, it has caused problems; when this problem occurred, none of the PHP sites were accessible.</li>
<li>Through experience with a very heavily-used site, I became less enamored of WordPress&#8217;s &#8220;read from the database every time&#8221; way of doing business. Â I also found that various caching plug-ins for WordPress, on this particular site, did very little to ease the load.</li>
<li>Since I first looked at Mono (Linux&#8217;s implementation of the .NET framework), it has matured significantly. Â It supports most of C# 4.0 already, which was released earlier this year.</li>
<li>BlogEngine.NET is a rapidly-maturing blog platform, and the project has a stated goal of 100% compatibility with Mono. Â This is good, because you can mention Mono problems to the team, and you&#8217;re not dismissed because you&#8217;re running Linux.</li>
</ul>
<p>As part of the move, the URL has changed; the new link is <a title="DJS Consulting Tech Blog" href="http://techblog.djs-consulting.com">http://techblog.djs-consulting.com</a>Â . Â I have implemented redirection for each post, the category and category feed links, and the main blog feed and home page from the old URL, so you may not have even realized that you&#8217;re looking at the new site. Â The DJS Consulting Software Repository remains at <a title="DJS Consulting Software Repository" href="http://djs-consulting.com/linux/software">http://djs-consulting.com/linux/software</a>.</p>
<p>I&#8217;m looking forward to this new setup!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2010/tech-blog-2-0.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle SQL Developer Debian Package</title>
		<link>http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html</link>
		<comments>http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html#comments</comments>
		<pubDate>Wed, 29 Oct 2008 13:17:14 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[alien]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[sql developer]]></category>

		<guid isPermaLink="false">http://techblog.johnson/?p=167</guid>
		<description><![CDATA[Oracle SQL Developer is a Java-based tool that provides a graphical interface to a database. While it&#8217;s main focus is Oracle (of course), it can be hooked up, via JDBC, to many other databases, such as MySQL, PostgreSQL, and SQL &#8230; <a href="http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Oracle SQL Developer â€¢ Oracle" href="http://www.oracle.com/technology/products/database/sql_developer/index.html">Oracle SQL Developer</a> is a Java-based tool that provides a graphical interface to a database. While it&#8217;s main focus is Oracle (of course), it can be hooked up, via JDBC, to many other databases, such as MySQL, PostgreSQL, and SQL Server. It&#8217;s similar to <a href="http://www.toadsoft.com/">Toad</a>, but is provided by Oracle at no cost.</p>
<p>Oracle provides SQL Developer in either an RPM, or a generic binary install. I like the ability to manage packages, but I&#8217;ve never had much luck at getting RPM to run on Ubuntu. I downloaded the RPM file, and, using <a href="http://kitenet.net/~joey/code/alien/">alien</a>, I converted the package to a .deb package (Debian package format) and installed it. It worked like a charm!</p>
<p>I haven&#8217;t tested it with gcj, but using Sun&#8217;s Java 6 update 7 from the Ubuntu repositories, it ran just fine. After you install the package, do a directory list on /usr/lib/jvm. You&#8217;re looking for the Sun JDK &#8211; if it&#8217;s installed, you&#8217;ll have a symlink java-6-sun that points to java-6-sun-1.6.0.07. Once you&#8217;ve determined the location of the JDK, run &#8220;sqldeveloper&#8221; from the command line &#8211; the program will prompt you for the path to your JDK. Enter it (probably &#8220;/usr/lib/jvm/java-6-sun&#8221;) and you&#8217;re good to go. (You have to install the package as root &#8211; but, for the rest of these steps, use your normal user, not root, as this puts settings in a .sqldeveloper directory off your home directory.) The package installs an icon in the &#8220;Programming&#8221; or &#8220;Development&#8221; group. Once you&#8217;ve told it where the JDK is, you can use this to launch it.</p>
<p><a title="SQL Developer 1.5.1 Debian Package â€¢ DJS Consulting Linux Software Repository" href="http://djs-consulting.com/linux/software/sqldeveloper/sqldeveloper_1.5.54.40-2_all.deb">Download SQL Developer 1.5.1 Debian Package</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.djs-consulting.com/2008/oracle-sql-developer-debian-package.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

