<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Dan Klassen</title>
	
	<link>http://danklassen.com/wordpress</link>
	<description>Apps, tech-news, and other interesting stuff.</description>
	<lastBuildDate>Wed, 06 May 2009 17:44:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DanKlassen" /><feedburner:info uri="danklassen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>gitg, a prettier git UI</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/uAZseExrZt8/</link>
		<comments>http://danklassen.com/wordpress/2009/05/gitg-a-prettier-git-ui/#comments</comments>
		<pubDate>Wed, 06 May 2009 16:00:24 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=109</guid>
		<description><![CDATA[A while back I posted about a number of graphical interfaces to the git version control system. In the last couple of days I happened across a new system named gitg. Astute readers may have guessed that the second &#8216;g&#8217; in the name stands for gnome and they would be correct.
Gitg has much the same [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I <a title="Graphical Git User Interfaces Reviewed" href="/wordpress/2008/12/git-version-control-graphical-tools/">posted</a> about a number of graphical interfaces to the git version control system. In the last couple of days I happened across a new system named gitg. Astute readers may have guessed that the second &#8216;g&#8217; in the name stands for gnome and they would be correct.</p>
<p><a title="Gitg, gnome graphical interface for git" href="http://trac.novowork.com/gitg/" target="_blank">Gitg</a> has much the same feel as gitk does, but feels much more polished and is well worth a look. I find it quite handy to view the history of projects to get a visual representation as to what has happened in the history. It also has the ability to stage and commit changes.</p>
<p>Definitely check it out if this sounds like something you would find useful and you are using the gnome desktop environment.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=uAZseExrZt8:QXtr3n1mlgM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/05/gitg-a-prettier-git-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2009/05/gitg-a-prettier-git-ui/</feedburner:origLink></item>
		<item>
		<title>Magento: my experiences thus far.</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/91VaCwJ_8Bg/</link>
		<comments>http://danklassen.com/wordpress/2009/05/experiences-with-magento/#comments</comments>
		<pubDate>Sun, 03 May 2009 23:31:38 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=105</guid>
		<description><![CDATA[If you have been looking around for an open source shopping cart / e-commerce system in recent times, you most likely have come across Magento at one point or another and wondered at how it works in real live.
There certainly are some good things to be said for it. It has an impressive feature set, [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been looking around for an open source shopping cart / e-commerce system in recent times, you most likely have come across <a title="Magento Commerce" href="http://www.magentocommerce.com" target="_blank">Magento</a> at one point or another and wondered at how it works in real live.</p>
<p>There certainly are some good things to be said for it. It has an impressive feature set, and an intuitive interface which allows the store admins flexible control over discounts, pricing, taxes, etc. However there are some strong drawbacks to consider before taking the plunge and integrating it on a site.</p>
<p><span id="more-105"></span>First off, it is fairly resource hungry. If you are in a shared hosting environment, I would not consider it a viable option at all. Page load times will be significant, and adding an item to a cart will require the patience of Job. On a dedicated environment there are a number of tweaks that can be implemented to bring this down to a much more acceptable level however.</p>
<p>Secondly, nail down your requirements for the store first. If Magento doesn&#8217;t do what you need out of the box, or there aren&#8217;t any modules available in the community that meet your needs, anticipate a steep learning curve. Magento is developed using the EAV data structure, so don&#8217;t expect to be doing many direct SQL queries yourself to access data. Also, the object API is poorly documented, and in some cases broken.</p>
<p>Templating can be a bit of a bear until you learn which files to edit. Even then, a single page may be split across about a dozen files. Be sure to enable the theme developer hints in the configuration. This will help you out immensely in tracking down where content is coming from.</p>
<p>Lastly, I would recommend checking out the magento forums. There are so many threads that start with &#8220;Has anyone gotten magento to do x?&#8221; followed up with &#8220;I would like to know as well&#8230; anyone?&#8221;. The development team doesn&#8217;t seem to be able to keep up with the requests for features and isn&#8217;t the most communicative.</p>
<p>However, if you have your own server (or a good level of control over the environment and resources the project is being deployed in), and only need the features that are available through the interface, it can be a great solution to put in place.</p>
<p>Has anyone else had experience in Magento they wish to share? I&#8217;ve been told I should start a support group.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=91VaCwJ_8Bg:jyvbLjm2dM8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/05/experiences-with-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2009/05/experiences-with-magento/</feedburner:origLink></item>
		<item>
		<title>Configuring SSH</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/YA5_THNT1qU/</link>
		<comments>http://danklassen.com/wordpress/2009/02/configuring-ssh/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:00:26 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[server admin]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=97</guid>
		<description><![CDATA[In the last while I have been having to connect to various servers using different accounts with different types of credential requirements. This has lead to some interesting ssh commands such as

ssh -l some_user -i ~/.ssh/other_key.pub example.com

After having a few servers and starting to lose the commands in my history, I figured there must be [...]]]></description>
			<content:encoded><![CDATA[<p>In the last while I have been having to connect to various servers using different accounts with different types of credential requirements. This has lead to some interesting ssh commands such as</p>

<div class="wp_codebox"><table width="100%" ><tr id="p975"><td class="code" id="p97code5"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-l</span> some_user <span style="color: #660033;">-i</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>other_key.pub example.com</pre></td></tr></table></div>

<p>After having a few servers and starting to lose the commands in my history, I figured there must be a better way to keep track of this. Turns out there is (surprise surprise). Inside your home directory, there&#8217;s a .ssh folder where you can drop a config file. So, to recreate the above example you would add the following section:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p976"><td class="code" id="p97code6"><pre class="bash" style="font-family:monospace;">Host example.com
    User some_user
    IdentityFile ~<span style="color: #000000; font-weight: bold;">/</span>.sh<span style="color: #000000; font-weight: bold;">/</span>other_key.pub</pre></td></tr></table></div>

<p>and now I can connect with</p>

<div class="wp_codebox"><table width="100%" ><tr id="p977"><td class="code" id="p97code7"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> example.com</pre></td></tr></table></div>

<p>There is a whack of documentation about how this can make your life easier. Check out the man pages</p>

<div class="wp_codebox"><table width="100%" ><tr id="p978"><td class="code" id="p97code8"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">man</span> ssh_config</pre></td></tr></table></div>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=YA5_THNT1qU:AZ2mFSbZA2I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/02/configuring-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2009/02/configuring-ssh/</feedburner:origLink></item>
		<item>
		<title>RAM – who knew it could take out a computer?</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/IktH3Cp4TjE/</link>
		<comments>http://danklassen.com/wordpress/2009/01/ram-who-knew-it-could-take-out-a-computer/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 16:15:43 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[server admin]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=90</guid>
		<description><![CDATA[At one point or another I&#8217;m sure most of you have run across bad hardware. This past week I built a computer and was running into an odd situation. After about 2 minutes of running (or less) the system would completely lock up. Rebooting would sometimes make it to the login screen while other times [...]]]></description>
			<content:encoded><![CDATA[<p>At one point or another I&#8217;m sure most of you have run across bad hardware. This past week I built a computer and was running into an odd situation. After about 2 minutes of running (or less) the system would completely lock up. Rebooting would sometimes make it to the login screen while other times it would just die part way through. Other times, the system wouldn&#8217;t event make it past the POST or show the BIOS loading screen.</p>
<p>Fearing a faulty motherboard, or inproper CPU installation, I decided to watch what was happening to the temperature in the BIOS. The temp was staying quite low ( &lt; 30 C for both the CPU and motherboard) but, the system would still lock up&#8230; even in the BIOS screen. At this point I had detached everything except for the video card, 1 stick of RAM, and the hard drive and was still getting the same problem.</p>
<p>As a last ditch attempt, I swapped out the final stick of RAM for one of the other ones in the pile of components sitting beside the case. And what do you know, it worked!</p>
<p>Now, the only conclusion I can come to is that the RAM was overheating after about 2 minutes or so of use, and then completely ceasing to function. The bad memory addresses must have been quite close the beginning since even in the BIOS screen (where I&#8217;m assuming it doesn&#8217;t do all that much with RAM) would lock up.</p>
<p>Has any one else ever experienced something like this? For the record it was a Corsair 2GB stick.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=IktH3Cp4TjE:vyv4t06B3IU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/01/ram-who-knew-it-could-take-out-a-computer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2009/01/ram-who-knew-it-could-take-out-a-computer/</feedburner:origLink></item>
		<item>
		<title>git – commiting a portion of your changes</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/gFqt7gGt_DM/</link>
		<comments>http://danklassen.com/wordpress/2009/01/git-commiting-a-portion-of-your-changes/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 06:15:07 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=81</guid>
		<description><![CDATA[While code the other day I ran into a familiar situation where I wanted to commit just a few of my changes in a file instead of all of them. Some of the code was needed for a quick fix, but the rest was more in the building / testing phase. I know the better [...]]]></description>
			<content:encoded><![CDATA[<p>While code the other day I ran into a familiar situation where I wanted to commit just a few of my changes in a file instead of all of them. Some of the code was needed for a quick fix, but the rest was more in the building / testing phase. I know the better setup would have been to have a branch for the bigger change, and merge back when it was all ready to go, but unfortunately that wasn&#8217;t the setup this time.</p>
<p>Doing a bit of researching, I found that using git it is possible to commit some of your changes instead of all of them. To do this I have found the interactive commit command the most straight forward to use.</p>
<p>To begin an interactive commit,  issue the command with the &#8211;interactive flag (note, that&#8217;s two dashes, not the one long one)</p>

<div class="wp_codebox"><table width="100%" ><tr id="p8112"><td class="code" id="p81code12"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">--interactive</span>
           staged     unstaged path
  1:    unchanged        +3<span style="color: #000000; font-weight: bold;">/</span>-0 index.php
&nbsp;
<span style="color: #000000; font-weight: bold;">***</span> Commands <span style="color: #000000; font-weight: bold;">***</span>
  1: <span style="color: #7a0874; font-weight: bold;">&#91;</span>s<span style="color: #7a0874; font-weight: bold;">&#93;</span>tatus	  2: <span style="color: #7a0874; font-weight: bold;">&#91;</span>u<span style="color: #7a0874; font-weight: bold;">&#93;</span>pdate	  3: <span style="color: #7a0874; font-weight: bold;">&#91;</span>r<span style="color: #7a0874; font-weight: bold;">&#93;</span>evert	  4: <span style="color: #7a0874; font-weight: bold;">&#91;</span>a<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #c20cb9; font-weight: bold;">dd</span> untracked
  <span style="color: #000000;">5</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>p<span style="color: #7a0874; font-weight: bold;">&#93;</span>atch	  <span style="color: #000000;">6</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>d<span style="color: #7a0874; font-weight: bold;">&#93;</span>iff	  <span style="color: #000000;">7</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>q<span style="color: #7a0874; font-weight: bold;">&#93;</span>uit	  <span style="color: #000000;">8</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>h<span style="color: #7a0874; font-weight: bold;">&#93;</span>elp
What now</pre></td></tr></table></div>

<p>As you can see it gives you a number of options. In this case we want to patch the file so we hit &#8216;5&#8242; and then hit enter.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p8113"><td class="code" id="p81code13"><pre class="bash" style="font-family:monospace;">What now <span style="color: #000000;">5</span>
           staged     unstaged path
  <span style="color: #000000;">1</span>:    unchanged        +<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>-<span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>ndex.php
Patch update</pre></td></tr></table></div>

<p>This is showing us a list of files that we can choose to patch from. Hitting 1 will select index.php for patching. You have to hit return again to begin the process after a file has been selected.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p8114"><td class="code" id="p81code14"><pre class="bash" style="font-family:monospace;">Patch update 1
           staged     unstaged path
<span style="color: #000000; font-weight: bold;">*</span> 1:    unchanged        +3<span style="color: #000000; font-weight: bold;">/</span>-0 <span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>ndex.php
Patch update
<span style="color: #c20cb9; font-weight: bold;">diff</span> <span style="color: #660033;">--git</span> a<span style="color: #000000; font-weight: bold;">/</span>index.php b<span style="color: #000000; font-weight: bold;">/</span>index.php
index 90ea18f..e2f84ef 100644
<span style="color: #660033;">---</span> a<span style="color: #000000; font-weight: bold;">/</span>index.php
+++ b<span style="color: #000000; font-weight: bold;">/</span>index.php
<span style="color: #000000; font-weight: bold;">@@</span> -1,7 +1,10 <span style="color: #000000; font-weight: bold;">@@</span>
 this is a <span style="color: #7a0874; font-weight: bold;">test</span> of how to commit partial files
+this is the first addition to the <span style="color: #c20cb9; font-weight: bold;">file</span>
 some <span style="color: #c20cb9; font-weight: bold;">more</span> changes
+and another line goes here
 testing
 and some <span style="color: #c20cb9; font-weight: bold;">more</span> testing here... this is fun<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
 adding some content to the bottom of the <span style="color: #c20cb9; font-weight: bold;">file</span>
+okay, <span style="color: #c20cb9; font-weight: bold;">last</span> one <span style="color: #000000; font-weight: bold;">for</span> now
 and a couple <span style="color: #c20cb9; font-weight: bold;">more</span>
&nbsp;
Stage this hunk <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #000000; font-weight: bold;">/</span>a<span style="color: #000000; font-weight: bold;">/</span>d<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #7a0874; font-weight: bold;">&#93;</span>?</pre></td></tr></table></div>

<p>Hitting &#8217;s&#8217; will split the current hunk and show you the changes to the file one hunk at a time giving you the option to stage the change or not.</p>
<p>After you are satisfied with how you have things set up, hit 7 to quit when given the option and git will bring you to the familiar comment adding screen.</p>
<p>Doing a git diff right after doing this will show you that only the staged changes got committed, the rest are still waiting there for whenever you&#8217;re ready to commit them as well.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=gFqt7gGt_DM:si7b1vA2100:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/01/git-commiting-a-portion-of-your-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2009/01/git-commiting-a-portion-of-your-changes/</feedburner:origLink></item>
		<item>
		<title>Git: You have some suspicious patch lines…</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/54XmJeTy77I/</link>
		<comments>http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 02:46:16 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=76</guid>
		<description><![CDATA[So, I&#8217;ve run into this a few times now and it seems like bizarre behaviour to me. While committing, git complains about files which have trailing white space, or spaces followed by a tab. While this may not be the nicest formatting, enforcing this to be fixed before committing a file seems odd.
It turns out [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve run into this a few times now and it seems like bizarre behaviour to me. While committing, git complains about files which have trailing white space, or spaces followed by a tab. While this may not be the nicest formatting, enforcing this to be fixed before committing a file seems odd.</p>
<p>It turns out this is being caused by a pre-commit hook. There are two options you can go with to circumvent the issue.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p7617"><td class="code" id="p76code17"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">--no-verify</span> .</pre></td></tr></table></div>

<p>The &#8211;no-verify will bypass the pre-commit hooks. This only works on the current commit thought, so you have to add the flag each time you want to commit.</p>
<p>I&#8217;ve found that if you</p>

<div class="wp_codebox"><table width="100%" ><tr id="p7618"><td class="code" id="p76code18"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> .git<span style="color: #000000; font-weight: bold;">/</span>hooks<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-x</span> pre-commit</pre></td></tr></table></div>

<p>will disable the pre-commit hooks permanently by removing the executable rights on the file.</p>
<p>Apparently they are disabled by default in newer releases.</p>
<p>Hope this helps someone else out as well.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=54XmJeTy77I:d0sIJ6hxOpg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/</feedburner:origLink></item>
		<item>
		<title>Git Version Contron Graphical Tools</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/XQz7QVE57Fs/</link>
		<comments>http://danklassen.com/wordpress/2008/12/git-version-control-graphical-tools/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 06:21:07 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=37</guid>
		<description><![CDATA[*Update 2009-05-05* Also check out my quick post on gitg, a gnome based UI for git.
One thing that I have found while working with git is that there isn&#8217;t a wide selection of graphical tools to interact with the repository. There is gitk which comes with a default install of git. This program gives you [...]]]></description>
			<content:encoded><![CDATA[<p>*Update 2009-05-05* Also check out my <a title="Gitg, gnome graphical interface for git" href="/wordpress/2009/05/gitg-a-prettier-git-ui/">quick post on gitg</a>, a gnome based UI for git.</p>
<p>One thing that I have found while working with git is that there isn&#8217;t a wide selection of graphical tools to interact with the repository. There is gitk which comes with a default install of git. This program gives you a visual representation of the workflow of the repository that you&#8217;re currently working on. From your checkout folder typing gitk should bring up a window similar to this one.</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/gitk.png"><img class="aligncenter size-medium wp-image-68" title="gitk" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/gitk-300x174.png" alt="gitk" width="300" height="174" /></a></p>
<p><span id="more-37"></span>You&#8217;ll see a list of commits and a line tieing it to the parent commit. If you have a team of developers working on a single project, this can make for some interesting graphs to say the least. Tags are highlighted with a nice yellow flag which makes them stand out. Right clicking on a commit will let you view the differences between it and the currently select commit. Also, you can roll back the master branch to the selected version. In the bottom right pane there is a list of changed files on the currently select commit. Right clicking on one of these will let you bring it up in an external diff tool to view the changes that were made (I recommend meld for this).</p>
<p>If you were looking closely at the previous screen shot, you may have noticed that this was a clone of the Giggle repository. It&#8217;s also an sudo apt-get install giggle for simplicity&#8217;s sake. Giggle has a nicer interface that fits in with the gnome desktop environment better as you can see from the screen shot.</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle.png"><img class="aligncenter size-medium wp-image-70" title="giggle" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle-300x174.png" alt="giggle" width="300" height="174" /></a></p>
<p>Also, built in to the giggle interface is the ability to commit directly from there which seems to be lacking from the gitk app unless I&#8217;m completely missing something.</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle-commit.png"><img class="aligncenter size-full wp-image-71" title="giggle-commit" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle-commit.png" alt="giggle-commit" width="500" height="380" /></a></p>
<p>The last app I&#8217;ll look at for today is qgit4. This program is one that I cloned and compiled locally. You can make a clone of the repo by typing in</p>

<div class="wp_codebox"><table width="100%" ><tr id="p3721"><td class="code" id="p37code21"><pre class="bash" style="font-family:monospace;">git clone git:<span style="color: #000000; font-weight: bold;">//</span>git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>scm<span style="color: #000000; font-weight: bold;">/</span>qgit<span style="color: #000000; font-weight: bold;">/</span>qgit4.git</pre></td></tr></table></div>

<p>Then cd qgit4 and type in</p>

<div class="wp_codebox"><table width="100%" ><tr id="p3722"><td class="code" id="p37code22"><pre class="bash" style="font-family:monospace;">qmake qgit.pro
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>You&#8217;ll need the Qt developer libraries installed for this to work, but if all went according to plan, you should have a bin directory with a qgit4 executable in it now. It should looks something kinda like this:</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/qgit.png"><img class="aligncenter size-medium wp-image-72" title="qgit" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/qgit-300x174.png" alt="qgit" width="300" height="174" /></a></p>
<p>Qgit4 seems to be one of the more full-featured programs I&#8217;ve come across yet. It feels like it fits in more with the KDE desktop environment withsince it uses the Qt libraries. However, it lets you create multiple tabs if you want to take a closer look at each file and what changed. Clicking on a revision will show you the list of files that changed in the bottom right pane as well. Then right clicking on a file can open it in an external diff viewer as well.</p>
<p>I think each of these programs has their place. For quick &#8216;what change in this commit&#8217; gitk seems to fit the bill nicely (albeit rather ugly) and if you&#8217;re using gnome, I recommend giggle (if you can bring yourself to using a program named giggle&#8230; just don&#8217;t tell anyone else).</p>
<p>For typical day-to-day operations like committing, adding files to version control, and tagging I find that using the command line is pretty hard to beat though. However, having tools like these available will make git accessable to a wider audience, and easier to pitch to the team for your next development project.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=XQz7QVE57Fs:ldVXid70t64:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/12/git-version-control-graphical-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2008/12/git-version-control-graphical-tools/</feedburner:origLink></item>
		<item>
		<title>Create a csv from MySQL output</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/WCO7OpLuxTk/</link>
		<comments>http://danklassen.com/wordpress/2008/12/create-a-csv-from-mysql-output/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 04:30:45 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=61</guid>
		<description><![CDATA[Today I got asked to pull some information from a mysql database. Pretty simple, but the one minor catch was that the person asking wanted it in a spreadsheet. Thankfully this is pretty easy with mysql&#8217;s built in &#8216;INTO OUTFILE&#8217; functionality.

select * from users where last_name LIKE &#34;%smith%&#34; order by first_name
INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY [...]]]></description>
			<content:encoded><![CDATA[<p>Today I got asked to pull some information from a mysql database. Pretty simple, but the one minor catch was that the person asking wanted it in a spreadsheet. Thankfully this is pretty easy with mysql&#8217;s built in &#8216;INTO OUTFILE&#8217; functionality.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p6124"><td class="code" id="p61code24"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">select</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">from</span> users <span style="color: #993333; font-weight: bold;">where</span> last_name <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;%smith%&quot;</span> <span style="color: #993333; font-weight: bold;">order</span> <span style="color: #993333; font-weight: bold;">by</span> first_name
<span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #993333; font-weight: bold;">OUTFILE</span> <span style="color: #ff0000;">'/tmp/result.csv'</span>
<span style="color: #993333; font-weight: bold;">FIELDS</span> TERMINATED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">','</span> <span style="color: #993333; font-weight: bold;">OPTIONALLY</span> <span style="color: #993333; font-weight: bold;">ENCLOSED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'&quot;'</span>
<span style="color: #993333; font-weight: bold;">LINES</span> TERMINATED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span>;</pre></td></tr></table></div>

<p>This will write the file /tmp/result.csv in a format that is readable by pretty much any spreadsheet program (Excel, OpenOffice, etc). If you have any specific requirements for your file format (say you want tab separate) play around with the options until you get it just right. As you can see you can do anything you would regularly do in a sql query (joins, where clauses, ordering, etc).</p>
<p>And there you have it, one happy person who can access their data in their favourite program</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=WCO7OpLuxTk:G90MPXTm-yI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/12/create-a-csv-from-mysql-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2008/12/create-a-csv-from-mysql-output/</feedburner:origLink></item>
		<item>
		<title>Setting up VPN Connection with gnome Network Manager</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/Ww_5cd83x_E/</link>
		<comments>http://danklassen.com/wordpress/2008/12/setting-up-vpn-connection-with-gnome-network-manager/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 04:32:58 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[server admin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[system admin]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=54</guid>
		<description><![CDATA[Recently for a project I&#8217;ve been working on at the office I had to set up a VPN connection to gain access to the client&#8217;s network. They already had vpn set up on their end (thankfully) however, oddly enough I didn&#8217;t have a vpn client. I noticed that the gnome Network Manager had a tab [...]]]></description>
			<content:encoded><![CDATA[<p>Recently for a project I&#8217;ve been working on at the office I had to set up a VPN connection to gain access to the client&#8217;s network. They already had vpn set up on their end (thankfully) however, oddly enough I didn&#8217;t have a vpn client. I noticed that the gnome Network Manager had a tab for VPN, however the add button was disabled. After a quick google, I found out that you just have to install the packages &#8216;network-manager-pptp&#8217; and &#8216;pptp-linux&#8217; to enable it.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p5426"><td class="code" id="p54code26"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> network-manager-pptp pptp-linux</pre></td></tr></table></div>

<div id="attachment_57" class="wp-caption alignnone" style="width: 310px"><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/screenshot-network-connections.png"><img class="size-medium wp-image-57" title="Network Manager Window" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/screenshot-network-connections-300x224.png" alt="Network Manager Window" width="300" height="224" /></a></dt>
</dl>
</div>
<p>Did the trick and now it was just a matter of entering the server information, username, password. At this point I was still unable to connect to the network. I double and triple checked my info and it was all right. It turned out I had to enable Point to Point Encryption (makes sense) in the advanced section.</p>
<div class="mceTemp">
<dl id="attachment_58" class="wp-caption alignnone" style="width: 209px;">
<dt class="wp-caption-dt"><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/screenshot-nm-connection-editor.png"><img class="size-medium wp-image-58" title="Use Point to Point encryption" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/screenshot-nm-connection-editor-199x300.png" alt="Use Point to Point encryption" width="199" height="300" /></a></dt>
</dl>
</div>
<p>Now, I have a nice little &#8216;locked&#8217; icon on my network status bar.</p>
<div class="mceTemp">
<dl id="attachment_56" class="wp-caption alignnone" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/network-manager-locked.png"><img class="size-medium wp-image-56" title="VPN Connection in Network Manager" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/network-manager-locked-300x20.png" alt="VPN Connection in Network Manager" width="300" height="20" /></a><p class="wp-caption-text">VPN Connection in Network Manager</p></div>
<p>Who knew it would be that easy?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=Ww_5cd83x_E:eECU_w6lmkY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/12/setting-up-vpn-connection-with-gnome-network-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2008/12/setting-up-vpn-connection-with-gnome-network-manager/</feedburner:origLink></item>
		<item>
		<title>Stress Testing Apache Using ab</title>
		<link>http://feedproxy.google.com/~r/DanKlassen/~3/YEIPp03SiM4/</link>
		<comments>http://danklassen.com/wordpress/2008/11/stress-testing-apache-using-ab/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 20:49:04 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[server admin]]></category>
		<category><![CDATA[system admin]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=50</guid>
		<description><![CDATA[If you&#8217;ve ever written a web-app you&#8217;ve probably wondered how well it will hold up once the world discovers your awesome service. Will it work if you get dugg? What happens if 200 people all try to access your site at once? This is where benchmarking can provide some useful numbers to give you an [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever written a web-app you&#8217;ve probably wondered how well it will hold up once the world discovers your awesome service. Will it work if you get dugg? What happens if 200 people all try to access your site at once? This is where benchmarking can provide some useful numbers to give you an idea as to how your server will hold up.</p>
<p><span id="more-50"></span></p>
<p>Apache Benchmark can be a helpful tool to determine response times based on various traffic patterns. It lets you determine how many requests per second your server should be able to handle, and how long each visitor will have to wait to receive a response.</p>
<p>The syntax is pretty straight forward:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p5029"><td class="code" id="p50code29"><pre class="bash" style="font-family:monospace;">ab <span style="color: #660033;">-c</span> 10 <span style="color: #660033;">-n</span> <span style="color: #000000;">1000</span> http:<span style="color: #000000; font-weight: bold;">//</span>yourdomain.com<span style="color: #000000; font-weight: bold;">/</span></pre></td></tr></table></div>

<p>(note the trailing / if you are wanting to test your main document). The -c tells ab to make 10 concurrent requests at a time and -n tells it to make 1000 requests total. This will create output similar to</p>

<div class="wp_codebox"><table width="100%" ><tr id="p5030"><td class="code" id="p50code30"><pre class="bash" style="font-family:monospace;">This is ApacheBench, Version 2.3 <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #007800;">$Revision</span>: 655654 $<span style="color: #000000; font-weight: bold;">&amp;</span>gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http:<span style="color: #000000; font-weight: bold;">//</span>www.zeustech.net<span style="color: #000000; font-weight: bold;">/</span>
Licensed to The Apache Software Foundation, http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
Benchmarking yourdomain.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>be patient<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
&nbsp;
Server Software:        Apache<span style="color: #000000; font-weight: bold;">/</span>2.2.9
Server Hostname:        yourdomain.com
Server Port:            80
&nbsp;
Document Path:          <span style="color: #000000; font-weight: bold;">/</span>
Document Length:        240 bytes
&nbsp;
Concurrency Level:      10
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">20.824</span> seconds
Complete requests:      <span style="color: #000000;">1000</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Non-2xx responses:      <span style="color: #000000;">1000</span>
Total transferred:      <span style="color: #000000;">565000</span> bytes
HTML transferred:       <span style="color: #000000;">240000</span> bytes
Requests per second:    <span style="color: #000000;">48.02</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       208.238 <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       20.824 <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          26.50 <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received
&nbsp;
Connection Times <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
              min  mean<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #000000; font-weight: bold;">/</span>-sd<span style="color: #7a0874; font-weight: bold;">&#93;</span> median   max
Connect:       59  120 376.0     68    3093
Processing:    61   80  44.0     70     466
Waiting:       61   80  44.0     70     466
Total:        121  200 377.8    144    3165
&nbsp;
Percentage of the requests served within a certain <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">50</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">144</span>
<span style="color: #000000;">66</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">151</span>
<span style="color: #000000;">75</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">156</span>
<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">162</span>
<span style="color: #000000;">90</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">176</span>
<span style="color: #000000;">95</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">203</span>
<span style="color: #000000;">98</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">520</span>
<span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">3132</span>
<span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">3165</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>longest request<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>From this we can see that the server tested was able to hand approximately 48 requests per second and was able to process 1000 requests in just under 21 seconds. Whether or not these are acceptable values completely depends on the requirements of your project and application.</p>
<p>You are also able to send in post and cookie data (check the man pages for instructions on how to do that) if you would like to benchmark an authentication process or some form processing.</p>
<p>I&#8217;ve found ab to be  a useful tool to determine which pages on a site are taking too long to server / bogging down the server. It&#8217;s certainly not the end-all / be-all but can get you pointed in the right direction. After collecting some baseline data though ab, it may give you some ideas as to what code to optimize or where to implement caching on your server.</p>
<p>Remember, be kind and only stress test your own servers. Other people may not take kindly to you hammering their server just to see how they hold up.</p>
<p><em>edit</em></p>
<p>Just a quick note about dynamic urls. You can use these if you put single quotes around the entire url. For example:</p>
<p>ab -c 5 -n 2000 &#8216;http://yourdomain.com/index.php?id=27&amp;action=edit&#8217;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DanKlassen?a=YEIPp03SiM4:esMatiN80l0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DanKlassen?d=yIl2AUoC8zA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/11/stress-testing-apache-using-ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://danklassen.com/wordpress/2008/11/stress-testing-apache-using-ab/</feedburner:origLink></item>
	</channel>
</rss>
