Friday 16. October, 2009

Amazon announces same day delivery (source)

Whoever decides to provide this service in Oslo for a reasonable price will have me as a loyal customer. Amazon is charging 15$ for normal customers and 6$ for prime customers. Would make a prime membership worth it quite quickly if you live in one of those target cities I guess. (via daring fireball).

Thursday 8. October, 2009

Creating QR barcodes with perl. (source)

A really simple tutorial for creating these 2d-barcodes that you see android use all the time.

Tags: , ,
Wednesday 7. October, 2009

Things you don’t want to see in your server console.

2190872.796576] Unable to handle kernel NULL pointer dereference
[2190872.796765] tsk->{mm,active_mm}->context = 00000000000016ca
[2190872.796810] tsk->{mm,active_mm}->pgd = fffff800b6244000
[2190872.796853]               \|/ ____ \|/
[2190872.796860]               "@'/ .. \`@"
[2190872.796867]               /_| \__/ |_\
[2190872.796875]                  \__U_/
[2190872.797141] swapper(0[#0]): Oops [#1]
[2190872.797271] TSTATE: 0000009911001600 TPC: 0000000000000000 TNPC: 0000000000000004 Y: 00000000    Not tainted
[2190872.797387] TPC: <0x8>
Tuesday 29. September, 2009

Introducing … Me

Hey there, the internet is a turbulent place, and since I’ve moved around quite
a few times, I think I forgot to introduce myself the last time I made the
move. I am Marcus Ramberg, the writer of this blog, and director of
Nordaaker, a small British/Norwegian company currently run out of Oslo,
Norway. In addition to being my personal blog, at the time being this blog
acts as Nordaaker’s dynamic english presence. As the other director of
Nordaaker, Arne Fismen runs our norwegian presence.

In one form or another, I’ve been writing on the internet since around
2002, when I set up my first own domain, thefeed.no.
Back then I was running my own Movabletype installation.
Thanks to the glorious Internet Archive you can see my
first blog the way it looked about a year after it’s launch. It is
very strange for me to go back and read the thoughts I had so many years
ago.

I was also hosting other blogs on my movabletype installation, including
slemmen, who wrote about sysadmin stuff and some college friends like
marlboro and gry.

On the front page we had a perl script that aggregated all the blogs,
a simple planet if you will.

Back then, I wrote a lot less about tech than I do now. Looking at the
categories, we see that the three biggest ones are Travel[44], Geek[36]
and Opinion[26]. Still, even then I was journaling things from the
Perl Community. However, checking back around 2005, a few years
later, Geek[108] was dominant, With Opinion[49] and Mac[34] as the next
ones. Perl is trailing 4. with 27 posts. I also wrote 18 book reviews

About that time I gave my first talk about a MVC framework.I was
already active in the community, contributing a Mason view to Maypole,
my third CPAN module. I had been using Mason at work for a couple of years
by then. It was not until I started working for ABC Startsiden that I started
using Template Toolkit.

About then, disaster struck. My server HDD died, losing a lot of images
from our image galleries. After that, I lost a lot of the motivation for
running thefeed, given the risks. Losing people’s personal data isn’t fun.
At least I am glad that the blogs are preserved in the internet archive.

It took a while for me to start writing again after that, but in the period 2006-2009
I decided to use hosted solutions, keeping both a vox blog and a
livejournal, before finally moving to this blog installation.
I’m self-hosted again, and the software might vary, but I hope the addresses
will last for a long time :)

Tags: , , ,
Monday 28. September, 2009

Masters of the hipster-universe (source)

Awesome hipster He-Man and friends drawings. Must see.

Tags: , ,

mirrorshades.net – Excellent operations blog (source)

If you are interested in system administration and Unix/Solaris/Virtualization, my friend Bryan D. Allen’s new work blog mirrorshades.net is a must-add to your feed reader. I’m going to be looking into Puppet Real Soon Now.

Tetris Skaters

Friday 4. September, 2009

iPhone 3GS series from Aker Brygge (source)

Glass Construction by Marcus Ramberg.

Went for a quick bike ride near Aker Brygge this morning and tested the iPhone 3GS camera. I’d like a tripod mount so I can film from the bike with it. Will test out with the gorillapod and my flip mino hd.

Update: The first set I published was post-processed using adobe lightroom to give them a mood I like. For reference, I’ve uploaded the non-postprocessed versions as well

Catalyst cares about your old code

09:52 < @rafl> wow.. you can actually see how old that code is
10:00 < @rafl> but it still runs without a single modification. nice!
10:00 < @rafl> catalyst++
10:14 < @marcus> rafl: try that with rails :)
10:14 < @rafl> no, thanks

Code rot is everywhere, but some platforms suffer more than others. Even Simple C++ code suffers from code rot.

Tags: , ,
Wednesday 2. September, 2009

Catalyst::Plugin::AutoCRUD

One major factor in Catalyst’s success has been extensibility. I plan to
do a series on extensions that I’ve found useful recently. To kick it off,
I’ll feature a model which gives me a simple and useful admin interface to
my DBIx::Class models.

When I first got involved with MVC Web Frameworks like Maypole and Ruby on
Rails, a big selling point was the ability to generate CRUD (Create/Read/
Update/Delete) interfaces to your data model. Ruby on Rails does this through
a mechanism called scaffolding, where it adds a set of actions to your
controller. It soon became apparent that these CRUD frameworks did not live
up to their promise as a base for creating your own custom actions. Usually,
you spend more time customizing these controllers than you would just
implementing the features you require.

However, there is still a good use for these for giving your admins a
direct interface to your data model. There has been several iterations of
these tools for the Catalyst framework, but with Catalyst::Plugin::AutoCRUD,
I’ve finally found something easy to plug into your existing app, which
integrates well with most setups.

autocrud

For most apps, all you need to do is plug it into the main application class
by adding AutoCRUD to your list of plugins. This will plug a complete CRUD
application, including controllers and view and templates into your app.
By default it will attach itself at ‘/autocrud’, but you can easily change
that in config. Just add this to your config file:


      basepath admin

and it will respond to /admin/* instead. Another common requirement is to
add authentication for the admin interface. One way to accomplish that is
by using Catalyst’s auto handler functionality. Add a method like this in
your Root controller

sub auto :Private {
    my ( $self, $c ) = @_;
    if ($c->action->reverse =~ /^autocrud\//) {
        $c->authenticate({},'users');
    }
    return 1;
}

Note that my example is using HTTP Basic auth. The actual authenticate call
needs to be customized for your realm.

AutoCRUD supports multiple DBIC Schemas, and if will automatically provide you
with a list to let you pick which one to work with. After that, you choose
a Result class, and you have access to an extensive AJAX-enhanched database
admin tool. You can search and browse data, as well as edit it and add new
rows easily. AutoCRUD also understands your DBIC relationships, so you can
easily see data related to the current rows.

Like it’s predecessors, I do not recommend trying to make this tool
into a generic ‘allweb’-application. However, if you use it for what it is,
you can save countless of development hours making trivial admin tools. Since
it works again your DBIC Schema, you’ll also get the advantage of keeping
your business logic in the data model. Things like DBIC timestamps will
Just Work.

There still might be some polishing left to do on AutoCRUD, but I already
find it a hugely useful tool. You can install it just like you would any other CPAN module using

$ cpan Catalyst::Plugin::AutoCRUD