Posts
MongoDB `smallfiles` setting on Ubuntu for development
I recently installed MongoDB on Ubuntu to do some development and noticed it didn’t start when I installed it via
sudo aptitude install mongodb
. Checking the logs I discovered the problem:[initandlisten] ERROR: Insufficient free space for journal files [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
I have a tiny SSD on my computer and I really don’t need this using over 3GB just so I can do a little hacking.
OK so I’ll just set
--smallfiles
. Under Ubuntu settings like arguments passed to a daemon when it starts are usually found in/etc/defaults
but I couldn’t see any such file for MongoDB.It turned out you can also set this in the config file under
/etc/mongodb.conf
so just add this line to the bottom of that file:smallfiles = true
Load RSpec fixtures in Rails
If you’re still using fixtures in your RSpec Rails tests for some reason you might want to load them into an environment to look at. For example, to ensure the data is displaying in the application like you intend.
Rails expects you’re using Test::Unit so it expects the fixtures to live in
test/fixtures
. Here’s how you load fixtures from RSpec into your ‘test’ environment:bundle exec rake db:fixtures:load RAILS_ENV=test FIXTURES_PATH=spec/fixtures
You get a deprecation warning when running this. It says you should set this withUpdate: the deprecation warning was removed in Rails 4.1.ActiveRecord::Tasks::DatabaseTasks.fixtures_path = '/path/to/fixtures'
instead but I haven’t worked out where you’d put that for this kind of use (suggestions in the comments greatly appreciated!).lightningtimer.net lives again
I discovered that the very useful lightning talk timer, lightningtimer.net, was down for me.
So I put it on Github pages: http://henare.github.com/lightningtimer.net/
P.S. Thanks to Simon Willison for writing lightningtimer.net and putting it on Github.
Featured in The Australian Financial Review
I haven't posted anything in ages and since this is fast becoming a brag book and not a blog I thought I'd post about how the OpenAustralia crew and I were recently featured in the AFR:
There's also a screenshot of the article if that link goes down.
OpenAustralia API Ruby Gem
To celebrate International Day of Democracy I'm happy to announce the availability of the OpenAustralia API gem on RubyGems.
A couple of months back I was toying with a project in Ruby that needed information from OpenAustralia.org so I took a look at the gem made by Alex Cooper three years ago. Of course being that old it needed some love so I decided to spruce it up and publish it on RubyGems.
I mainly updated it to today's Ruby technology, adding things like Bundler and also fixed a bug. I haven't used it in anger so there's doubtless other bugs and it could use an internal overhaul - pull requests accepted! :)
subscribe via RSS