13 January 2012

Open Source Report no. 1

Inspired by Mike Gunderloy's attempt at doing something for the open source world every day, I figured I should be able to at least do something every week.

So here's what I've been up to the past week:

  • watchmen is a new extension for Python's Fabric library that is aimed at monitoring a set of servers. At the office, we're growing pretty tired of Nagios, so I did a little test to see how hard it would be to build something better. The actual checks would be pretty doable with this library, though we'd still need to build a webbased dashboard and notifications via e-mail/irc/campfire/sms.
  • soundcheck is my unified interface to running tests. I recently came across the need to run a Minitest suite, so I've added something to support that. Not quite happy with how it works yet, I'll probably improve it next week.
  • bootstrap I fixed some JS with regard to the buttons, when they are <input type="submit">s, instead of divs with class button.

→ fakefs

File system faker to make testing stuff that depends on the FS easier.

Personally, I tend to dependency-inject some IO class when I need to test file stuff.

→ DocHub

Much better place to lookup stuff than w3schools. I find this a little easier to browse than the Mozilla dev center.

→ Sprintly

Very pretty scrum tool. I especially like the preformatted form for new stories which forces you to write it in a certain format, I wish Pivotal was a little more opinionated in that area.

→ Sugru

Air-curing rubber. Moldable for 30 minutes, then hardens after 24 hours. Seems like cool stuff.

→ capistrano-colors

This little gem helps make the output of Capistrano a whole lot more readable. Highly recommended.

26 September 2011

Compass + Rails 3.1

Spend a little time debugging something with Rails 3.1, the asset pipeline and the Compass 0.12.alpha release. First of all, this gist works perfectly. Except we had Rails configured so that it would compile assets in production. Compilation then failed with the error that it couldn't find "compass/reset".

The problem was that we had the compass gem in the assets group in Gemfile, but ofcourse that group wasn't loaded in production.

(And yes, I do realize this was my own dumb fault. But I'm putting it here for Google.)

04 May 2011

Unity and focus follows mouse

Speaking of Ubuntu, the new Unity shell breaks focus follows mouse (a global menu at the top of the screen doesn't work too well when the app it represents changes as you move the pointer towards it). Which is bad enough in it's own right, but that they knew about it and just don't care, that's a lot worse. They couldn't even be bothered to remove the FFM-preference...

04 May 2011

iMacs are laptops

iMacs, Mac Pros, and laptops:

Every Mac Pro revision after its introduction in 2006 has raised the prices of the midrange configurations. Mac Pros are now so expensive that almost nobody like me — geeks who like big, fast, expandable desktops but don’t do many long-running CPU-bound tasks, like video processing, for a living — can afford or justify them. Sure, I’ve gotten three solid years of use (so far) out of this one and it’s still doing fine, but it was also only $2800 for the mid-speed dual-socket model. (The similarly positioned model in today’s lineup is $5000 and is approximately 2.5 times as fast, which, while impressive, isn’t as far ahead as I’d like it to be for that price.)

This pretty much sums up why I gave up on the Mac. I was no longer interested in having a huge 24" laptop. I was tired of having 4 external drives besides the iMac. The overall noise level around my desk has decreased by not having all those drives (amongst which was a Drobo with a rattling fan) there.

And the Mac Pro is just unjustifiably expensive. I'm now running on a home-built desktop, Sandy Bridge i7, lotsa RAM, and an SSD. Ubuntu, with a Windows partition for Lightroom and Photoshop (okay, and games). I hope one day Adobe will release their software for Linux too, but I can boot Windows from within Linux, and I can boot Linux from within Windows, so all in all it doesn't really matter too much which operating system I happen to have booted up natively.

Apple now trying to patent location history. Just to make sure you keep hating software patents.

Tim Bray:

The Retina display is a fantastic engineering accomplishment, and as a typography geek I love it, but I don’t think it’s why the iPhone 4 is selling well.

Could be, but don't forget network effects. A retina display would likely be one of the differentiating factors between the iPad and other tablet devices for a while. And geeks would likely weigh the pixel density in their decision on what tablet to get.

The masses tend to buy the devices they see in use. So if you want to capture a new market, you should capture the early-adopters, and they are the kind of people who like things like a retina display.

Tab Sweep — Technology

The Retina display is a fantastic engineering accomplishment, and as a typography geek I love it, but I don’t think it’s why the iPhone 4 is selling well.

Could be, but don't forget network effects. A retina display would likely be one of the differentiating factors between the iPad and other tablet devices for a while. And geeks would likely weigh the pixel density in their decision on what tablet to get.

The masses tend to buy the devices they see in use. So if you want to capture a new market, you should capture the early-adopters, and they are the kind of people who like things like a retina display.

Marco Arment:

My iOS app, Instapaper, relies on the installation of a Javascript bookmarklet to be effective, because it needs a way for users to easily send URLs from Mobile Safari to Instapaper.

[...] the conventional wisdom that Macs are more attractive to “creative professionals,” as they call them, which I think is an awesome term considering that it leaves Windows with “dull professionals” and “creative slackers,” [...]

-- Wil Shipley

22 September 2010

Information Architects - Writer for iPad

Information Architects – Writer for iPad. Seems really nice, going by the blogpost. But they make the same mistake most other Dropbox-enabled writing apps make. They claim their own directory in the root folder of my Dropbox account. That's pretty-much a no-go for me, it clutters up my Dropbox, and makes it hard to keep all files for a project together. And it turns Dropbox into a syncing service where each app just has its own data silo, where there is no interaction between apps, because they can't (not by limitation of Dropbox, but by their own silly thinking) reach eachothers files. Then we're basically back to square one: select all, copy, switch app, paste in new document, edit there. Lather, rinse, repeat.

10 September 2010

Getting Rails 3 to add methods to your JSON

Previously, I'd been using something like

respond_to do |format|
  format.js { render :json => @record.to_json(:methods => [:foo, :bar]) }
end

But obviously, this is no longer DRY in Rails 3. So I cleaned that up to work with the new responders:

respond_to :html, :json

def show
  respond_with @record
end

But that left me with a problem: where to put the :methods? From the documentation I couldn't really figure this out all that well, which is why I'm posting this. The release notes for Rails 2.3.3 let me know that there's now an as_json, which I knew, but turns out it works a bit different than I thought I'd understood from the docs. It should basically just deliver a hash, which will be converted to JSON by Rails. So add something like this to your model:

def as_json(options = {})
  attributes.merge({:foo => foo,
                    :bar => bar
                   })
end

And you'll be all set again.

How do you hold your Nokia? - The official Nokia Blog.

We’ve found any of the four grips mentioned above to be both comfortable and as you can see, offer no signal degradation whatsoever. This isn’t a feature you’ll only find on high-end Nokia devices either.

I'm sorry Nokia, but you've lost your privileges to make fun of others about this a long time ago.

01 June 2010

Personal Cloud Computing

Otherland is a science-fiction tetralogy wherein the author Tad Williams writes of a future where everyone has computing devices called "pads". While the story never goes into details of these devices, I can imagine them looking quite similar to what the iPad is currently. In the novel, these devices are the main computing power, and people access them either directly, or use them as processors, interfacing with the web through direct neural connectors. While these neural connectors may be some time away, it got me thinking.

One of the criticisms of the iPad, or tablet pc's in general is that they're missing so much. But what if we were to augment their limited capabilities while you're at home. We already have the keyboard for the iPad, which turns it into a slightly more capable editor.

What if we to fix the problem of processing power by replacing the Mac on your desk with a Mac Mini sized box, ready to supply it's processing powers to your pad, over the air, to any pad on the local WiFi which needs it. Hook a Drobo up to your network if space is an issue.

And let's imagine WiFi-enabled screens (Otherland calls them wallscreens). These would probably be similar to iMacs, but less powerful. Your iPad could be the control hub, a switching station which connects your bluetooth keyboard, the screen and the processing node.

I don't think the iPhone OS is ready for this yet, nor do I have any insight whether it could be made to be. WiFi probably isn't fast enough yet, and there are probably loads of other problems I'm conveniently ignoring. But we're already seeing this become a real possibility. Chuq Von Rospach wrote about coupling Lightroom on your desktop computer with an iPad Lightroom app. The only real problem at this point is getting data to and from your iPad fast enough.

Now, if only that iPad were available over here in the Netherlands…

23 May 2010

Golfing with Ruby

Yesterday we held the annual IWI Programming Contest at the university. For this contest, it's customary to have one problem which is longwindedly described, but extremely simple to write in code. This year, it basically came down to:

  • Read a line containing an integer n
  • Read n lines containing an integer x,
  • and print floor(x/5)

We started golfing this, and this is what I came up with:

#!/usr/bin/ruby -n 
p $_.to_i/5 if $.>1 

The tricky part here is ignoring the first line. It took me a little digging through the Ruby documentation to find that $. variable, which holds the current line number of the file (or STDIN) most recently read.

  • Maniacal Rage - Photoshop Crash Reports by Garret Murray. I find these hilarious, but maybe I'm just weird that way. Whoops, hold on, "Photoshop has encountered an error while completing your request." Uhm, sure... it's not like I was asking you to do anything though...
  • Rubinius 1.0 - Milestone release for this alternative Ruby implementation. I should find time to try this and JRuby sometime.
  • TomDoc - A new Ruby documentation style, optimized for plain text readability. Also aspires to automatically generate diffs between versions of API docs.
  • latex-lab - Webbased editor for LaTeX documents, based on Google Documents.
  • Rubular - A Ruby regular expression editor and tester
  • Tolk - A new translation app for translating Ruby on Rails locale files.
  • gitextensions - Git plugin for Visual Studio.

Spent some time today migrating this site to WordPress.

  • Postalicious Plugin - I'm using this to pull in posts from my Pinboard account. For Pinboard, set type to Yahoo Pipes and put in any public rss.
  • Linked List URL Plugin - I might use this one day. Right now I'm using the Postalicious plugin to pull in my Pinboard RSS feed and publish stuff as a daily post.
  • Quick Page/Post Redirect Plugin - I'm using this to put the ZenFolio link in my top navigation bar.
  • LR2/Blog - Send images to your blog from Adobe Lightoom - This might be useful now that I'm switching to Wordpress.
  • Jigasawrus - This looks sort-of like an album laid out with jQuery Masonry. I'm going to steal this layout idea for my own albums software, which I should go and write at some point.

I came across this little dinky at DealExtreme. Costs only a couple of bucks, and it lets you turn a normal network cable into a long USB-cable. Anyone who ever shoots tethered should have one of these.

13 May 2009

Goodbye Blipfoto

It's been fun while it lasted. Due to growing irritations with Blipfoto I'm moving to my own hosted site. Not to discredit Blipfoto here though.

Any site can be slower for some time while they experience some growing pains. I know that first-hand, having worked at a webhosting firm which became quite popular really fast. We could hardly add more servers to keep up. Recent downtime issues haven't been my worries.

The problem for me lies in an inherent mismatch between my primary shooting style, and Blipfoto's rules and philosophies. The one photo a day, taken on that day rule... it simply isn't for me. While I do strive to shoot multiple times a week, I don't have the time to do it every day. And when I shoot, I'll often have multiple great shots. Having my own site means I set the rules, and can post whatever I want, whenever I want to.

The one thing I expected when I came here was actually to find a good community. While there surely is a community, the thing I find lacking is constructive criticism, or pretty much any criticism at all. I'm in this to improve my shooting as much as anyone else, but yet no-one is telling me specifically what they like and don't like about the shots. "Great shot!" comments aren't helpful.

Then there's something nagging me at a more basic level. I have the technical know-how to set up my own site, have everything exactly as I want. As a computer nerd, I like having everything under version control. On my new site, posts are text files which I can edit with whatever I want. I'm pretty sure that in 50 years time, when I'm old and grey, while the software which currently transforms that into HTML files may no longer work (it probably won't), the text files will still be readable just fine, and I could write a script at that time which extracts the titles and bodies of the posts, and outputs them in whatever format people use by then.

Wanting to have everything hosted under my own domain name, under my own banner is another factor. At some point, I'll occasionally post a regular blog post. I can't do that at Blipfoto, and I'd like a one-stop hub for my online presence.

It's been fun, but Blipping isn't for me. Hope to see you at my new site, I'll be working on it in the weeks to come, one thing to do is commenting, but I wanted to switch and keep my pace going.

13 May 2009

Hello mr. Jekyll

This site is now running a — slightly modified — version of Jekyll. The modifications I made are so that I can navigate by previous and next post within the category the post belongs to. I have a seperate category for photos and blogposts, and to stop previous/next links from intermingling I needed to add this feature. If you need it, you can find it in my fork. The source for this site is here, though the contents remain copyrighted. If you want to use my design, feel free to send me an e-mail, I'll probably give you the go-ahead but I put the all rights reserved license on there to maintain control. And given that my photos end up there aswell, I thought this was just the easiest.

Rake

Because of the photos, I needed thumbnails, and for that purpose I added a rakefile.

task :default => :publish

desc "Builds thumbnails for photos"
task :thumbs do
  files = Dir["photos/files/*.jpg"]

  FileUtils.mkdir_p("#{ROOT}/photos/files/thumbs-86")
  thumbs = Dir["photos/files/thumbs-86/*.jpg"].map {|th| File.basename(th) }
  files = files.reject {|file| thumbs.include?(File.basename(file)) }
  files.each do |file|
    dest = "#{ROOT}/photos/files/thumbs-86/#{File.basename(file)}"
    puts "Building #{dest}"
    `convert #{file} -thumbnail x172 -resize '172x<' -resize 50% -gravity center -crop 86x86+0+0 +repage -format jpg -quality 91 #{dest}`
  end
end

desc "Run Jekyll"
task :build => :thumbs do
  puts `/Users/marten/code/ruby/jekyll/bin/jekyll`
end

desc "rsync everything to server"
task :publish => :build do
  puts `rsync -avz "#{ROOT}/_site/" marten@robinson.veldthuis.com:~/web/public/`
end
This is Marten's blog.

Projects