<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Cameron Yule</title>
 <link href="http://cameronyule.com/atom.xml" rel="self"/>
 <link href="http://cameronyule.com/"/>
 <updated>2013-03-21T09:39:14+00:00</updated>
 <id>http://cameronyule.com/</id>
 <author>
   <name>Cameron Yule</name>
   <email>cameron@cameronyule.com</email>
 </author>

 
 <entry>
   <title>Archiving Large Files Across Multiple DVDs</title>
   <link href="http://cameronyule.com//2008/11/archiving-large-files-across-multiple-dvds"/>
   <updated>2008-11-28T00:00:00+00:00</updated>
   <id>http://cameronyule.com//2008/11/archiving-large-files-across-multiple-dvds</id>
   <content type="html">&lt;p&gt;I was backing up our SVN repositories to DVD a while ago and wrote an entry on our wiki detailing how I&amp;#8217;d done it. Thinking this is the kind of thing people will have to do at some point I thought it could be useful to share.&lt;/p&gt;

&lt;p&gt;The method I&amp;#8217;ve used is to create a single &lt;abbr title='Taped Archive'&gt;tar&lt;/abbr&gt; file of everything you&amp;#8217;re looking to backup and then split that file into chunks which fit onto a single DVD.&lt;/p&gt;
&lt;h3&gt;Install GNU Core Utilities&lt;/h3&gt;
&lt;p&gt;Before we start, you&amp;#8217;re going to need &lt;code&gt;gsplit&lt;/code&gt; installed. This comes as part of the &lt;a href='http://www.gnu.org/software/coreutils/'&gt;GNU Core Utilities&lt;/a&gt; package, so you can either download it from there or use your favourite package management software.&lt;/p&gt;

&lt;p&gt;You can either build from source,&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;wget http://ftp.gnu.org/gnu/coreutils/coreutils-6.9.tar.gz
tar xzvf coreutils-6.9.tar.gz
&lt;span class='nb'&gt;cd &lt;/span&gt;coreutils-6.9
./configure
make &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; make install
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Or use a package management tool like &lt;a href='http://mxcl.github.com/homebrew/'&gt;Homebrew&lt;/a&gt;.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;brew install coreutils
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h3&gt;Split your content into chunks&lt;/h3&gt;
&lt;p&gt;Put all the files you want to backup into one folder, create the tar achive and then split that into chunks.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;mkdir archive
&lt;span class='c'&gt;# … add some content to the archive/ folder …&lt;/span&gt;
&lt;span class='nb'&gt;cd &lt;/span&gt;archive
tar -cvf archive.tar *
gsplit -b4500m archive.tar
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;After you&amp;#8217;ve burned each generated file to a DVD, delete both those and the source archive.tar file as they&amp;#8217;ll be using quite a lot of space on your drive.&lt;/p&gt;
&lt;h3&gt;Restoring&lt;/h3&gt;
&lt;p&gt;Should the worst happen and you need to get your content back, copy all the files from across your DVDs to a folder on your machine and run the following.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;cat x* &amp;gt; archive.tar
tar -xvf archive.tar
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Taking Regular Breaks</title>
   <link href="http://cameronyule.com//2008/11/taking-regular-breaks"/>
   <updated>2008-11-27T00:00:00+00:00</updated>
   <id>http://cameronyule.com//2008/11/taking-regular-breaks</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve always been on the lookout for a small application to remind me to take regular breaks while working, as it&amp;#8217;s easy to get involved in what you&amp;#8217;re doing and lose track of time.&lt;/p&gt;

&lt;p&gt;The few I&amp;#8217;ve found in the past have always had their problems, from terrible interfaces to being overly intrusive - think alarm calls and locking the computer. Thankfully I&amp;#8217;ve found a great solution - &lt;a href='http://tech.inhelsinki.nl/antirsi/'&gt;AntiRSI&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As well as reminding you to take breaks, it&amp;#8217;s small, unobtrusive and configurable. As an added bonus it takes idle time into account, so if you&amp;#8217;ve specified you’d like to take 5 minute breaks each hour and leave the machine idle, the counter for your next break will adjust appropriately.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Configuring MySQL To Use UTF-8</title>
   <link href="http://cameronyule.com//2008/07/configuring-mysql-to-use-utf-8"/>
   <updated>2008-07-15T00:00:00+01:00</updated>
   <id>http://cameronyule.com//2008/07/configuring-mysql-to-use-utf-8</id>
   <content type="html">&lt;p&gt;A project I&amp;#8217;m working on at the moment is going to have multiple language options available, not all of which use the same alphabet (e.g. Russian and Chinese).&lt;/p&gt;

&lt;p&gt;To lessen the pain commonly associated with internationalisation on the web, it&amp;#8217;s beneficial to use the UTF-8 character set. This short summary from the &lt;a href='http://www.unicode.org/'&gt;Unicode Consortium&lt;/a&gt; may help explain better;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language. … Unicode enables a single software product or a single website to be targeted across multiple platforms, languages and countries without re-engineering. It allows data to be transported through many different systems without corruption&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thankfully MySQL has supported Unicode for quite some time now, even if it&amp;#8217;s not configured to use it by default.&lt;/p&gt;

&lt;p&gt;First, let&amp;#8217;s check what our settings are at the moment;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;mysql&amp;gt; SHOW VARIABLES LIKE &lt;span class='s1'&gt;&amp;#39;collation%&amp;#39;&lt;/span&gt;;
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | latin1_swedish_ci |
| collation_server     | latin1_swedish_ci |
+----------------------+-------------------+
3 rows in &lt;span class='nb'&gt;set&lt;/span&gt; &lt;span class='o'&gt;(&lt;/span&gt;0.01 sec&lt;span class='o'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;mysql&amp;gt; SHOW VARIABLES LIKE &lt;span class='s1'&gt;&amp;#39;character_set%&amp;#39;&lt;/span&gt;;
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     | 
| character_set_connection | latin1                     | 
| character_set_database   | latin1                     | 
| character_set_filesystem | binary                     | 
| character_set_results    | latin1                     | 
| character_set_server     | latin1                     | 
| character_set_system     | utf8                       | 
| character_sets_dir       | /usr/share/mysql/charsets/ | 
+--------------------------+----------------------------+
8 rows in &lt;span class='nb'&gt;set&lt;/span&gt; &lt;span class='o'&gt;(&lt;/span&gt;0.00 sec&lt;span class='o'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;That&amp;#8217;s to be expected, but it&amp;#8217;s not really what we wanted.&lt;/p&gt;

&lt;p&gt;Find your MySQL configuration file (on most Linux/BSD systems it&amp;#8217;s /etc/my.cnf) and make sure it&amp;#8217;s got the following statements under the relevant headers.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;&lt;span class='o'&gt;[&lt;/span&gt;mysqld&lt;span class='o'&gt;]&lt;/span&gt;
default-character-set&lt;span class='o'&gt;=&lt;/span&gt;utf8
default-collation&lt;span class='o'&gt;=&lt;/span&gt;utf8_general_ci
character-set-server&lt;span class='o'&gt;=&lt;/span&gt;utf8
collation-server&lt;span class='o'&gt;=&lt;/span&gt;utf8_general_ci
init-connect&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s1'&gt;&amp;#39;SET NAMES utf8&amp;#39;&lt;/span&gt;

&lt;span class='o'&gt;[&lt;/span&gt;client&lt;span class='o'&gt;]&lt;/span&gt;
default-character-set&lt;span class='o'&gt;=&lt;/span&gt;utf8
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Restart MySQL and make sure it&amp;#8217;s working;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;service mysql restart
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;mysql&amp;gt; SHOW VARIABLES LIKE &lt;span class='s1'&gt;&amp;#39;collation%&amp;#39;&lt;/span&gt;;
+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_general_ci | 
| collation_database   | utf8_general_ci | 
| collation_server     | utf8_general_ci | 
+----------------------+-----------------+
3 rows in &lt;span class='nb'&gt;set&lt;/span&gt; &lt;span class='o'&gt;(&lt;/span&gt;0.00 sec&lt;span class='o'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;mysql&amp;gt; SHOW VARIABLES LIKE &lt;span class='s1'&gt;&amp;#39;character_set%&amp;#39;&lt;/span&gt;;
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       | 
| character_set_connection | utf8                       | 
| character_set_database   | utf8                       | 
| character_set_filesystem | binary                     | 
| character_set_results    | utf8                       | 
| character_set_server     | utf8                       | 
| character_set_system     | utf8                       | 
| character_sets_dir       | /usr/share/mysql/charsets/ | 
+--------------------------+----------------------------+
8 rows in &lt;span class='nb'&gt;set&lt;/span&gt; &lt;span class='o'&gt;(&lt;/span&gt;0.00 sec&lt;span class='o'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Demonstrating setting the charset and collation when creating tables, as suggested by &lt;a href='http://nevali.net/'&gt;Mo&lt;/a&gt;:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;CREATE TABLE &lt;span class='sb'&gt;`&lt;/span&gt;content&lt;span class='sb'&gt;`&lt;/span&gt; &lt;span class='o'&gt;(&lt;/span&gt;
  &lt;span class='sb'&gt;`&lt;/span&gt;id&lt;span class='sb'&gt;`&lt;/span&gt; int&lt;span class='o'&gt;(&lt;/span&gt;11&lt;span class='o'&gt;)&lt;/span&gt; NOT NULL auto_increment,
  &lt;span class='sb'&gt;`&lt;/span&gt;language&lt;span class='sb'&gt;`&lt;/span&gt; varchar&lt;span class='o'&gt;(&lt;/span&gt;255&lt;span class='o'&gt;)&lt;/span&gt; CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  &lt;span class='sb'&gt;`&lt;/span&gt;title&lt;span class='sb'&gt;`&lt;/span&gt; varchar&lt;span class='o'&gt;(&lt;/span&gt;255&lt;span class='o'&gt;)&lt;/span&gt; CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default &lt;span class='s1'&gt;&amp;#39;&amp;#39;&lt;/span&gt;,
  PRIMARY KEY  &lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='sb'&gt;`&lt;/span&gt;id&lt;span class='sb'&gt;`&lt;/span&gt;&lt;span class='o'&gt;)&lt;/span&gt;
&lt;span class='o'&gt;)&lt;/span&gt; &lt;span class='nv'&gt;ENGINE&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Finding Large Files On Your OS X System</title>
   <link href="http://cameronyule.com//2008/01/finding-large-files-on-your-os-x-system"/>
   <updated>2008-01-16T00:00:00+00:00</updated>
   <id>http://cameronyule.com//2008/01/finding-large-files-on-your-os-x-system</id>
   <content type="html">&lt;p&gt;I’ve recently discovered a handy open–source application for OS X on Sourceforge called &lt;a href='http://grandperspectiv.sourceforge.net/'&gt;Grand Perspective&lt;/a&gt;, which allows you to create a visualisation of the relative size of your files. You can specify a specific folder or your entire disk and the program will scan all your files and create an interactive graphic that lets you identify what&amp;#8217;s using the most space – useful for finding things you’ve forgotten.&lt;/p&gt;</content>
 </entry>
 
 
</feed>