<?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>CornEmpire Software &#187; Linux</title>
	<atom:link href="http://cornempire.net/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://cornempire.net</link>
	<description>Tidbits about programming, web development, gaming and other random stuff.</description>
	<lastBuildDate>Sat, 31 Mar 2012 11:43:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Part 2: OAuth2 and Configuring Your ‘Application’ With Google</title>
		<link>http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/</link>
		<comments>http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 19:58:38 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=322</guid>
		<description><![CDATA[This is the second part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users. The Series: Part 1: Setting up Google Calendar Part 2: OAuth2 and Configuring Your ‘Application’ With Google &#60;- You Are Here Part 3: <a href='http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This is the second part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users.</p>
<p>The Series:</p>
<ol>
<li><a href="http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/">Part 1: Setting up Google Calendar</a></li>
<li>Part 2: OAuth2 and Configuring Your ‘Application’ With Google &lt;- You Are Here</li>
<li><a href="http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/">Part 3: A Sample Web Page For Bookings</a></li>
</ol>
<h2>Background</h2>
<p>This was by far the hardest part of the whole exercise. I had worked with version 1 of the Google API for PHP a few years back. This allowed you to code your username and password into your script, and it would handle authentication for your application. Now that we are on to version 3 of the API, that method is no longer available. Instead OAuth2 is used for authentication and token management.</p>
<p>I downloaded code samples, and went about building my application, however, I quickly realized that the OAuth2 code samples are designed to allow you to interact with a visitors calendar. In the case of taking online bookings, I need to work with a single calendar, namely my calendar, not theirs.</p>
<p>After a lot of trial and error, and then reading, I realized that it could be done, and relied on what is called a &#8216;Refresh Token&#8217; in OAuth2. This token allows you to get a new valid authentication token when the initial grant from your end user expires. Since the refresh token doesn&#8217;t expire, you can always use it to get a new authentication token, and therefore people can continue to use your application after you have initially configured it. I spent a while trying to implement it myself with no success, but then I came across this page: <a title="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" href="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" target="_blank">http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html</a> This explains in some detail how to configure the application and token. It is written for the Google Affiliate Network API, but I made a few tweaks to make it work for Calendar. I will now take you through the steps of setting up your application with Google, and generating your Refresh Token.</p>
<h2>Create Your Application</h2>
<p>Log into your Google Account, and then visit <a title="https://code.google.com/apis/console/" href="https://code.google.com/apis/console/" target="_blank">https://code.google.com/apis/console/</a>. This will take you to a page that invites you to create a project with the Google API. Click on <strong>Create project&#8230;</strong>.</p>
<p>You are now asked to activate the services you wish to use. Click the button next to <strong>Calendar API</strong> to enable the calendar. You will be redirected to a page with a Terms of Service. Read and accept this.</p>
<p>Now click on <strong>API Access</strong>. Here we will configure the IDs needed for your application to authenticate with Google. Click on <strong>Create an OAuth2 client ID&#8230;</strong>. You will be offered to create Branding Information. You should add your project/product name. The rest won&#8217;t be necessary as you will not be asking users directly for access to their resources, but you can complete it if you like.</p>
<p><a href="http://cornempire.net/files/2012/01/oauth1.png"><img src="http://cornempire.net/files/2012/01/oauth1.png" alt="" width="755" height="551" class="aligncenter size-full wp-image-344" /></a></p>
<p>Then click <strong>Next</strong>. Here you will want to select <strong>Installed application</strong>. Click <strong>Create client ID</strong>.</p>
<p><a href="http://cornempire.net/files/2012/01/oauth2.png"><img src="http://cornempire.net/files/2012/01/oauth2.png" alt="" width="561" height="300" class="aligncenter size-full wp-image-345" /></a></p>
<p>You will be taken back to the API Access screen, with your new Client ID and Client secret. You will need this information to generate your Refresh Token, and to configure your application. </p>
<p><a href="http://cornempire.net/files/2012/01/oauth3.png"><img src="http://cornempire.net/files/2012/01/oauth3.png" alt="" width="560" height="280" class="aligncenter size-full wp-image-346" /></a></p>
<p>This page will also have your API key for &#8216;Simple API Access&#8217;. You will also need this API Key for your final calendar application.</p>
<p><a href="http://cornempire.net/files/2012/01/api1.png"><img src="http://cornempire.net/files/2012/01/api1.png" alt="" width="538" height="215" class="aligncenter size-full wp-image-342" /></a> </p>
<h2>Get Your Application Information</h2>
<p>Now that you have your application information, it is time to generate your refresh token. I&#8217;ve modified the script available from <a title="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" href="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" target="_blank">http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html</a> to just get us our refresh token for our calendar application. Here is the code for the script.  Download this and save it as <em>oauth-setup.php</em>:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$cScope         =   'https://www.googleapis.com/auth/calendar';
$cClientID      =   '';
$cClientSecret  =   '';
$cRedirectURI   =   'urn:ietf:wg:oauth:2.0:oob';

$cAuthCode      =   '';

if (empty($cAuthCode)) {
    $rsParams = array(
                        'response_type' =&gt;   'code',
                        'client_id'     =&gt;   $cClientID,
                        'redirect_uri'  =&gt;   $cRedirectURI,
                        'scope'         =&gt;   $cScope
                        );
    $cOauthURL = 'https://accounts.google.com/o/oauth2/auth?' . http_build_query($rsParams);
    echo(&quot;Go to\n$cOauthURL\nand enter the given value into this script under \$cAuthCode\n&quot;);
    exit();
} // ends if (empty($cAuthCode))
elseif (empty($cRefreshToken)) {
    $cTokenURL = 'https://accounts.google.com/o/oauth2/token';
    $rsPostData = array(
                        'code'          =&gt;   $cAuthCode,
                        'client_id'     =&gt;   $cClientID,
                        'client_secret' =&gt;   $cClientSecret,
                        'redirect_uri'  =&gt;   $cRedirectURI,
                        'grant_type'    =&gt;   'authorization_code',
                        );
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $cTokenURL);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $rsPostData);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $cTokenReturn = curl_exec($ch);
    $oToken = json_decode($cTokenReturn);
    echo(&quot;Here is your Refresh Token for your application.  Do not loose this!\n\n&quot;);
    echo(&quot;Refresh Token = '&quot; . $oToken-&gt;refresh_token . &quot;';\n&quot;);
} // ends
?&gt;
</pre>
<p>Before running this script, you will need to enter your Client ID ($cClientID) and Client Secret ($cClientSecret) as we found on the API page with Google.  Once these values are added, run this script from the command line like this: <strong>php oauth-setup.php</strong>.  You should see output like this:</p>
<pre>
thomas@thomas-desktop:~/code$ php oauth-setup.php
Go to

https://accounts.google.com/o/oauth2/auth?response_type=code&#038;client_id=##########################&#038;redirect_uri=###############&#038;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar

and enter the given value into this script under $cAuthCode
</pre>
<p>Visit the website, grant permission to access your resources, and then copy the code on this page.  This is your auth code, and is normally good for 3600 seconds or so.  </p>
<p><a href="http://cornempire.net/files/2012/01/authcode.png"><img src="http://cornempire.net/files/2012/01/authcode.png" alt="" width="400" height="57" class="aligncenter size-full wp-image-343" /></a></p>
<p>Enter this code into the oauth-setup.php script in the $cAuthCode variable.  Then run the script again: <strong>php oauth-setup.php</strong>.  You should see output like this:</p>
<pre>
thomas@thomas-desktop:~/code$ php oauth-setup.php
Here is your Refresh Token for your application.  Do not loose this!

Refresh Token = '#####################################';
</pre>
<p>Now, copy down the Refresh Token and save it for later.  You will need it to make subsequent requests to Google to get a valid Auth Code for a transaction.</p>
<p>Stay tuned for Part 3 of the tutorial, which will use the above information to make calendar requests to Google.  And allow us to create a web application that uses Google Calendar as a backend for a scheduling application.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Diff in Filezilla</title>
		<link>http://cornempire.net/2011/08/09/diff-in-filezilla/</link>
		<comments>http://cornempire.net/2011/08/09/diff-in-filezilla/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 14:13:15 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[filezilla]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=296</guid>
		<description><![CDATA[Filezilla is a great ftp/sftp/&#8230; tool. But it is missing one feature that would make it more useful: a file diff ability. This allows you to see the remote file, and local file side by side to see what is different between them. This is an often requested feature in the Filezilla forums, and until <a href='http://cornempire.net/2011/08/09/diff-in-filezilla/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Filezilla is a great ftp/sftp/&#8230; tool.  But it is missing one feature that would make it more useful: a file diff ability.  This allows you to see the remote file, and local file side by side to see what is different between them.  This is an often requested feature in the Filezilla forums, and until it is implemented officially, you can use this workaround to get diffs in Filezilla.</p>
<p>This was done running Filezilla 3.3.1 on Ubuntu 10.04.</p>
<ol>
<li>First, install Meld (haven&#8217;t tried it with any other diff viewer yet)</li>
<li>Then go to Edit -&gt; Settings -&gt; File editing</li>
<li>Change to &#8216;Use custom editor:&#8217; and enter: /usr/bin/meld /home/{yourusername}/filezillafake.txt</li>
<li>Click OK.</li>
<li>Create a file in your home directory called filezillafake.txt</li>
<li>You may need to also select &#8220;Always use default editor&#8221;.  Optionally, you can go one menu below to &#8220;Filetype associations&#8221; and add the command for any file types that you want so it isn&#8217;t available for all.</li>
</ol>
<p>Now, when you View/Edit a file, it will open in meld with your fake file on the left, and the remote file on the right. Then <strong>drag the file from your filezilla window into the &#8216;Browse&#8217; area</strong> for the fake file in the Meld Window. It will load up and show you the diff.</p>
<p>You should be able to edit the file here and save it and Filezilla should prompt for an upload.</p>
<p>This works because Meld supports drag and drop, and also inserting two file names at the command prompt. Any application for any platform that does that should be supported by this method. The only downside is that Meld is now your default editor for files, and you may not like that if you do a lot of remote editing.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/08/09/diff-in-filezilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bandwidth Checker Perl Script</title>
		<link>http://cornempire.net/2011/01/27/bandwidth-checker-perl-script/</link>
		<comments>http://cornempire.net/2011/01/27/bandwidth-checker-perl-script/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 17:42:32 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=284</guid>
		<description><![CDATA[Recently, I needed the ability to get a readout of the average bandwidth used on the server at one time. As many of you probably know, bandwidth is tough to measure for an instant. I could not find a tool or command that would allow me to get the data I wanted. So I decided <a href='http://cornempire.net/2011/01/27/bandwidth-checker-perl-script/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed the ability to get a readout of the average bandwidth used on the server at one time.  As many of you probably know, bandwidth is tough to measure for an instant.  I could not find a tool or command that would allow me to get the data I wanted.  So I decided to write one.</p>
<p>I write a perl script that uses the output from one invocation of ifconfig with a later invocation.  The results are compared, and the total transferred, along with the average bps is extracted and printed.</p>
<p>Here is an example of printout:</p>
<p><code><br />
thomas@thomas-desktop:~$ perl bandwidth-checker.pl -p -i=eth0 -t=5<br />
Monitored traffic on interface eth0 for 5 seconds:<br />
Incoming: 17.7109375 kbit (2.2138671875 KB) Average: 3.5421875 kbps (0.4427734375 KBps)<br />
Outgoing: 2.109375 kbit (0.263671875 KB) Average: 0.421875 kbps (0.052734375 KBps)<br />
</code></p>
<p>I wrote a little page on the script, and have the source there as well.  Hopefully it will help someone else out there: <a href="http://wiki.cornempire.net/scripts/bandwidth">http://wiki.cornempire.net/scripts/bandwidth</a></p>
<p>If you have any use for it, on find any problems with the script, please comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/01/27/bandwidth-checker-perl-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Knowledgetree, Ubuntu and Hash Sum mismatch</title>
		<link>http://cornempire.net/2010/12/04/knowledgetree-ubuntu-and-hash-sum-mismatch/</link>
		<comments>http://cornempire.net/2010/12/04/knowledgetree-ubuntu-and-hash-sum-mismatch/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 01:48:04 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Repair]]></category>
		<category><![CDATA[10.04.01]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[hash sum mismatch]]></category>
		<category><![CDATA[knowledge tree]]></category>
		<category><![CDATA[knowledgetree]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend server]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=275</guid>
		<description><![CDATA[I was trying to use the Knowledgetree automated installer on a fresh install of Ubuntu 10.04.01 64-bit server. While trying to install, I received an error about swftools, which I was able to install thanks to the directions here (in post 2): http://forums.knowledgetree.org/viewtopic.php?f=6&#38;t=20633 However, I then received an error that read: Failed to fetch http://repos.zend.com/zend-server/deb/dists/server/non-free/binary-amd64/Packages.bz2 <a href='http://cornempire.net/2010/12/04/knowledgetree-ubuntu-and-hash-sum-mismatch/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I was trying to use the Knowledgetree automated installer on a fresh install of Ubuntu 10.04.01 64-bit server.  While trying to install, I received an error about swftools, which I was able to install thanks to the directions here (in post 2):<br />
<a href="http://forums.knowledgetree.org/viewtopic.php?f=6&amp;t=20633" target="_blank">http://forums.knowledgetree.org/viewtopic.php?f=6&amp;t=20633</a></p>
<p>However, I then received an error that read:<br />
<code>Failed to fetch http://repos.zend.com/zend-server/deb/dists/server/non-free/binary-amd64/Packages.bz2  Hash Sum mismatch</code><br />
Followed by a few zend packages that couldn&#8217;t be installed.</p>
<p>After much purging and googling, I found that this worked well:</p>
<ol>
<li>Go to <strong>/var/lib/apt/lists/partial/</strong> and delete the files that failed to download. (If you are curious, I looked at the file that was supposed to be correct in the partial directory, and noticed it was encoded still.  I suspect an incorrectly expanded archive file that was causing the problem.  Some people reported that simply deleting these files fixed the problem, but it did not help for me.)</li>
<li>Using the root URL of the repo that had the hash problem&#8230;.go to the site.  So for me it is <a href="http://repos.zend.com/zend-server/deb/dists/server/non-free/binary-amd64/">http://repos.zend.com/zend-server/deb/dists/server/non-free/binary-amd64/</a></li>
<ul>
<li>Here I noticed that there were a number of files that had the packages.  The file it failed on was the bz2 file, however, there is a plain text one available called <strong>Packages</strong></li>
<li>I clicked on <strong>Packages</strong> and copied all of the text.</li>
<li>On the server, I created a new file in the <strong>/var/lib/apt/lists/</strong> directory with the same name of the file that failed/was encoded in the partial directory (<em>sudo vim repos.zend.com_zend-server_deb_dists_server_non-free_binary-amd64_Packages</em>) and pasted all of the text in there.</li>
</ul>
<li>Then I ran <strong>apt-get update</strong> and it ran without errors.</li>
<li>Finally, I ran the Knowledgetree install again, and it downloaded all of the required packages fine.</li>
</ol>
<p>I imagine this would work on any repo that is having a similar problem with <strong>Hash Sum mismatch</strong>, but of course the URL you will visit, and the file name you will use will be different.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2010/12/04/knowledgetree-ubuntu-and-hash-sum-mismatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Long Time No Post (Various Software and Plans)</title>
		<link>http://cornempire.net/2010/10/31/long-time-no-post-various-software-and-plans/</link>
		<comments>http://cornempire.net/2010/10/31/long-time-no-post-various-software-and-plans/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 20:17:14 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=256</guid>
		<description><![CDATA[Hello Folks, Long time and no posting. I&#8217;ve been quite busy. So here are some updates: Updates MCPM I&#8217;m currently completing a Masters Certificate in Project Management. It is a four month course that prepares you to be a professional project manager. It has been an interesting experience. The skills I&#8217;ve learned so far have <a href='http://cornempire.net/2010/10/31/long-time-no-post-various-software-and-plans/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Hello Folks,<br />
Long time and no posting.  I&#8217;ve been quite busy.  So here are some updates:</p>
<h1>Updates</h1>
<h2>MCPM</h2>
<p>I&#8217;m currently completing a Masters Certificate in Project Management.  It is a four month course that prepares you to be a professional project manager.  It has been an interesting experience.  The skills I&#8217;ve learned so far have already been put to good use both at work, and with my business on the side.</p>
<h2>Project Work</h2>
<p>My company has been awarded a contract to develop a Document Management System, as well as install servers and software to support this system.  Work will be starting next week, and I will have very little free time to work on anything else during this. <img src='http://cornempire.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   But, it will be a great experience and our first big project!</p>
<h2>Server Hosting</h2>
<p>In the last month or so, the company I had a VPS with <a href="http://www.webserve.ca" target="_blank">http://www.webserve.ca</a> (<a href="http://www.bbb.org/mbc/business-reviews/internet-web-hosting/webserve-communications-in-north-vancouver-bc-1142872" target="_blank">BBB Rating: C &#8211; 121 Complaints</a>) was constantly attacked and hacked by outsiders.  No matter what lengths I go to, somehow, someone was on the server sending mail and doing bad things.  It seems that the company does very little intrusion detection, and the way in which the server was compromised, I suspect that the virtual hosts were actually the source.  After 12 hour downtime with no answer from their 24/7 support, I decided to return to my former web host (<a href="http://www.canadianwebhosting.com" target="_blank">http://www.canadianwebhosting.com</a> <a href="http://www.bbb.org/mbc/business-reviews/internet-web-hosting/canadian-web-hosting-in-richmond-bc-217425" target="_blank">BBB Rating: A+ &#8211; 0 complaints</a>).  Although more expensive, their support has been fantastic, and quality/value of service is good.</p>
<h2>Software Plans</h2>
<p>That last piece is a great segue into my software plan section.  During my migration, I had to move my database (obviously).  That experience has pushed me to develop a script that dumps commands to recreate all of your users and all of your grants in the event that you have to migrate your mysql database.  By running this script, you will get all of the code you need to recreate all of your users and grants.  Coupled with a mysql dump, you should be able to quickly copy an entire database!  Hopefully I will find some time in the next few months to write the code.</p>
<p>I&#8217;m also planning to write a simple script that will aggregate our logwatch reports from our 15 servers into a single daily report.  Instead of the default function, which is to email, the logwatch report will be scp&#8217;ed to a central server, and then a script will go over all of the reports, and put something together for all of the servers.  I&#8217;ll make this available once it is written.</p>
<h2>Gaming</h2>
<p>I&#8217;ve been playing a bit of Civilization 5 lately.  It is an ok game, but I find it is still very rough around the edges.  Lots of bugs, incomplete features, and terrible AI.  Although I really do enjoy the new combat engine.</p>
<p>I&#8217;ve also been playing a bit of <a href="http://www.urbanterror.info/news/home/" target="_blank">Urban Terror</a>.  A free realistic FPS available for Linux.</p>
<h2>Software</h2>
<p>I&#8217;ve also run across a few nice software packages that I&#8217;d like to recommend:<br />
<a href="http://www.adminer.org/en/" target="_blank">Adminer</a>: A great PHP script that you can upload to your site, and gain phpmyadmin type access to your databases.  Supports a number of database types.  Allows you to execute queries, create databases, backup databases and just browse your tables.  It is a single file, so there is no installation, and I intend to use it for some light DB admin work.</p>
<p><a href="http://www.fwbuilder.org/index.html" target="_blank">Firewall Builder</a>: I was looking for a program to help me manage iptables on linux.  I&#8217;ve run firestarter in the past, but that is a gui app, and I wanted to configure the firewall for a server with no gui.  I ran across Firewall Builder and gave it a try.  It is dually licensed as commercial for Windows and Mac users and free for Linux users.  Being a Linux user, I jumped at it to give it a try.  </p>
<p>The interface is a bit daunting for the first time user, I strongly recommend you watch the intro video (and hopefully you already know what a firewall does. <img src='http://cornempire.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )  This program lets you use drag and drop to configure rules for your firewall.  It creates the rules in a custom format, and then compiles them into a number of different formats for various firewall programs and devices.  It even goes a step further and lets you remotely install the firewall on the remote servers.  A very nice touch.</p>
<p>I&#8217;ve only tried iptables configuration so far, but it ran very well.  I intend to use it for all of our servers, and put the configuration files under revision management.  So I can manage all versions of our firewall configs from a single box.</p>
<p>That&#8217;s all for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2010/10/31/long-time-no-post-various-software-and-plans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desktop GUI Programming (Python (PyDev, pygtk) and Glade)</title>
		<link>http://cornempire.net/2010/07/29/desktop-gui-programming-python-pydev-pygtk-and-glade/</link>
		<comments>http://cornempire.net/2010/07/29/desktop-gui-programming-python-pydev-pygtk-and-glade/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 16:57:32 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[glade]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[pydev]]></category>
		<category><![CDATA[pygtk]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=233</guid>
		<description><![CDATA[I recently decided to get back into desktop applications. Since about 2000 I&#8217;ve focused on developing for the web using Perl and PHP (mostly PHP). But sometimes it is nice to write a desktop app, instead of having to write a web app for everything. I&#8217;ve written some applications using the PHP CLI option, but <a href='http://cornempire.net/2010/07/29/desktop-gui-programming-python-pydev-pygtk-and-glade/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I recently decided to get back into desktop applications.  Since about 2000 I&#8217;ve focused on developing for the web using Perl and PHP (mostly PHP).  But sometimes it is nice to write a desktop app, instead of having to write a web app for everything.  I&#8217;ve written some applications using the PHP CLI option, but that isn&#8217;t quite the same as a gui.  My motivation was to write a GUI that controlled ffmpeg and would allow me to capture screen casts for tutorials I needed to make.</p>
<p>I started my adventure looking at a GUI frontend for PHP.  And ran across <a href="http://gtk.php.net/">PHP-GTK+</a>.  I installed it, and looked at some tutorials on it, but the more I looked, the more it looked like the community was inactive and stale.  I also couldn&#8217;t find any way to package my application to share with others.  They would need to install PHP, compile GTK+ (which wasn&#8217;t all that easy), reconfigure PHP and then run my application.  Although most of the programs would be for my eyes only, it would be nice to have the option to share from time to time.  So that was the end of the road for my PHP adventure.</p>
<p>I then decided to look at other languages for developing the application.  I considered some of the options out there, Java, C, Ruby, Python, but decided to give Python a try.  I&#8217;ve coded Java before, and I wasn&#8217;t a fan.  Always seemed like overkill for everything I wanted to do.  I&#8217;ve heard lots of good stuff about Python, and it is usually installed with most Linux installations, so this was my language of choice.</p>
<p>I then began looking for a good IDE for Python.  Being a big fan of Eclipse, I ran across <a href="http://pydev.org">pydev</a> for Ecplise.  A simple install into the software manager in Eclipse, and I was off to the races.  You will need to configure the location to your python binary, which for me (Ubuntu 9.10) was in /usr/bin/python2.6  Enabling this, gives you all the fancy code completion which I love so much.  If you need to set it up, you need to visit (In Eclipse) Window -&gt; Preferences -&gt; Pydev -&gt; Interpreter &#8211; Python -&gt; New&#8230; and browse to your python binary. (If you do not have python available, you may need to install it first using apt-get or Synaptic Package Manager.  Just search for python, and it should install everything you need to get started.)  Here are some tutorials for getting started with Python:</p>
<ul>
<li><a href="http://docs.python.org/tutorial/appetite.html">Python Manual</a></li>
<li><a href="http://www.ibm.com/developerworks/opensource/library/os-php-pythonbasics/index.html">Python basics for PHP Developers</a></li>
<li><a href="http://www.php2python.com/">Python alternatives to PHP functions</a></li>
</ul>
<p>I&#8217;ve used <a href="http://glade.gnome.org/">Glade</a> once before, very briefly just to figure out what it was.  It is a GUI drawer.  Similar to the GUI drawer in Visual Basic, it allows you to layout your interface without using code.  It creates XML files which can be imported by your application (and it has bindings for many languages) that create your interface.  You just need to connect your code to the signals in the GUI, and you can make magic happen.  You will need to install Glade via Synaptic Package Manager.  The current version is the 3.6 series.  Here are some great tutorials to get you started with Glade:</p>
<ul>
<li><a href="http://www.micahcarrick.com/gtk-glade-tutorial-part-1.html">GTK+ and Glade3 GUI Programming Tutorial</a></li>
<li><a href="http://www.overclock.net/application-programming/342279-tutorial-using-python-glade-create-simple.html">Writing a GUI app with Python &amp; Glade</a></li>
<li><a href="http://www.linuxjournal.com/article/6586">A Beginner&#8217;s Guide to Using pyGTK and Glade</a> (older, but still useful)</li>
</ul>
<p>So, my first dabble in GUI desktop programming in a decade, and my first taste of python.  About 5 hours later I had written the application I wanted.  It is an 84 line python script binding to one glade file for the interface.  It allows me to select a window, and using a pre-set configuration, launch ffmpeg and record a screencast.  Still a lot of work to do before it is ready to be shared, but it is a great start.  Using pydev via Eclipse for the Python coding, and Glade for the interface design, you should be able to turn out some simple desktop apps in a matter of hours.</p>
<p>This is probably just the beginning of my python coding, so you may see more here on that in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2010/07/29/desktop-gui-programming-python-pydev-pygtk-and-glade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Database Commands</title>
		<link>http://cornempire.net/2010/05/05/useful-database-commands/</link>
		<comments>http://cornempire.net/2010/05/05/useful-database-commands/#comments</comments>
		<pubDate>Wed, 05 May 2010 18:52:37 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=188</guid>
		<description><![CDATA[Here are some neat database commands I recently came across while I was trying to get statistics and status information on some mysql and postgres databases. Postgres This will give you a list of all of the databases in the server.* select datname from pg_database; * If you don&#8217;t know how to connect to postgres <a href='http://cornempire.net/2010/05/05/useful-database-commands/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here are some neat database commands I recently came across while I was trying to get statistics and status information on some mysql and postgres databases.</p>
<h2>Postgres</h2>
<p>This will give you a list of all of the databases in the server.*<br />
<code>select datname from pg_database;</code></p>
<p>* If you don&#8217;t know how to connect to postgres from the command line, don&#8217;t fear (well fear a little).  What I had to do was <em>su</em> to the user that is a DB user, and then run <em>/usr/local/pgsql/bin/psql</em>  This launched a command line client (without needing a password), that let me query the server.  I can&#8217;t provide a better understanding then that, as this is the first time I&#8217;ve ever interacted with a postgres server.</p>
<p>This tells you how big a particular database is.<br />
<code>SELECT pg_size_pretty(pg_database_size('xythosdocs'));</code><br />
 The output is like this:<br />
<code> pg_size_pretty<br />
----------------<br />
 2834 MB<br />
(1 row)<br />
</code></p>
<h2>Mysql</h2>
<p>Get all database sizes:<br />
<code>SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema;</code><br />
Produces output like this on the command line:</p>
<pre><code>
+--------------------+----------------------+------------------+
| Data Base Name     | Data Base Size in MB | Free Space in MB |
+--------------------+----------------------+------------------+
| blogadmin          |           0.35750008 |       0.00098896 |
| blogs              |          90.60342026 |      27.73141003 |
| information_schema |           0.00781250 |       0.00000000 |
| musicschedule      |           0.00548172 |       0.00020599 |
| mysql              |           0.54032421 |       0.00000000 |
| phpflash           |           0.77745819 |       0.00000000 |
+--------------------+----------------------+------------------+</code></pre>
<p>Get some status information on the sever.  Run this from the command line:<br />
<code>mysqladmin -uroot -p status</code><br />
Phpmyadmin also provides a lot of process status information if you have that installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2010/05/05/useful-database-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lemmings Plus Plus</title>
		<link>http://cornempire.net/2010/04/05/lemmings-plus-plus/</link>
		<comments>http://cornempire.net/2010/04/05/lemmings-plus-plus/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 11:26:49 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[lemmings]]></category>
		<category><![CDATA[multiplayer]]></category>

		<guid isPermaLink="false">http://www.cornempire.net/?p=166</guid>
		<description><![CDATA[In one of my many Linux Game RSS feeds, I ran across an announcement for L++. This is a multiplayer version of the old Lemmings game. Lemmings is a puzzle game where you have to guide your no-brain lemmings from the entrance, to the exit. L++ has all of the original single player content, plus <a href='http://cornempire.net/2010/04/05/lemmings-plus-plus/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>In one of my many Linux Game RSS feeds, I ran across an announcement for <a href="http://lplusplus.co.cc/download.php">L++</a>.  This is a multiplayer version of the old Lemmings game.  Lemmings is a puzzle game where you have to guide your no-brain lemmings from the entrance, to the exit.  </p>
<p><a href="http://lplusplus.co.cc/download.php">L++</a> has all of the original single player content, plus a lot of extra player created content.  It has a built in level editor (which I found wasn&#8217;t super easy to use) and 8 player network multiplayer.</p>
<p>It is quite surprising how fun multiplayer lemmings could be.  If you are a lemmings fan, and have a friend or two, I&#8217;d highly recommend giving this a try.</p>
<p>Update: I just went to the site, and they currently have taken the download off as they remove some of the copyrighted content that was in the game.  You can read more here: <a href="http://lplusplus.co.cc/topic.php?topic=16">http://lplusplus.co.cc/topic.php?topic=16</a>.  Oddly enough, I only downloaded the windows version as that was the machine I was on when I decided to try this.  I guess I&#8217;ll have to wait with you to give it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2010/04/05/lemmings-plus-plus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Openshot/IM Conflict Ubuntu 9.10</title>
		<link>http://cornempire.net/2010/04/05/openshotim-conflict-ubuntu-9-10/</link>
		<comments>http://cornempire.net/2010/04/05/openshotim-conflict-ubuntu-9-10/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 11:18:04 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[openshot]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.cornempire.net/?p=163</guid>
		<description><![CDATA[I recently installed the excellent OpenShot video editor for Ubuntu because I had to splice together some video from our curling league. We had two cameras shooting the action from the Semi-Final, and Final games. OpenShot is a very easy to use program from making some basic movies and it handled the two different format <a href='http://cornempire.net/2010/04/05/openshotim-conflict-ubuntu-9-10/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I recently installed the excellent <a href="http://www.openshotvideo.com/">OpenShot</a> video editor for Ubuntu because I had to splice together some video from our <a href="http://wiki.cornempire.net/curling/start">curling league</a>.  We had two cameras shooting the action from the Semi-Final, and Final games.</p>
<p>OpenShot is a very easy to use program from making some basic movies and it handled the two different format videos pretty well.</p>
<p>However, after installing, I noticed that I could no longer use AMSN, my instant messenger of choice.  When launching from the terminal, I would receive an error about GStreamer problems. This also affected Pidgin, and I&#8217;ve heard reports of problems with Empathy and others too.  The problem lies in frei0r-plugins package, which messes up gstreamer for some programs, and is required by OpenShot.  The easy solution to get it working is to remove frei0r-plugins, but of course, OpenShot won&#8217;t work anymore.<br />
<code>sudo apt-get purge frei0r-plugins</code></p>
<p>After searching the net a bit, I ran across a <a href="https://bugs.launchpad.net/ubuntu/+source/gavl/+bug/456530">launchpad page</a> that pointed the finger at libgavl.  The problem is fixed in libgavl 1.1.1.  Of course, 1.1.0 is the highest version you can get with Ubuntu 9.10.  </p>
<p>So, to correct this once and for all, you can compile 1.1.1 yourself, or you can download the .deb for Ubuntu 10.04.  So, go here: <a href="http://packages.ubuntu.com/lucid/libgavl1">http://packages.ubuntu.com/lucid/libgavl1</a> and download the correct version for your architecture, and you should be good to do.</p>
<p>I got some warnings about an older, more supported version being available in the repositories, but you can safely ignore that.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2010/04/05/openshotim-conflict-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>awstats Information</title>
		<link>http://cornempire.net/2009/10/22/awstats-information/</link>
		<comments>http://cornempire.net/2009/10/22/awstats-information/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 14:54:03 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[webhosting]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.cornempire.net/?p=154</guid>
		<description><![CDATA[Just surfing the web and came across this excellent site with advanced awstats configuration information. As you all know, I do enjoy using awstats, and have had to modify it in the past. Well, this site has lots of cool scripts and modifications to make awstats more useful: http://www.internetofficer.com/awstats/ My favourite modifications so far are: <a href='http://cornempire.net/2009/10/22/awstats-information/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Just surfing the web and came across this excellent site with advanced awstats configuration information.  As you all know, I do enjoy using awstats, and <a href="http://www.cornempire.net/2009/08/31/adding-a-robot-to-awstats/" target="_blank">have had to modify it in the past</a>.</p>
<p>Well, this site has lots of cool scripts and modifications to make awstats more useful: <a href="http://www.internetofficer.com/awstats/" target="_blank">http://www.internetofficer.com/awstats/</a></p>
<p>My favourite modifications so far are:</p>
<ul>
<li><a href="http://www.internetofficer.com/awstats/bing/" target="_blank">Bing in awstats</a></li>
<li><a href="http://www.internetofficer.com/awstats/hotlinking-pages/" target="_blank">Detecting Hotlinking</a></li>
</ul>
<p>And don&#8217;t forget to check out my own tutorial on adding robots (<a href="http://www.cornempire.net/2009/08/31/adding-a-robot-to-awstats/">Blog Post</a>/<a href="http://wiki.cornempire.net/doku.php?id=awstats:awstatsrobots">Wiki Entry</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2009/10/22/awstats-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

