Changing the mime type of assets in Dropwizard

I’m serving static content with Dropwizard’s AssetsBundle(0.6.2), and a problem occured where .handlebars-files arrived as text/html-files.

This was a problem in our project, because we were behind a proxy that added certain script tags to all text/html-files, so we needed to find a way to make dropwizard give the handlebars-files out as text/plain.

After a lot of trying, I gave up, but my colleague came up with this ingenious solution:

  1. Copy mime.properties from org.eclipse.jetty.http to the same package in your own source, for example src\main\resources\org\eclipse\jetty\http\mime.properties

  2. Add handlebars=text/plain to your copy of the file

Dropwizard will now use your properties-file instead of the original one.

Share

Little Christmas day

cd

For some reason, I decided to check youth ticket prices from Trondheim to Kristiansand. From my experience, SAS’ youth tickets aren’t really that cheap, but this time I was in luck; the prices were the same as for the train ticket that I’d already bought one month earlier.

A quick call to NSB to cancel my ticket was followed by a quick online transaction to SAS. This ticket brought with it a number of advantages, the best of these being that time of departure moved from 8:30 to 12:40, giving me the possibility to take a full night out.

I don’t really remember coming home from this night out. Things I must have done, at least based on what I noticed in the morning, includes: undressing like usual, covering myself with the cover and .. eh. That’s it. The list of things I didn’t do obviously iincludes brushing my teeth and setting the alarm clock for my 12:40 flight (as previously mentioned).

Well, I made the flight, in good time even. Who would’ve thought? My body unshowered and smelling bad, but who cares?

When flying home, I saw Sandstø from the air. That was pretty cool.

I was tired when I came home, so I decided to rest around 8 pm. That rest culminated in sleep, which again lead to me waking up at 3 am, not managing to sleep again before 8:30.

Waking up at 11, eating, getting firewood, joining my dad in a gift trip to Grimstad, buying presents and visiting Jean at the nursing home before again coming home to Sandstø for some traditional little Christmas day-grøt, dressing up the tree and some website programming.

I’m glad to be home, but can’t wait to see Dorotea again.

Share

Ønskeliste for jula 2011

Når det regner på presten, så drypper det på klokkeren.

Som vi alle er smertelig klar over er det snart jul, og hva er vel viktigere da enn å bruke så mye penger på meg som mulig?

Derfor har jeg satt meg ned og tenkt lenge og vel over hva som passer i en sånn her ønskeliste. Resultatet kan du se under.

  • Skalljakke - trenger klaff foran glidelåsen og god, justerbar hette. F.eks. denne.
  • Bokser - Jean Paul eller han der franskmannen på Kiwi-butikker.
  • En litt penere genser

Som du kan se er den ikke akkurat komplett. Hvem vet, kanskje den aldri blir det?

Share

Remote connect to Swift with tempauth with python-cloudfiles

I had a setup with Swift on a server, Ubuntu 11.10 and OpenStack Diablo, and I could do curls-commands to it.

However, when trying to use python-cloudfiles and swift-cli from a remote machine, it just returned Errno 111: Connection Refused all the time.

After days with googling, I finally got the nerve to visit the openstack irc channel, and after about half an hour with troubleshooting, they provided me with the answer that I need to have an url for the callback under the tempauth filter in proxy-server.conf-file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

[DEFAULT]
bind_port = 8080
user = swift
log_facility = LOG_LOCAL1

[pipeline:main]
pipeline = healthcheck cache tempauth proxy-server

[app:proxy-server]
use = egg:swift
#proxy allow_account_management = true
account_autocreate = true

[filter:tempauth]
use = egg:swift#tempauth
user_admin_admin = admin .admin [[http://<swift-ip>:8080/v1/AUTH_callback]] # the url is needed
user_test_tester = testing .admin

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:cache]
use = egg:swift#memcache

Now, connecting with cloudfiles works like a charm:

1
2
3
4

import cloudfiles
conn = cloudfiles.get_connection("admin:admin","admin",authurl="<swift-ip>/auth/v1.0")
conn.connection_args[0] '<swift-ip>'
Share

Mother and Child Reunion

is

After an emotional goodbye-party, time had come to pack my shit and get on my way. The day was packed with ice cream, and an unpleasant reunion with our landlord, Mr. Azoulay who tried to rip us for 700€.

My two bags, carry-on backpack, my bike and an extra little backpack on the side was sufficiently heavy for me to request some help from Henry to get to the train station. When there, I promptly denied all his attempts to come with me on the train and to help me to the airport. How I regret that decision.

With my backpack on my back, my biggest bag hanging over that again, my other bag hanging of my neck and my bike and backpack #2 in hand I started walking from the airport train station towards the airport. Positivity quickly faded into despair as the meters went along. My biggest bag wasn’t really firmly sitting in one place but dragging me a little to the left, while my other bag was dangling on the other side while I was desperately trying to steer my bike in the correct direction without the front wheel suddenly changing direction leading to sudden stops.

After 200 meters I had to stop, tired out of my mind with day nightmares about missing the flight. Of course I hadn’t too much time before they would close check-in.

At my third break, about 800 meters from the station, my pulse was about 90% of max, I’d sweated about 10 liters and I couldn’t remember ever being this tired. Luckily, I was over half way to the airport, so a little hope remained.

70 meters from the entrance to the airport I had to resign. There was no way I could carry on with everything, I had to leave something behind. I locked my bike with one of the backpacks, and continued. The lightened load was still heavy enough, and everything about me must’ve been screaming of exhaustiveness as I dragged by legs one meter at the time through Terminal 1.

Norwegian was of course placed in the far end of the terminal. I reached the check-in 5 minutes before time, and I begged them to let me go back for my bike. They looked at me with strange eyes, I suspect that I might’ve been the most tired person they had ever seen before. Without any real energy left, I still managed to run all the way to my bike and get back without spending too much time.

Alors, I had to pack my bike into the bike bag. Unfortunately I forgot all the tools for dismantling it, so with the bike in it, so the procedure was tiresome. While packing the bike, the good girls in the check-in decided to weigh my carry-on luggage. Apparently 16 kg is too much for carry-on, and the bottle of rum inside could of course not go through security.

Unsuccessfully I tried to donate the rum bottle to them, and I had to pay to check in the carry on as normal luggage.

To do this I had to go to another clerk. This guy spent 200 million years finding out how much I needed to pay, and my watch showed about-fucking-time-to-be-through-security. With my bike bag I was running towards the over-sized luggage. The bag was slowly opening because of my poor packing, so I was afraid they wouldn’t let it on.

Fortunately they did, I got through security and this story ends with a disappointing anti-climax with me reaching the boarding in very good time.

Share

Temps de revisions

Curveball

-Putain!

My lifelong dream of beating Davi Costa in Curveball had just been shattered by two unexpected very good returns by the AI-player on the other side. “This is it!” I said, “time to put my aspirations of being a professionalCurveball-player on the shelf, and face the fact that I have two exams the following day. Or tomorrow. Or today, since it’s actually past midnight already.”

In front of me are two foil sets on “Vehicular Wireless Access” and about 4000 pages on MapReduce. Unslotted, Slotted and Partially Slotted Alohas are mixing up with the sweet taste of “processing huge datasets on certain kinds of distributable problems using a large number of computers (nodes), collectively referred to as a cluster (if all nodes use the same hardware) or as a grid (if the nodes use different hardware).”

I don’t ever pull any seams around here, but I don’t really mind and it’s not starting to get to me. Wonder if any companies have got place for a lazy, ambition-less kid from the streets of Bjorbekk, or if I need to go work for Husquarna the rest of my life.

Share

Trop chaud!

Wrong

It is considerably warmer here than is good for a healthy 24 year old. Just walking steadily from my desk to the kitchen will break out a sweat, and I am forced to not training because doing so would make me dehydrated in an hour.

This heat started with the arrival of my sister. The evening of here arrival and those before that had perfect temperatures, allowing shorts and t-shirts but not making the sweat run like a flood on my skin. The following evening it was 25 degrees at 11pm.

Despite the killing heat, we did have some fun. Thomas and Helle were also in the area, I’d already had some great evenings with them withouth my sister, and on the Saturday we joined them in Canyon Forest. Canyon Forest is basically a place where you climb and throw yourself between trees.

We did go a lot to the beach, something that might have given me an unmistakable tanline, and we also went to see Monaco and Robert De Niro.

The end.

Share

Je viens de vous asseoir et regarder le spectacle

Pretty

An hour after I started my cycling trip today I stumbled upon a beautiful valley or canyon. It was steep as I’ve seldom seen them before, accompanied by some beautiful waterfalls. Some hundred meters up I was presented with the most stunning view of the valley with the sea in the background. I believe I could see from Nice to Juan les Pins. Amazing.

Some nights ago I was sitting on the bus back from Nice, and there I was sitting behind an actual tagger. If writing “SWAT ADN” on the bus seat with a carpenter pencil is tagging, that is. I’m pretty sure this is the first time I’ve actually seen one of these fascinating people who find the need to bring a pen/pencil/marker with them, just in case they get a chance to write something meaningful for the future generations.

On the same bus was another winner. I first saw him trying to sneak past the two security guards checking the tickets. After actually buying a ticket he sat down two rows behind me on the left. Just as a girl, she was obviously very drunk, fell asleep in front of me, he almost ran through the bus trying to take advantage. She promptly denied him, luckily, making me re-evaluate the bad impression I had of her.

As she fell asleep one more time our hero once again rushed forward in hopes that all past tries were forgotten. Denied again.

My money has flown away and I’m trying to rule this town on a budget granting me less than an average poor Sudanese.

Share

Nous sommes toujours en cours d'exécution pour le grand frisson

Bird

Our downstairs neighbour is still acting out. Without even giving a little warning he turned off our power yesterday around half ten. It’s hard to say why. Could’ve been because I was listening to music at half the maximum volume of my PC speakers. It might have been because our washing machine was doing its best to rip the floor apart.

Me, Henry, Michal and his brother went to the seashore tonight. It was blowing like crazy, but the wind was warm so no problem. Bitch.

For some reason our school gives us vacations the week after Easter instead of the actual week. This might be the strangest thing that ever happened to me.

Share

Tour de France

Way

Without actually having a ticket for Birkebeinerrittet I’ve started training for it. Not too much but an old body like mine feels the difference.

After looking at the route profile of the infamous bike race I realised that I needed to do some routes with more elevation. This lead me to Col de l’Ecre. Suddenly I had somewhat more respect for Hushovd.

The beach season has arrived! This is pretty awesome.

Apart from that I’m working like a hero with school.

Share