• 25Apr
    Categories: Funny Comments: 2

    Hi everyone.

    Allow me to share a rather embarrassing episode I had yesterday that resulted in the doom of my laptop screen. So, I was on my way home from another hard-working-good-lookin day at school, and as always I was kind of stressed. The “walking” part was to the parking lot not far from the school, and I was talking to a friend at the same time as I had my brother on the phone. (You know, we boys can’t multitask things). When I was about to unlock my car from the passenger side, I had to drop my backsack on the ground infront of my car. Unlocking my car from the passenger side and then open the driver door from the inside is the algorithm to unlock my car (quite old car). The idea was that I was suppose to fetch my backsack when walking around the car. However, in all the mess and stress, I take the other way around the car.

    Jumping into the car thinking everything is OK, igniting the car, adjusting the stereo, need the right moood and sound before driving you know. Then, shifting into 1th gear and flooring the throttle. I was soon to discovery a rather unusual sound from the front of the car. Hmm, what could it be? Hitting the break a millisecond later, I came to realize that I was missing my backpack. WTF?! Backup up the car I find my backpack rather flat and dusty. The first thing that goes through my mind was the laptop…. Was it OK? Taking a quick physical check tells me it survived, so far so good. But, what’s that next to my laptop? Noooooooo, my coffee cup is broooken!! So, I drive home rather grumpy, but thinking it went OK since my laptop survived. I keept that thought to the next morning. Sitting in the reading hall at the university I suddenly realized that my laptop screen was big time fucked. Unable to read a single character.

    Now, you may have your bad mornings, but this as so far been my worst..

    EDIT: I’ve now added a photo of my laptop.. I haz proof!

  • 21Apr
    Categories: school Comments: 0

    Woho, deadline for master rapporten (også kjent som “Diplomen”) nærmer seg med stormskritt. Litt i overkant av en måned igjen til deadline (1.Juni). Blir en voldsom mengde espresso og sene kvelder fremover, da det bestandig er ting man bare forandre på.

    For alle andre som skal eller driver på å skriver diplomen sin, så vil jeg bare ønske dere lykke til. Det kan i begynnelsen virke som en ubestridelig stor oppgave, men såfremt man tar det et steg av gangen så er det faktisk lys i enden av tunnelen.

    En annen ting: Kreativiteten for alt annet enn selve master oppgaven vokser med ca 80%!

  • 20Apr
    Categories: Funny Comments: 2

    Okey, so this post is somewhat special since its not geeky in any way, it is much more an observation from my side.

    At NTNU there is several lavatories around, and there is one observation in the gentlemens lavatory thats been bugging me. In most lavatories at NTNU there is two urinals pr lavatory, and here’s the case. You know when you’re just let the “water” flow and there is one “spare” place besides you and there is not much space between the urinals? Well, for some reason many people find it natural to occupy the urinal right next to the one you’re using. Those people are wrong! The available urinal next to another one in use is not meant to be used, its purpose is only psychological.This behavior is only allowed in cases where there is at least more than a half meter between each urinal!

    So, to summeraize, if you find yourself in this situation and you’re that poor person already in action at the urinal, then you’re entitled to take verbal action. If you’re that other horrible person, then I would urge you to think twice before you use the urinal.

    Urinal
  • 19Apr
    Categories: python Comments: 0

    Have you ever had a need to extract some information for a webpage in a automatic fashion? Well, I have multiple times. And, lazy as I am and given that I needed the process to be runned many times each day, I wanted to create a fancy script to do this. Now, I’m not gonna go into which webpage I needed to extract info from, by lets say the wanted information site is http://example.org. Now, the people behind this website is clever, they don’t want automatic scripts to download and use their information. So, if the HTTP headers is showing that a HTTP request is not from a web browser such as Firefox, Opera, Safari, IE, they would deny the request.

    Our nerdy curiosity would tell us not to give up! So, how would we cope with this kind of obstacle? Well, the Python programming language is a fantastic language providing us with modules for everything. One builtin module is the “urllib2″ which has capabilities to “mimic” a web browser. Here is a simple python code for achieving this:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    #!/usr/bin/env python
    import urllib2
    main_url = "http://example.org"
    txheaders = {'User-agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3'}</code>
     
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
    urllib2.install_opener(opener)
    req = urllib2.Request(main_url, '', txheaders)
    handle = urllib2.open(req)
    print handle.readlines()

    And that’s all there is to it. The website http://example.org inspects the headers which is valid and tells the webserver at example.org that the client is a Firefox web browser running on Linux OS.

    One important note: It is illegal to steel information from sites and present it on your own site without an agreement of the source website and refering to the source. Remember to always “be nice”.

  • 19Apr
    Categories: linux Comments: 0

    Today I spent some time trying to understand SSL certificates and how I could implement SSL on my web sites. Some googling later gave me some interessting tips regarding using CAcert and Apache2.

    So, signing up as a user at CAcert, I was able to get my certificates signed by CAcert by simple web clicks. One thing to notice about CAcert is that they are not shipped as an CA in most web browser. This means that if you implement your CAcert signed certificate in your Apache2 web server, and visits your website with Firefox (via HTTPS) you will receive a notification stating that your certificate is not signed by any know authorities. What you will need is to import CAcert.org root certificate to make the browser able to verifi the certificates.

    What does CAcert.org have in constrast to other CA’s around the world? Well, its a free service, so you don’t need to pay expensive fees to get your certificates signed. This is the most attractive feature. One downside has already been mentioned here, that the root certificate is not already in most browsers, so one has to import them manually. If you want to provide your webpages through HTTPS, I would absolutely recommend you to have a look at CAcert.org. For tutorials and guides for how to use CAcert.org with Apache, take a look at the http://wiki.cacert.org page.

    Some links:

    • http://wiki.cacert.org/wiki/SimpleApacheCert
    • http://wiki.cacert.org/wiki/CSRGenerator
  • 19Apr
    Categories: lucene Comments: 4

    Have you ever heard of the Apache Lucene open-source search library? Well, now you have. It’s basiclly a big library which have all the necessary technology for high-performance search engine. Lucene is focused on text indexing and searching.

    In my master thesis which I’m currently working on, I’ve created a prototype software which’s main goal is to build different kinds of indexes and perform a hugh number of searches on them. What I’m then doing is to collect numbers such as the time it takes to construct the indexes, the disk space needed, the time to perform a huge chunk of queries on each index, and more. With this information I will then analyze and discuss the results in light of phrase searching, which is my master thesis main goal. My master thesis is concerned with how to enhance phrase searching in text indexes, and this is what I will discuss using the numbers extracted from my experiments.

    So, if you would like to learn more regarding search technology I would recommend you to have a look at Apache Lucene.

  • 19Apr
    Categories: Funny Comments: 0

    Her om dagen ble jeg gjort oppmerksom på at en meget spesiell ny type boks brus var ute. Noen få underinger senere og et lite besøk innom Tapir kiosken på Gløshaugen, NTNU, så satt jeg og noen klassekamerater med en Ubuntu brus å hånda.
    En rask prøvesmaking var på sin plass, og verdt å merke, til å være en relativt ukjent brus smakte den faktisk godt. I og med at dette var en sukkerholdig leskedrikk var det begrenset med slurker jeg klarte å innta (les: diabetiker), men det smakte.

    Tags: , ,
  • 19Apr

    Hepp hepp.. Jeg har en stor lidenskap, nerding på høyt nivå. Falt pladask for nerding i en tidlig alder, og det er nå blant mine hverdagslige gjøremål.

    En ting som har brøytet seg frem den siste tiden er web programmering, og teknikker innefor dette området. Her har jeg fått veldig sansen for rammeverk som er modulære og tilpasser seg MVC-arkitekturen. Og siden jeg er en stor fans av programmeringsspråket Python, så var Turbogears et rammeverk som utmerket seg godt. Også en god konkurrent er rammeverket Django.

    Hvertfall, jeg vil anbefale alle som har lyst til å lære seg morsomme og smarte måter å utvikle store / middels / små web-applikasjoner å ta en titt på Turbogears. Skal prøve å få ut noen få morsomheter med Turbogears etterhvert..Cool

  • 19Apr
    Categories: dia Comments: 0

    For some time now, I’ve been playing around with the Dia diagramming tool http://live.gnome.org/Dia. One thing that has annoyed me is the lack of stylish shapes such as those available in the M$ Visio digramming tool. As an attempt to solve this, I’ve been spending some days trying to understand the Dia XML files that encapsulates both the sheets and shapes.

    Just to make thing clear, a sheet is by definition a collection of shapes. If I call a sheet for “Computer stuff”, then that particular sheet will contain shapes that is within the scope of “Computer stuff”.

    I have currently made available some sheet for download. However, considere these sheets as ‘very’ beta, as I’ve only created very simple shapes that supports 9 different connection points, and that’s it.

    You can download them as an tar.gz or ZIP file here: http://asbjorn.fellinghaug.com/filer/Dia_shapes.tar.gz and http://asbjorn.fellinghaug.com/filer/Dia_shapes.zip.

    Tags: , , ,
  • 19Apr
    Categories: linux, tips Comments: 0

    Caching inside Linux such as pages and inodes can become quite hugh, and thats the point. Linux wants to utilize all the available memory to create a faster working environment…

    Now, lately I’ve been experimenting on some IR-software (http://lucene.apache.org), and for these experiments I needed to clear the internal page caching of I/O data. Basicly, whenever I open a file, then Linux caches that particular file, so that if I need it again later on, it will be available in “no-time”. For my experiments, I needed a “clean” cache for every run, and therefor needed to clear my cache.

    After some Googling I stumbled upon this site: http://linux-mm.org/Drop_Caches. There was a lot of interessting stuff there, so I would recommend people to read it.

    Basically, whenever you need to uncache something in your computer, you can (in Linux that is), write the following in a terminal:

    This one below will free pagecache:

    # echo 1 > /proc/sys/vm/drop_caches

    This one below will free dentries and inodes:

    # echo 2 > /proc/sys/vm/drop_caches

    This one below will free both pagecache, dentries and inodes:

    # echo 3 > /proc/sys/vm/drop_caches