<?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>Nevermind &#187; TechTidBits</title>
	<atom:link href="http://www.nevermind.co.nz/category/techtidbits/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nevermind.co.nz</link>
	<description>Epiq Failjure</description>
	<lastBuildDate>Tue, 07 Jun 2011 09:50:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Installing Dropbox on Debian Sid</title>
		<link>http://www.nevermind.co.nz/2011/04/07/installing-dropbox-on-debian-sid/</link>
		<comments>http://www.nevermind.co.nz/2011/04/07/installing-dropbox-on-debian-sid/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 09:24:58 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[TechTidBits]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.nevermind.co.nz/?p=475</guid>
		<description><![CDATA[I had to install the ubiquitous Dropbox on my Debian Sid box tonight, just thought I&#8217;d leave a few notes here to help along someone else who was needing it. As Dropbox does not provide a Debian package, we&#8217;ll use their source package. However, we&#8217;ll do it in a way that Dropbox will still be [...]]]></description>
			<content:encoded><![CDATA[<p>I had to install the ubiquitous <a href="http://www.dropbox.com/">Dropbox</a> on my Debian Sid box tonight, just thought I&#8217;d leave a few notes here to help along someone else who was needing it.</p>
<p>As Dropbox does not provide a Debian package, we&#8217;ll use their source package. However, we&#8217;ll do it in a way that Dropbox will still be installed under the supervision of the package manager and can still be uninstalled, or installed on other systems at will.</p>
<ol>
<li>Start by downloading the Dropbox source (.tar.gz) from <a href="http://www.dropbox.com/downloading?src=index">this page</a></li>
<li>Install the dependencies using apt:<br />
<code><br />
$ aptitude install libnautilus-extension-dev checkinstall<br />
</code></li>
<li>Compile the Dropbox source package:<br />
<code><br />
$ ./configure<br />
$ make<br />
</code></li>
<li>Create and install a new Debian package from the source install using checkinstall<br />
<code><br />
# sudo checkinstall make install<br />
</code><br />
Just accept the default for the questions, unless you&#8217;re building a package for distribution in which case specify the applicable options (i.e. requires)</li>
<li>Start dropbox:<br />
<code>Applications -> Internet -> Dropbox</code><br />
OR<br />
<code>$ dropbox -i</code></li>
<p>Enjoy!</p>
<p>More tips on installing Dropbox from CLI <a href="http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall">can be found here</a>.</p>
<p><strong>Edit</strong>: <a href="http://raphaelhertzog.com">Raphaël Hertzog</a> commented below to let us know that he has correctly packaged Dropbox for inclusion in the Debian distribution. Here is <a href="http://raphaelhertzog.com/2011/06/06/official-debian-ubuntu-packages-for-nautilus-dropbox/">his post.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nevermind.co.nz/2011/04/07/installing-dropbox-on-debian-sid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speeding up INSERTs on MySQL</title>
		<link>http://www.nevermind.co.nz/2009/10/13/speeding-up-inserts-on-mysql/</link>
		<comments>http://www.nevermind.co.nz/2009/10/13/speeding-up-inserts-on-mysql/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 10:00:06 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[TechTidBits]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.nevermind.co.nz/?p=345</guid>
		<description><![CDATA[Was working on a problem today that required a lot of bulk inserts to a MySQL table. I was getting about 200 inserts/second on my development system, which is OK considering there was some minor processing going on. Since some batches can contain well over a million rows, I started working on how to optimise [...]]]></description>
			<content:encoded><![CDATA[<p>Was working on a problem today that required a lot of bulk inserts to a MySQL table. I was getting about 200 inserts/second on my development system, which is OK considering there was some minor processing going on.</p>
<p>Since some batches can contain well over a million rows, I started working on how to optimise these queries so we can get them in there faster.</p>
<p><strong>Firstly</strong>, watch your indexes on the table. Obviously the more indexes you have on the table the more work the DB has to do on INSERT to maintain them.</p>
<p><strong>Second</strong>, if possible, ditch your ORM. Instead of building and hydrating objects for each row in the table used direct/prepared queries. Most ORMs worth their salt can handle this. i.e. Propel can give you direct access to the underlying <a href="http://php.net/manual/en/book.pdo.php">PDO</a> connection to use your prepared statements.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/** @var $con PDO */</span>
<span style="color: #000088;">$con</span> <span style="color: #339933;">=</span> Propel<span style="color: #339933;">::</span><span style="color: #004000;">getConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Obviously if you have business logic tied up in your objects, it&#8217;s best to use them instead of duplicating code.</p>
<p><strong>Third</strong>, lock the table for a batch of inserts. Here&#8217;s some sample code</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$con</span> <span style="color: #339933;">=</span> Propel<span style="color: #339933;">::</span><span style="color: #004000;">getConnection</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$con</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">beginTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rowsToInsert</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">100</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$con</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">commit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$con</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">beginTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  TablePeer<span style="color: #339933;">::</span><span style="color: #004000;">insertUsingPreparedStatement</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>If your using MyISAM you can lock the table using the LOCK TABLE statement</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$con</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'LOCK TABLES table_name WRITE'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$con</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'UNLOCK TABLES'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Depending on how important your data is you can change the (100) value in the $i % conditional to higher or lower. The reason this speeds up Inserts so much is that MySQL won&#8217;t flush it&#8217;s write cache to the disk until the transaction is finished, as opposed to every INSERT statement. However, having unflushed data in your cache is dangerous because it may disappear if something happens to the DB server, or get rolled back if your script carks it. Also, since a transaction/lock table call will stop all other access to the table, if it&#8217;s frequently read from those queries will be waiting on locks, so it&#8217;s good to refresh them frequently.</p>
<p>Using these three methods I almost tripled the performance of my script which now inserts between 550-600 rows per second. Win!</p>
<p>There&#8217;s some more tips over <a href="http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html">here in the MySQL manual</a> and some of the comments are quite helpful too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nevermind.co.nz/2009/10/13/speeding-up-inserts-on-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TechTidBit: Try the New Firefox 3.0</title>
		<link>http://www.nevermind.co.nz/2008/06/18/techtidbit-try-the-new-firefox-30/</link>
		<comments>http://www.nevermind.co.nz/2008/06/18/techtidbit-try-the-new-firefox-30/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 00:36:15 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[TechTidBits]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[techtidbit]]></category>

		<guid isPermaLink="false">http://www.nevermind.co.nz/2008/06/18/techtidbit-try-the-new-firefox-30/</guid>
		<description><![CDATA[Today is Download Day for Mozilla&#8217;s new release of Firefox, the big 3.0. Mozilla touts over 15,000 improvements with this new version over Firefox 2 and label this the fastest, most secure browser yet and absolute gold for power users And having used the beta and release candidate versions for a while now, they might [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float:left;margin:10px" src="http://www.spreadfirefox.com/files/images/full-v-lockup-207x300_0.jpg" alt="" />Today is Download Day for Mozilla&#8217;s new release of Firefox, the big 3.0. Mozilla touts over 15,000 improvements with this new version over Firefox 2 and label this the fastest, most secure browser yet and absolute gold for <a href="http://lifehacker.com/396312/power-users-guide-to-firefox-3">power users</a></p>
<p>And having used the beta and release candidate versions for a while now, they might just be right&#8230;</p>
<p>With this release, Mozilla hope to reach a new world record of software downloaded in a 24 hour period. We&#8217;re almost 8 hours into it so far and have almost 2.5 million downloads, about half of the 5 million they hope to achieve. You can track the progress <a href="http://www.spreadfirefox.com/en-US/worldrecord">here </a>although their counter is not quite up to date. Also, their site is taking an absolute hammering at the moment so you might need to be patient.</p>
<p>I have to say that Mozilla has done an excellent job marketing Firefox, from sponsoring events to a full grassroots campaign named <a href="http://www.spreadfirefox.com">SpreadFireFox </a>they are actually taking back the web and showing how things can be done in the nu-media. With valuable partnerships with companies such as Google, it goes to show that even free software can make great money!</p>
<p>If you want to give it a shot, and you should especially if you&#8217;re still using Internet Exploder, you can grab it <a href="http://www.mozilla.com/en-US/firefox/?p=downloadday">here</a>. If you like Firefox, You might also be interested in their mail application <a href="http://www.mozilla.com/en-US/thunderbird/">Thunderbird</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nevermind.co.nz/2008/06/18/techtidbit-try-the-new-firefox-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TechTidBit: Avoid MagnumMac</title>
		<link>http://www.nevermind.co.nz/2008/04/10/techtidbit-avoid-magnummac/</link>
		<comments>http://www.nevermind.co.nz/2008/04/10/techtidbit-avoid-magnummac/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 21:26:50 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[TechTidBits]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[magnummac]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[techtidbit]]></category>

		<guid isPermaLink="false">http://www.nevermind.co.nz/2008/04/10/techtidbit-avoid-magnummac/</guid>
		<description><![CDATA[photo credit: teknopata I recently had the misfortune of dealing with MagnumMac to process a warranty battery replacement for my Mac Book Pro. Needless to say that they are dragging the normally good name of Apple Customer Care through the mud with their penny-pinching and cagey, neglectful attitudes. I won&#8217;t go all the way into [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left;margin:10px"><a href="http://www.flickr.com/photos/14458430@N00/2305201691/" title="" target="_blank"><img src="http://farm4.static.flickr.com/3176/2305201691_5b849a2d26_m.jpg" alt="" border="0" /></a><br /><small><a href="http://www.photodropper.com/creative-commons/" title="creative commons" target="_blank"><img src="http://www.nevermind.co.nz/wp-content/plugins/photo_dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/14458430@N00/2305201691/" title="teknopata" target="_blank">teknopata</a></small></div>
<p>I recently had the misfortune of dealing with MagnumMac to process a warranty battery replacement for my Mac Book Pro. Needless to say that they are dragging the normally good name of Apple Customer Care through the mud with their penny-pinching and cagey, neglectful attitudes.</p>
<p>I won&#8217;t go all the way into it but I went to see them for a battery issue with a machine that is still under warranty, they sent me home with the battery-less laptop shell and a foul taste in my mouth for having talked to them. The support agent, when questioned, indicated that it was Apple&#8217;s global policy that a return is not issued until the faulty part is shipped and delivered. Sounded like honk to me considering Apple&#8217;s stunning record of Customer Care worldwide and a quick call to the Apple Support call center confirmed this, this was a Renaissance/MagnumMac policy and not Apple.</p>
<p>I called the MM branch back and spoke to another muppet who went to the full extent to patronise me (&#8220;One week without a battery is not the end of the world&#8221;) before bestowing the wisdom: &#8220;If you really need another battery for this week, then you should purchase a new one&#8221;. Which I did. And it arrived first thing this morning. But not from them.</p>
<p>I made a few calls and escalations to both Apple Support (in Australia) and Renassance/MagnumMac but I don&#8217;t expect to hear back from either, however Apple Support indicated they&#8217;ve been hearing about these sorts of complaints with MM fairly often. In the meantime, if you need help, support or want to purchase any Apple product, do yourself a favour go through the <a href="http://www.apple.co.nz">Apple Online Store</a> or another one of their <a href="http://store.apple.com.au/buy/fmpro?-db=wheretobuy&#038;-format=/buy/svcresultsnz.html&#038;-max=300&#038;-op=cn&#038;service=yes&#038;country=NZ&#038;-sortfield=Courier%20City&#038;-find">Service Providers</a> and avoid MagnumMac and their parent company Renaissance completely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nevermind.co.nz/2008/04/10/techtidbit-avoid-magnummac/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>TechTidBit: Streem</title>
		<link>http://www.nevermind.co.nz/2008/02/22/techtidbit-streem/</link>
		<comments>http://www.nevermind.co.nz/2008/02/22/techtidbit-streem/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 08:03:24 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[TechTidBits]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[techtidbit]]></category>

		<guid isPermaLink="false">http://www.nevermind.co.nz/1999/11/30/techtidbit-streem/</guid>
		<description><![CDATA[Streem is the new microblogging site on the block. With some features of the popular Twitter, it&#8217;s more like a socially-connected Tumblr, or Tumblog. The idea behind Tumblr is the &#8220;micro-blog&#8221;, little snippets of things you come accross in life or the internet. Whether it be a quote, a link, an audio file or a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://streem.us/">Streem</a> is the new microblogging site on the block. With some features of the popular Twitter, it&#8217;s more like a socially-connected Tumblr, or Tumblog.</p>
<p>The idea behind Tumblr is the &#8220;micro-blog&#8221;, little snippets of things you come accross in life or the internet. Whether it be a quote, a link, an audio file or a full blown blog post you feel like writing, you&#8217;ll see a microblog can be also expressed as a &#8220;life stream&#8221;. So although the traditional life streams are nice, it&#8217;s difficult to share and collaborate with your friends. This is why Twitter has been so popular, allowing you to follow people as they post small 140-char messages about their life as it happens, from the internet or mobile phone.</p>
<p>Thats where Streem comes in. By making use of &#8220;tags&#8221; and the social network idea of the Facebook&#8217;s and Bebo&#8217;s of this virtual world, they can very easily find interesting content from your friends with what you like. Although the site is simple, not to mention colourful, the idea is definitely solid and it&#8217;ll be interesting to see where this goes! Of course, social networks are useless without people and it&#8217;s useless to a person if their friends don&#8217;t come to the party, but Streem is definitely something to keep an eye on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nevermind.co.nz/2008/02/22/techtidbit-streem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TechTidBit: Mac Buying Tips</title>
		<link>http://www.nevermind.co.nz/2008/02/17/techtidbit-mac-buying-tips/</link>
		<comments>http://www.nevermind.co.nz/2008/02/17/techtidbit-mac-buying-tips/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 04:21:55 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[TechTidBits]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[techtidbit]]></category>

		<guid isPermaLink="false">http://www.nevermind.co.nz/2008/02/17/techtidbit-mac-buying-tips/</guid>
		<description><![CDATA[Like the look of the new MacBook Air? Pondering buying the new MacBook Pro&#8217;s that are rumored to be released at Apple&#8217;s event coming up late Feb? Or are you just looking to make the switch like everyone else? We all know Apple&#8217;s products come at a price premium, so here are a few tips [...]]]></description>
			<content:encoded><![CDATA[<p>Like the look of the new MacBook Air? Pondering buying the new MacBook Pro&#8217;s that are rumored to be released at <a href="http://www.macrumors.com/2008/02/07/apple-event-in-last-week-of-february/">Apple&#8217;s event coming up late Feb</a>? Or are you just looking to make the switch like everyone else?</p>
<p>We all know Apple&#8217;s products come at a price premium, so here are a few tips to make the most of your hard earned money</p>
<ul>
<li><strong>Don&#8217;t pay the &#8220;Mac Black Tax&#8221;<br /></strong><strong><span style="font-weight: normal;">If you&#8217;re buying a MacBook, the difference between the mid-range and the top-of-the-line model is +40gb HDD space, a black finish and about $300. Considering Apple will upgrade your HDD to 160gb on the mid-level model for a mere $125, $175 is a lot of cash to pay for a colour!</span></strong></li>
<li><strong>Don&#8217;t pay Apple for RAM upgrades<br />
  <span style="font-weight: normal;">Most people want to upgrade their RAM. MacOS X loves RAM and RAM is cheap &#8211; unless you buy it from Apple that is. Upgrading from 1GB of RAM to 4GB of RAM on the vanilla MacBook will cost you $1420 from Apple. If you buy RAM from almost anywhere else, you&#8217;ll pay about $80 per DIMM (of which you&#8217;ll need 2 for the MacBook) for a saving of still over $1000. Note: You can install RAM by yourself, quite a simple procedure, without voiding your factory warranty or AppleCare. If you send it off for repair they&#8217;ll take it out and ship it back to you when they return the system.</span></strong></li>
<li><strong>Don&#8217;t pay Apple for HDD upgrades<br />
  <span style="font-weight: normal;">A few systems allow for user-upgradable HDD&#8217;s. You can easily save $100-200 by upgrading your own system with store-bought parts instead of paying Apple&#8217;s premium.</span></strong></li>
<li><strong>Buy AppleCare for laptops</strong><br />
  Worth every penny for laptops with very few user-serviceable parts in it. And you&#8217;ll bet that trying to get your Mac repaired out of warrenty will cost you a bundle with Apple&#8217;s proprietary hardware! This is a fairly decent rule for all Laptops &#8211; not just Apple since you&#8217;d be out of luck trying to get a lot of the components replace 3rd party &#8211; especially in NZ!</li>
<li><strong>Don&#8217;t buy anything straight before a refresh</strong><br />
  Although Apple don&#8217;t usually let on when they&#8217;re about to refresh a product line with updated hardware, it&#8217;s usually fairly easy to predict. <a href="http://buyersguide.macrumors.com/">MacRumors Buyers Guide</a> can help with the timing and have hints on when it&#8217;s a good time to buy.</li>
</ul>
<p>Any more tips, leave &#8216;em in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nevermind.co.nz/2008/02/17/techtidbit-mac-buying-tips/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

