Today’s sysadmin tip: ipsort – sort text by ip address

March 25th, 2014

Quite often, I have a list of ip addresses or networks available as an output from a list or a script, and would like to sort them based on the address. The usual unix sort -n does numerical sort, so the list often becomes almost correct

$ (echo 192.168.1.1; echo 192.168.10.2; echo 192.168.2.10) | sort -n 
192.168.10.2
192.168.1.1
192.168.2.10

But grep has a few tricks up its sleeves. Numerical sort by field:

$ alias ipsort="sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4"

$ (echo 192.168.1.1; echo 192.168.10.2; echo 192.168.2.10) | ipsort
192.168.1.1
192.168.2.10
192.168.10.2

Nice, isn’t it?

Today’s sysadmin tip: Latest rpm changelog entry

March 13th, 2014

Nothing special today, just a small script that shows (only) the newest changelog entries from the latest installed version of a package, optionally only showing security entries. Especially useful for multiversioned packages, like the kernel.

latest-changelog script may be downloaded here.

Example run:

latest-changelog: Shows the most recent changelog part of the latest installed package given

Usage: latest-changelog [-s] package | [-h]
Options:
  -s | --security : Filter out security information
  -h | --help     : This message

Example: latest-changelog -s kernel

[ingvar@thijs ~]$ latest-changelog -s kernel
- [exec] ptrace: fix get_dumpable() incorrect tests (Petr Oros) [1039486 1039487] {CVE-2013-2929}
- [net] ipv6: fix leaking uninitialized port number of offender sockaddr (Florian Westphal) [1035882 1035883] {CVE-2013-6405}
- [net] inet: fix addr_len/msg->msg_namelen assignment in recv_error functions (Florian Westphal) [1035882 1035883] {CVE-2013-6405}
- [net] inet: prevent leakage of uninitialized memory to user in recv syscalls (Florian Westphal) [1035882 1035883] {CVE-2013-6405}
- [net] ipvs: Add boundary check on ioctl arguments (Denys Vlasenko) [1030817 1030818] {CVE-2013-4588}

Mythopoeia (norsk)

January 27th, 2014

Mythopeia
av J.R.R Tolkien, 1931

Til norsk ved Ingvar Hagelund
v0.01, April, 2014

Det er mange, mange ting å si om dette diktet. Tolkien setter mennesket i sin rolle i skaperverket som den som gir navn. Verden ville bare vært stoff, hadde det ikke vært for oss som ser på den, og setter alt i sammenheng til alt. Med klassisk kristen teologi diskuterer han det onde, og han utlegger sin skepsis til tanken om fremskritt og teknologi som positiv kraft i verden. Han argumenterer for at det mange negativt angir som eskapisme gjennom myter og fantasi, faktisk er en bra ting. Men mest sier han kanskje, om menneskets kreative kraft, hvor den kommer fra, og hvordan den dermed blir opphav til de myter vi ser opp gjennom historien. Gud har skapt menneskenes kreativitet, og selv om mennesket har blitt fordervet gjennom synd, vil likevel mytene vi skaper ha rot i sannheten, fordi vår kreativitet kommer fra Ham.

Et av de vakreste bildene Tolkien bruker i dette diktet er for meg den, at mennesket er et prisme som bryter lyset. Gud er det sanne hele hvite klare lyset, og fra ham kommer all skaperkraft. Når vi lar det hvite lyset skinne gjennom oss, altså når vi lager myter, eller med-skapelse (sub-creation), som Tolkien kaller det, er det ikke perfekt. Det blir ikke den hele sannheten. Det blir enkeltfarger, noen røde, noen blå, noen gule, noen fiolette. Men denne fargerikdommen har verdi i seg selv. Når vi skaper fortellinger, eller, siden vi ikke alle er forfattere eller skalder, bruker de talenter vi har, om det er som musiker eller programmerer eller statistiker eller datakonsulent, er det en oppfyllelse av det potensial som Gud stråler gjennom oss. Med sine mange former og fargetoner bringer vi fram en rikdom som ikke ville fantes uten oss. Og om vår med-skapelse ikke er fullkommen, så kommer den likevel fra det ubrutte, hvite lyset.

Så det var dagens lille andakt.

Til han [C.S. Lewis] som sa at myter er usanne, og derfor verdiløse, selv om de er ‘åndet med sølv’.

Fra Philomythus til Misomythus

Du ser på trær men navner kun kontekst                   You look at trees and label them just so,
(for trær er 'trær', og vekst er bare 'vekst');          (for trees are 'trees', and growing is 'to grow');
du tråkker jorden ned med verdig gange                   you walk the earth and tread with solemn pace
denne vesle sfære blandt de mange:                       one of the many minor globes of Space:
en stjerne kun en liten stoppet ball                     a star's a star, some matter in a ball
i evig tvunget matematisk fall                           compelled to courses mathematical
midt i den strenge, kalde, tomme dans                    amid the regimented, cold, inane,
der dømte atomer drepes uten stans                       where destined atoms are each moment slain.

Vi kneler foran Viljen (som vi må)                       At bidding of a Will, to which we bend
vi kan den svakt, ja bare knapt forstå                   (and must), but only dimly apprehend,
på dens bud stiger veldige prosesser frem,               great processes march on, as Time unrolls
fra dunkel start til ukjent mål for dem                  from dark beginnings to uncertain goals;
som på en side vettløst overskrevet                      and as on page o'er-written without clue,
en endeløs myriade av former vevet                       with script and limning packed of various hue,
pakket med skrift og risset i ulik drakt                 an endless multitude of forms appear,
en stygg, en vakker, en underlig, en forsagt             some grim, some frail, some beautiful, some queer,
alle fremmed, ringer kun i vann                          each alien, except as kin from one
fra fjernt Origo, stein, sol, mygg, og mann.             remote Origo, gnat, man, stone, and sun.
Gud skapte petroøse steiner og arboreale trær            God made the petreous rocks, the arboreal trees,
den telluriske jord, stellare stjerner, og der           tellurian earth, and stellar stars, and these
de ørsmå mennesker som roter jorden i fryd               homuncular men, who walk upon the ground
med nerver som kribler berørt av lys og lyd              with nerves that tingle touched by light and sound.
Havets rytme, vind i trær, de ville dyr                  The movements of the sea, the wind in boughs,
det grønne gress, den langsomme undring hos kyr          green grass, the large slow oddity of cows,
torden og lyn, fugler sirkler med skrik og skrål         thunder and lightning, birds that wheel and cry,
slim fra mudderet lever og dør etter sitt formål         slime crawling up from mud to live and die,
alle behøvrig registrert i godt behold                   these each are duly registered and print
i hjernens furer, i hver sin egen fold                   the brain's contortions with a separate dint.

Men trær er ikke 'trær' før de var til                   Yet trees are not 'trees', until so named and seen
som så dem og gav navn til 'Eik' og 'Pil'                and never were so named, till those had been
som foldet ut pustens knopp til blad av ord              who speech's involuted breath unfurled,
svakt ekko, uklart bilde av vår jord                     faint echo and dim picture of the world,
men hverken foto eller et lydopptak,                     but neither record nor a photograph,
er omen, latter, eller dom i sak                         being divination, judgement, and a laugh
svar fra dem som kjente vekket                           response of those that felt astir within
i brystet dype følelser i slekt                          by deep monition movements that were kin
med liv, og trærs, og dyrs, og stjerners død             to life and death of trees, of beasts, of stars:
frie fanger filer over skygge-gitters nød                free captives undermining shadowy bars,
miner ut alt det vi vet fra det vi har sett              digging the foreknown from experience
og vasker gull fra åndens åre med vårt vett              and panning the vein of spirit out of sense.

Med mektige krefters arbeid så de hvem de seg selv er       Great powers they slowly brought out of themselves
Og når de så tilbake så de alver                            and looking backward they beheld the elves
som har i sinnets dunkle smie spunnet                       that wrought on cunning forges in the mind,
lys og mørke drømmer sammentvunnet                          and light and dark on secret looms entwined.

Den ser ei stjerner, som ei første gang                     He sees no stars who does not see them first
ser det levende sølv som plutselig sprang                   of living silver made that sudden burst
ut i flamme, som blomster, under en eldgammel sang          to flame like flowers beneath an ancient song,
og musikkens ekko er her fremdeles siden den gang           whose very echo after-music long
Det finnes ingen himmelvelving med stjerner som du har telt has since pursued. There is no firmament,
Tomrom kun, om ikke et juvelbesatt telt                     only a void, unless a jewelled tent
mytevevd, mønstret av alver; det finnes ingen Jord,         myth-woven and elf-patterned; and no earth,
om ikke det liv vi er født fra, som er vår mor              unless the mother's womb whence all have birth.

Vi husker ennå ham som la visdom i vårt minne               The heart of Man is not compound of lies,
og vårt hjerte, ingen løgn fra ham, finnes gjemt der inne   but draws some wisdom from the only Wise,
Om vi har blitt fremmedgjort fra han som har oss skapt      and still recalls him. Though now long estranged,
er vi verken endret eller helt fullstendig tapt             Man is not wholly lost nor wholly changed.
Kanskje falt fra nåden, men ennå ei fra tronen              Dis-graced he may be, yet is not dethroned,
Vi samler sparsomt restene av makten og av kronen           and keeps the rags of lordship once he owned,
vårt verdensstyre ved vår skaperakt                         his world-dominion by creative act:
men ikke dyrk det største han har skapt                     not his to worship the great Artefact,
Menneske, medskaper, det hvite lys alene                    Man, Sub-creator, the refracted light
gjennom deg er splintret, brutt i fra det ene               through whom is splintered from a single White
i fargetoner, vi kan sammenføye                             to many hues, and endlessly combined
til skikkelser som flyr fra sinn til øye                    in living shapes that move from mind to mind.

Om vi fylte alle verdens sprekker og berg                   Though all the crannies of the world we filled
med skogalver og fjelltusser, og mang en langskjegget dverg with Elves and Goblins, though we dared to build
om vi våget bygge Guder med tempel som ingen har sett       Gods and their houses out of dark and light,
og sådde vi dragesæd tenk, så var det vår rett              and sowed the seed of dragons, 'twas our right
brukt eller misbrukt, den retten har ikke gått tapt         (used or misused). The right has not decayed.
vi skaper ved samme lov som vi ved er skapt                 We make still by the law in which we're made.

Javisst spinner vi "ønskedrømmer" for å lure                Yes! 'wish-fulfilment dreams' we spin to cheat
våre tandre hjerter og bekjempe fæle fakta!                 our timid hearts and ugly Fact defeat!
Hvor kom det ønsket fra, og drømmens kraft                  Whence came the wish, and whence the power to dream,
eller dømme noen ting vakre eller noen ting stygge?         or some things fair and others ugly deem?
Ikke alle ønsker er forgjeves, og om vi forsøker            All wishes are not idle, nor in vain
oppfylle dem er det ikke kastet bort                        fulfilment we devise 
                           -- for smerte er smerte                                -- for pain is pain,
ikke å trakte etter, for det er ondt                        not for itself to be desired, but ill;
ellers var det å streve eller undertrykke viljen            or else to strive or to subdue the will
like nådeløst; og om det Onde er dette                      alike were graceless; and of Evil this
alene den dødelige sannhet: Ondskapen finnes.               alone is deadly certain: Evil is.

Signede bevrende hjerte det onde hater,                    Blessed are the timid hearts that evil hate
skjelver i skyggen, men likevel ondt det forsaker          that quail in its shadow, and yet shut the gate;
vil ikke forhandle, men gjemt i sikrede bôl                that seek no parley, and in guarded room,
liten og bløt, og på en tander vevstol                     though small and bate, upon a clumsy loom
med tråder av morgensol lar de skyttelen løpe              weave tissues gilded by the far-off day
vever troen og håpet, under Skyggens svøpe                 hoped and believed in under Shadow's sway.

Signet de byggende menn av Noas art                        Blessed are the men of Noah's race that build
sine små arker, enn skrøpelige, med dekket bart            their little arks, though frail and poorly filled,
styrer de gjennom skiftende vind mot et skrømt             and steer through winds contrary towards a wraith,
mot en havn, et rykte, som kun noen i tillit har drømt     a rumour of a harbour guessed by faith.

Signet er de som skrev legender på rim                     Blessed are the legend-makers with their rhyme
om ting som ikke kan finnes i nedskrevet tid               of things not found within recorded time.
Det er ikke dem som har glemt selve Natten                 It is not they that have forgot the Night,
eller bedt oss flykte fra organisert lyst                  or bid us flee to organized delight,
på lotus-øyer av økonomisk herlighet                       in lotus-isles of economic bliss
forsverger sjelen for å oppnå en nymfes kyss               forswearing souls to gain a Circe-kiss
(og bare et forfalsket slikt, masseprodusert               (and counterfeit at that, machine-produced,
forføring av dem igjen og igjen).                         bogus seduction of the twice-seduced).

Such isles they saw afar, and ones more fair,
and those that hear them yet may yet beware.
They have seen Death and ultimate defeat,
and yet they would not in despair retreat,
but oft to victory have tuned the lyre
and kindled hearts with legendary fire,
illuminating Now and dark Hath-been
with light of suns as yet by no man seen.

I would that I might with the minstrels sing
and stir the unseen with a throbbing string.
I would be with the mariners of the deep
that cut their slender planks on mountains steep
and voyage upon a vague and wandering quest,
for some have passed beyond the fabled West.
I would with the beleaguered fools be told,
that keep an inner fastness where their gold,
impure and scanty, yet they loyally bring
to mint in image blurred of distant king,
or in fantastic banners weave the sheen
heraldic emblems of a lord unseen.

I will not walk with your progressive apes,
erect and sapient. Before them gapes
the dark abyss to which their progress tends
if by God's mercy progress ever ends,
and does not ceaselessly revolve the same
unfruitful course with changing of a name.
I will not treat your dusty path and flat,
denoting this and that by this and that,
your world immutable wherein no part
the little maker has with maker's art.
I bow not yet before the Iron Crown,               Jeg bøyer meg ikke ennå for Jernkronen
nor cast my own small golden sceptre down.         Og kaster ei mitt gullsepter fra tronen

In Paradise perchance the eye may stray
from gazing upon everlasting Day
to see the day illumined, and renew
from mirrored truth the likeness of the True.
Then looking on the Blessed Land 'twill see
that all is as it is, and yet made free:
Salvation changes not, nor yet destroys,
garden nor gardener, children nor their toys.
Evil it will not see, for evil lies
not in God's picture but in crooked eyes,
not in the source but in malicious choice,
and not in sound but in the tuneless voice.
In Paradise they look no more awry;
and though they make anew, they make no lie.
Be sure they still will make, not being dead,
and poets shall have flames upon their head,
and harps whereon their faultless fingers fall:
there each shall choose for ever from the All.

Today’s sysadmin tip: Finding what binaries to restart revisited

January 20th, 2014

Almost exactly two years ago, I posted a perl script to find what binaries to restart for Red Hat based systems. I digs a bit deeper than the excellent needs-restarting script that is provided by Red Hat, by running ldd on the running process binaries, and recursively checking all underlying libraries. I did an extra variant for Debian and derivates today.

Why is this necessary? Because processes may map libraries without opening them. If the underlying library is updated, needs-restarting (or checkrestart on Debian, Ubuntu and derivates) won’t list the process as need to be restarted. But the process may crash or behave strangely when it some time in the future opens a mapped library, and that library has been changed by an update.

And yes, this is a real problem, experienced on production systems.

Red Hat variant
Debian/Ubuntu variant

Qiu Xiaolong: År i Rødt Støv

December 31st, 2013

Dette er en ganske vidundelig liten bok. Historien om Kina under kulturrevolusjonen er storslagent tragisk og grusom. I denne boka har forfatteren gitt rom for de små fortellinger i stedet. Rødt Støv er en liten gate i Shanghai. Vi får glimt fra hverdagslivet i gata gjennom korte historier og glimt gjennom femtiseks år. Hvert kapittel er en som en selvstendig liten novelle, og åpner med gatas siste veggavis for det året.

Her blir hverdagskina tryllet fram gjennom muntre glis, sorg og savn, og besk humor, gitt i akurat passe små porsjoner til at vi rekker en på sengekanten, eller mellom stasjonene på banen. Litt visere blir vi også. Anbefales svært varmt.

Boris Akunin: Kroningen

December 31st, 2013

Moskva, 1896. Tsar Nicholas II skal krones, og det planlegges stor festivitas og en masse selskapligheter med svært celebre gjester fra hele verden. Afanasi Zjukin, overkammerherre hos storhertug Georg Alexandrovitsj får vanskeligheter når et medlem av famlien, selve lilleprins Mikail, tsarens fire år gamle nevø, blir bortført foran øynene på guvernanten, familien, og Zjukin selv. Ikke helt tilfeldig er Erast Petrovitsj Fandorin på pletten, og sammen med sin japanske tjener Masa jager han bort kidnapperne, men ikke før prinsen er forsvunnet. En internasjonal forbryter i mesterhjerneklasse, dr. Lind, tar på seg ansvaret, og forlanger den største løsepenge som kan tenkes; selveste Orlov-diamanten, en av de største skatter i Russlands skattkammer, og et avgjørende element i Tsarens septer, som selvsagt skal brukes under kroningen. Her haster det altså.

Dette er god underholdning, såklart. Det er det alltid med Fandorin. Men samtidig vet jeg ikke helt hvordan jeg skal plassere boka. Boris Akunin har pleid å leke med genrer. En bok er som James Bond, en annen som Agatha Christie, en tredje er et historisk krigsskue, en fjerde er en terrorist-thriller, osv. Men her peker det litt i alle retninger. Stakkars Zjukin blir fremstilt som en litt pompøs klovn der han går helt opp i rollen som overkammerherre. Noen steder går det nærmest over i farse, med elsker-i-skapet-scenen, velkledde herren detter-i-søla-scenen, velkledde-herrer-blir-kledd-opp-i-drag-scenen, velkledde-herrer-skal-kjøpe-undertøy-til-damen-scenen, osv. Samtidig beskrives Moskva og stemningen i byen tilsynelatende historisk korrekt, og det gjør den straks mer interessant. Boka tar f.eks opp i handlingen Khodinka-tragedien, der hundrevis av mennesker ble trampet til døde ved et arrangement til kroningen.

Leseverdig, og litt spennende innimellom. Hvem som egentlig er skurken gjetter leseren ganske tidlig, og Fandorin og Zjukin er kanskje i overkant trege med å forstå sammenhengen. Men hvem som står igjen levende og død til slutt er ikke avgjort før på nest siste side.

Kan trygt anbefales

Chris Tvedt: Av jord er du kommet

December 31st, 2013

Edvard Matre er etterforsker ved KRIPOS. Han blir kalt ut til et underlig drap på Finnskogen. En eldre mann blir funnet henrettet med rifle. Han har vært død lenge, og bortsett fra en datamaskin med barneporno finnes det ingen spor i saken. Matre og teamet hans blir etter noen ukers famling tatt av saken, og får noe så sjeldent som en seriemorder i Bergen å ta hånd om. En sinnsyk morder tar livet av prostituerte på blodigst mulige måte, og det blir en kamp mot tiden for å stoppe morderen før han dreper igjen. Kompliserende faktorer er et team som samarbeider dårlig, og Matre klarer å innlede et slags kjærlighetsforhold til et av de mulige ofrene. Midt oppi det hele får han vite at han er adoptert, og at levningene etter hans biologiske mor er funnet i en massegrav ved Ris kirke, med pasienter fra Gausdal sykehus. Med et plundrete forhold til broren på toppen blir veldig mange tråder å holde i for stakkars Edvard, som knapt vet hvem han selv er. Med politiledelse og presse på nakken i tillegg så det er ikke så rart at han sliter litt underveis.

Historien om Matre og teamet hans er god, men den er over kjent lest. Liknende varianter er jo skrevet f.eks av Jørn Lier Horst eller Henning Mankell. Et lite gullegg er det jo å sette identitetskrise på mannen. Det gir en interessant vri. Forfatteren tør gi hovedpersonen svakheter. Han er ikke noen spesielt god leder, og viser også dårlig selvinnsikt idét han tviholder på en ekstremt viktig sak samtidig som han går gjennom en personlig krise.

Utgangspunktet for denne historien er selvsagt massegraven på Ris. I boka blir den åpnet, og restene av de døde blir forsøkt identifisert. Denne graven finnes i virkeligheten, men den er aldri blitt åpnet, og forfatteren spekulerer åpenbart i hva man kan finne ut om behandling og pasienter om dette blir gjort. Ikke at det blir mindre viktig av den grunn. Edvard Matre er ny hovedperson, men forsvarsadvokaten Mikael Brenne fra tidligere bøker dukker opp som bifigur.

Dette er bra krim av kjent merke. Kan trygt anbefales.

J.R.R. Tolkien: The Silmarillion

December 31st, 2013

Since it’s that time of the year again, I’m reading Tolkiens “canon”, that is The Hobbit, The Lord of the Rings, and The Silmarillion. I always do around Christmas. I’m still moved by the creation of Ëa, the Earth, and of the many stories, I find The Tale of the Children of Húrin the most intriguing. The story variant in the Silmarillion is almost too short, and for those who want the longer version, I would recommend the standalone book The Children of Húrin.

J.R.R. Tolkien: The Lord of the Rings

December 31st, 2013

Since it’s that time of the year again, I’m reading Tolkiens “canon”, that is The Hobbit, The Lord of the Rings, and The Silmarillion. As earlier years, I’ve also this time tried to find a new angle or figure to scrutinize. This year, the turn has come to Prince Imrahil of Dol Amroth.

Imrahil is a bit strange to me. His name would have another kind of etymology, I think. Imrahil sounds more Arabic-like (or Harad, if you like) than of Nùmenorean origin. And he’s too good to be true. Being but Denethor’s brother-in-law, he appears even more noble than Faramir!

When Imrahil first enters the story, he’s the bright hero warrier knight in his shining armour, on his white horse, and his soldiers are marching behind him singing. Wow! And through the story, he barely jumps from his high horse, and then either to save prince Faramir from certain death, or to find that Eowyn is still alive, (and thus saving her as well): ‘I deem she yet lives.’ And he held the bright-burnished vambrace that was upon his arm before her cold lips, and behold! a little mist was laid on it hardly to be seen. And when finally Aragorn is revealed as the heir of the throne of Gondor, Imrahil bows his head, and calls him his liege-lord.

What a man, what a hero, and he is even humble in all his glory. It’s almost too much. And he even has the looks; he is part elvish, according to Legolas: Legolas looked at him and bowed low; for he saw that here indeed was one who had elven-blood in his veins..

Stop. Brakes on. Part elvish? There’s something fishy here. Skipping forward to Appendix A, subchapter The Nùmenorean Kings, it is stated that there were only three unions of elves and men; Lúthien and Beren, Idril and Tuor, and Arwen and Aragorn. Of course, Imrahil could be of Nùmenorean race, but that doesn’t rhyme with the rest of Legolas encounter: It is long since the people of Nimrodel left the woodlands of Lórien, and yet still one may see that not all sailed from Amroth’s haven west over the water. And Imrahil answers: So is the lore of my land.

Now this is a little mystery. What’s the story about elves mingling with men in Dol Amroth? I thought I could remember having read something about that somewhere, but being unwilling to read my volumes of The History of Middle-Earth again, I humbled my pride, and searched the Internet. Wikipedia had the answer, of course. I’m obviously not the first to dig into this. The story is is found in a note in Unfinished Tales, in one of the variants of the founding of the line of Dol Amroth. It is shortly told that Mithrellas, a Silvan elf-lady of Nimrodel’s company became lost in the mountains, but was found and harboured by the Nùmenorean Imrazôr of Bel Falas, who wedded her. She bore him two children, a girl Gilmith and a boy Galador. Thus Nùmenorean blood was mingeled with Silvan elves, and the line of Dol Amroth was established. Shortly after, Mithrellas left, and was never heard of again. It is an, a bit sad story I think, and with Mithrellas leaving, not to say escaping, her wedding to Imrazôr is not mentioned by the “official” unions of elves and men – or it could just be one of the many discrepancies in Tolkien’s stories.

J.R.R Tolkien: The Hobbit

December 31st, 2013

Since it’s that time of the year again, I’m reading Tolkien’s “canon”. And since the Internet is full of posts about the book, I’d rather post a few comments on the new Hobbit movie, The Desolation of Smaug, which I watched just before Christmas. (Yes, the Internet is full of those posts too, I know.)

I was a bit surprised by this film. I quite enjoyed last year’s chapter of the story, but this time I was a bit baffled. I mean, yeah, this is a cool film, and I kind of liked it, but this is … another story. It could be described as “loosely based on a story by J.R.R. Tolkien”. But while watching it, I thought, well, OK, let’s see what happens. I might be surprised. And as beeing one that knows the original story, well, let’s say, in more detail than the average, that’s probably a good thing, isn’t it? And with that, I found the film quite entertaining.

There were a few things to note, though, if I may.

First, the meeting of Gandalf and Thorin in Bree, in retrospect. That part is fetched from the appendixes of The Lord of the Rings. I very much liked that part. And perhaps especially because it picks one of the main weaknesses of the book: What is the mission of the dwarves? They should understand that addressing a dragon, and go burglaring for several hundred tons of treasure is just a mad quest. Making the Arkenstone the primary target, as it gives royal power over the rest of the dwarvish clans, see that’s a quest that might be possible to achieve using a smart and quiet burglar. And it also shows Gandalf’s master plan: To get rid of the dragon before Sauron may use it for his own purposes. Nice!

Beorn and his house. Gone is the rather comical encounter of Gandalf and his story, and the dwarves popping up like jack-in-a-boxes. Gone is the laughing, jolly huge man, and his wonderful animals. In his place, a dreadful beast, and a rather mystical, dreamlike figure. I missed the children’s book’s Beorn.

Gandalf finds that the Necromancer has released the Úlari, the nine Nazgûl from their well bolted up tombs in the mountains. A bit far fetched, I think. According to legend, the ring wraiths never died. The rings made them live forever, under Sauron’s dominion. They did not have to rise from death. But this is what happens when one tries to combine the stories. The Nazgûl did not exist yet in Tolkien’s mind when he wrote about the Necromancer in Dol Guldur. Actually making him Sauron, as Gandalf discovers, did not appear to Tolkien before he had started writing The Lord of the Rings.

Bilbo’s heroism against the spiders in the forest is rather ignored. That’s sad. Instead, the general fight, and the fierceness of the elves, and in particular this totally new character, Tauriel, is emphasized.

Tauriel, I actually quite liked, but why was she there? After discussing this with a colleague, the obvious reason appeared: There is no women at all in the original book. And this far in the films, the only female figure that has appeared has been Galadriel. Nice, but quite remote. So here is a heroine for our female audience. Good for them. This is our fight!.

Then, the elven king. With the looks and temper of Lucius Malfoy. ‘nough said. I didn’t like that at all.

An action movie needs action scenes. Legolas jumping from dwarf to dwarf on the river while constantly beheading orcs. It’s a laugh! And that surfing-on-a-shield detail from The two Towers was revisited twice, or was it three times? Or four?

Making Bard a kind of agent for People’s Liberation Front against the Tyrant, was an interesting move, I think. At least more than the original variant of an acid-stomached watchman. But again, Bilbo’s rôle and heroism is ignored. It should be Bilbo that discovers the weakness of the dragon. It should not be a well-known fact from the stories from Dale. Why is Bilbo’s courage diminished for this?

An elf-dwarf love story. Now that’s way too far fetched. Sorry, that would never happen. Orcs attacking Esgaroth? Uhm, well, okay. But parting some of the dwarves from the rest of the company. Now that was a strange move. Didn’t see that coming.

I loved the scene where the keyhole is found. It almost gave me goosebumps. The dragon was great. The dwarves try to fight the dragon using dwarvish tech. Well, there had been at least four minutes without an action scene, and if you have to fill up a film, why not go for the spectacular. I can stomach that.

All in all, while making quite a different story than Tolkien’s own Hobbit, I quite enjoyed this. And to quote a Norwegian ex-politician, caught while lying about so-called facts: “But it could have happened” * **.