Posted on April 24, 2008
I’ve been trying to persuade git-svn to work properly with Rails plugins that have been installed via svn:externals. Whilst working out how to do it I stumbled across several great articles, but I couldn’t get any of the solutions presented to work perfectly. Samuel Tesla’s article is especially informative, but for a long time I couldn’t stop git-svn from trying to commit Git metadata back into my Subversion repository…
After a bit of head scratching I got it sorted, and wrapped the process up in a little utility called git-me-up.
Tagged with: automation git rails |
9 comments
Posted on April 21, 2008
As Tim says, you can tell a lot about a man from his bash history.
doe% history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head
327 svn
147 cd
86 ls
61 rake
38 cap
37 sudo
35 gem
23 cat
21 find
18 update-puppet
What’s in yours?
0 comments
Posted on April 16, 2008
When I setup this blog I took the opportunity to try out Git. The thinking was that if I needed to patch the blog software (Mephisto) that I’d have a fairly trouble free upgrade path, merging the upstream changes straight into my branch.
And then, several hours of work later, I lost everything…
Tagged with: git |
0 comments
Posted on April 14, 2008
I’ve been trying out Merb recently, and I’m liking it. However, I’ve spent a lot of time stumbling around the interweb looking for examples of what I’ve been trying to achieve. So far I’ve been coming up short. The Merb API docs are good, but you can’t beat a good example.
So I’ll be recording my little revelations as they happen. First up - how to test a controller.
Tagged with: merb |
0 comments
Posted on April 12, 2008
One of the first things you discover when you start playing with DataMapper is how to specify conditions when searching a database table. This will get you all the chocolate biscuits:
Biscuit.all(:chocolate => true)
After I’d read some of the docs I hoped I might be able to use a similar approach to search my associations. Given that a packet has_many biscuits I hoped I’d be able to do something like this:
packet.biscuits(:broken => true)
I was wrong, and you’d probably only expect that to work if (like me) you hadn’t done much with DataMapper yet. Still, you might.
In the current version (0.3.0) you do it like this:
Biscuit.all(:packet_id => packet.key, :broken => true)
That’s fine. I dare say associations will grow the ability to be searched in due course, but in the meantime, maybe that’ll help clarify it for somebody…
If you’re interested in DataMapper (and merb?) then you might want to check out the open source book on the subject: Life On The Edge With Merb, DataMapper & RSpec.
Tagged with: merb |
0 comments
Posted on April 08, 2008
God is a very neat piece of software, frequently used by Rails developers to monitor mongrel servers, and restart them if/when they crash or use up too many system resources.
Its use isn't limited purely to monitoring web servers though; you can monitor pretty much anything you like. Read on to see how to configure it to monitor the Ruby job processing daemon, BackgrounDRb.
Tagged with: god rails sysadmin |
2 comments
Posted on April 06, 2008
I used to work for a company that was in the business of deploying laptops running Linux into hospitals. We automated the installation of these laptops to such a degree that all we had to do build a new laptop was unwrap it, plug it into an ethernet network and turn it on. We used PXE boot and our own bespoke deployment system to achieve it. It even supported deploying automatic configuration updates over a mobile phone connection, while the laptops were in a different country.
It never seems to be worth going to the effort to setup a tool like puppet when configuring a new desktop computer, a virtual server to run your blog, or a VPS for a small client who is keen to keep the budget down. But why should automation be expensive?
If you like the idea of an automated server build on the cheap, read on...
Tagged with: automation sysadmin |
Posted on March 29, 2008
How often do you find yourself wanting to check the source code of a locally installed Ruby gem? Do you find it painful digging around your filesystem to locate the gems directory?
Rather than this:
mate /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2
I now type this:
mategem activerec[tab]
Note the [tab] key, which converts "activerecord" into "activerecord-2.0.2".
Tagged with: textmate |