Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex


Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter

Older entries

Atom - Subscribe - Categories

Facebook icon Share on Facebook Google+ icon Share on Google+ Twitter icon Share on Twitter LinkedIn icon Share on LinkedIn

Using a spare-tyre, maintenace of rear axle

So, a few days ago I tried to fix the axle of my bike, which broke off, but not completely.

I have an older bike, broken down, stored here as well, and I took the shield around the cone which guards the ball bearing from that, and hoped it would work.

It did work, for a couple of kilometres. Then the tire started wobbling.

Turns out that shield didn't fit, and the ball-bearing beneath it had been gobbled up into bits.

So, I figured I would instead use the entire tyre from the old bike, and it seems like a good fit.

No description

No description

It had been standing out in the rain etc. though for quite some time, so I disassembled most of the rear axle, cleaned the balls in the ball bearing, put on a good amount of cleaning/lubricant (similar to WB40), and now I'm letting than run off.

No description available

As I'm looking at the tire, I see that it is rated for 70 kgs, and I'm well beyond that, and was at the time that I bought it. I got a bad vibe about those ******* at the store, and it turns out I should have listened more closely to that.

Anyway, I won't be using that tire for long, and I'll be going at a slow pace to keep things safe. It's a useful exercise for me to do this kind of work.

So, I took a break for some food and a cup of tea. It started to rain, I wasn't happy about that, but it turns out the paper becomes water-repellent once it is soaked in oil, and the bits and pieces had water droplets formed on them, which also indicates the oil/cleaner is working.

No description

I guess this cleaning / oil is so thin that it loosens up things, yet it is oily enough to stick and displace water.

I attached the wheel, and it sits well, and looks better after being treated with a bit of that good stuff. Now I just have to get some air into it, and adjust the break pads slightly.

No description

No description

[Permalink] [By morphex] [Maintenance (Atom feed)] [12 Jul 15:46 Europe/Oslo]

Charges filed against Nordland police district, formerly Helgeland police district, by Rana police station

Complaint against Nordland police district, formerly Helgeland police district, by Rana police station

I wish to file a complaint against Rana police station, because they have since 2013 been passive, and as a result of that, I've been inflicted considerable financial losses, and suffering.

Furthermore, employees at Rana police station have taken a more aggressive stance to my public posts the last 6 months, without explaining why.

I have reason to believe that they are trying to scare/pressure me into stopping talking (blogging) about what has happened since 2009, as they don't explain what's wrong with my blogging, and why.

In addition to this, employees at Rana police station have tried to pressure me into giving a statement recently, even if they before that got good reasons as to why I couldn't give a statement.

After this, I've mailed with one Joakin Einhaug at Rana police station, where I have repeated what I've earlier said about the matter, without getting any response.

Morten W. Petersen
9. April 2020

Original complaint (In Norwegian).

[Permalink] [By morphex] [Family (Atom feed)] [19 Jun 09:49 Europe/Oslo]

Complain filed against primary care physician Ina Løvlihaugen

It's going towards a 3rd round in court about my kids, and in that process, the court asked my lawyer new Kent Fredriksen, to ask me to get documentation [from my doctor].

The old lawyer Sveinung Hestad Strand suddenly and without notice disappeared to a job in the public sector.

So, I asked my doctor for some documentation. Before this, I thought our working relationship was OK, but as soon as I was asking for this documentation, things got weird. So I ended up also asking for a document that documents that I have been taking Seroquel (as I should), for 10 years. Which was on the side of this court process.

However, when I went to pick up my package of Serqouel at the pharmacy, I found that Ina Løvlihaugen had retracted my subscription, without me having an idea she would, and without sending me a message about it.

That she doesn't want to document something that is central to my medical treament and that I know is true, is alarming. They should be able to tell, after 10 years, if I'm taking the medication as I should or not.

And retracting the medication, a medication I'm mentally and physically dependant on, is over the line. Here is my complaint, translated from Norwegian [original is here: ]:

Subject: Complain on primary care physician Ina Løvlihaugen
Cc:, Kent Fredriksen (
Date: Thursday, 11th of June, 2020 at 10:25 PM


I wish to send a complaint on Ina Løvlihaugen, at Moholt Legesenter [Moholt doctor's centre].

When I went to pick up my medication saturday, the prescription had been withdrawn. I had not gotten a message about it being withdrawn. I also had no idea that the prescription would be recalled.

The medication is Seroquel depot, and I understand it that in the prescribed use, I am mentally and physically dependant on this medication.

After sending messages about this, a new package was prescribed.

This was picked up on tuesday. Later the same day I sent a request for a new prescription.

Now, 2209 thursday evening, I still don't see a prescription on [main healthcare website in Norway].

In addition to this, Ina recently refused to make a certificate that I have taken the drug Seroquel as agreed for 10 years, since 2010.

I have taken the medication as agreed with doctors, when one disregards trivialities such as very sporadically forgetting a dose, taking a tablet too much, taking it in the early afternoon instead of the morning etc.

I thought the collaboration between me and Ina has been OK, but it has become weird after Kent Fredriksen asked me to get a certificate from her. I asked for a certificate that described our relation and that the collaboration was OK, I did not get that. This in connection with parental responsibility in a custody case.

I think this matter regarding Seroquel is suited to create insecurity for me and other users of the healthcare system, and further weakens my trust to the healthcare system.



[Permalink] [By morphex] [Health (Atom feed)] [17 Jun 08:46 Europe/Oslo]

Reworking the balcony

So, I'm staying at my dad's cabin, going to fix it up as I go along.

Some rot in the balcony caught my eye, and eventually I found that parts here and there in the lower section of the balcony was rotten and had cracks.

So I'm going to keep the roof, for now, and remove whats underneath. Today's project was to prepare the roof for a new mainstay at the outer edge.

So I had to remove some bits of plank that were added to support the fixture where the water drain that runs along the roof is attached.

No description available

I, rather romantically, started thinking I could drill some holes in the place I wanted to break the planks at the right place, or use an iron tap, but those bits of plank there were solid, and they've been there for many decades - good wood and/or they're in a well ventilated place.

No description available

I've made it a point to make the process as safe as possible for me and for anyone else, so nails that are left, are bent and/or hammered into the wood so it doesn't become for example a tetanus trap.

No description available

Eventually though, the romantic, soft approach turned into a brutal and time-saving process, where I just hammered on the plank to make it break.

No description available

That worked rather well actually, the wood broke at the right place to still keep things in place, and clearing the supporting struts so that a mainstay can be put in place.

Some good wood here, getting chucked:

No description available

Making sure removed nails etc. are put in the "jewelry box":

No description available

I guess the only disappointing part today was that one of the supporting struts beneath the roof had rot:

No description available

But it's not very surprising, it was on the corner with rot that first got me started with this. Is it the weather exposure and/or bad ventilation?

I don't know.

Anyway, final result!

No description available

The balcony roof is now ready for a new mainstay a bit below the old one, some concrete can be poured, and the roof will have some new support columns, and the lower part of the balcony can be removed.

[Permalink] [By morphex] [Building a home (Atom feed)] [07 Jun 16:47 Europe/Oslo]

Creating Instagram video out of an animated gif using ffmpeg

I like to play around with images and video, and one thing I'm on about these days are negative images.

I caught a bunch of images of a small waterfall the other day, and Google Photo created an animation of it.

I looked for an app that could convert it into a video Instagram would accept, but ended up having to use ffmpeg through Termux to create a video Instagram would treat as a video.

The command was

$ ffmpeg -f gif -i IMG_20200407_173651_1CS-ANIMATION.gif -vf negate -pix_fmt yuv420p out.mp4

Key command line argument was "-pix_fmt yuv420p".

[Edit shortly after posting..]

BTW, the video I created is here:

[Update the day after..]

Here's the animation of falling water from Google Photos.

[Permalink] [By morphex] [All (Atom feed)] [08 Apr 21:08 Europe/Oslo]

Make-shift exercise tool in these Corona times

I have a set of programs I alternate between at the gym, but now with the Corona virus and all, I have to find alternative ways to exercise.

At the same time, I don't want to invest in a lot of gear, because that costs money, and it is a pain to transport, when for example moving.

So I bought a weighted vest, 30 kilos. I've been using that on for example push-ups, to replace the effect of pushing 36 kilo dumbbells.

I figured I could use the same vest to create a make-shift dumbbell for lateral raises, biceps curling and sideways lifts (to build abs).

So here are the pictures of that process. First picture I've cut a broom handle in half, second and third I've taped the ends and the middle with some packing tape, fourth and fifth I've wrapped the thing in sports tape, sixth picture I've added a piece of orange medical tape to tell where the middle is, and final picture you have the vest, ready to be used as a dumbbell and curl bar.

Broom handle cut and saw, on a chair

Taped ends of cut broom handle

Taped centre of cut broom handle

Wrapped in sports tape

Another picture of wrapped in sports tape

Orange tape in the middle to mark the center

Lifting bar thread through the weighted vest

[Permalink] [By morphex] [Health (Atom feed)] [04 Apr 21:35 Europe/Oslo]

Script to setup WiFi at boot

So, I've got a computer I can't easily access, so I have to set it up to use WiFi at boot. Different configuration options on different Linux distributions give unpredictable results. Today I also experienced a lot of dropped connections, so I had to add a test for network connectivity and setup part of the connection when it drops.

Here's the script, it is also available on

# Crontab entry: @reboot /root/
# Uncomment to kill any wpa_supplicant processes started automatically
#/usr/bin/killall wpa_supplicant
/sbin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &> /root/wpas.log &
/bin/sleep 5
while :
/bin/ping -c 2
if [ $? -eq 2 ]
/usr/bin/killall -q dhclient
/bin/sleep 5s
/sbin/dhclient wlan0
/bin/sleep 5

[Permalink] [By morphex] [Linux (Atom feed)] [23 Jan 15:09 Europe/Oslo]

A notice of concern regarding Justin Smith, leader of the Norwegian family welfare office in Mo i Rana, and the family welfare offices in general

So, this week I got an email from Justin Smith, leader of the family welfare office in Mo i Rana. I was disturbed by this email, in addition to behaviour he has displayed earlier. Here is that email.

Subject: A notice of concern regarding Justin Smith, leader of the Norwegian family welfare office in Mo i Rana, and the family welware offices in general
Cc: Justin Smith <>,
Lise Lydersen <>,
Vebjørn Svidal <>,,,,
Postmottak Nordland politidistrikt <>,


I'm concerned regarding Justin Smith, as he displays a behaviour that is unsuitable, with regard to him being a leader that arbitrates in family conflicts, and has the role of overseeing [time parents have with their kids], which I have gone to court to get, time with my kids.

Justin Smith has earlier this year (on the 16th of August), asked for a meeting with regards to the supervised time I have with the kids. I said yes to this meeting, and a few days later, I added some points which I wanted to discuss. I sent a reminder regarding this meeting on the 17th of September, and the 4th of October. Wanting to have this meeting was also mentioned by me on the 13th of November, in an email about a new round of arbitration.

I think Justin Smith is quite foggy and at times annoying to talk to, and that the family welfare office in Mo i Rana and Trondheim, doesn't come across in a way one might expect - as a neutral party for the best interest of the kids. Where their best interest is among other things, to have [a good relation with their dad].

It seems for example that he [Justin, in conversations], waits for me to say something, and then starts to say something, [to disrupt and/or annoy me].

..the meeting [that Justin originally wanted] was never arranged, and a couple of weeks ago, I called the family welfare office (familievernkontoret i Mo i Rana) in Mo, and talked to Justin Smith. There I suggested 2 alternatives for having the meeting. One was that Bufetat (The Norwegian Directorate for Children, Youth and Family Affairs ), paid for the travel expenses, where the meeting could take place outside of the periods where I see the kids, the other was a meeting over the phone, where I get to loan an office space from the family welfare office in Trondheim (familivernkontoret i Trondheim). Justin was negative to both of these alternatives. I then suggested a third alternative, that I rent an office in Trondheim, and send the bill to Bufetat. I did not catch a positive response to this. It is important for the meeting to be able to speak openly, without [people that had no right to hear confidential information being able to hear it].

This shows that several alternatives for having a meeting have been suggested.

Justin knows, or should know, that it is an extremely small amount of time I get with the kids compared to what I want, that the kids mom [Hilde Olsen] only wants to share expenses for the cheapest transport [added: about 500km each way on train] and not staying overnight in a hotel, and that there has been a long conflict, and still is, between me and the kids mom. And that I think it is important to get the most out of the time I get with the kids.

I have previously said that I wanted arbitration about the parental resposibilities, where they live, time with parents etc. to be outside of the periods I have time with the kids, to get the most out of these times with the kids.

To then force in a meeting at 09:00, the exact same time as the time with my kids starts, is therefore strange, and inconsiderate. It goes without saying that this also limits the amount of time I can use on the meeting (talk about things I want/need to discuss), and that it disrupts the execution of the time I have with the kids.

I think it is important to have good health, and for example regularly check my blood pressure. The highest blood pressure I've had this year, has been very close time-wise, to a visit to see the kids.

Attached is an email sent to Justin with points I wanted to discuss in addition to what Justin wanted to discuss ( ) , and an email sent from Justin this week, with my answers ( ).



[Permalink] [By morphex] [Family (Atom feed)] [06 Dec 08:18 Europe/Oslo]

A lack of response from the Norwegian family welfare office in Mo i Rana leader Justin Smith

So, a good while ago, the leader of the Norwegian family welfare office in Mo i Rana, Justin Smith, contacted me as he wanted a meeting about the roles the people in the office and the person assisting me in my visits seeing the kids have.

I'm not sure what the deal was, because the meeting so far hasn't taken place. But it might have been that I privately wanted to pay the person assisting me (Rubi Stjernen) in these visits for more time, so I could spend more time with the kids, or it could be because I've asked Rubi to welcome the kids, so that I don't have to deal with the the kids mom (Hilde Olsen), her contact person (Vebjørn Svidal, Hilde's brother-in-law an police officer) or any other member of that family.

Anyway, I agreed to such a meeting, then a bit later I figured out there were other things I wanted to discuss, as this conflict about the kids has been going on for 6+ years, and the family welfare office in Trondheim and Mo i Rana have been involved in the conflict for 6+ years.

I sent this email asking for an extended meeting, with the things the leader of the Mo i Rana office wanted to discuss as the first point over 7 weeks ago, but haven't heard anything after that. I send a reminder some weeks ago, and I sent a final reminder last Friday, the 4th of October, asking for comments. I haven't heard anything back.

I think the lack of response, says a lot in itself.

Here's a copy of that email, translated to English:

Subject: About contact meeting
To: Justin Smith, <>

Hi Justin.

I don't have a place to [have a call] that is fully private, so I thought I could borrow a room at the family welfare office in Trondheim.

There are a couple of other things I want to talk about:

1. The roles the family welfare office, visit supervisor etc. have

2. Carrying out visits, wishes

3. Extension of visits [time with the kids]

4. Parental responsibility, why can one party refuse to share information, when is this [considered] irresponsible

5. Review of [conflict] history up until today, confidentiality [non-disclosure], the position of moms and dads in family matters [conflicts], the position of the parent the child is living with, in family matters

I think we can say 15 minutes on each point.

I would like 15 minutes alone in the room before and after the meeting, to prepare and round up. I want the meeting to take place circa in the middle of my [scheduled] visits to see the kids, in about 3 weeks.

I will probably want to have more meetings.

I prefer to have meetings towards the end of the [working] day.

I will record the meetings.

[Permalink] [By morphex] [Family (Atom feed)] [08 Oct 18:51 Europe/Oslo]

Google Drive on Linux (ocamlfuse) and cp cannot create hardlink, function not implemented

So, I was copying a bunch of stuff from an old Windows partition, in case there was something there I needed, making a backup to my Google Drive.

Copying it all using Firefox or Chrome didn't work, the process just died away at some point. So I thought why not go for the command line, which could be setup to retry etc. whenever something fails.

I found google-drive-ocamlfuse, and installation and setup was straightforward. The installation command was

sudo add-apt-repository ppa:alessandro-strada/ppa && sudo apt-get update && sudo apt-get install google-drive-ocamlfuse

(all on one line).

After that, I created a directory google-drive in my home folder, with the command

mkdir google-drive

and setup that folder as a mount point to my google drive, using

google-drive-ocamlfuse google-drive/

It is worth mentioning that you have to close down the browser after authorizing gdfuse to access your google drive, otherwise you can sit and wait on the command line for a long time.

Voila, the google drive was mounted at /home/morphex/google-drive

Now, to mount my Windows partition and make it accessible for my regular user, I had to run

sudo mount -u uid=1000,gid=1000 /dev/sda3 /mnt

To mount the drive accessible to my regular user, so the copy command could read all files.

To copy all the files from the Windows partition, I had to use

cp -Ruvv --copy-contents /mnt /home/morphex/google-drive/ssd

It is worth mentioning that I figured out I had to use the --copy-contents argument, after cp said it couldn't create hardlink, function not implemented.

As an example, that was presumably that a file A existed, and file B was a pointer to the same file, with no contents of its own, and the ability to copy just the pointer was not implemented, so now file A and B exists in the google drive folder, each with their own set of data, taking up double the space.

It was a bit surprising that it took a bit of googling and thinking to figure out I could use the --copy-contents flag.

[Permalink] [By morphex] [Linux (Atom feed)] [05 Sep 15:59 Europe/Oslo]

A follow-up on the struggle to see my kids (role of a police officer)

So, I've been in a conflict with the mother of my kids for 6 years now, and for some time, her brother-in-law, a police officer in Mo i Rana, Vebjørn Svidal, has been a contact person.

I've found his role questionable, in that he as a police officer, has some authority and credibility, and that he then meddles with this conflict, can give the kids mom credibility, because he is a police officer and doesn't do anything about what's going on. For example, reporting the kids mom to the child services.

I reported him to the internal affairs branch of the police, some more info is on this page.

But long story short, the internal affairs dismissed my complaint, but at the same time, forwarded it to the police district where he works.

In my complaint(s), I say that Vebjørn acts as an extended windpipe for the kids mom, trolling along; and that she does not share expenses for me seeing the kids, according to the law, and hasn't done so for 6 years. I write that his meddling in this conflict is questionable, and that he must realize that he, being married to the twin sister of my kids mom, is surrounded by people who can influence him, every day.

But also importantly, the internal affairs did not say that anything I wrote is untrue. A complaint given to the police does have some weight to it, as it is a bad idea, and can be punished by law, to lie to the police.

[Permalink] [By morphex] [Health (Atom feed)] [20 Apr 22:22 Europe/Oslo]

When medication is not available as advertised / promised

Recently I was at a pharmacy, to pick up some Seroquel Depot medication, at the Norwegian pharmacy chain Apotek1, their store at Heimdal.

I ordered 5 packs Seroquel depot 50mg online in their webshop, and things looked fine.

I went to pick it up, and I was the last customer serviced that day. It turned out that they did not have 5 packages available, and after some complaints from me, the pharmacist gave me a 150mg package of Seroquel depot, and 2 50mg packages of Seroquel depot, which was an OK solution, then and there.

However, I find it worrying that a pharmacy advertises, and makes it possible to order important medication online, and when you come to pick it up, it isn't available. I could've bought some packs before traveling, I could've had few packs left at home etc. - and it is an inconvenience that they don't have important medication - AS PROMISED.

I've read online that the maximum concentration of medication in the blood (and its effects and side-effects), can be different for a patient taking 2x150mg of Seroquel depot, as opposed to 1x300mg of Seroquel depot.

I've been on the same dose of Seroquel for quite some time, on 50mg tablets, and it has worked well, I'm in good shape.

However, I've also earlier experienced pharmacies (from other chains) having few packs of Seroquel available, so overall, it seems that a person that has emotional or cognitive problems, should keep a stash of medication at home. Which isn't a bad idea, because I see there are shortages of some medications from time to time.

Apotek1 is a commercial chain of pharmacies, and they get their rules & regulations from the state. They are basically an extended arm of the state healthcare system, when they dole out prescription medication.

I see that Seroquel depot is available in 50mg, 150mg, 200mg, 300mg, 400mg. But not 100mg.

I find that odd, and seeing that the dosage for various psychiatric illnesses start at 150mg a day, I'm entertaining the possibility that the medication is not available as expected, and the dose of each tablet is setup, so that the healthcare system can manipulate the patient in how they take medication, and how much.

I recently changed primary care physician, because the previous one was a bit of a disaster, and I've talked to my new primary care physician about wanting to reduce the amount of Seroquel I take, due to mental side effects, as well as long-term physical side effects.

Thinking about how eager my old psychiatrist Daniel Molyneux was to get me over on anti-depressants, and he, my old primary care physician Thor Digre, and NAV - the state welfare system, was negative to me using exercise as a way to manage and stabilize mood and manage physical health, I do entertain the possibility that they have setup the medication dosage, and the distribution system, so that they can fuck with the medication.

And if they fuck with the medication in such a way, what else do they see themselves are justified in doing? What else are they fucking with?

[Permalink] [By morphex] [Health (Atom feed)] [07 Apr 16:46 Europe/Oslo]

Mail to the police: An encounter near City Syd

from: Morten W. Petersen <>
cc: Sveinung Hestad Strand <>
bcc: Jarle Petersen <>
date: Feb 16, 2019, 7:39 PM
subject: An encounter near City Syd


I'm writing this in English, as it is going on my blog. I'm too busy these days to write in Norwegian, and translate.

About 19:18 I left City Syd, and walked towards the bridge crossing the road. There I encountered two young guys maybe 16-18 years old, one with black hair down to the chin, and wearing a white sweater.

I walked straight forward, and was walking straight ahead, when the guy in the white sweater bumped into me.

It looked like those guys knew where they were going and determined, when they were coming out from around a corner. Some seconds later, I encountered a brown/black-haired girl on the bridge, she smiled at me like she was smart/flirting, and maybe talking on the telephone. She looked like she could be 16-18 years old, and had drawn the eyeliner way out on the sides. I think she had a black sweater.

This was a bit unpleasant/annoying, and as I mentioned earlier, I encountered someone else on the same spot not long ago.

Before that I was entering City Syd. and a guy was rushing to get through the door, just at the same time as me. It wasn't near closing time, and if I'd hazard a guess, that guy was a cop or some other official.



[Permalink] [By morphex] [Misc (Atom feed)] [16 Feb 19:40 Europe/Oslo]

Something is fishy in the Norwegian healthcare sector

So, I've been a bit sick lately. I think it must have been one or more consecutive viruses, and it has given me sinusitis etc.

Anyway, I try to sleep as much as possible when I'm sick, so my sleep patterns are a bit off.

Sunday morning, I noticed that the prescription labels on some Avamys (anti-nasal-congestion spray) were different. The label was different for two packages I picked up the same day.

One was ordered online, and I thought I'd pick up another when I first was at the pharmacy.

The prescription for Avamys was issued by my previous primary care physician, Thor Digre. I do not understand why a prescription label would be different, for the same medication, picked up the same day.

I also recently changed primary care physician, because my relationship with Thor Digre had deteriorated, because I've for the last 5+ years, seen my kids less than 2 hours each month on average, and a lot of this is related to me being treated in the healthcare system.

Another part of that problem with seeing my kids, is the kids mom.

But, another point is that I've discussed the possibilities of allergies with Thor Digre, and I've taken several blood tests to check for allergies, all were supposedly negative.

So why my Avamys prescription suddenly says that it is for allergies, is a mystery to me. I had not seen my new primary care physician before the 12th of January, and I do not remember talking with Thor Digre where he said that I did in fact have allergies.

[Update..] See also my Instagram post with the images:

That Instagram post didn't turn out right, here's the original video which shows 3 different Avamys packages:

[Permalink] [By morphex] [Health (Atom feed)] [21 Jan 08:15 Europe/Oslo]

Questioning mental health treatment techniques

So, I've been criticizing the system for a while, mostly because I have seen my kids less than 2 hours a month for the last 5.5 years, on average.

I was in court in 2015, and I'm very sceptical of the report the mental health professionals made. They did mention something about me being paranoid, and ironically, I slammed into the floor of a bus, 1 week before the result of that trial was beginning, me seeing the kids with supporting supervision.

I could have lost my life in that accident, and there was critique of me blogging about my life and related matters before that accident.

But a while ago, I heard a repetive voice/memory in my head, it felt like a memory, but at the same time, strangely repetetive.

And this happened a while after I've stopped going to therapy, and it was quite odd.

Do they with the aid of medications like Seroquel (Quetiapine), use hypnosis or something similar in mental health treatment, and is a person manipulated on a level it isn't possible to reflect over?

[Permalink] [By morphex] [Health (Atom feed)] [30 Dec 11:21 Europe/Oslo]

Python quick-fix of broken router

I have a router which seems to "take the day off" every once in a while, and this started after I filled up all 4 Ethernet ports.

Rebooting, the only fix I've found so far, fixes the problem, so that all 4 Ethernet ports start working again.

Rebooting the router gets boring and annoying after a while, so I decided to write a script to automatically reboot the router every hour.

That script is here:

Didn't need to write any Python 2 or 3 specific hacks to make it work on either Python 2 or 3 either.

I was reading a Python 2-3 cheat sheet here:

And after getting used to using for example print(1), I like the idea of making things simpler and more consistent, an easier to learn syntax.

An added benefit is that I, and other who use two or more keyboard layouts, don't have to remember where the backticks are located on no_nb and en_us keyboard layouts.

[Permalink] [By morphex] [Python and web (Atom feed)] [15 Dec 15:51 Europe/Oslo]

Focusing on the simple things

This morning the internet became unavailable, after also being unavailable this weekend for several days.

So I decided to take a look at my demo board which does surveillance with a webcam using the surveil app, surveil is here:

Well, one thing lead to another (...), and I locked myself out of the demo board.

Which was all-in-all a good thing, because when I decided to make things easy for myself, I instead ran the surveil app on my laptop, with the webcam attached there.

I was a bit surprised and embarrassed when the surveil script which should have given a helpful error message on the wrong command-line arguments, instead failed with a TypeError, because I had forgotten a comma.

So I fixed that, and noticed that the contents of the surveil directory (images taken with the webcam that could contain sensitive data) was included in the commit.

This was a big deal, and I included the surveil and longterm data storage directories in the .gitignore file.

Finally, I made the video capture device a configure option, as I don't use the webcam integrated in the laptop, but rather /dev/video1 - which is the device the USB Webcam gets when attached.

A commit of these changes is here:

Last week I drifted off in an interesting conversation on the Python-User list:

Which I guess shows that I could've spent the time thinking about an interesting concept on more pragmatic things, like testing the surveil script on another machine.

Finally, I'm looking for a way to do testing; and I'm wondering of a good way to test that the command-line interface functions as expected as well.

I guess that's more of a functional test, but maybe there is a package which integrates unit and functional tests / integration tests.


I found Integrate which I'll be testing. Bonus points for supporting Python 2.7, as I have for example the software powering this blog (Issue Dealer, using Zope 2 and Python 2.7.

[Permalink] [By morphex] [A surveillance app (Python tree here I come!) (Atom feed)] [07 Dec 14:52 Europe/Oslo]

An interesting lack of response from the Rana district court (Rana tingrett)

Long story short: I broke up with the woman I have two kids in 2013, and after I rejected a relationship with her in the spring/summer 2013, it got difficult to see the kids.

Court-appointed professionals (suggested by the lawyer of the kids mom?) found me to be very troubled, and the kids mom to "great". I was troubled, but I don't believe the kids mom to be "great". Putting your own needs in front of the kids needs is not great. Not letting me have information about the kids from school, healthcare etc. is not great. The latter borders on negligence in my opinion.

So, I was not satisfied with what the court appointed professionals (suggested by the kids mom) found in 2015, and recently I got a pretty solid proof that these mental health professionals were wrong. For 5 years, the kids mom has claimed that we had an agreement on expenses for seeing the kids, while not having an agreement on how often I should see the kids, or rather, how often they should get to see me.

As I state in this blog post:

It is illogical and unreasonable. So, on the 7th of November, I mailed these court-appointed professionals about this, and they pretty much will not respond to my request about the kids mom showing enough personality traits / behaviour to classify as a psychopath.

So on the 8th of November, I contacted Rana district court (Rana tingrett) about this. I did not see a reply.

Then I contacted them again on the 13th of November, no reply.

And I contacted them again today, and have as of yet, not seen a reply.

So it has taken over 4 weeks to give a response, and I have not seen any kind of response such as "we got your email, we're looking over things".

The PDF of this email thread is here:

[Permalink] [By morphex] [Family (Atom feed)] [05 Dec 23:03 Europe/Oslo]

Open letter to Tiller DPS (psychiatric hospital)

So, I was in treatment for a number of years, for psychosis, mostly at Tiller DPS. I've also been to court to get to see my kids in that period, and I guess my biggest problem today, is that I've accrued quite a bit of court-related expenses, and I've also seen my two sons less than two hours a month, for the last five years.

So I wrote a, now open, letter, to Tiller DPS, asking some questions.

To: Tiller DPS
Cc: My lawyer, County governor's office, St Olav Hospital
Bcc: Police, Dad


I stopped by yesterday, and picked up some journals, my treatment journal, and a list of who has accessed it.

I have some questions related to this. I see that a meeting was held on the 3rd of May 2010 about enrolling me for treatment, while the access log of my journal, starts on the 15th of June 2010.

Why does the access log to my journal, start well after the enrollment meeting?

It looks like Gunnar Gotaas was the therapist in the period before the court case in 2015, while Morten Mitsem was the therapist right before the court case. It also looks like there's a gap in the access log from April 2015 to September 2015, where nobody has accessed the journal, and presumably I've not been in treatment. The court case took place in June 2015.

Who is it that evaluates the security under the law for someone who takes medicine that affects how the brain works? The mental health experts [appointed to evaluate the parties in the court case] should have a competence and do an assessment, but they don't see what happens before either party goes to the court [to get a case tried].

These court experts evaluated me in relation to the court case in 2015; was there any contact between Tiller DPS and IKFT by Sylva Krogh in relation to the court case, and if so, where is the log of this?

Before I became psychotic in 2009, I was by my primary case physician in Oslo, the Legegruppen Manglerud doctor's office, where an EKG was taken, and where I got a prescription of Zoloft (Sertraline).

I'm thinking Zoloft is something I had a negative reaction to, and that may have caused that I became psychotic with hallucinations. How is information like this relayed to Tiller DPS? It must be relevant.

I want to know about all the info that has gone into, and out of, Tiller DPS, regarding me.

Furthermore, I'm wondering if there are other logs and documentation that documents the treatment choices made for me. Has there for example been used techniques such as hypnosis, has anxiety been manipulated so that it feels more intense and real, and hard to get rid of, how does medication affect such manipulation, etc.


Morten W. Petersen

[Permalink] [By morphex] [Health (Atom feed)] [20 Nov 08:19 Europe/Oslo]

Dealing with a kids mom that doesn't honor obligations

So, it's been well over 5 years since I rejected the kids mom, rejected her as in rejecting a relationship, or just sexual relations.

Since that time, I've seen the kids less than 2 hours each month on average, and I don't have contact with the school, healthcare system etc. - so I don't know what they do, day to day.

The kids mom has all the way, claimed that we had an agreement on how to deal with the expenses for seeing the kids, but that we did not have an agreement on how often I should see the kids.

I think it is obviously unreasonable and illogical to claim that we had an agreement on expenses, and not on frequency. Yesterday, after over 5 years of trying to get the kids mom to share expenses for me seeing the kids, according to the law, she rejected a payment request on a money transfer app.

I've used the same money transfer app, to send her installments on interest of the court expenses she had in 2015, after I lost the case, but gained court-appointed supervision to see the kids.

I lost the case in 2015, because Sylva Krogh and her colleagues in IKFT, Institutt for klinisk forebyggende tiltak (Institute for clinically preventive measures), said that the kids mom was "great".

In court, this "motherly greatness" was never questioned, and the Sylva Krogh and her colleagues said the kids mom had no psychopathic traits.

I'm not a psychologist, but to sum up; my understanding around expenses seeing kids, is that those expenses should be divided among the parents, according to their income. It is written in the law. Some rough calculations, tells me that the kids mom since 2015, has avoided paying me over 20.000 kroner, NOK, about 2/3 of the expenses I've had seeing the kids. That is over 10% of what I earn per year now, before taxes.

When I look at for example this page:

It says:

[...] Current Diagnostic criteria for 301.7 Antisocial Personality Disorder (4th ed., text revision).

A. There is a pervasive pattern of disregard for and violation of the rights of others occurring since age 15 years, as indicated by three (or more) of the following:

    (1) failure to conform to social norms with respect to lawful behaviors as indicated by repeatedly performing acts that are grounds for arrest
    (2) deceitfulness, as indicated by repeated lying, use of aliases, or conning others for personal profit or pleasure
    (3) impulsivity or failure to plan ahead
    (4) irritability and aggressiveness, as indicated by repeated physical fights or assaults
    (5) reckless disregard for safety of self or others
    (6) consistent irresponsibility, as indicated by repeated failure to sustain consistent work behavior or honor financial obligations
    (7) lack of remorse, as indicated by being indifferent to or rationalizing having hurt, mistreated, or stolen from another. 

And I would say that the kids mom ticks off 2, 6 and 7.

From what I understand, the kids mom and her family were not "well off" when she was young, so she knows about not having a lot of money.

Today, I think she has a fortune of millions of kroner, I think she might be close to, or past the euro/dollar millionaire mark as well.

So she has no financial reason I can see, to not pay me, and she also displays little empathy for my financial situation, when she also *profits* on interest from court costs in 2015.

Looking at this whole situation, with the court, the child protection services, the police, these so-called mental health experts, I am shocked that this can happen, and that it goes on for 5+ years.

Finally here's a link to the email I sent to these mental health experts yesterday, translation to come:

[Permalink] [By morphex] [Health (Atom feed)] [08 Nov 10:31 Europe/Oslo]

Taking a look at my Python surveil(lance) app

So, I created this surveillance app in Python, to surveil ( the room where I spend most of my time, just to make sure that nobody else visits it, without my approval.

Before I wrote this app, I saw there were different applications out there, that could do some sort of surveillance, but I guess I recognized early on that I could easily mail images to myself, and that this was a good approach as it kind of disconnects the surveil app from outside dependencies, at least it doesn't have to have an internet connection up absolutely all the time, to function.

Another feature of mailing myself images compiled into videos, is that as soon as it comes into (in my case) GMail's system, there is a record of the video, and it is because of that, difficult to manipulate data, when a mail has been delivered.

Python was the language of choice, because I wanted to make things easy for myself, and Python is the language I've worked with the most, and it is easy to read and write things in Python.

Before this, I had dabbled a bit with ffmpeg, playing around with videos, adding effects to them and so on.

I'd say fortunately I dabbled with ffmpeg, because it is quite a powerful video processing package. The command line is not intuitive and user friendly, but once the command line is right, ffmpeg seems to be pretty stable.

I read about Python and the GIL (Global Interpreter Lock) today, and I remember this from years back. I guess over 90% of the programming work I've done to date, is in Python and Zope 2. Zope 2 had a way around the GIL and exploiting all CPU cores, and that was running a main database server, and then having several database clients/applications on each of their on process, which effectively went around the GIL, as each application was one process to the operating system. This worked well as the system was built for few writes to the database and many reads.

So, fortunately I dabbled with ffmpeg before this project, because I soon realized that threading could be a bit of a headache, so I opted for running ffmpeg as a subprocess of the surveil app, and using shell scripting and files to pass messages; so when ffmpeg is done processing a set of images into a video, it creates a file, and a thread with a loop in the surveil app monitors for these files, then mails the video and deletes the files related to that video afterwards.

Python is simple and intuitive, and that's the main reason I think, that it became my programming language of choice. It was easy to get started, interesting to explore Python via the interpreter, and there was an advanced web system which used Python as the main programming language.

Years back, I was pretty much obsessed with cross-platform portability, but with this surveil app, I'm creating a temporary (RAM-based) file system which is Linux-specific, and I'd be happy if it runs on *nix/POSIX systems. It's all in keeping things simple.

So I guess the point of this post was to underline that, yes, Python has a GIL, but in most instances it is a non-issue, and if there are CPU-intensive things, these can be forked out to a command-line tool, or you could even have an extension in C which does the heavy lifting. If I hadn't learnt ffmpeg, I could easily have spent a lot more time writing this app.

Another point that is worth mentioning, is the file for this project, is easy to read, and goes with the Python style of simplicity, and goes one step beyond being a config file, it also has some (easy to understand) logic.

This project is a mix of different systems; Python to glue it all together, *nix file systems and scripting in a middle layer, and the ffmpeg application for the heavy-duty work. As far as I can tell, this is all good and stable, although the surveil app reboots about every 24 hours, so it is hard to know how well it runs with a 100% uptime.

[Permalink] [By morphex] [A surveillance app (Python tree here I come!) (Atom feed)] [23 Oct 15:26 Europe/Oslo]

Adding (mandatory) SMTP authentication to my surveil app

So, I was thinking a bit lately, about adding a small feature to my surveillance app, so that it would send a mail whenever it was started.

Went about to add that this evening, when I discovered that there were large gaps in time between mailed videos in my Surveillance folder/label.

After some searching and debugging, I found that the SMTP server (GMail's in this case), was rejecting emails from my IP. I guess that's just an automated response, when over time, I sent emails to myself,, from myself and at some point that gets flagged as spam, because I wasn't logged in before sending emails.

Anyway, I guess it was naive to try to run something without logging into an SMTP with spam being what it is, so I added (mandatory) support for logging into the outgoing SMTP server today.

In addition to this, I guess it is nice to have the ability to reboot the host regularly, as a host system might for some reason become bogged down. So I added a config option to specify the amount of time between each reboot, in

I think the config file is quite neat, because Python is neat; one can add config options, and even some logic to deal with config options in one file, and it seems natural.

At the end of the config file as it was on that commit, there is a statement that adds 5-60 minutes of delay to the reboot interval specified above - so that it is a bit harder to predict when a surveillance camera is rebooted.

[Permalink] [By morphex] [A surveillance app (Python tree here I come!) (Atom feed)] [15 Oct 00:57 Europe/Oslo]

An encounter with NAV, Euroskolen, Sonans, Anne C Stavelie, Anne-Grete Dahlberg and Guri Ulfsnes

So, a couple of years ago (2014-15 I think), I attended a thing I wasn't motivated for, setup by the Norwegian welfare system hub, NAV.

They were then called Euroskolen, and looks like they are now Sonans.

In their report, which surfaced now that NAV has been been very eager to get me going, when I wanted peace and quiet because of going to court regarding the kids, they wrote that I was "usually late", which I find not to be recognizable as a characteristic for me.

So I asked them to retract that statement/report, which they refuse to do.

I understand it that they don't keep records of attendance, when people meet up etc. If I remember correctly, the kids mom which I've been in conflict with for a number of years, has a dad who is a member of Odd Fellow, and Odd Fellow owned the property (big sign on the wall) where Euroskolen operated. I thought that was a weird coincidence then, but there you go..

It should not be that hard to retract a report or a statement, if you can't document it.

[Permalink] [By morphex] [Work (Atom feed)] [01 Oct 12:25 Europe/Oslo]

Changes to my Python surveillance (webcam, web camera) app

So, I created a surveillance app a week ago, because I felt it would be comforting to be able to see if somebody had been into my room.

Since then, I had to make the mailer code, the codes that mails a compiled video to the given email address, a bit more robust:

As I one day discovered that the last mail sent to me with a video, was sent at 03:34, and looking at the log for surveil, I could see that DNS had stopped working.

Today I added another mailer feature, which is simply moving the mailer code into its own function, and then running that code as a loop forever, in a separate thread:

Other notable changes are a separate configuration file, as well as parsing the output from fswebcam when a picture is taken, and if an error is detected, re-get the image:

Finally, I added a script that can be started from Cron, so that the surveil app starts running as soon as the laptop/desktop/demoboard - whatever, boots up.

I added the script, because it's easy to forget to include the PATH etc. - which leads to confusion, irritation and so on, when automating things.

Of all the things I did summarized here, I think the mailer hack is the best; I simply moved some code around and fired up another thread, so that images are taken and videos created and mailed, without delays which could create gaps in time where the room was not surveilled.

[Permalink] [By morphex] [A surveillance app (Python tree here I come!) (Atom feed)] [24 Sep 15:01 Europe/Oslo]

An open letter to Tiller DPS (Tiller psychiatric)

Subject: An open letter to Tiller DPS (Tiller psychiatric)
To: Tiller DPS
Cc: County Governor's office, Various
Bcc: Various


I'm wondering if you can say something about how memories can be manipulated.

Reading a bit of psychology these days, where they among other things, talk about the importance of first and last impressions.

In my own experience, I can remember something that I then and there thought was OK, in a much more negative way, much later in time.

Daniel Molyneux (last psychiatrist) wanted me to start taking anti-depressants and come in on appointments, but since I over a long time [before that] took up problems with the kids mom, and you didn't do anything, I gather that you have seen this family conflict [and me not seeing the kids, or the kids not seeing me] as an opportunity to treat me, and maybe even you had something to do with certain things happening.

So maybe instead of talking with me in [therapy sessions], you could help me sort out today's situation, to get a clear view of who did [and is responsible for] what.


Morten W. Petersen

[Permalink] [By morphex] [Health (Atom feed)] [24 Sep 09:32 Europe/Oslo]