diff --git a/.rvmrc b/.rvmrc index bd26552..beb6a03 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1 @@ -rvm --create 1.9.2@wezm.net +rvm use default diff --git a/Gemfile b/Gemfile index 27cb09f..0d53711 100644 --- a/Gemfile +++ b/Gemfile @@ -1,14 +1,13 @@ source :rubygems +gem 'rake' gem 'mime-types' gem 'nanoc' gem 'bitly' gem 'haml' +gem 'sass' gem 'rdiscount' gem 'rubypants' gem 'nokogiri' gem 'builder' -gem 'rb-fsevent' -gem 'guard' -gem 'guard-nanoc' -gem 'growl' +gem 'fssm' diff --git a/Gemfile.lock b/Gemfile.lock index 111ea26..fd14f41 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,51 +1,43 @@ GEM remote: http://rubygems.org/ specs: - addressable (2.2.2) - bitly (0.6.1) + bitly (0.8.0) crack (>= 0.1.4) - httparty (>= 0.5.2) - oauth2 (>= 0.1.1) - builder (3.0.0) - configuration (1.2.0) - crack (0.1.8) - cri (1.0.1) - faraday (0.5.4) - addressable (~> 2.2.2) - multipart-post (~> 1.1.0) - rack (< 2, >= 1.1.0) - growl (1.0.3) - guard (0.3.0) - open_gem (~> 1.4.2) - thor (~> 0.14.6) - guard-nanoc (0.1.0) - guard (>= 0.2.1) - nanoc (>= 3.1.5) - haml (3.0.25) - httparty (0.7.2) - crack (= 0.1.8) - launchy (0.3.7) - configuration (>= 0.0.5) - rake (>= 0.8.1) - mime-types (1.16) - multi_json (0.0.5) - multipart-post (1.1.0) - nanoc (3.1.6) - nanoc3 (>= 3.1.6) - nanoc3 (3.1.6) - cri (>= 1.0.0) - nokogiri (1.4.4) - oauth2 (0.1.1) - faraday (~> 0.5.0) - multi_json (~> 0.0.4) - open_gem (1.4.2) - launchy (~> 0.3.5) - rack (1.2.1) - rake (0.8.7) - rb-fsevent (0.3.9) - rdiscount (1.6.5) + httparty (>= 0.7.6) + oauth2 (>= 0.5.0, < 0.9) + builder (3.1.4) + colored (1.2) + crack (0.3.1) + cri (2.3.0) + colored (>= 1.2) + faraday (0.8.4) + multipart-post (~> 1.1) + fssm (0.2.9) + haml (3.1.7) + httparty (0.9.0) + multi_json (~> 1.0) + multi_xml + httpauth (0.2.0) + jwt (0.1.5) + multi_json (>= 1.0) + mime-types (1.19) + multi_json (1.3.6) + multi_xml (0.5.1) + multipart-post (1.1.5) + nanoc (3.4.3) + cri (~> 2.2) + nokogiri (1.5.5) + oauth2 (0.8.0) + faraday (~> 0.8) + httpauth (~> 0.1) + jwt (~> 0.1.4) + multi_json (~> 1.0) + rack (~> 1.2) + rack (1.4.1) + rake (0.9.2.2) + rdiscount (1.6.8) rubypants (0.2.0) - thor (0.14.6) + sass (3.2.1) PLATFORMS ruby @@ -53,13 +45,12 @@ PLATFORMS DEPENDENCIES bitly builder - growl - guard - guard-nanoc + fssm haml mime-types nanoc nokogiri - rb-fsevent + rake rdiscount rubypants + sass diff --git a/Guardfile b/Guardfile deleted file mode 100644 index 59429df..0000000 --- a/Guardfile +++ /dev/null @@ -1,6 +0,0 @@ -guard 'nanoc' do - watch(%r'^config.yaml') - watch(%r'^Rules') - watch(%r'^layouts\/') - watch(%r'^content\/') -end diff --git a/content/about.html b/content/about.html index 75a231e..d20b536 100644 --- a/content/about.html +++ b/content/about.html @@ -12,10 +12,13 @@ This Site --------- This site is written in [Markdown][markdown] and [SASS][sass], generated using -[nanoc][nanoc], enhanced with [jQuery][jquery] and hosted on a Crucial Paradigm VPS running [Debian -GNU/Linux][debian] and [nginx][nginx]. +[nanoc][nanoc], enhanced with [jQuery][jquery] and hosted on VPS running +[Debian GNU/Linux][debian] and [nginx][nginx]. It makes use of the following +resources made available freely by their authors: + +* [Reset CSS][cssreset] by Eric Meyer +* [Mono icons][monoicons] by tutorial9 +* [Feed icon][feedicon] by FeedIcons.com and the Mozilla Foundation The content is split into two sections: [Technical](/technical/articles/) and [Personal](/personal/articles/). There is @@ -48,3 +51,6 @@ photos. My primary camera is a Canon 400D SLR, with the following lenses: [debian]: http://www.debian.org/ [jquery]: http://jquery.com/ [sass]: http://sass-lang.com/ +[cssreset]: http://meyerweb.com/eric/tools/css/reset/ +[monoicons]: http://www.tutorial9.net/resources/108-mono-icons-huge-set-of-minimal-icons/ +[feedicon]: http://feedicons.com/ diff --git a/content/contact.html b/content/contact.html index 550f446..04232de 100644 --- a/content/contact.html +++ b/content/contact.html @@ -35,6 +35,11 @@ while(x=eval(x));}hiveware_enkoder(); //]]> +App.net +------- + +[https://alpha.app.net/wezm](https://alpha.app.net/wezm) + Twitter ------- diff --git a/content/drafts/google-chrome-for-mac.html b/content/drafts/google-chrome-for-mac.html deleted file mode 100644 index 9ea8fc5..0000000 --- a/content/drafts/google-chrome-for-mac.html +++ /dev/null @@ -1,3 +0,0 @@ -Google's web browser, Chrome, has been available as a developer preview for some time now. Recently it shifted to beta status and the polish keeps piling on. There are a lot of nice touches in the browser that have contributed to me switching away from Safari such as multi-purpose address/search bar, tab closing behaviour, performance and a supported extension mechanism. Some of these things were discussed in Rob Friesel Jr.'s a Week With Chrome and Basil Safwat's obviously tab focussed, A piece with a lot of screenshots about the close tab behaviour in Google Chrome. - -Today, whilst reading http://orderedlist.com/our-writing/resources/html-css/single-line-css/ \ No newline at end of file diff --git a/content/drafts/google-chrome-for-mac.yaml b/content/drafts/google-chrome-for-mac.yaml deleted file mode 100644 index 21ffd2b..0000000 --- a/content/drafts/google-chrome-for-mac.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -slug: google-chrome-for-mac -permalink: http://www.wezm.net/?p=298 -kind: draft -is_hidden: true -section: personal -created_at: 0000-00-00 00:00:00 -title: Google Chrome for Mac -post_id: 298 -tags: [] - -categories: -- Miscellaneous -status: draft diff --git a/content/drafts/haiku.html b/content/drafts/haiku.html deleted file mode 100644 index 3749d8c..0000000 --- a/content/drafts/haiku.html +++ /dev/null @@ -1,3 +0,0 @@ -On the topic of OS's nearing release, Haiku is set for an alpha release in Sep[1]: http://www.osnews.com/story/22001/Haiku_Schedules_First_Alpha_Release_for_September_9 - -If you haven't heard of Haiku its a rewrite of BeOS from scratch. The aim of the first release is compatibility with the last official release of BeOS: R5. They're a good way down that path. As far as I know many apps that were built for R5 will run on Haiku. I've been following the project for a while now. Back in uni I downloaded an installed BeOS on my PC, this was obviously before the company went out of business/was bought by Palm (I think). The bit that interests me about it is that its GUI out of the box, much like OS X and Windows. Its attributes such as compactness, GUI, open source and POSIX core makes it a great candidate for high level embedded type projects I think. Things like the digital photo frame project I've had in mind for a while. Its one drawback in my mind is that the platform's primary language is C++, which I'm not a huge fan of. However if you're into C++ it might be worth checking out. If I recall correctly large parts of the kernel are written in C++ too. \ No newline at end of file diff --git a/content/drafts/haiku.yaml b/content/drafts/haiku.yaml deleted file mode 100644 index dc4b10f..0000000 --- a/content/drafts/haiku.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -slug: haiku -permalink: http://www.wezm.net/?p=240 -kind: draft -is_hidden: true -section: personal -created_at: 0000-00-00 00:00:00 -title: Haiku -post_id: 240 -tags: -- os -categories: -- Miscellaneous -status: draft diff --git a/content/drafts/iphone-gripes-reminders.html b/content/drafts/iphone-gripes-reminders.html deleted file mode 100644 index ecc69da..0000000 --- a/content/drafts/iphone-gripes-reminders.html +++ /dev/null @@ -1,3 +0,0 @@ -Reminders aren't aggressive enough. A single buzz when on silent is not enough and makes them very easy to miss. They should behave like a phone call and persist until acknwledged. - -Lack of camera functionality: no timed photos \ No newline at end of file diff --git a/content/drafts/iphone-gripes-reminders.yaml b/content/drafts/iphone-gripes-reminders.yaml deleted file mode 100644 index 6735f5b..0000000 --- a/content/drafts/iphone-gripes-reminders.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -slug: iphone-gripes-reminders -permalink: http://www.wezm.net/?p=237 -kind: draft -is_hidden: true -section: technical -created_at: 2008-07-24 14:11:35 -title: "iPhone gripes: Reminders" -post_id: 237 -tags: [] - -categories: -- iPhone -status: draft diff --git a/content/drafts/perl-worst-practices.yaml b/content/drafts/perl-worst-practices.yaml index 6424799..bb3b294 100644 --- a/content/drafts/perl-worst-practices.yaml +++ b/content/drafts/perl-worst-practices.yaml @@ -4,7 +4,7 @@ permalink: http://www.wezm.net/?p=100 kind: draft is_hidden: true section: uncategorized -created_at: 0000-00-00 00:00:00 +created_at: 2012-01-01 00:00:00 title: Perl Worst Practices post_id: 100 tags: [] diff --git a/content/personal/2010/09/weather-station.mkdn b/content/personal/2010/09/weather-station.mkdn index 2977c9c..e0cb8e9 100644 --- a/content/personal/2010/09/weather-station.mkdn +++ b/content/personal/2010/09/weather-station.mkdn @@ -54,13 +54,17 @@ what I'm most interested in.
The Finished Installation
The Finished Installation
-
+
To log and upload the weather readings to [http://weather.wezm.net/][weather] I'm using the [wview][wview] weather station software. wview is running on the Mac mini connected to our TV. The site layout is pretty basic so I hope to come up with a cleaner design in the coming weeks. +**Update:** I built a custom logging and charting solution. See the post, +[Weather Station Software][software]. + +[software]: /technical/2010/09/weather-station-software/ [WS2355]: http://www.lacrossetechnology.com.au/shop2/product_info.php?cPath=21&products_id=93 [wview]: http://www.wviewweather.com/ [weather]: http://weather.wezm.net/ diff --git a/content/personal/2012/01/a-photo-a-day-in-2012.html b/content/personal/2012/01/a-photo-a-day-in-2012.html new file mode 100644 index 0000000..9015627 --- /dev/null +++ b/content/personal/2012/01/a-photo-a-day-in-2012.html @@ -0,0 +1,39 @@ +This year I've decided to have a go at publishing a photo every day +of the year. I'm not the first to do this, its also known by the name +[Project 365][project365]. I'm publishing my photos to the [2012 set on +Flickr][set]. The first week whilst I was still on Christmas holidays was +pretty easy. Although I am missing a photo for Jan 2 as the photo I took +got deleted whilst trying to restore my iPhone that got drowned in a river. +Anyway after returning to work its been harder to find things to take +pictures of but I haven't missed a day yet. + +[set]: http://www.flickr.com/photos/wezm/sets/72157628659470185/ +[project365]: http://content.photojojo.com/tutorials/project-365-take-a-photo-a-day/ + +Some of my favourites from the first 3 weeks are: + +
+ Eastern Spinebill +
Jan 8 — Eastern Spinebill
+
+ +
+ CityLink +
Jan 13 — CityLink
+
+ +
+ Sulphur Crested Cockatoo +
Jan 15 — Sulphur Crested Cockatoo
+
+ +
+ Belvedere — Intense +
Jan 18 — Belvedere – Intense
+
+ +
+ Macedon Primary School Plantation +
Jan 19 — Macedon Primary School Plantation
+
+ diff --git a/content/personal/2012/01/a-photo-a-day-in-2012.yaml b/content/personal/2012/01/a-photo-a-day-in-2012.yaml new file mode 100644 index 0000000..5568b4a --- /dev/null +++ b/content/personal/2012/01/a-photo-a-day-in-2012.yaml @@ -0,0 +1,11 @@ +--- +title: A Photo a Day in 2012 +extra: In 2012 I'm aiming to take and publish a photo every day. +kind: article +section: personal +created_at: 2012-01-21 17:18:00 +keywords: +- photography +- "2012" +- project365 +short_url: http://bit.ly/wKwmtl diff --git a/content/projects.html b/content/projects.html index a567010..82a8610 100644 --- a/content/projects.html +++ b/content/projects.html @@ -3,21 +3,31 @@ more noteworthy projects are listed below. [github]: http://github.com/wezm - + +lua-imlib2 +---------- + +[lua-imlib2] is a fork of the published lua-imlib library with additional +functionality. This library allows image processing in Lua. Specifically I +added: + +* Support for filters +* Image blending + +[lua-imlib2]: https://github.com/wezm/lua-imlib2 node-genx --------- diff --git a/content/screen.sass b/content/screen.sass index 78f8222..2d4a43f 100644 --- a/content/screen.sass +++ b/content/screen.sass @@ -282,7 +282,7 @@ a height: 75px width: 75px border: 1px solid #ccc - background: url(/images/photos.jpg) no-repeat 0 -75px + background: url(/images/photos.jpg?20120121) no-repeat 0 -75px &:first-child margin-left: 2em diff --git a/content/technical/2008/07/comment-feeds-in-wordpress.html b/content/technical/2008/07/comment-feeds-in-wordpress.html index c288f2a..ce9b62a 100644 --- a/content/technical/2008/07/comment-feeds-in-wordpress.html +++ b/content/technical/2008/07/comment-feeds-in-wordpress.html @@ -1,4 +1,5 @@ Here's tip for something I worked out today. WordPress blogs generally have an RSS feed available for the comments on a post. This is handy for when you want to see other comments posted without having to remember to check back. The problem is many WP themes don't provide a link to the feed. The solution is to add `/feed` to the URL of the post, so for this post the comment feed is at: -http://www.wezm.net/2008/07/02/comment-feeds-in-wordpress/feed. -**Update 25 Mar 2010:** The example given will no longer work because I've moved this site off WordPress. \ No newline at end of file +http://www.wezm.net/2008/07/02/comment-feeds-in-wordpress/feed + +**Update 25 Mar 2010:** The example given will no longer work because I've moved this site off WordPress. diff --git a/content/technical/2010/09/weather-station-software.html b/content/technical/2010/09/weather-station-software.html index 67dd41d..8e78b06 100644 --- a/content/technical/2010/09/weather-station-software.html +++ b/content/technical/2010/09/weather-station-software.html @@ -16,7 +16,7 @@ functions for communicating with a LaCrosse WS-23xx weather station and a set of tools. wview logged its observations to an SQLite database, which seemed appropriate for this application. There were tools in Open2300 to log current conditions to MySQL and PostgreSQL databases but not SQLite. So last weekend -I spend some of the afternoon learning enough of the SQLite C API to add +I spent some of the afternoon learning enough of the SQLite C API to add such a tool. The result is in my [git mirror of the Open2300 SVN repo][open2300git]. Once the SQLite tool is tidied up a bit more I'll submit it upstream. @@ -29,9 +29,10 @@ that wview was previously generated. To do this I wrote a small [Lua tool][weather-tools] to query the database and output the results to a [JSON][json] file. The JSON is used on the new [weather page][weather], which is largely populated -by Javascript and uses the [flot charting library][flot] to graph the -temperature history. +by Javascript and uses the [flot][flot] and [dygraphs][dygraphs] libraries +visualise the weather data. [json]: http://www.json.org/ [flot]: http://code.google.com/p/flot/ -[weather-tools]: http://github.com/wezm/weather-tools \ No newline at end of file +[dygraphs]: http://dygraphs.com/ +[weather-tools]: http://github.com/wezm/weather-tools diff --git a/content/technical/2011/08/monochrome-thumbnails.html b/content/technical/2011/08/monochrome-thumbnails.html new file mode 100644 index 0000000..4bb5ffb --- /dev/null +++ b/content/technical/2011/08/monochrome-thumbnails.html @@ -0,0 +1,49 @@ +Ever since this version of my site went live I've been meaning to +post about the generation of the monochrome thumbnails on the [front page](/). +When I was building the site I wanted to include recent items +from my Flickr photostream. However with the predominantly monochrome +design I didn't like the look of all the colour they added. So I looked into +having monochrome versions of the thumbnails shown. + +The first thing I investigated was Javascript image processing libraries. The +only main contender in that space was [Pixastic]. It worked but its cross browser +support wasn't great at the time. So I moved on to writing a tool that I +could run locally. + +[Pixastic]: http://pixastic.com/ + +I decided the tool should generate a single image with +both the colour and monochrome versions in it (a technique known as spriting). +Using a single image means only one HTTP request instead of forty. Being a +programmer with an interest in Cocoa programming I created a small command line +tool that used the Flickr API to get the details of the last twenty images in +my photostream, fetch them and then use Core Image to convert them to +monochrome, add both the colour and monochrome versions to the output image and +finally save the result. + +This worked great, however when I stopped hosting my site on my Mac I thought I +would need to run the process periodically on my Linux server, which ruled out +Core Image. I took this as another opportunity to learn something new and +rewrote it in Lua using imlib2 bindings. I had to make some additions to the +imlib bindings, which are [published on GitHub][luaimlib]. + +[luaimlib]: https://github.com/wezm/lua-imlib2 + +I used the Lua version for some time but never bothered to set it up +on the server. I wasn't uploading photos all that frequently and it +was simple enough to run locally and rsync the result. I've recently +switched back to the Mac version as it was simpler to get up and running +on my new laptop. + +The [code is on GitHub][code] if anyone wants to do something similar. The +Cocoa version is on the master branch, the Lua version is on the +[lua branch][lua-branch]. + +[code]: https://github.com/wezm/monothumb +[lua-branch]: https://github.com/wezm/monothumb/tree/lua + +The current version of the processed thumbnails is shown below. + +
+ +
diff --git a/content/technical/2011/08/monochrome-thumbnails.yaml b/content/technical/2011/08/monochrome-thumbnails.yaml new file mode 100644 index 0000000..6d81702 --- /dev/null +++ b/content/technical/2011/08/monochrome-thumbnails.yaml @@ -0,0 +1,13 @@ +--- +title: Monochrome Thumbnails +extra: Generating monochrome thumbnails with a color rollover from my Flickr feed +kind: article +section: technical +created_at: 2011-08-27 18:54:00 +keywords: +- image +- processing +- lua +- core +- monochrome +short_url: http://bit.ly/omIs0U diff --git a/content/technical/2011/08/strip-trailing-whitespace-xcode-4.html b/content/technical/2011/08/strip-trailing-whitespace-xcode-4.html new file mode 100644 index 0000000..4cdcd4d --- /dev/null +++ b/content/technical/2011/08/strip-trailing-whitespace-xcode-4.html @@ -0,0 +1,29 @@ +Xcode has a bad habit of adding trailing whitespace to code, which is a pet +peeve of mine. It introduces irrelevant changes into diffs and is particularly +glaring when commiting code with [GitX], which highlights it in red. In [TextMate] +and now [Vico] I have bound the strip trailing whitespace in current document +action to ⌃⌥⌘S (control-option-command-s). This makes it quick and easy. +Xcode makes adding these types of actions a bit harder but I came up with a +solution that uses the Behaviours functionality in Xcode 4. This is how I did +it: + +[GitX]: http://gitx.frim.nl/ +[Vico]: http://www.vicoapp.com/ +[TextMate]: http://macromates.com/ + +Create a shell script that invokes `sed` on each git tracked file that is +modified. Since Xcode doesn't tell the script what the current file was and +I didn't want to run sed over every file every time, processing tracked files +with modifications was the best solution I could come up with. Note that the +script also only prcocesses `.m` and `.h` files. I have my copy of the script +in `~/Documents/strip.sh`, be sure to give it the execute permission. + + + +Next you need to add a behaviour to Xcode. Go to the Xcode preferences and +click the Behaviours section, then click the + button. Name the behaviour and +give it a keyboard shortcut. In the right pane check Run and choose the script +you saved above. That's it. Now you can kill off that nasty whitespace with +ease. + +Xcode 4 Behaviours Preferences diff --git a/content/technical/2011/08/strip-trailing-whitespace-xcode-4.yaml b/content/technical/2011/08/strip-trailing-whitespace-xcode-4.yaml new file mode 100644 index 0000000..ac2befc --- /dev/null +++ b/content/technical/2011/08/strip-trailing-whitespace-xcode-4.yaml @@ -0,0 +1,16 @@ +--- +title: Strip Trailing Whitespace in Xcode 4 +extra: How to create a behaviour in Xcode 4 to strip trailing whitespace from all git tracked files with changes. +kind: article +section: technical +created_at: 2011-08-27 19:36:00 +keywords: +- xcode +- strip +- trailing +- whitespace +- text +- editing +- programming +- apple +short_url: http://bit.ly/nGeJrK diff --git a/content/technical/2011/09/custom-search-engine-safari.html b/content/technical/2011/09/custom-search-engine-safari.html new file mode 100644 index 0000000..c5c94d4 --- /dev/null +++ b/content/technical/2011/09/custom-search-engine-safari.html @@ -0,0 +1,54 @@ +In my ongoing efforts to distance myself from Google I started using +[DuckDuckGo][duck] as my default search engine. I tried the DDG Safari +extension but didn't really like it, especially +since it needed to add an entire new toolbar to the browser. Other +suggestions for adding DDG to Safari involved [hacking the binary][hack] +or other extensions, which I wasn't interested in. + +[duck]: http://duckduckgo.com/ +[hack]: http://hints.macworld.com/article.php?story=20030514035516436 + +**Update:** There an easier way to achive what I describe below: Just +add a hosts file entry for search.yahoo.com that points at DuckDuckGo's +IP address and set you search engine to Yahoo! in Safari. [See DuckDuckGo +for the full instructions][hosts]. + +[hosts]: http://help.duckduckgo.com/customer/portal/articles/255650 + +My solution to the problem was to hijack the Bing option in the default +search box for use with DDG. **Note:** This solution assumes you will +never want to go to the `www.bing.com` domain, not a problem for me. The +steps to implement it are: + +Add an entry for `www.bing.com` to `/etc/hosts` that points the domain to +your local machine: + + 127.0.0.1 www.bing.com + +Next configure an Apache virtual machine to respond to the `www.bing.com` +domain and redirect the request to Duck Duck Go (or your search engine +of choice). This works because DDG accepts the search query in the same +query string parameter, `q`, as Bing and ignores the other Bing related +params. + +`/etc/apache2/extra/httpd-vhosts.conf`: + + + ServerName www.bing.com + RewriteEngine On + RewriteRule ^/search(.*)$ http://duckduckgo.com/$1 [redirect,last] + + +For this to work you will need to have "Web Sharing" enabled in the Sharing +preferences pane and have the the following line included in +`/etc/apache2/httpd.conf`: + + Include /private/etc/apache2/extra/httpd-vhosts.conf + +Restart Apache (`sudo apachectl graceful`) and set your search engine +to Bing in Safari. Do a search and you should end up at the DDG +results. One of the neat features of DDG is its [!bang syntax][bang], +which allows you to search to 100s of sites directly. One of which is +`!g` for those times when you need to fall back on Google. + +[bang]: http://duckduckgo.com/bang.html diff --git a/content/technical/2011/09/custom-search-engine-safari.yaml b/content/technical/2011/09/custom-search-engine-safari.yaml new file mode 100644 index 0000000..81f8d03 --- /dev/null +++ b/content/technical/2011/09/custom-search-engine-safari.yaml @@ -0,0 +1,15 @@ +--- +title: Add a Custom Search Engine to Safari +extra: How to add a custom search engine to Safari without nasty hacks or input managers. +kind: article +section: technical +created_at: 2011-09-24 15:34:00 +keywords: +- safari +- custom +- search +- engine +- duckduckgo +- google +- apache +short_url: http://bit.ly/rj1slK diff --git a/content/technical/2011/12/freebsd-zfs-powered-nas.html b/content/technical/2011/12/freebsd-zfs-powered-nas.html new file mode 100644 index 0000000..c5392a9 --- /dev/null +++ b/content/technical/2011/12/freebsd-zfs-powered-nas.html @@ -0,0 +1,162 @@ +## Summary + +Here's the tl;dr version: I sold my Mac Pro to fund building a home +NAS. The result is a HP MicroServer with 4Gb RAM and 3 × 2Tb hard +drives running FreeBSD from the system drive and a ZFS pool across the +three 2Tb drives. Total cost: AU$731.67. + +## Rationale + +Recently the Time Machine drive in my Mac Pro started to randomly +disappear and Mac OS X would say that I had removed it improperly, +which was not true given it was an internal drive still inside the +machine. + +I've seen this behaviour before and in that case it resulted in the drive +being replaced due to its inability to complete a short S.M.A.R.T. +scan. This drive (also a Samsung) was suffering a similar problem except +that initiating the S.M.A.R.T. scan would actually cause it to disappear +from the SATA bus. A check on the Samsung site showed that the drive was +out of warranty so I was up for a replacement. + +The Mac Pro wasn't getting used for much since I got a i7 powered Mac +Book Pro. Its main duties involved storing my iTunes library, Aperture +library and running my weather logger. It wasn't exactly a very energy +efficient machine to run all the time. It would in fact keep the study +warm overnight when the door was closed during winter. + +There was also a problem with replacing the failing drive: I couldn't afford +to do so. So I decided to move the weather logging to my [ALIX board][alix] +and sell the Mac Pro to fund building a home NAS. I was able to sell the +Mac Pro very quickly on eBay for $1500 but gave myself a budget of $1000 for +the NAS. I wanted the NAS to have reliable, redundant storage, which for me +meant [ZFS]. This implied the new machine would need to run one of [Solaris], +[illumos], [FreeBSD], [FreeNAS] or [SmartOS]. The requirement to run one of +these OS's ruled out an off the shelf NAS appliance. + +[ZFS]: http://www.opensolaris.org/os/community/zfs/ +[alix]: /technical/2011/12/openwrt-on-alix/ +[Solaris]: http://oracle.com/solaris +[illumos]: https://www.illumos.org/ +[FreeBSD]: http://www.FreeBSD.org/ +[SmartOS]: http://smartos.org/ +[FreeNAS]: https://www.illumos.org/ + +I did a lot of research into different ways to build the machine and +tried out all the OS options in virtual machines. I considered using +basic PC hardware, MiniITX, HP MicroServer, etc. Each had its own +pros and cons. The basic PC approach was possibly the cheapest but it +was the largest. MiniITX was more expensive and choice of multi hard +drive bay cases were limited. I ended up settling on the [HP Proliant +MicroServer][microserver] running FreeBSD. + +[microserver]: http://h10010.www1.hp.com/wwpc/hk/en/sm/WF06b/15351-15351-4237916-4237917-4237917-4248009-5163345.html + + + +
+ Inside/outside view of HP MicroServer +
The end result. Click/tap to toggle inside view.
+
+ +
+ Fron of MicroServer with CD for size comparison +
CD for size comparison.
+
+ +
+ Oblique view of HP MicroServer +
Oblique view (excuse the finger prints).
+
+ + +## The Build + +The MicroServer is a neat little unit. It uses a low power dual core AMD +Turion II CPU and comes with 2Gb ECC RAM and a 250Gb HD. I has 4 non-hot +swappable hard drive bays all packaged up in a squat little box. I ordered +mine with an extra 2Gb or RAM as ZFS likes to have plenty of RAM available +to run well. + +During my research hard drive prices sky rocketed due to floods +in Thailand, however I was able to get some at pre-flood prices from +[ht.com.au][ht]. They have since put the price up ~$40 and placed order +limits on them. + +For the drives I chose 2Tb Seagate Barracuda Green's. They feature SATA 3 +and a 64Mb cache and run at an atypical 5900RPM. These drives seemed to be +a good balance across energy efficiency, noise, performance and price. + +[ht]: http://ht.com.au/ + +The final parts list ended up being rather diminutive: + +* 1 × [HP MicroServer][microserver] (658553-371) + 2Gb extra RAM $336.82 +* 3 × [2Tb Seagate Barracuda Green Hard Drives][hard-drives] $394.85 + +[hard-drives]: http://www.ht.com.au/cart/1/part/V0531-Seagate-Barracuda-Green-ST2000DL003-hard-drive-2-TB-SATA-600/detail.hts + +The total cost ended up being $731.67, healthily under budget. + +
+ Installing RAM into HP MicroServer +
Installing the extra RAM.
+
+ +
+ Installing hard drives into HP MicroServer +
Installing the hard drives.
+
+ +## Software + +Installing FreeBSD and setting up the ZFS pool was very +straightforward. I'm running the drives in a RAIDZ configuration, +giving 3.6Tb of usable storage. I currently have two ZFS file systems +on that. One in a normal configuration and the other for photos with +`copies=2` set. + +The system all ran well for a few days however on the forth day one of +the brand new drives failed and started making a terrible clicking, beeping +noise. Fortunately HT replaced it very promptly and the replacement has +been running fine since. During the time the failed drive was out for +replacement the ZFS pool continued to run fine in its degraded state, with +no data loss. Once the new drive was installed it was a simple matter of +issuing `zfs replace ada1` and it began the process of resilvering the data +onto the new drive and it has been running incident free since. + + $ zpool status + pool: storage + state: ONLINE + scan: resilvered 1.07T in 9h32m with 0 errors on Tue Nov 29 07:13:29 2011 + config: + + NAME STATE READ WRITE CKSUM + storage ONLINE 0 0 0 + raidz1-0 ONLINE 0 0 0 + ada1 ONLINE 0 0 0 + ada2 ONLINE 0 0 0 + ada3 ONLINE 0 0 0 + + errors: No known data errors + +After setting up the OS and file systems the only other thing I +needed to so was make the storage available to other machines on the +network. Since my house is all Macs I built [netatalk] via the FreeBSD +ports collection to make the storage available via AFP. + +[netatalk]: http://netatalk.sourceforge.net/ + +With that done it's the sever shows up in the Finder via Bonjour and +copying/accessing data is dead simple. + diff --git a/content/technical/2011/12/freebsd-zfs-powered-nas.yaml b/content/technical/2011/12/freebsd-zfs-powered-nas.yaml new file mode 100644 index 0000000..78319e5 --- /dev/null +++ b/content/technical/2011/12/freebsd-zfs-powered-nas.yaml @@ -0,0 +1,14 @@ +--- +title: Home NAS Powered by FreeBSD and ZFS +extra: Building a home NAS with a HP MicroServer running FreeBSD and ZFS. +kind: article +section: technical +created_at: 2012-01-21 17:08:00 +keywords: +- zfs +- freebsd +- hp +- proliant +- microserver +- nas +short_url: http://bit.ly/xz4hnt diff --git a/content/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview.html b/content/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview.html new file mode 100644 index 0000000..e6dd257 --- /dev/null +++ b/content/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview.html @@ -0,0 +1,46 @@ +When it comes time to present errors or other messages in iOS with +[UIAlertView] it is immediately obvious that a more convenient interface +would involve the use of blocks. A [search on GitHub][github-search] +shows just about every iOS developer has had the same thought and had a crack at it. + +[UIAlertView]: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAlertView_Class/UIAlertView/UIAlertView.html +[github-search]: https://github.com/search?type=Repositories&language=&q=uialertview&repo=&langOverride=&x=14&y=17&start_value=1 + +After reviewing the better options (I.e. those that actually had a +README with more than a few lines of content) on GitHub it appeared +that one of the challenges was how to handle memory. This stems from +the wrapper becoming the delegate for the UIAlertView but not having a +strong reference from the caller. I saw various solutions to this, most +involving adding a extra retain call to keep everything around until the +delegate methods were called. + +Since my project is using ARC I looked for a solution that +didn't involve marking the wrapper file as non-ARC and +invoking `retain`. The solution I came up with was to use +[`objc_setAssociatedObject`][set-object]. This Objective-C runtime +function allows one object to be associated with another using various +memory management strategies. I used this to associate the UIAlertView +blocks based wrapper with the UIAlertView. + +[set-object]: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocAssociativeReferences.html + +In the `init` method the wrapper instance is associated with its UIAlertView: + + objc_setAssociatedObject(alertView, _cmd, self, OBJC_ASSOCIATION_RETAIN); + +Note that I'm using the implicit second argument to the method, its +selector, `_cmd` as the key for the associated object. This was +suggested in a [tweet by Bill Bumgarner][bbum]. + +[bbum]: http://twitter.com/bbum/status/3609098005 + +Then in `alertView:didDismissWithButtonIndex:`, the association +is removed, `dealloc` of the wrapper called as a result and the +`UIAlertView` also released. + + SEL key = @selector(initWithTitle:message:); + objc_setAssociatedObject(self.alertView, key, nil, OBJC_ASSOCIATION_RETAIN); + +The full [MIT licensed code][gist] is available as a [gist on GitHub][gist]. + +[gist]: https://gist.github.com/1392611 diff --git a/content/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview.yaml b/content/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview.yaml new file mode 100644 index 0000000..28401c7 --- /dev/null +++ b/content/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview.yaml @@ -0,0 +1,14 @@ +--- +title: Fun With objc_setAssociatedObject and UIAlertView +extra: Using objc_setAssociatedObject in a blocks based UIAlertView wrapper. +kind: article +section: technical +created_at: 2011-12-11 17:26:00 +keywords: +- ios +- uialertview +- blocks +- objc_setAssociatedObject +- arc +- objective-c +short_url: http://bit.ly/u9Ys9v diff --git a/content/technical/2011/12/ios-launch-image-is-not-a-splashscreen.html b/content/technical/2011/12/ios-launch-image-is-not-a-splashscreen.html new file mode 100644 index 0000000..f7caa34 --- /dev/null +++ b/content/technical/2011/12/ios-launch-image-is-not-a-splashscreen.html @@ -0,0 +1,61 @@ +At work we're currently having an iOS app that I'm working on styled +by a designer. The second screen we were supplied was a pretty splash +screen with a big logo on it. We responded saying that we didn't want +to use the launch image like that. Our designer responded saying that +was fine but the majority of the clients nowadays require heavy emphases +on corporate branding therefore it was a standard practice to cater to +those requirements. It's a shame that this is what people are are asking +for since its is not the intended use of the launch image. + +Justin Williams recently had the following clear-cut words to say on the +topic of splash screens in his [On Magazines and the iPad][carpeaqua] +article (emphasis from the article): + +> Remember, kids. The first rule of mobile development is that *no one +> gives a fuck about your brand*. A splash screen with a giant logo +> is something that makes editors and marketing directors feel good, +> but to a user it just feels like a meaningless delay. You know that +> feeling of frustration you get each time there’s a 15-second preroll +> before a video on the web? That’s what a splash screen with logos and +> advertisements is. + +[carpeaqua]: http://carpeaqua.com/2011/12/04/on-magazines-and-the-ipad/ + +The Apple [iOS Human Interface Guidelines][MobileHIG] include the +following suggestions: + +> Avoid taking space away from the content people care about. For +> example, displaying a second, persistent bar at the top of the screen +> that does nothing but display branding assets means that there’s less +> room for content. Consider other, less intrusive ways to display +> pervasive branding, such as subtly customizing the background of a +> screen. + +> Display a launch image that closely resembles the first screen of the +> application. This practice decreases the perceived launch time of your +> application. + +> Avoid displaying an About window or a splash screen. In general, try +> to avoid providing any type of startup experience that prevents people +> from using your application immediately. + +> Supply a launch image to improve user experience. +> +> Avoid using your launch image as an opportunity to provide: +> +> * An "application entry experience," such as a splash screen +> * An About window +> * Branding elements, unless they are a static part of your +> application’s first screen +> +> Because users are likely to switch among applications frequently, you +> should make every effort to cut launch time to a minimum, and you +> should design a launch image that downplays the experience rather than +> drawing attention to it. + +[MobileHIG]: http://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/MobileHIG.pdf + +The launch image is designed to make the perceived launch time of you app +feel faster by showing something resembling the interface that will be loaded +as quickly as possible. Displaying a logo does nothing but draw attention +to how quickly your app loads and adds nothing to the user's experience. diff --git a/content/technical/2011/12/ios-launch-image-is-not-a-splashscreen.yaml b/content/technical/2011/12/ios-launch-image-is-not-a-splashscreen.yaml new file mode 100644 index 0000000..f892d76 --- /dev/null +++ b/content/technical/2011/12/ios-launch-image-is-not-a-splashscreen.yaml @@ -0,0 +1,15 @@ +--- +title: The iOS Launch Image is Not a Splash Screen +extra: Reasons why the launch image in iOS apps is not intended to be a splash screen with your pretty logo on it. +kind: article +section: technical +created_at: 2011-12-08 07:29:00 +keywords: +- ios +- iphone +- ipad +- splash +- screen +- launch +- image +short_url: http://bit.ly/uRHJqI diff --git a/content/technical/2011/12/openwrt-on-alix.html b/content/technical/2011/12/openwrt-on-alix.html new file mode 100644 index 0000000..7aa0056 --- /dev/null +++ b/content/technical/2011/12/openwrt-on-alix.html @@ -0,0 +1,85 @@ +After ongoing issues with maintaining a reliable Internet connection at +home I decided to add a router box to the network in charge of assigning +IP addresses and sharing our Internet connection with the rest of the +network. I wanted something with at least two Ethernet ports so that +all Internet traffic would flow through the device and allow bandwidth +hogs to be identified at times when the connection appeared flooded. + +After a bunch of research into appropriate hardware and software I +decided on a [PC Engines ALIX][alix] single board computer (alix2d13). The +ALIX is a small board about the size of a CD case with the following +features: + +* 500Mhz AMD Geode (x86 compatible) CPU +* 256Mb RAM +* 2 × USB ports +* 3 × 10/100 Ethernet ports +* Mini-PCI socket (for WiFi if desired) +* RS-232 serial port +* CompactFlash socket + +Along with the board I ordered one of [PC Engines cases][case] +(case1s2u) to go with it. + +[alix]: http://www.pcengines.ch/alix2d13.htm +[case]: http://www.pcengines.ch/case1d2u.htm + +For the software I settled on [OpenWRT][openwrt]. I chose it for a number of +reasons: + +* Good support for ALIX boards. +* Designed to run from Flash and read only file systems. +* Great binary package manager that allows additional software to be + installed. +* Lightweight [Lua] based Web UI available ([LuCI][luci]). + +[openwrt]: https://openwrt.org/ +[luci]: http://luci.subsignal.org/ +[Lua]: http://www.lua.org/ + +After learning to use the excellent OpenWRT build system I was able to +build a custom CompactFlash image for the board to run. I also created a +package for my [weather logging software][weather-software] so that the +ALIX can do all my [weather station][weather] logging. + +[weather]: /personal/2010/09/weather-station/ +[weather-software]: /technical/2010/09/weather-station-software/ + +This setup has been extremely reliable. I've pushed all services on to +it that my ADSL modem and AirPort base station used to be responsible +for. Including maintaining the PPPoE connection to my ISP. I'd certainly +recommend a set up like this to anyone who is looking for a small +dedicated home router. + +If you don't like the prospect of building your own custom OS image I'd +also highly recommend [m0n0wall], which is a [FreeBSD] derived +router system. I ran this on the ALIX initially and it was very easy +to get up an running (write image to CF card, boot from card - default +settings worked fine but can be changed via a web UI) and very reliable. + +[m0n0wall]: http://m0n0.ch/wall/ +[FreeBSD]: http://www.freebsd.org/ + +
+ Front view +
Front with three LEDs. The behaviour of the LEDs can + be customised in OpenWRT. I have the left one indication power and + the middle one indicating activity on the WAN port. The other one is + currently unused.
+
+ +
+ Top view with CD for size comparison +
Top of case, showing size in comparison to a CD case.
+
+ +
+ alix2d13 board +
The ALIX board itself with the following connected: WAN + and LAN Ethernet, 8Gb [MosKeyto USB flash drive][moskeyto], + weather station USB cable and 32Mb CF card that the system runs + off.
+
+ +[moskeyto]: http://www.lacie.com/au/products/product.htm?id=10425 + diff --git a/content/technical/2011/12/openwrt-on-alix.yaml b/content/technical/2011/12/openwrt-on-alix.yaml new file mode 100644 index 0000000..fa59af0 --- /dev/null +++ b/content/technical/2011/12/openwrt-on-alix.yaml @@ -0,0 +1,16 @@ +--- +title: Little Linux Router Box +extra: Solving my Internet connection issues with a PC Engines ALIX single board computer and OpenWRT. +kind: article +section: technical +created_at: 2012-01-21 15:33:00 +keywords: +- alix +- embedded +- linux +- openwrt +- server +- appliance +- freebsd +- m0n0wall +short_url: http://bit.ly/y9ZEKZ diff --git a/content/weather.html b/content/weather.html index b150aaa..eeabb8f 100644 --- a/content/weather.html +++ b/content/weather.html @@ -26,7 +26,7 @@
-Forecast icons by LavAna +Forecast icons by LavAna. Data from my weather station.