Wine bottle glasses.
Here’s a first attempt at cutting wine bottles to make drinking glasses. These were done by hand so the scribe was not straight enough. A jig will have to be made!
Cooping the chickens
Chickens arrive tomorrow so Nathan and I have been cooping like mad to get things ready. The coop is made of 90% on hand materials. The only new parts are some of the door frame components.
A letter to Random House Australia regarding eBooks.
The following is a letter I sent to the Random House Australia. As you can tell from reading it I am unhappy that it is not possible for me to buy the books I want from them in the format I want.
27th October 2009
Ebook publishing.
Random House Australia
Level 3 100 Pacific Highway North Sydney, N.S.W., 2060 AustraliaDear sir or madam,
I have followed with keen interest the international launch of the Kindle electronic reader from Amazon.com. When I had established that a minimum of books which interest me are available I placed an order and am now a very satisfied user of the device. It is the second e-ink device I have owned and without a doubt its best feature is the ease with which content may be sampled and purchased.
It was with some irritation however that I noticed many if not all books from your catalogue are not available for purchase in Kindle format within Australia. This is despite them being available from the Kindle store for other regions. I appreciate that this is due to the way that publishing rights are negotiated but, as I will outline, this doesn’t matter to me.
I shall also outline why I have come to the conclusion that the greatest piracy threat publishers face is themselves.
Let us look at the example of Terry Pratchett’s recent book Unseen Academicals. I would very much like to read this book but I don’t necessarily feel the need to own a paper copy. In the event that I might desire to own a paper copy I still may not bother because of a simple truth: I am lazy. I want to take the easiest route to reading the novel at a reasonable price. The less effort involved the more likely my purchase.
Were the book available via the Kindle store I would have bought it within a few moments with not much more than a quick taping of a few buttons. It wouldn’t even have been necessary for me to get out of my hammock or comfy chair. However, the book is not available to me in this way. What am I to do?
There are a few options. For the sake of making my overall point plain I shall list them in order of ease, starting with the easiest.
- I could not read the book. You get nothing, Mr. Pratchett gets nothing, and I get nothing.
- I could pirate the book. A few quick Google searches suggest that it’s definitely available. The quality is likely to be variable but from the comments of the people who have pirated it would appear to be readable.
- I could create a fake U.S. address and have the book “shipped” there. You get nothing, Mr. Pratchett gets paid, and I get to read the book.
- I could go to the library. This is closer to my house than any decently sized bookstore and reserving the book online is often as fast as ordering it. You get a small amount of money per reader, Mr. Pratchett gets a small amount of money per reader, and I get to read the book.
- I could go to a physical bookstore. The outcome of which is obvious.
Critical in all of this is the observation that by not making the title available for the device I use you’ve made several options which don’t net you any income more attractive than buying from you. Obviously, given my writing to you, I have significant objections to piracy and would not want to deprive Mr. Pratchett of the income but as for you? I’m not sure it upsets me as much. If the author is paid and some publisher continues to make future titles available it doesn’t seem that it would change my enjoyment of the books significantly.
Much of the chatter on internet forums regarding the Kindle launch has focused on ways in which users may access the U.S. Kindle store. This is a very positive sign that people are willing to pay for the content they consume. I doubt however that they will be return exclusively to paper books should this “loophole” be closed. They will instead move to the next easiest option, piracy.
It is to be hoped that what you see as the solution to this is making your catalogue available in formats for which people have shown a desire. If your position is that electronic book formats require more protection or better region controls then I have little sympathy for you and hope that you see the error in this before you find your ebook offerings replaced by foreign or illegitimate markets.
If you are currently negotiating with Amazon or preparing your content for sale in Kindle format please disregard this letter.
Yours sincerely,
Name Removed.
A letter to the Minister for Housing
The following is a letter I sent to the Minister for Housing. I also sent slightly modified versions to my local member and to the Prime Minister.
The Hon. Tanya Plibersek MP
Minister for Housing
Minister for the Status of Women
111-117 Devonshire Street
Surry Hills, N.S.W., 2010Dear Minister,
I have read with interest the Prime Minister’s recent comments regarding the possibility of the boosted First Home Buyers Grant ending as scheduled. As a person saving for my first home I am very much in favour of ending the grant as it appears to me only to push up prices and encourage people to enter the property market before they are ready. I would urge you to consider ways in which the grant might be minimised, applied only to new construction or withdrawn in the future, if this is not already planned. I would also ask you to consider how negative gearing for existing dwellings may be removed in the future or made to apply only to rental profits.
The First Home Saver Account scheme is in my opinion a far better initiative than grants to people entering the property market. I believe it would be in the best interests of people entering the property market to increase the government contribution percentage, increase the cap on the government contributions, provide a grant only to those who have met the withdrawal criteria or have a proven savings history, or some combination of these options.
I look forward to seeing how the upcoming budget and future policy will address my interests in this matter.
Sincerely,
Name Removed.
As you can guess I’m not happy with the meddling that is happening in the property market.
A letter to the Minister for Broadband, Communications and the Digital Economy
The following is a letter I wrote to the Minister for Broadband, Communications and the Digital Economy which I penned in response to the Australian Government’s unworkable internet filtering scheme.
Senator the Hon. Stephen Conroy
Minister for Broadband, Communications and the Digital Economy
Level 4, 4 Treasury Place
Melbourne
Victoria, 3002Dear Minister,
As an employee of an Australian company which provides secure internet based communications and transaction exchange software, and an internet user I am deeply troubled by plans to introduce mandatory internet filtering.
Such filtering has been shown in countries where it is used to be largely ineffective. The massive and ever growing amount of information available means that it will never be possible to eliminate inappropriate content from the internet. It would be better to focus on efforts such as law enforcement and education which would help reduce the instances of this content being created or sought in the first place.
The size of the problem will mean that only known and high profile items will make it to the list of inappropriate content in a timely fashion. The ability to effectively filter only these targets will make us a target of ridicule. It has become a not uncommon activity to show a ‘Chinese view’ of a website beside a ‘normal view’ of the same site. I doubt it will do Australia’s reputation good to be added as the third party in these comparisons.
The technical realities of the problem will adversely affect the cost and performance of internet services in Australia. As well as being a nuisance to Australian internet users it will also force internet based services operating out of Australia to relocate hosting and technical operations to foreign countries.
Furthermore, as an employee of an Australian company which provides internet based secure transaction exchange services, I have serious security concerns with the implementation of this plan. The sales of our communications products rely in large part on the level of privacy and security we can offer our clients. The use of ‘man in the middle’ attacks, required by the tested filtering software for Secure Sockets Layer connections, will remove our ability to assure customers that their security has not been compromised. The correct operation of the proposed filters will be indistinguishable from a hostile party performing ‘man in the middle’ attacks.
While Australian customers may in time come to accept this as unavoidable (since online banking and other operations will suffer the same problem) it will make our products unmarketable to foreign customers without moving our hosting and server infrastructure overseas. This will make a number of our Australian staff redundant.
I regret that the nature of the plans became clear to me too late for it to have been a factor in my voting choices for the recent election. I do not doubt that these plans are ultimately motivated by good intentions but I fear that the originators have bought snake oil and wish to continue applying it to gain the favour of a few ‘key’ politicians.
Please consider how the money for the filtering scheme may be better spent. I would suggest that increasing funding to education and law enforcement would better meet its objectives and the requirements of all Australians.
Sincerely,
Name Removed.
I received the same form letter reply as everyone else who wrote to the minister.
Ruby serialport gem.
Ruby-serialport doesn’t play well with RubyGems. Trying to require 'serialport' when using RubyGems results in:
NameError: (eval):1:in `private_class_method': undefined method `create' for class `Class'
from (eval):1
from (eval):1
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from (irb):2The quick fix to get around this is by doing:
Kernel::require 'serialport'
It would be nicer if we could avoid the conflict with RubyGems. It would be even nicer if the serialport library was itself packaged as a gem. Turns out this has been done by aaronp but it doesn’t take advantage of GitHub’s automatic gem builder and doesn’t build correctly using GCC.
I’ve cloned and tidied the git repository. This gem version should build the needed native extension and work on both POSIX compatible and Windows operating systems.
Installing the serialport gem
If you haven’t configured GitHub as a gem source yet you will need to run the following command:
gem sources -a http://gems.github.com
Then, you can install the gem as normal:
sudo gem install toholio-serialport
Unlike the official ruby-serialport extension, this gem works with RubyGems (duh!). When you want to use it you should only need to do the following:
require 'rubygems' require 'serialport'
On a side note: git and GitHub rock. Forking, contributing to and merging projects should be this simple.
Nickel Silver is moving to GitHub.
I’m falling in love with GitHub. To see if this love will last I’ve moved my LocoNet server gem to GitHub from RubyForge. The RubyForge gem still exists (and will continue to do so) but changes will be happening at GitHub (probably permanently).
To get the new version of the gem you will need to have GitHub configured as a gem source. So if you haven’t already, you must run:
gem sources -a http://gems.github.com
To get the latest version of the gem run:
sudo gem install toholio-nickel-silver-server
Ruby on Nickel-Silver Rails
It’s been hot here in Melbourne so rather than actually leaving the house to do anything I’ve been sitting in front of a fan mucking about with my computer. Yesterday afternoon I created a Ruby implementation of a LocoNetOverTCP server. I’ve decided to call it Nickel-Silver because that’s the common name of the alloy most model railroad track is made of and some trifling project has already used the name “Ruby on Rails”. Here’s a quick list of Nickel-Silver’s features:
- Implements all of LocoNetOverTCP protocol version 1
- Multithreaded (inherits from GServer)
- Easily extendable interface for LocoNet hardware devices
- Only about 100 lines of code (according to egrep -c -v "^[ ]*$|^[ ]*#")
- Base implementation uses only the standard library
- Included “driver” for the LocoBuffer-USB hardware uses a single extra package, ruby-serialport
- It’s written in Ruby
Hardware setup
Currently the only “driver” provided connects to a LocoNet network via a LocoBuffer-USB. So a complete hardware setup looks something like the following diagram.

LocoNetOverTCP clients connect to the server running on the computer which acts as a proxy to the LocoNet. This removes the need for each computer to have its own LocoNet hardware interface. It also removes the need for the clients to be physically located near layout.
Server setup
Assuming we’re going to use the included LocoBuffer-USB “driver” we need to do the following to start a server.
- Install ruby-serialport if you haven’t already.
- Install the nickel-silver-server gem
- Open a new ruby script in your favourite editor or start IRB.
- Determine the serial port your LocoBuffer-USB is connected to.
- Create an instance of the LocoBufferUSB “driver” class.
- Create an instance of the server with the “driver” as a parameter.
- Run the script
To install the server’s gem open a terminal and run:
gem install nickel-silver-server
That should get everything that’s required with the exception of ruby-serialport which you must install manually.
My LocoBuffer-USB is connected to my computer via the virtual serial port /dev/cu.usbserial-FTQ1P4JC so a complete script for my server would look like the following.
#!/usr/bin/ruby require 'rubygems' require 'nickel-silver-server' # connect to a LocoBufferUSB on the virtual serial port /dev/cu.usbserial-FTQ1P4JC' interface = NickelSilver::Server::Interface::LocoBufferUSB.new( '/dev/cu.usbserial-FTQ1P4JC' ) # create a server using the default port (i.e. 5626, 'loco' spelt on a phone keypad) # using our freshly connected LocoBuffer-USB server = NickelSilver::Server::LocoNetServer.new( interface ) # start the server server.start # wait for the server to stop before exiting server.join
Documentation
Currently this post is the only documentation not contained within the gem. You can view the gem’s rdoc documentation at http://nickel-silver.rubyforge.org/nickel-silver-server/rdoc/
Sending trains down the track
Until boredom strikes again there isn’t a Ruby throttle program that can interface with Nickel-Silver. Instead we can use the excellent Java program JMRI to talk to our trains.
JMRI already knows about LocoNetOverTCP servers right out of the box. Starting JMRI and looking at the preferences we can wrangle things to look like the following.

Now we’re ready to go. Selecting Tools > Throttles > New Throttle gives us a throttle window where we can enter a locomotive address and make it move.
Implementing a new “driver”
The only LocoNet computer interface I have access to is a LocoBuffer-USB. I’d highly recommend one to anyone who is interested but acknowledge that there are many people with other hardware.
As long as you can send and receive LocoNet packets via your hardware in Ruby (or in any language that may be used for Ruby extensions) you can write a “driver”.
The only things a “driver” needs to be able to do are:
- Store incoming packets as FixNums representing bytes in a buffer array
- Send outgoing bytes (represented as FixNums in a buffer array) to LocoNet
- Use a Mutex to lock access to the buffers when in use (remember Nickel-Silver is multithreaded)
- Provide a method that causes your interface to start collecting packets
The interface is simple. Only the following public methods are needed:
- Accessors for input_buffer, output_buffer and io_mutex
- run() which starts buffering
How you do this is up to you but you can take a look at LocoBufferUSB.rb to get an idea of how it might be done. A stub driver might look like the following…
class SomeLocoNetInterface attr_accessor :input_buffer, :output_buffer, :io_mutex def initialize # these may be modified at any time by the server @input_buffer = [] @output_buffer = [] # only make changes when locked using @io_mutex @io_mutex = Mutex.new end def run loop do # get incoming bytes if byte_waiting? @io_mutex.synchronize do # byte getting code here @input_buffer << get_byte end end # send outgoing bytes until @output_buffer.empty? do @io_mutex.synchronize do # send a byte send_byte( @output_buffer.shift ) end end end end end
Remember that either buffer may be empty or already containing data and that you must lock the mutex for the minimum amount of time possible.
Isn’t there already a LocoNetOverTCP server project?
Yes there is! It’s called LbServer and is hosted over at SourceForge.
If you’re looking for a mature LocoNetOverTCP server that’s probably the place you should start. Unlike my implementation there are more people than just me using it and they probably have more bugs fixed than I’m likely to notice any time soon.





