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

I am

An OGG/Vorbis player, implemented in Javascript.

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

Morphex's Blogodex

Me on Instagram

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

An eventful coding week for Simple TCP proxy

I've been mailing a bit on the python-users mailing list about STP this week, and there were some discussions there that were unfruitful - but I got some useful tips in the process:

This TCP proxy needs to scale and perform reasonably well, so the last thing I worked on was making sure that downloading large files via the proxy works reasonably well, in these commits:

In was interesting, and relieving to see that I could speed up the download process 3-4x by multiplying the "transfer buffer" by 8. A local download of the test.tar file was around 1.3 GB/s via lighttpd, and 122 MB/s via STP. After the buffer change, the speed increased to 449 MB/s. Which is more than what a gigabit connection to the internet can handle.

So, so far so good, and good enough.

The previous commit:

I got a tip for, and reduced the thread stack size to the minimum, which is from what I gather, necessary to ensure that it will run reliably on different platforms - as Linux has a rather big thread size and that could break on others if you're reliant on it.

I also implemented a "fall through", so that the thread sending data back and forth doesn't stop and wait for .N number of seconds, if data has just been sent back and forth.

And in the commit before that, I adjusted the sleep time for threads "polling" on whether or not they have become active:

which also increased the speed at which STP could deal with the connection queue.

There has been some questions on the Python list as to exactly what I'm building and why, but I think a fair description would be that it is a simple to understand, and run, TCP proxy which does some useful things out of the box.

Coming from the web development and hosting world, I'm tempted to add some HTTP protocol features as well, but that's something that belongs in another project, maybe using STP as the frame which it plugs into.

[Permalink] [By morphex] [A simple TCP Proxy (Atom feed)] [31 Jul 20:08 Europe/Oslo]

A simple TCP Proxy

So as I was working on the SMPS, simple message passing system, I looked at ways of protecting it on the public net.

Port knocking was one thing I looked at, and although it looked fine, I thought this was an opportunity to hone my Python/programming skills, and freshen up a bit on programming.

So I ended up writing a simple TCP proxy, and a working copy is here:

The script will setup a proxy in front of a local webserver.

The STP seems a bit sluggish when a lot of connections are made, but I'll have a look at how to optimize that performance.

[Permalink] [By morphex] [An SSL TCP client/server implementation in Python (Atom feed)] [26 Jul 23:52 Europe/Oslo]

Encountering Python crash on numerous client connects to socketserver

On the SMPS package, I've refactored a bit since the last blog post, and I also encountered what looks like a bug in Python.

Python can randomly crash if too many client connections are made to the socketserver, and it crashes in such a way that it is difficult for me as a regular Python programmer to understand what the problem could be.

So although I was tempted to do a bit of C debugging and poke around, I do have limited time and energy, so I did the smart thing and patched it up so that it is easy to reproduce the problem:

and then I created an issue in the Python bug tracker:

[Added later:] Aha. So it turns out I was quitting threads, and this gave an unclear error message. Thanks to Jeff Epler for pointing that out.

That got worked on in this commit:

and the parent commit. Now with > 400 test connections I get an SSL handshake timeout, but, that's in ssl.c and probably due to some configuration setting somewhere.

[Permalink] [By morphex] [An SSL TCP client/server implementation in Python (Atom feed)] [24 Jul 18:13 Europe/Oslo]

Thread-safe message database for SMPS

I hacked a little more on the SMPS project today, which resulted in the following commit:

A pretty straight-forward message passing queue, that expires messages after n number of seconds. I guess the only thing left now before it can be put into practical use, is adding some sort of handshake with a secret, so that it is possible to protect the message queue from unauthorized access.

[Permalink] [By morphex] [An SSL TCP client/server implementation in Python (Atom feed)] [18 Jul 17:37 Europe/Oslo]

An SSL TCP client/server implementation in Python

Related to work I found myself needing a solution to pass messages, so I started working on something simple, just to get the basics down.

I started out with the idea of doing it over HTTPS, but after a bit, I decided to go for a more minimalistic solution, using just TCP over SSL.

I've implemented a simple example of how to implement an SSL protected client/server message passing solution in Python 3.9. I googled a bit, and couldn't find a good, solid, simple example, so I figured the first iteration of the Simple Message Passing System could serve as an example, for others as well.

The committed state of the files [edit: for that first iteration are] here:

[Permalink] [By morphex] [Python and web (Atom feed)] [17 Jul 20:33 Europe/Oslo]

Some more easy sunday accounting hacks

I added some code to the ravencoin-taxman tool today:

which enables the calculation of earnings in a local currency. So if you're mining for example, it is possible to get the entire earnings in a year, into the local currency, which should be sufficient for accounting and tax purposes for that year.

The commit also included a bit of refactoring, of I guess you can call it standard debug stuff, to lessen the amount of code necessary to write later. Support for CSV files using ; as a separator was also added, the Norwegian bank uses that as a separator in its datafiles, as , is the decimal separator in the Norwegian locale.

I also added a test, to illustrate the command line and how to operate it:

[Permalink] [By morphex] [Ravencoin and ethereum (classic) accounting tools (Atom feed)] [19 Jun 20:46 Europe/Oslo]

Comparing apples and oranges

So finally for this sunday hacking, I added some tests for the ravencoin-taxman project, and before that, I added RVN-USD calculation for transactions; giving (an acceptable) USD valuation of any given transaction:

The code of this project looks cleaner than then one for the ethereum-classic-taxman project; probably because I'm getting back into the groove of programming, but also because they are fairly similar, and this could be called a re-write of sorts.

Refactoring seems to be a key part of productive programming, and necessary to manage any software project with more than a few pages of code. I see now that there will be at least a 3rd project between ethereum-classic-taxman and ravencoin-taxman, with code utilized by both.

[Permalink] [By morphex] [Ravencoin and ethereum (classic) accounting tools (Atom feed)] [05 Jun 19:46 Europe/Oslo]

A little sunday refactoring

Making a little progress in the ravencoin-taxman accounting script today, refactored date parsing into its own function in this commit:

There are some that might argue that a function (in any programming language) shouldn't take up more than one console window - if it's bigger than that it should be broken up.

I kind of agree, it's a good guiding principle. In this case, the function was reduced to less than half the size, and in the process, I guess you can say it become better documented as well, because the old function is easier to read and the new parse_date function also has a docstring with a little information.

[Permalink] [By morphex] [Ravencoin and ethereum (classic) accounting tools (Atom feed)] [05 Jun 11:00 Europe/Oslo]

Exchange rate file parsing for ravencoin taxman

I hacked a little more on the

Ravencoin accounting tool today, it takes a lighter approach than ethereum-classic-taxman, downloading a CSV file of transactions instead of running through all the blocks in a blockchain node to find relevant transactions.

Since it does that, it makes things a bit less mentally demanding to work with, and I need to get FIFO sorted out for accounting purposes, so that it is possible to calculate loss and gains for capital tax.

Ravencoin-taxman works with data from different sources, one part is the Ravencoin transactions, another is the rate in USD for RVN at any given time (day) and finally a local currency is often necessary, in my case NOK, Norwegian kroner, to calculate things correctly for accounting and tax purposes.

Working a bit with CSV files, it is easy to appreciate their simplicity, on the other hand, they're not what you can call "well-defined" formats, for example the date fields in them can have different meanings based on where the CSV file is generated. YY/MM/DD or YY/DD/MM or even DD/MM/YY.

So I worked on that today. I think there is a little CSV tool that can be refactored into a separate Python package for working with CSV files, or data that isn't strictly declared or formatted.

CSV files are great in their simplicity and utility, but as this code shows:

It takes quite a bit of work to make sure that data from CSV files is interpreted correctly, and if you're working with a limited amount of data, it is possible for that code to interpret a date wrong, switching the month and day fields the wrong way around.

[Permalink] [By morphex] [Ravencoin and ethereum (classic) accounting tools (Atom feed)] [29 May 14:40 Europe/Oslo]

JSON viewer for JSON database

I was looking to get a little done on the ethereum-classic-taxman accounting tool today, and thought a bit outside-the-box, what could I need in there that isn't a direct priority.

The tool uses JSON databases, I switched a little while back because there could be security issues related to using a Python pickle database as the database backend.

An added benefit of using JSON is that its content is easy to view, and for example for debugging purposes, I thought it could be a good thing to have a tool that creates a view of the data that is easy to navigate and view. For example for debug purposes.

So I created this little script:

There are graphical JSON viewers on Ubuntu for example, but this little script can also have its output piped into a file, so that a database can be edited by hand in an editor. Or it could be piped to less on Linux/UNIX for viewing and searching.

On a related note, I saw some people lost their savings on the recent Luna/Terra crash. On the upside, I guess now is a chance to make a bet that the new variant with a massively higher amount of coins minted will succeed.

[Permalink] [By morphex] [Python and web (Atom feed)] [15 May 21:33 Europe/Oslo]

Ravencoin and ethereum (classic) accounting tools

So I've been hacking away at the accounting tool for ethereum (classic) today, adding support for converting the USD rate for ETH/ETC to another currency, based on data provided in the CSV format.

It's mostly here:

I had to code my way around one thing in that respect, and that's because the USD-NOK rate for example is provided by the central bank, and they don't provide rates for Saturday, Sunday etc. So when transactions are made on days like that, the nearest, previous USD-NOK rate is used.

It seems reasonable to solve it that way, because something tangible (known) is better and more logical that whatever rate might come the day or even days after the transaction.

I also started work on another crypto currency accounting tool today

Ravencoin Taxman. This takes a different approach from ethereum-classic-taxman, as it works with CSV data retrieved from a block explorer service. It doesn't download transactions and blocks from a node.

It takes much less (programming) time and (computer) resources to do it that way, but I also noticed that it was difficult to get CSV exports of ETC transactions on major / well known ETC block explorers today. This shows that it is useful to have a tool that is independent of for example block explorers, something that will work with just a node available.

The ravencoin-taxman code will need to have some crypto (RVN-USD) rate and fiat rates databases as well, I think I might just copy over most of the code for that from the ethereum-classic-taxman project. It doesn't seem like there will be much if any changes to those code bits in the future, and I don't see any obvious way now of making a package that will fit for both projects.

So I guess the only major bit left for both projects is getting the valuation (crypto currency * crypto currency rate in USD) combined with FIFO correct. That would pave the way later for example for tax reduction later, choosing the crypto-currency with the highest value when received for outgoing transactions. Which leads to less taxes due.

[Permalink] [By morphex] [Python and web (Atom feed)] [07 May 23:56 Europe/Oslo]

Some more work on an Ethereum (classic) accounting tool

So, I've hacked some more on the tool I'm building for accounting purposes.

I guess since the last time I've posted on it, there are mainly two things I've been working on, one is valuation of crypto currency, the other is correctness of generated CSVs.

I've followed a simple principle when it comes to valuation of the crypto currency; and that is, first in, first out. Other options could be first in, highest value out, or first in, lowest value out.

It looks like in Norway, there is also the option of first in, whichever you want out; meaning you can receive crypto, and for tax purposes, choose which crypto currency you sell first. Which could be useful for tax purposes, to increase or decrease the tax owed due to dealings with crypto currency.

But it's a bit to keep track of, and I think I've gotten most of it done.

Another part however, is making sure the values in the CSV / Spreadsheet are correct, and I noticed that somewhere along the line of transactions, the account balance was off, compared to the state in for example. So I started looking, and figured out that it was due to a transaction that was registered, but didn't complete, because it ran out of gas. The max fee to complete the transaction was too low.

But as the transaction is still registered, you still have to pay the gas fee, so for that transaction, the value of the crypto transferred to another account is zero, and the gas fee still needs to be deducted.

You can see more about this on the go-ethereum issue tracker

there is also information in the commit:

I think this shows, really well, how good Python integrates with the command line, and how easy it is to get something done in Python. A handful of changed lines, and it is possible to manually exclude a set of comma-separated transactions.

Of course this is also due to knowledge of how Python works, but yes, a great scripting and prototyping language Python is.

[Permalink] [By morphex] [Ethereum (classic) accounting data generator for Python (Atom feed)] [27 Apr 15:57 Europe/Oslo]

Ethereum (classic) accounting data generator for Python

Here's a python tool to generate CSV files suitable for accounting purposes, for incoming and outgoing Ethereum (classic) transactions:

It will start with one main address, and then generate a CSV with transactions for that address, and one CSV for each address that receives ETH/ETC from that main address.

Crypto currencies were hyped up for a while, but given how much time has gone by, it looks like they are here to stay. I got some .com vibes from this crypto hype, but given that crypto currencies and related technologies will make finance-related activities such as loans cheaper and more accessible for the lender, and transactions in general cheaper and more flexible, there is little doubt left in my mind that it will work.

Betting on the right horse(s) is another matter however.

Regardless, taxes have to be paid, so I created this script that will connect to a geth/core-geth node and download all transactions related to a given address. I saw there were different services that offered x amounts of queries for y amount of money, and that's nice, but as a brogrammer and a small business owner I liked the idea of being able to be completely independent of such services.

The script comes with a test and test address 0x222f266B603e4fa6D5605b5ec1F1C86E35C19F7D (not owned by anyone I know), and running it generates the following CSV:

From,To,Hash,Value,Value USD,GAS Price ETH,Gas price USD,GAS Price Gwei,Block,Timestamp,Timestamp date,Timestamp time,Exchange rate

Which looks right to me. I've also tested it against other ETH addresses and the calculations look correct. The precision of the last column rate was too high and it created a number which wasn't real, so just now I added a 6-point precision to floats generated in the CSV. This is also just enough to capture the standard low fee for ETC transactions.

[Permalink] [By morphex] [Python and web (Atom feed)] [03 Apr 10:21 Europe/Oslo]

A python script to calculate placement of poles for a roof

I've been working on the cabin, lately clearing out a tree behind the cabin that was a threat to the roof.

Some blog posts about some of the work on the cabin here:

Anyway, I need to setup some new poles for the porch / balcony, as there is a lot of rot in the parts below the roof, and those parts support the roof. So I can't just rip it out.

I wrote a script some time ago, and was going to use that today as I took finer measurements of the new beam that will carry the roof and how long an extended beam will have to be. As I was reading the script I couldn't make sense of it, so I re-wrote it, and posted a new one today:

The old one is also in the same repository as, but you'll have to dig through the version history for that one.

I think it shows that in construction work, you have to cut once, measure twice, calculate thrice and maybe re-write the code quadrice. I wrote a program today as well, but that was also discarded, more as a tool in the thinking process I guess.

[Permalink] [By morphex] [Python and web (Atom feed)] [13 Jun 17:14 Europe/Oslo]

An Open Source license for scripts, small code bits and programs

I have some miscellaneous code here:

Which hasn't been given a license yet, and I was wondering what license to give it. Just to make things clear, and make it easier to make use of the software. Using imapsync I was reminded of this.

It's been put up there for sharing and re-use obviously, so what are the best suggestions for a license? I was thinking BSD, GPL or LGPL.

Not sure whether to use GPL 2 or 3 though.

My email is

[Update on the 22nd of May]

So I landed on the GPL, version 3. I think it's a good choice for me, as it is more explicit on what it grants and easier to use for others, and also makes it difficult for someone to make something closed-source and make money off it, without paying me.

I read a bit on about the GPL version 3 and I liked what I read, one thing we don't need is more lawyers to get something useful done, or make it harder for small enterprises to innovate, or favor large companies or duopolies/monopolies.

[Permalink] [By morphex] [Python and web (Atom feed)] [16 May 20:17 Europe/Oslo]

An IMAP migration script

So, last December I got an email from the email hosting provider for Nidelven IT that the email server would be taken down in 6 months time.

I didn't like the timing, as I was in court process, the third one in 7 years about my kids, but understand that things are expensive to maintain, a potential security hole etc. when they age.

So I wrote a little script that pretty much would do what was necessary.

Then after some thinking, it struck me that this is something others would need to do, and it wasn't completely straightforward. So I decided I could model a script based on the process I was using.

Here's the script:

I found the imapsync script:

Which can be used to do the heavy lifting. I read the license file for that project, and although I'm not a lawyer, it seems straightforward enough that I can use it for my needs. It might've been a better choice to use a known license, but whatever, it is very minimalist and straightforward in its wording.

The script just lists folders for now, then I guess it could build a shell script file which calls imapsync, and that can be inspected and executed.

I was scratching my head a bit as I was writing the script, as the print() statement printed parentheses, then I saw I was running it with python 2 and not 3.

Other than that, I wasn't able to figure out a way to parse command line options for the script using just getopt, am I missing something or is there another module?

[Update on the 13th of May]

The script is now more or less complete. Gilles also responded to an email, saying imapsync imapsync also has --justfolderlists.

I couldn't quite understand the getopt module, haven't used it much before.

[Update on the 15th of May]

I'm now using this script to run imapsync, and imapsync is chugging away, at around 5-6 messages per second.

After posting the previous update I looked over the script a few times, and spotted a print() statement too much, in the generation of the shell script. That goes to show that just looking over code is useful.

Latest commit here:

I also made SSL mandatory, it's the kind of mistake someone could make, not using SSL, and it's easy to edit the script file afterwards to remove it, if you know what you're doing.

[Update on the 16th of May]

So the build migration script script is working, and imapsync looks like a sturdy piece of software, it ran through hundreds of thousands of messages in one run. Had to add a command line flag to copy header-less messages, imapsync suggested it might be Draft messages etc. and was on about a Message-ID. A second pass copying over remaining messages was uneventful.

[Permalink] [By morphex] [Python and web (Atom feed)] [09 May 19:53 Europe/Oslo]

A small script to find suitable, recurring dates

So, I recently was in a long process, to find an arrangement between me and the kids mom regarding the kids.

We made a court settlement, and the setup is that I see them every 8th week. Through my volunteer work, I have commitments during Christmas and Easter, and I also plan to partake in a mini triathlon in the middle of July each year. A useful goal, to keep me motivated for exercise. I also meet family around this triathlon, and it's good to keep connected, and get connected.

I've come quite a long way physically, I feel much lighter and nimbler today than I did a year ago, five years ago.

So, I created this small script:

Using the Python 3 datetime module. I haven't used the formatting before, so I'm not sure if I did it right, but it looks right on the console anyway.

I thought about adding checks for whether dates were around Christmas or Easter, but it didn't look like the datetime module could automatically figure out what period Easter falls on each year.

And having run the script, I found a usable start date just checking Easter dates manually.

[Updated 03/02/2021 10:30] Mark Lawrence chimes in on email, mentioning the dateutil module:

When I think about it, the Python library documentation could do with a section at the end of each module, which briefly summarizes known, trusted modules and packages and their contents.

It's not directly under PSF control, but it would be useful to have nonetheless.

[Permalink] [By morphex] [Python and web (Atom feed)] [01 Feb 19:36 Europe/Oslo]

Adding some reporting functionality

I just added some code to the surveil app, the beginnings of what will be a reporting feature.


I found that the surveil app uses quite a bit of bandwidth when sending video, on the mobile network anyway, so I added an option to just store the videos locally a while ago.

That works, but then the surveillance app can stop making videos for whatever reason and nobody's the wiser.

So I figured it would be nice with a daily report of the videos created, so that it is possible to keep an eye on things, even if videos aren't mailed.

Another thing I'd like to add to the report is the file size and checksum of the video, so that it is possible to see if someone has tampered with the video.

But almost as soon as I got started I got tired, so I'll finish it off later.

Oh and I moved the find command out to a separate file; subprocess.Popen and shell command line arguments turned out to be a bit too complicated.

[Permalink] [By morphex] [A surveillance app (Python tree here I come!) (Atom feed)] [03 Oct 21:30 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]

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]

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]

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]

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]

A surveillance app (Python tree here I come!)

So, lately I've been taking it very easy on the activities front, since I've had a court-related matter to get to see the kids.

So I've had some ideas, urges etc. to do technical stuff, artsy stuff etc. - and today I wrote myself a script that will run on a PC, or a demo board like Raspberry Pi, Orange Pi etc. - and take pictures on a webcam, and merge these pictures taken over time into a video, and mail them.

I started with Python (2), but figured that now is the time to take the plunge to Python 3 and don't look back.

I have to say, Python 3 isn't difficult, there are some changes in conventions etc. but nothing big.

So I was able to be productive in Python 3 straight away, and wrote this script:

Which will do what I mentioned above. And here's the source code tree as it was when I wrote this post:

This video was generated from this script:

And impressively enough, each image the video was generated from, was 55-78 KB, while the entire video with 18 images was ~120 KB. I guess VP9 is effective at compressing, at the same time, a lot of the objects in the video are static.

[Permalink] [By morphex] [Python and web (Atom feed)] [17 Sep 00:08 Europe/Oslo]

A bit of video fun, ffmpeg fractional timestamp and slow-down

So, I've been recording some workouts, and posting them on Instagram; lately I've also experimented with video-altering apps on Android.

But, Linux has its own Swiss-army knife for altering videos, called ffmpeg.

I've also been recording myself massaging a punching bag, and was pleased when I saw myself tapping and then stomping the bag, in rapid succession, with great power.

So, I thought I'd see how fast I was actually going, and after some digging around, I found that I could add a fractional timestamp to a video, and slow it down, using these commands:

ffmpeg -i VID_20180803_153745~2.mp4 -vf "drawtext=text='Time\ \ \ \ \ \ ':x=120:y=h-lh-30:fontsize=20:fontcolor=white:shadowcolor=black:shadowx=1:shadowy=1:timecode='00\:00\:00\:00':timecode_rate=25/2" out.mp4

which adds the timestamp, and

ffmpeg -i out.mp4 -filter:v "setpts=8.0*PTS" out2.mp4

which slows down the video 8-fold. Here's the video:

And here's another, edited using an Android app, to go forwards and backwards, creating something that can be watched over and over again, smoothly:

[Added a day later:] I guess I should mention that the commando used to find the timecode_rate was:

ffprobe -v 0 -of csv=p=0 -select_streams 0 -show_entries stream=r_frame_rate VID_20180803_153745~2.mp4

and the output was: 25/2

[Permalink] [By morphex] [ffmpeg (Atom feed)] [04 Aug 20:19 Europe/Oslo]

Graceful degredation of redirect using meta http-equiv and Javascript in XHTML, for caching

So, I saw that SSL was becoming more or less mandatory these days, so I got SSL setup for the domain

However, since I also wanted to keep serving the site over HTTP as well as HTTPS (for graceful degradation and a fallback), and I have a cache sitting between the SSL-server and the weblog system, which pretty much caches everything, all the time, for a long time, I had to do a bit of extra work.

The cache in this setup isn't able to tell the difference between requests coming via HTTP or HTTPS, so an extra '&protocol=http[s]' is added at the end of URLs.

So with this code

  <meta http-equiv="refresh" id="meta_refresh" content="1;" />
  <script type="text/javascript">
    refresh = document.getElementById('meta_refresh');

it is possible to have the page redirect with the protocol key without Javascript, while this piece of Javascript

    <script type="text/javascript">
    // <![CDATA[
    function myOnLoad() {
      if (window.parent.document.location.toString().indexOf('') != 0) {
        if (window.parent.document.location.toString().indexOf('https:') != 0) {
      if (window.parent.document.location.toString().indexOf('') != 0) {
        if (window.parent.document.location.toString().indexOf('http:') != 0) {
    document.getElementById('iFrameLoadTest').myOnLoad = myOnLoad;
    // ]]>

does redirect to setup frames *and* add the protocol key. I setup this site so that it would be possible to access the site without a browser that supports [i]frames, and I guess it is reasonable to expect that a browser that doesn't support Javascript, also doesn't support frames.

Although for example the NoScript extension for Firefox does enable blocking Javascript per-site etc. for security.

So the cache is able to cache http and https pages differently, which again is tidy and neat, as URLs generated on the blog are often absolute starting with http: or https: - and not relative, for example /morphex.

If you're wondering how the meta tag is generated, that's by a script on the server side, which decides to redirect with an &protocol= suffix on URLs, based on an environment variable HTTP_X_FORWARDED_PROTO, which the cache sitting in the middle, is unable to take into account.

It did add "Vary: HTTP_X_FORWARDED_PROTO" to the pages generated in the weblog, but that did not affect the cache.

Now, I was wondering how long a timeout the http-equiv refresh should have, and found 0 was too short, and 2 was too long. If the timeout is 0, it is reasonable to expect that the browser will execute the refresh immediately. It is also reasonable to expect that within 1 second, the following <script> tag is read and executed, and when that Javascript is run, it deletes the meta tag, and from what I can tell, deleting the meta tag, also stops any actions contained within that tag.

You might think that adding <meta> tag within a <noscript> tag in the header would be much easier, and it would be, however, that is not valid XHTML according to the W3C validator, so this "hack" is what will work and be accepted as valid XHTML.

[Permalink] [By morphex] [Web (Atom feed)] [23 Jun 15:18 Europe/Oslo]

Now making (an almost) complete Twitter archive using Java, validating as UTF-16LE XHTML


I was figuring out the latest bits to my Twitter archival tool today, and once I made a complete dump of all Tweets, I saw that I had forgotten to HTML-encode URLs, so & was breaking the validation.

Boy, was my face red for a split second. Anyway, the nice org.apache.commons folks have created a tool to encode URLs for HTML, so that was an easy fix.

However, the W3C validator

Was still giving weird errors, and after some fiddling around and googling, I found the W3C I18N checker, which explained that XHTML couldn't be prefixed with an <?xml declaration. It's been a while since I worked properly with web documents I guess, so I'd forgotten about that.

So OK, I removed the declaration, and thought I'd add a meta http-equiv or charset tag to the document, to be declarative about the content of the document.

However, the I18n validator first complained about that, saying I couldn't use UTF-16LE as an encoding, and that I had to say UTF-16, but when that was fixed, the validator complained and said that I shouldn't specify the encoding in the document.

And that makes sense, because the document starts with a BOM, which indicates the charset and the endianness of the charset.

Anyway, I get a whiff of cultural imperialism when I see that W3C says UTF-8 is the recommended encoding, and the main validator is so unhelpful when giving feedback on what is wrong with the document. :\

So, here's the commit of today's work:

A productive day, and

Shows an almost complete archive of my Tweets. A grep shows that my archive is 3128 tweets:

iconv test3.html -f utf-16|grep "class='tweet"|wc -l
iconv: incomplete character or shift sequence at end of buffer

while Twitter says I have well over 4000 tweets:

    Tweets 4,943
    Following 98
    Followers 189

So I guess Twitter has some segmentation of its archive, for unknown reasons.

I did get some feedback on my blogging about Java and type-casting, and using Java generics it is possible to avoid this tedious type-casting I was talking about earlier. I had seen the syntax for Java generics before and found it to a bit of an eyesore, but seeing how it saves quite a bit of tedious typing and that the syntax is straightforward, I guess I can't complain.

It's not Perl after all..

[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [23 Apr 16:52 Europe/Oslo]

Can I Java cup of coffee? Isn't that valid?

Yesterday I made some progress on the twitter-exporter tool, working and thinking quite a bit in one day.

I'm surprised I am as productive as I am in Java, since I haven't used it in work-related projects. Yesterday it felt like I had a couple of cups of coffee too many, maybe it's the spring, but I was cranking out code and dealing with Exceptions like I'd been eating a lot of cake and drinking a lot of coffee.

I'm particularly pleased with this piece of code:

class TwitterStatusFetcher {
        Twitter twitter;
        ArrayList statuses = new ArrayList();
        Integer page = 1;
        Integer count = 20;

        TwitterStatusFetcher(Twitter twitter_) {
                twitter = twitter_;

        Status getNextStatus() throws TwitterException {
                if (statuses.isEmpty()) {
                        // See if more tweets can be found
                        ResponseList results = twitter.getUserTimeline(
                                new Paging(page, count));
                if (statuses.isEmpty()) {
                        return null;
                Status status = (Status) statuses.get(0);
                return status;

Which works with the twitter4j code and Twitter API to deliver one status at a time to the rest of my app code. Maybe it's not that big of a deal, but I found it elegant, and it does use the object-oriented paradigm that Java is big on.

It seems the most frequent mistake I make coming from Python, is forgetting the semicolon; I like to indent code regardless of language, so it's the semicolon that I forget.

I guess one thing I've found annoying about Java so far, is the type casting that is necessary at different places. I was working on some code which I guess was eventually removed, where I knew the method to call, but because of some abstraction in a method call, the returned objects were java.lang.Object, and calling a method, a String method I think, on that object failed in compilation.

I was also almost smacking my head yesterday, when I discovered that twitter4j returns shortened (and expanded) URLs in their Tweets as well, and thought I'd developed quite a bit of code for no good reason.

However, as it turns out, some tweets do contain shortened URLs that aren't mentioned in the Tweet metadata, so the class I wrote to resolve URLs still has some use. Phew.

Finally, I found Firefox now displayed the test.html output page as XML, instead of XHTML. So I made the code output a Unicode BOM, and Firefox says it is in standards compliance mode, and Chrome does not complain. However, the validator on, - still does not validate the page when it has a UTF-16LE BOM.

I'm not sure what's going on there, but to me it looks like the w3c validator isn't working.

A test.html page I just created is available at - just rename it to test2.html after download and open it in Firefox to see the rendered archive of my tweets.

[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [14 Apr 10:35 Europe/Oslo]

Doodeling along with Java development, "unit development" and more

Yeah, I've been developing a Java app to export all my tweets for safe-keeping.

I'm new to Java, so I asked a bit about limiting the amount of pieces of development software, so it was less complicated to see what the problem was when the code failed.

I asked on, with the message ID <>. I did get some useful feedback, but I guess my idea of a simple bootstrapping development environment has something to it. Why not make something less complex if you can?

I worked on the code for resolving Twitter URLs today, and this is the file as of now:

I have to say, that coming from the Python world, a lot is the same, although I have to say Python is less bureaucratic and easier on the eyes. Maybe in Java's advantage, things are well packaged and one is pretty much forced to think in an object-oriented way.

I can't say that developing in Java is worse than Python, I think they are even in many ways.

The code I've been develolping is fairly simple, the data it works on is also uncomplicated, with standard encodings, data formats and protocols.. so I'm not learning anything new there, and keeping things very simple on whatever I need to store as well, plain-text file format. If I was learning some new protocols and software libraries it could be a bit more difficult.

It's nice though, to see that I'm able to be very productive in a language I haven't used in a work-related context, feels like I'm firing on all cylinders again.

[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [09 Apr 13:33 Europe/Oslo]

Automating builds using Maven, writing XHTML & refactoring in Java

In my efforts to write a tool for exporting Tweets from Twitter for safe-keeping in Java, I came a bit closer to the goal to create such an archive today, when I managed to automate the build of the app a bit, and make the app create something that resembles the desired end-result.

Earlier I had to download jar files from projects that my project depended on, but with the following commit:

One jar is built, and it is run using the command

java -cp ./twitter-exporter-1.0-SNAPSHOT-jar-with-dependencies.jar

I would like run the app in an even simpler way, but it is a big improvement from downloading jar files manually and including them on the "java -cp" command.

I was initially thinking I'd keep things as simple as possible and avoid unnecessary dependencies and systems, but seeing that there are collections of Java classes with useful features, features you'd expect to be in the Java core, it is great to be able to include these using some lines in the pom.xml Maven file.

Secondly I refactored the code a bit, so that the main App class was able to write an XHTML file containing a number of tweets:

You can download the generated output here:

I had to call the file test.html.bin to fool the application server into treating it as a binary file, as UTF16-LE is the encoding of the file and I guess the application server uses UTF-8. Renaming it to test.html and opening it in Firefox should work.

StringEscapeUtils.escapeXml10 is a nice tool, and something you'd assume would be so necessary and standard that it would be included with Java by default. Seeing this is the way it is, I guess there is really no way around using a tool like Maven to build projects.

[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [05 Apr 19:36 Europe/Oslo]

Testing out Java's Unicode support, UTF-16LE the choice for now

So, in my efforts to create a tool to export my Tweets from Twitter for safe-keeping, and learning a bit of Java in the process, I today created a Java snippet of code to write an XHTML file, to get acquainted with Java and its Unicode support.

I've worked with Unicode in Python and in C, and a while ago I started some discussions on comp.lang.c, as I was testing out C to write an XML parser. That project ran out of steam, but I still think today that UTF-32 is the least discriminatory (and uncomplicated) approach to sharing information like web pages.

Anyway, here's the Java code for writing a test XHTML page, fully validating on the W3C validator:

Well, it was validating on the W3C validator, but once I added code to write a BOM, it no longer validated. 🤔 But shows up fine in Firefox, and "file test.html" says:

test.html: XHTML document text (version 1.0), Little-endian UTF-16 Unicode text, with no line terminators

So I'm not sure what's going on there.

As I was testing out Java, I was hoping and optimistic for having a Unicode solution that just worked, and even more so when OutputStreamWriter accepted an encoding argument.

But as you can see on the history of, I had to revert to using just FileOutputStream, and encoding strings and writing them as bytes to the test.html file.

So much for that dream. Well, this is all alright, I find Java a bit verbose, but it also reminds me a bit about C and that's nice.

A thing that surprised me though, was that Firefox did not support UTF-32LE encoded XHTML. Why not?

[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [04 Apr 00:06 Europe/Oslo]

Resolving URLs from a URL shortening service in Java

So, in my efforts to create a tool to keep a (complete) archive of my Twitter activity, I today wrote a tool to help replace URLs in my tweets, with the actual URL, here:

Now I come from the Python world, and lately I've been looking at Java to learn it properly. To improve my chances of having gigs that are interesting, regardless of programming language.

I started looking at URL objects and generating a connection from that, but since I'm going to resolve a lot of addresses, found that it would be better if I kept an HTTPS connection open to the server, and then pass the final part of the URL over to Another issue here is maybe a "resting period" between each resolved URL, so as to not appear "spammy" or "resource hogging" on the server.

Anyway, luckily I found an example online that I could adapt for my purposes, and I'd have to say, compared to Python, Java is a bit bureacratic with its classes and types, but other than that, Java is just fine.

[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [01 Apr 12:05 Europe/Oslo]

A Java-based tool to export tweets from Twitter for safe keeping

So, I was looking into exporting all my tweets the other day, to keep a copy just in case something happened to my Twitter account.

I tried exporting from Twitter (using a desktop browser as they asked on the export page), but I have so far not seen a dump of all my tweets.

I see there are other tools available for exporting Tweets, websites, but I thought to myself, why not create a simple, safe tool for exporting and safe-keeping Tweets.

So, after a bit of rummaging I found twitter4j, and started to build a Twitter export client using a text editor, a Makefile and javac/java.

However, I quickly ran into a NoClassDefFoundError, and after googling a bit, I felt an obscure-configuration-detail-headache coming on, and decided I could try to use Maven, which is mentioned on the Twitter4j website for the build process.

The Maven quickstart guide instructed me to use this command to generate a Maven project:

mvn archetype:generate -DartifactId=twitter-exporter -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

And after downloading some components etc. - Maven had a file hierarchy for me.

I then added the following section to pom.xml


To include the twitter4j components in the Maven project. I then preceeded to run "mvn package" and then entered the target directory, and with the command

java -cp ./twitter-exporter-1.0-SNAPSHOT.jar

I got the result

Hello World!

Which is what one can expect, as the project was just generated. Afterwards I created a new repository on GitHub, and uploaded the project (output of "history|grep git" in bash):

 2172  git init
 2173  git add pom.xml src
 2175  git config --global ""
 2176  git config --global "Morten W. Petersen"
 2177  git commit
 2182  git remote add origin
 2183  git push -u origin master
 2184  history|grep git

I started with this before I decided to blog about it, so I guess to setup the enviroment you have to run "sudo apt install maven openjdk-8-jdk openjdk-8-jre git" on Ubuntu/Debian.

The source code website for the project is here:

[Update same day: I had to download the twitter4j jar and add it to the java command above: "java -cp ./twitter-exporter-1.0-SNAPSHOT.jar:./twitter4j-core-4.0.4.jar"]

[Update later same day: twitter4j-core-4.0.4.jar can be downloaded from]

[And update even later same day: twitter4j-core-4.0.6.jar can be downloaded from - it's necessary for the latest code to run]

[Permalink] [By morphex] [Java (Atom feed)] [30 Mar 15:19 Europe/Oslo]

Raspberry Pi as a WiFi uplink point for cable switch

So.. to keep myself entertained and work a bit with technical things I haven't worked a lot with earlier, I dug out the old Raspberry Pi and figured I could use it as an uplink for a switch I recently bought.

So basically I have

  The internet -> Apartment router -> My WiFi Router -> Raspberry Pi with Wifi -> Switch -> Computer x,y,z

This enables me to setup computers with internet, by just plugging them into the switch with an Ethernet cable. The ISC DHCP server is running on the Raspberry Pi, and deals out the necessary bits to each computer so that it gets internet access.

You can see the switch as well as the Pi on the following picture:

Raspberry Pi and ethernet switch with LED lights

Now I thought the whole thing was a bit daunting and didn't know where to start, but some recipes on the net made things fairly easy, and I do know a bit about networking etc. from earlier on.

Now, the Raspberry Pi has a DHCP server running, which deals out IP addresses, gateway etc. to each computer that connects to the switch.

The DHCP server is configured basically like this and listens on the Raspberry Ethernet port, eth0:

option domain-name "";
option domain-name-servers;

default-lease-time 600;
max-lease-time 7200;

ddns-update-style none;

subnet netmask {
        option routers;

But the Pi also has to know how to send data to and from the computers that are hooked up to the switch, and here's a script that sets that up:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT

Using those two bits, and using the built-in WiFi configuration in raspi-config, I setup a network for easy internet access in a couple of hours.

[Permalink] [By morphex] [Technology (Atom feed)] [27 Dec 00:26 Europe/Oslo]

Installing and using Fedora Linux 26 on my desktop computer

So, this week I got to buy a used bass guitar for cheap, after having put up an advertisement that I wanted to buy one.

I live in an apartment complex, so using any rig to play music is not such a good idea, so I thought why not go the cheap route here as well, and try to use a software-based amplifier which should give some of the same sound as an amplifier.

Well, I also bought a cheap USB-pluggable sound card a while ago, so I thought I'd use that.. but that didn't work out too well, so I decided to upgrade the Ubuntu installation from version 16 to 17..

And that was a mistake. I think the problem was that I had made some customization to the USB setup etc. a while ago - and when I upgraded to the new software and settings it didn't mix well with what I did earlier.

So.... after a bit of back and forth trying different options, the one I ended up with was wiping out the old Linux swap partition and installing Fedora 26 on it, which should be OK as I do have 16 GBs of RAM.

So yeah, I ended up doing that, the installation was straightforward and booted up in the new environment.

The environment didn't look too good, as the NVIDIA graphics drivers had to be installed manually, and the default settings for appearance of the desktop were towards fast and snappy rather than pretty.

Installing the NVIDIA drivers was a process in itself, and it's hard to understand that there is a good reason for having to do this, this way, in 2017. I saw something about NVIDIA being worried about knock-off cards etc. - but if it is so easy to knock off the product maybe this is more about brand and perceived value. Or maybe NVIDIA is favouring the Windows platform and making it a bit harder for Linux to compete. "Dollars, anyone?"

Anyway, I found instructions for installing the graphic drivers here:

Which were straightforward. After tweaking the settings a bit, the desktop looks OK and here's a screenshot:

Screenshot of Fedora 26 Desktop with KDE Plasma

Another thing I had to deal with was the sound setup; I have multiple soundcards in my machine, one is built-in into the [Edit: replaced soundcard with motherboard] motherboard, another is in the NVIDIA graphics card and the third is in my USB gaming headset, the Razer Megalodon.

When I bought the headset about a year ago used, it was a bit of a process to set it up on Linux, but eventually it worked.

So I was a bit surprised when it worked out of the box after the installation, but when I tried playing music there was no sound; the system automatically preferred another sound card even though the Megalodon was the default sound card. After oogling and googling a bit, I found that I could disable the other sound cards by blacklisting their driver module in the kernel, adding "blacklist snd_hda_intel" to /etc/modprobe.d/sound.blacklist.conf.

So although the installation process is OK, the user-friendliness of Fedora is still a bit half-assed, no regular computer user can easily figure out how to blacklist a sound card, and it is difficult to setup the graphical appearance in the most appealing way.

[Update 2017-09-24] I decided to try out some gaming as well, and installing the Steam client looked like a good choice. However, even using the RPM Fusion repository, the Steam client failed with different errors. The fix for that was downgrading (...) the NVIDIA drivers from 384.90 to 375.82.

[Permalink] [By morphex] [Linux (Atom feed)] [23 Sep 14:14 Europe/Oslo]

My first practical electronic hack

So, some time ago I figured I'd start a bit with electronics, soldering, circuit boards etc. I laid that on the shelf for a while, and now after I created that Raspberry Pi Wi-Fi router ( ) my motivation to start hardware hacking returned.

I've read up a little bit about electronics; resistors, potentiometers, diodes, voltage etc. - all in a very leisurely pace. I have bits and pieces of electronics lying around, including a Raspberry Pi / Arduino kit as well as some variants of the Arduino card.

I also have various adapters, wires and whatnot lying around after many years of consuming electronics, so I figured that I could take a DC power plug that fits in the Arduino MEGA and connect that to the power adapter that goes into the wall socket.

The DC power plug for the Arduino came from a 9V->Arduino DC power plug connector and since batteries are expensive and I might end up putting that Arduino up for some practical use, splitting the 9V connector from the DC power plug was an easy decision. Fortunately there are online webshops like and that sell bits and pieces of electronics at very low prices.

So here's the 9V connector that I didn't need:

9V connector from Arduino connector

I'm going to store that in a box of bits and pieces, as I might need it again some day. I also left some wire on it so it's easy to connect to whatever later.

I also separated the plug from the wall adapter, a standard adapter that gives 5 volts and 0.8 amps, or 4W max

Wall power adapter

I also stripped the end of the wire from the adapter and twisted the wires from the DC plug and the adapter together, and put them in one of those things that can hold circuit boards etc.

Circuit board holder

Put some cardboard underneath for capturing soldering spills and soldered the wires together. Then I wrapped some office-grade tape around the soldered wires for insulation, gave them a quick heat treatment with a lighter and then wrapped another round of tape around them. It's not electrical tape but I assume it is good enough, it's not a lot of current in those wires.

OK, so here's the result of my first practical hardware hack which involves soldering:

Arduino MEGA with power from hacked wall wart

It works and I've made good use of an adapter that probably would have been lying stored and eventually discarded (who can keep track of these adapters and their connectors anyway).

The only issue now is figuring out why the Arduino gives only 3.5V on its 5V pin; using the multimeter on the DC intake shows a bit more than 5V so it might just be that that's the way things work. I have a 5V motor I'd like to connect to the Arduino to play around a bit.

[Permalink] [By morphex] [Technology (Atom feed)] [10 Jan 13:34 Europe/Oslo]

Custom Raspberry Pi Wi-Fi router

So, I've moved to a new place, and as a result of that move, I need to get a decent setup for networking. One that gives low latency for gaming as well as high bandwidth for big Linux image downloads for example.

I have a Netgear router lying around which I could use, but I've also got some bits I've accumulated the last couple of years, like a Raspberry Pi mini-computer, a 10 metre Ethernet cable, USB Wi-Fi adapters and more.

So I opted to create my own access point, and thought that would be easy enough. Well it wasn't as easy as it should be, because the Realtek chipset has some old drivers, so I had to fiddle with patching the standard hostapd (access point app).

I ended up compiling the wpa Debian package to include the rtl871xdrv patch ( ) and then set on to create an accesspoint using create_ap ( ).

The AP started up and was visible, but it wasn't possible to authenticate. So I tested things back and forth, and also considered making it an unencrypted access point with MAC address based access control, but luckily I got a response from Guan Xin on the mailing list hinting that I should turn off some capabilities to make it all work.

So I now have an access point running, and it seems to be running just fine, I get about 25 Mb/s downloading from the internet now. [Edit: That was 25 Mbit/s, not MB].

Here's how it looks:

Picture of Raspberry Pi lying on the floor, with Wi-Fi adapter

It's maybe a bit overkill building my own router, but now I have full flexibility and control in how it should be setup, from QoS to firewalling to logging.

[Permalink] [By morphex] [Technology (Atom feed)] [22 Dec 13:25 Europe/Oslo]

An OGG/Vorbis player, implemented in Javascript

So, I've had a productive week(end), and after some fiddling over the last couple of months, I've managed to create a Javascript demuxer/decoder of OGG/Vorbis files. :)

It's located here:

Long story short, it runs in some browsers, as mentioned on the page. I think this is very cool, and it is nice to see that I've managed to make some practical use of the C programming I've been dabbling with the last couple of years.

[Permalink] [By morphex] [Web (Atom feed)] [16 Oct 08:40 Europe/Oslo]

Fixing up an old blog, transparent PNG embedded in Python code

So I've been fixing up on my blog lately, adding some iframe and javascript code, as well as backend code, to make it play my playlist from SoundCloud automatically.

This blog is running on Zope 2, and the blog software was written by me.. it's not been maintained well though, so I've been fixing up some minor things here and there.

One of the things I needed to fix was that on the search page, some images were referenced that for some reason wasn't approved by the weblog layer, and raised old-style HTTP authentication boxes.

So I figured I'd fix this in an easy and quick way. I created a new image in The GIMP, 1x1 transparent, and saved it as a PNG with as little metadata as possible and level 9 compression.

Looking at the file afterwards in Python, it looks like this:

-rwxrwx---+ 1 Morphex None 117 aug 2 14:26 1x1_transparent.png
-rwxrwx---+ 1 Morphex None 68 aug 2 14:36 1x1_transparent2.png

Morphex@Morphex-PC /cygdrive/C/Users/Morphex.Morphex-PC/Documents
$ python
Python 2.7.10 (default, Jun 1 2015, 18:17:45)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> f=open('1x1_transparent2.png')
'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4<MY BLOG LAYOUT LINE BREAK>

I updated the IssueDealerWeblog code to return this:

    def image(self, id=None, REQUEST=None, RESPONSE=None):
        """Returns an image related to the published issue."""
        result = self.catalog_search(id=self.get_published_ids(),
        if result:
            return base.base.image.im_func(self, id=id, REQUEST=REQUEST, RESPONSE=RESPONSE)
            RESPONSE.setHeader('content-type', 'image/png')
            RESPONSE.setBody('\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4<MY BLOG LAYOUT LINE BREAK>
\x89\x00\x00\x00\x0bIDAT\x08\xd7c`\x00\x02\x00\x00\x05\x00\x01\xe2&\x05\x9b\x00\x00\x00\x00IEND\xaeB`\x82', lock=True)

And now the search page returns without raising any authentication boxes. It's not the most purist way to just fail silently like this, but a quick fix that helps with the appearance and user-friendliness for a regular user.

[Edit: Adding paragraph..] And in case you're wondering, that image binary is released to the public domain, so you can use the Python string here anywhere. Or download the image No description available.

[Permalink] [By morphex] [Python and web (Atom feed)] [02 Aug 14:38 Europe/Oslo]

Developing my XML project in C

So, these last couple of months I've been dabbling with C and XML, to get to know C better. Out of all of this there might also come a nice XML parser and writer that will be freely available for anyone to use.

I wish I learned more C earlier, as a lot of things related to IT have fallen into place now that I've been forced to work on low-level stuff.

There have been quite a number of posts to comp.lang.c, and lots of useful information has been exchanged back and forth.

Anyway, the project is here:

I guess the bulk of the main code and tests are now around 25KB, which is quite a bit of code. One of the next steps is to create the main parsing loop, which will break down the XML file into its internal C representation. There will also have to be some data types created so that things work well.

One of the more interesting points that have come up is whether to use iteration or recursion when working with the internal representation.

In C, when you do a function call, things are pushed onto something called the stack. And with recursion, more and more things get pushed onto the stack, and if the recursion is deep enough, the stack is exhausted with unpredictable results.

So I think I'm opting for an iterative design in the C code, and using little if any recursion. I'm sure that's going to tick some people off, but having predictable and intelligible results when running the code is important for this project, because one can work with malicious input data.

Right now it feels like I'm past the most "painful" parts of learning C, and look forward to learning and writing more in the time to come.

[Permalink] [By morphex] [C & XML (Atom feed)] [13 Jul 00:51 Europe/Oslo]


These last couple of months I've been learning a bit of Assembler and C programming, as these days I have the time available. I've always found Python and other high-level languages fast enough for what I needed to do, but I've always wondered a bit about C and Assembler.

What I've learned so far is that the computer is in fact a very large calculator, and pretty much everything that happens is that instructions are called (for example adding two numbers), and that numbers are moved around in memory, disk, peripherals etc. I've found it useful to learn about Assembler and C because it gives me a more detailed and correct view of how things work in computing.

With my programming and system administration background, I found it easy to dive into C and Assembler, and I also appreciate a lot more what for example Python does as a high-level programming language.

I've been looking for some gig or project to create a C and Assembler project for, and what I've landed on so far is that I want to create an XML parser. An XML parser that validates the Unicode used, as well as insures that the document is "well formed". I haven't gotten that far yet, but I've pretty much decided that the parser should (for now at least) be restricted to an UTF-32-LE encoding, and that whenever I work with pointers the rule is to initialize to null when they are created as well as after free() has been called.

I think this is good fun and I do it whenever I have the time and energy, here's the code so far:

#include <stdlib.h>
#include <stdio.h>

int main() {
  char *buffer = NULL;
  int read = 0;
  buffer = malloc(1024*sizeof(char));
  FILE *file = NULL;
  file = fopen("test.xml.2", "rb+");
  read = fread(buffer, sizeof(char), 1024, file);
  if ((char)buffer[0] == (char)0xFF && (char)buffer[1] == (char)0xFE &&
      (char)buffer[2] == (char)0x00 && (char)buffer[3] == (char)0x00) {
    // We have a UTF-32-LE Byte Order Mark                                       
    printf("BOM found\n");
  } else {
    printf("BOM not found, %x\n", buffer[0]);
  printf("%i\n", read);
  fwrite(buffer, read, 1, stdout);
  free(buffer); buffer = NULL;
  return 0;

[Permalink] [By morphex] [Technology (Atom feed)] [09 May 11:44 Europe/Oslo]

An updated version of the Issue Dealer, building Zope 2.13.22

It's been a while since I did anything on Zope 2, and these last couple of months some bugs on the weblog publisher on have been bugging me.

So I decided I should get that fixed, and also get the IssueDealer updated to work with the latest stable version of Zope 2.

It has been some days of fixing things back and forth to get things working, but now I have an updated version of the IssueDealer, as well as a procedure for building the latest and greatest Zope 2.

I've been quite out of touch with what has been going on in the Zope, Plone and Python world lately, and it took me quite some effort to get things working, from getting Zope from GitHub, getting the right dependencies in etc. One thing I've noticed is that is using a common name of - which forced me to make a shell script to aid in the process of setting up Zope. This is sloppy at best, as it forces users to skip SSL verification.

But, enough of that, here's the hands on procedure for getting Zope 2 installed on a Debian Linux box. Beforehand, I think it's necessary to install the build-essential package as well as git, in other words:

sudo apt-get install build-essential git

I'm not sure what the procedure is for Fedora/Red Hat, SuSe etc. is but it should be easy enough to figure out.

OK. We'll install Python and Zope in a directory called


First thing we do is get Python 2.7.9 installed, which is done with

chmod o-rwx # So other users can't read the database etc.
mkdir tmp
cd tmp
tar xfz Python-2.7.9.tgz
cd Python-2.7.9/
./configure --prefix=/home/morphex/
make install
cd /home/morphex/
git clone zope
cd zope
git checkout 2.13.22
wget --no-check-certificate
chmod +x
./ ~/

Now, edit the buildout.cfg file, so that the [zopepy] and [wsgi] sections contains the line


like so, maybe using the command "nano buildout.cfg":

recipe = zc.recipe.egg
eggs = Zope2
interpreter = zopepy
scripts = zopepy
recipe = zc.recipe.egg
eggs =

Now, when that's done, we're ready to run buildout. Run the command


Now, this script may fail, if there are network issues for example that make downloading of packages break. If that's the case, just re-run the command until it completes with lines something like this:

Generated script '/home/morphex/'.
Generated script '/home/morphex/'.
Generated script '/home/morphex/'.
Generated script '/home/morphex/'.
Generated script '/home/morphex/'.
Generated script '/home/morphex/'.

After a lengthy process with lots of output, we can create the Zope instance, like so:

./bin/mkzopeinstance -d ~/

I'll leave it up to you to choose a username and password.

Now the instance has been setup, and we can run it for the first time. Type in the command

./instance/bin/zopectl fg

And you should see something like this:

/home/morphex/ -X debug-mode=on
2015-02-13 04:31:04 INFO ZServer HTTP server started at Fri Feb 13 04:31:04 2015
        Port: 8080
2015-02-13 04:31:05 INFO Zope Ready to handle requests

Now I login to my server on the URL - and select "Issue Dealer" from the drop-down list, click on add and give it the ID issues, and the title "My issues". Now that Issue Dealer instance is available on

Voila. If you're setting up a plain Zope 2 or Zope 2 with some product, just remove the Products.IssueDealer parts from the buildout.cfg and it should work.

Hope you found this useful, and comments etc. are much appreciated. My email is morphex AT gmail.

[Permalink] [By morphex] [Zope (Atom feed)] [13 Feb 04:05 Europe/Oslo]

A Rasbperry Pi router

So, I've been playing around with different technologies the last couple of weeks. The one I've talked the most about is the Raspberry Pi, a small computing unit that's available for cheap.

Where I'm staying doesn't have wired internet, and the Wi-Fi that is available isn't any good. So I decided I should create a router based on the Raspberry Pi that makes some "smart" decisions about network traffic.

I've got two providers of mobile internet, one on my phone and one pure mobile broadband subscription. The former has a good latency but limited capacity, while the latter is the opposite.

So when I'm playing online games like Battlefield, where latency (ping) is very important, I'd like to have the router choose what the best thing to do is, based on my instructions. I also flip between Windows and Linux on the desktop, and having things just work without per-OS configurations would be nice.

This router should be flexible so I can connect to it using Ethernet or Wi-Fi, and the Ethernet USB-dongle I got for it kept crashing the Pi. I reported this bug to the kernel developers but it is an old (not updated in years) driver that's causing the crashes so I don't have my hopes up. I found a patch which fixes the crashing ( ), but I'm not sure that patch does the right thing, it's probably the network chip driver is the one that should be patched.

Anyway, today I was able to patch the Raspbian kernel, cross-compile it on my X64 Octo-core 3.4 Ghz (significantly faster than compiling it on the Raspberry itself), install it on an SD-card, modify the config.txt file and boot the Raspberry with usbnet.c patched. And that worked well, copying a large file using scp went painlessly.

I ordered a new Ethernet dongle today, one that supports 1 Gbp/s in addition to 10/100 mbit, as offering that option as well seems like the right thing to do.

The Raspberry has support up to high speed USB 2.0, which has a max bandwidth of 480 Mbit/s (in practice the bandwidth one can use will be significantly lower) and there is also some CPU overhead, so it will never fast enough to give full 1 Gbps access. But it will offer the option of 1 Gbps connectivity, which probably means the upper limit is a couple of hundred Mbps.

I think this was a fun and smart thing to start with, I've also got some other Raspberry Pi ideas lurking, but limitied time and energy to play around with things.

[Permalink] [By morphex] [Technology (Atom feed)] [02 Feb 23:05 Europe/Oslo]

Repurposing old devices (NOKIA Lumia and Samsung Galaxy tab) for mobile internet access

So, where I'm staying right now doesn't offer a wired connection, so I've setup a mobile internet solution instead.

The companies that offer wireless mobile internet also offer routers etc. that can be used to setup WiFi access to the internet, but I didn't opt for any of those as I had a couple of old devices that could be setup as WiFi hotspots instead.

Up until a couple of days ago, I was using a Nokia Lumia as a WiFi hotspot and used the computer as a power source via USB, but I found that it started giving a very poor speed (20-30 KB/s) when I was on Linux. So I dug up my old Samsung Galaxy Tab P1000 instead, and placed my mobile internet provider SIM card in there.

It didn't work though, it just gave a couple of bars on the network indicating that there was some sort of connection, but no internet access.

After googling a bit, I found the setup procedure on Netcom (the provider of mobile broadband) for one of the devices they sold if internet didn't work. After some adjusting of the APN settings, I found that setting the Server to and the APN-Type of connection to internet, the Galaxy Tab started working as an access point to the internet.

So there you go, if you've got old phones etc. don't throw them away, they can be put to good use later.

[Permalink] [By morphex] [Mobile (Atom feed)] [07 Jan 05:11 Europe/Oslo]

A SoundCloud(R) export tool

Hoi. OK, so these last couple of weeks I've been cleaning up things in my SoundCloud account, as there were lots of cover songs and some mixes and remixes that triggered the "SoundCloud copyright system".

There has been many rounds back and forth, and I even had to clear out private tracks for example of cover songs, which is strange.

Anyway, I figured that it would be nice to be able to export all of the content I've created over the last couple of years, just in case SoundCloud decides to "terminate" my account, files could be lost etc.

I downloaded the python-soundcloud package, and started getting to work. This module has been created by some person over @ SoundCloud. After some trying and failing it looked like it wasn't able to download tracks with the package, so I forked it on github ( here ). Using that module and the following code in a script called for example should do the trick.

# The following code is available under the GPL, version 3, available here:

import soundcloud, urllib2, urllib
from soundcloud.request import make_request
import os

LIMIT = 1000 # Maximum number of tracks to download
             # a limit in case something goes wrong 
             # so we don't hammer the system.

def download_tracks(output_directory):
    client = soundcloud.Client(
    for track in client.get('/me/tracks', limit=LIMIT):
        path = track.download_url[len('')-1:]
        filename, data = client.get(track.download_url)
        output = open(os.path.join(output_directory, filename), 'w')
        print 'Downloaded file: ', filename

if __name__ == '__main__':
    import sys
    if len(sys.argv) != 2:
        raise SystemExit, 'output directory required'
    import os
    output_directory = sys.argv[1]
    except OSError:

[Permalink] [By morphex] [Technology (Atom feed)] [03 Jan 01:55 Europe/Oslo]

Taking a look at SASS, Compass & Zen Grid

OK, so a couple of days ago I got the idea that I should create a new personal website, which syndicates information from various sources into one channel, or page. That is, all my Youtube stuff, Tweets, stuff posted on SoundCloud, Instagram and so on.

Now, I've been using Python, Zope and Plone for many years, in work projects as well as personal projects. This time, I was thinking of creating something very simple, maybe even static HTML, Javascript and CSS files. Well, as for the static part, I think it is a good idea. The process for creating those static files could be done in any way though.

So I started looking at responsive design, and having a framework that delivers a lot seemed like a good idea. I ended up choosing Zen Grid because it felt right, a Ruby- and Compass-based framework for creating grid-based layouts. Ruby is a programming language, and Compass is a framework for creating CSS. I got Ruby installed, and got SASS, Compass and Zen-Grid installed using gem, an easy enough process, typing 'gem install sass', 'gem install compass', 'gem install zen-grid'.

OK, everything installed - fine. Now I had to create a SASS/Compass project, and the 'compass create <projectname>' command handled that. Creating a project creates some files, using the find command shows which files are present in my project right now:

morphex@infernal-love:~/apache/stats/tester$ find .


The sass directory contains the SASS files which will be compiled into the CSS files in the stylesheets directory. Now, first thing is first, and that's the web page. It is available here:

If you look at the source of that file, you can see it's an example copied from the Zen Grid reference, with the E field commented out. This is because I saw the E field being moved down as content was being added in rows to the B field. I couldn't see any need to go beyond the D so it was just easy to remove it and don't have any headaches trying to figure things out.

The CSS file that gives this page its layout and colours is here:

And the SASS file that generated that CSS is here:

It's all fairly straightforward, and it is a nice simple way to create a layout on a web page.

A final note on these files, config.rb should contain

  require 'zen-grids'

to make all of this work, like my one does:

For my part, I'm thinking it could be fun to create some tools in Python that pulls everything together, at least something that can generate HTML with information from all the different sites I post content to. It's easy to start over-engineering on projects like this, but maybe I'll also wrap Ruby, SASS, Compass etc. in a Python package to make these features easily available for Python. As well as look at including Zope's page template package to easily create templates.

Oh well, I'll get back to progress on all of this later. Tata. :)

[Permalink] [By morphex] [Web (Atom feed)] [04 Dec 17:29 Europe/Oslo]

Having two phones (HTC One X and Nokia Lumia 920)

So, a little while ago I bought myself a new phone, one in addition to the HTC One X I already have.

It was the Nokia Lumia 920, with a Windows Phone 8 operating system. I've played a bit around with it, and decided I like the new user interface.. it's intuitive that boxes can be dragged round and resized in the start screen. Downloaded some apps, for Twitter, Facebook, the bank and more, and these apps are OK to use. The gripe I have with the phone is that it the Spotify app isn't running as well as it should and the user interface is not that good, but I guess they'll improve that as time goes on.

So, some benefits of having two cellphones have popped up. I use a multi-SIM card solution from the phone operator Netcom, and for example when travelling by train where the coverage can vary, one phone can get SMS messages seconds or minutes before the other.

It is also nice to have one phone connected to the WiFi and the other not, so that whenever WiFi doesn't work as it should, it is easy and quick to use the other phone to check out Twitter, Facebook and so on.

So, now I have on Android Phone and one Windows Phone, and if the rumours are true, a big new Apple phone will arrive this summer. I think I'll get that one as well, and probably sell the HTC One unless I find a good reason to keep it.

A third benefit of having two phones is that one can pretty much always go through an entire day without having to charge up, and just put both in charging mode when going to bed. Most new phones suck battery like there's no tomorrow (...) so it is practical to have more than one phone in that regard.

I guess the only thing I'm missing for the Nokia Lumia 920 Windows Phone is an alternative browser. Firefox, Chrome, Safari or Opera would be nice, I guess WP8 isn't "big enough" yet that it has alternative browsers available.

[Permalink] [By morphex] [Technology (Atom feed)] [17 Apr 11:56 Europe/Oslo]

On the Nokia Lumia 920

So, I've had the Nokia Lumia 920 phone for a couple of days now. As I twittered fairly quickly, the user interface was interesting, the built-in speaker sound was good and the screen was nice to use, even in sunlight.

Now I've played with it some more, and it's a phone I can like. The biggest gripe I have is that it doesn't look like there are any alternative browsers for it. I use IE sparingly, which I think MS deserves after years of dragging web-developers down with their half-hearted approach to supporting web standards.

Another nag was that the logon to the Microsoft-account system (Hotmail, what was MSN messenger etc.) failed to begin with, and gave a pretty cryptic error message as to why. After googling (in a way a regular user would most likely not be able to), I found that the issue was an incorrect time zone setup on the phone.

Anyway, I keep playing with the phone and getting used to the "start" screen with all its little boxes and customizing it. It has got apps for Spotify, 7 Digital, Skype, Facebook and more, so it will be a phone I can use on a regular basis. I think it's a good phone so far. :)

[Permalink] [By morphex] [Technology (Atom feed)] [07 Apr 19:20 Europe/Oslo]

Internet over mobile network,

They've been working around or home the last couple of months to setup fiber for internet access. They had a mishap where internet was unavailable and one a couple of days ago as well.

So, I decided the other day that I need proper redundant internet access. We have devices on both of the major mobile GSM networks, and after being unsatisfied with how they work in lesser populated areas I decided to try something new.

So I bought an router which is "CDMA EV-DO Rev. B". OK, so GSM, EDGE and CDMA etc. is different in speeds and features, I don't know much more than that.

So yeah, bought the router and got it fired up. And I must say I'm pleased with how it works. Great ping (SSH is as responsive as on regular broadband) and the transfer speeds are good too.

I'll use it now and then I guess, but it is good to have a backup besides the usual mobile phone networks. I look forward to taking it to more remote locations as well, to see how well it works in lesser populated areas.

So far it's looking good, it really feels like regular broadband.

[Permalink] [By morphex] [Internet (Atom feed)] [16 Nov 17:30 Europe/Oslo]

Android everywhere for anyone

So, I've been using Android phones and tablets for a while now.. My HTC One X Android phone stopped working properly last week and this week I got around to delivering it in for repair.

I've been happy with the HTC One X, the only thing I have that is a bit annoying is that it sucks a lot of battery and needs to get charged during the day. Which might be partly because of lots of different apps pushing and polling over the network, but how hard can it be to get something going with good power management?

I think I'll buy a thicker phone, with a bigger battery, next time.

So yeah, I delivered the phone for repair and got a HUAWEI Ascend Y100. A snug little phone that runs Android. But typing things on it is a real pain, the keyboard and screen is much too small.

As I use different Android devices it is nice that they run the same icons, system etc. If I know one Android Phone I know them all.

I think that will be a good thing for Android, that you can go between devices and have calendaring and contacts sync over different models and that for example resetting a borrowed phone is the same on different models and easy as going through a couple of menus (privacy tab in settings).

[Permalink] [By morphex] [Android (Atom feed)] [16 Nov 15:04 Europe/Oslo]

I'd like a split personality phone please

So, I've been without a portable phone (using a big Samsung Galaxy Tab now) for a week, as the HTC One X suddenly got a black screen.

Being without something to constantly look at and play with, naturally some thoughts around smartphones and their use have popped up.

I don't like lugging around a lot of stuff, and I like to work *and* play with my phone, so I'd like one that runs in two modes. Regular mode, with games, Facebook, Twitter and those kinds of apps, and one mode for work, which is better protected, password-protects the screen faster etc.

I guess you can put more than two modes on the phone as well, but those are the ones I can think of now. Maybe a simple button on the phone that switches between the modes, and these modes are completely separate in terms of kernel- and user-space processes.

Have the protected mode in a paranoid configuration so that if you for example switch to regular mode and switch back, the password-protection is there immediately.

Sounds good to me. :)

[Permalink] [By morphex] [Technology (Atom feed)] [11 Nov 19:55 Europe/Oslo]

Spotify without Wine

So, after firing up Spotify in Wine a couple of times I got the message that I was running Spotify on an unsupported platform (with a link).

I opened the link and found that Spotify for Linux is in technology preview state. Fine, got some instructions on how to install it and followed them and voila, Spotify for Linux installed. Of course it was debian-package based which seems like the way most software organizations distribute software for Linux these days.

It works very well, looks a bit better than Spotify in Wine. Music sounds good etc. so it's a win. :)

[Permalink] [By morphex] [Linux (Atom feed)] [10 Nov 19:57 Europe/Oslo]

Spotify with Wine

So I try different things now and then, Linux, Windows a little bit of Apple. These days I'm keen on playing around with Linux again, and have Ubuntu Studio running as my main desktop.

I like music. I love music. So I thought I'd get Spotify installed using the Crossover "Windows-for-Linux" plugin, as I got a free 12-month deal on Halloween on the CrossOver plugin.

So yeah, installed CrossOver and downloaded the Spotify installer, but the installation process hung and I exited.

Thought I'd try regular Wine (1.4) instead, located the Spotify installer in /tmp and installed. And yes, it works fine. :)

Maybe we'll see more and more developers more aware of the Linux platform and developing in a way where Windows apps work transparently on Linux with Wine, that would be nice.

I leave you with this: spotify:track:4er8NyQ8cFnZ2b643Tjc44

[Update..] Here's how Spotify looks on Linux:

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

Skype on Linux, upside down video

I'm going to start using Skype more, or "chat software" in general so I got Skype fired up today and logged in.

Everything was fine, except the video camera (video chat) had the image turned upside down.

Some googling later I found the fix, and here's a small tutorial for an Ubuntu box:

cd /usr/bin
mv skype skype.bin
emacs skype

Paste this into the file:

LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/ exec ./skype.bin

save, and run

chmod +x skype. Next time you fire up Skype via the terminal, video should be correct vertically.

[Permalink] [By morphex] [Technology (Atom feed)] [29 Oct 14:57 Europe/Oslo]

HTC One X running Netflix app with Media Link HD streaming to TV

Some months I suddenly felt the urge to buy a new smartphone, and got myself a HTC One X smartphone. I've been using it over months now and am satisified with how it works. If I use it a lot, the phone needs to get charged during the day, but I'm not sure what the reason for that is, might be many apps running polling and pushing over the network.

I've been looking for a TV-adapter for the phone, but couldn't find any. Looked around many places, and no-one had an adapter. So I was pleasantly surprised when one salesman said they had a wireless HD adapter (Media Link HD) that pairs with the HTC One X. So, OK, I bought it.

Setting it up (pairing the phone with the adapter) was as easy as plugging into the power adapter, connecting HDMI and swiping some fingers on the phone and they autoconfigured and were ready to go.

I've played around with the phone and adapter for a couple of days now, having struggled a bit with for example choppy playback of video, and sound lagging a bit.

Here's the phone streaming to the TV yesterday.

So I took a look at the processes that were running (task manager) and stopped a lot of them, Facebook, Maps etc. - all non-essential processes.

And that made a big difference, now playback is almost perfect, some minor hiccups once in a while, but nothing that can't be pragmatically overlooked.

Well, that's that. But I'd like to see an app that can instantly kill all non-essential processes, or a setup where some programs like those who display video and are a bit "heavy" can get maximum CPU priority so that other apps running don't disturb the playback.

Oh, and I would probably be good with an app that can diagnose things relevant to streaming over Wi-Fi, such as network bandwidth, network latency, CPU used by background processes and so on.

[Permalink] [By morphex] [Mobile (Atom feed)] [25 Oct 19:08 Europe/Oslo]

New monitor setup

So I got a new monitor the other day, was walking around downtown and visited a computer store.. asked why the 27" 3D monitor was the same price as another plain 27" monitor and the salesman explained that it has been used for demos, so OK I bought it.

Came home, plugged it in and it didn't work very well. So I took it back, they confirmed it was broken and got me another one, the one that was actually on display.

I must say, so far I'm very happy with having an extra monitor and a big one at that.. lots of space, and it is possible to have several terminal windows up with different code which makes things a bit easier to work with.

Here's a one-terminal screenshot of the new monitor space, I'm running Ubuntu with 2 monitors, one 27" and the other on the laptop. The laptop isn't heavy duty so I was surprised that things are so snappy on the big screen as well:

[Permalink] [By morphex] [Technology (Atom feed)] [18 Aug 10:59 Europe/Oslo]

Having some networking fun

Today, somewhat inspired by my brother who has gotten mobile broadband (which works well), I bought myself some new networking gear.

It's a Netgear Powerline Nano 200 WiFi Set, which works by plugging in an adapter in one end and a another in the other end, hooking up the former to the router via ethernet and configuring the latter (via ethernet) to set up wireless access.

I had some small issues configuring the wireless adapter, but the setup tools for the adapter worked out on the second try.

Nothing big really, but at least I now have 5 bars on the WiFi, larger capacity for data transfers and a good ping to boot. Small things like these matter when you're working on a computer all day, feels smoother and snappier.

[Permalink] [By morphex] [Wireless (Atom feed)] [13 Aug 12:52 Europe/Oslo]

Creating a relatively safe and portable Linux setup

So, over the last years I've become more aware and focused on security and doing things securely and "hygienic" so that different activities don't transfer security issues between different platforms.

One trick I've been using is to have DVDs/CDs with some live Linux distro running, so that between activities the system is shut down and any contagion from one activity doesn't transfer over to another.

This approach works well, but it is a bit slow starting up and doing different things.. waiting for the disc reader to spin up or do its thing is so slow at times that it can become annoying. And if you're really paranoid, the risk of malware hiding in the firmware or some other part of the computer is always there.

So yesterday I bought myself a USB stick, so I can install Linux onto that.. I'm going to use the Ubuntu Linux Live disc and do an install to the USB stick with that. I installed a Live/Install disc to the USB stick first using UNetBootin, but when booting from the stick and trying to install to the stick from the stick, it didn't work.

Interestingly it didn't work because for some reason the installer had to modify the partition table on the stick and couldn't do that when the stick itself was mounted. [Edit: The stick already had a partition configured, so why should it modify?]

Then, when I boot up from the USB stick for the first time, I'll install VirtualBox onto the USB stick Linux, and could run different activities within virtualized machines. I think I'll setup a script that can cleanly initialize a virtual box image, and then startup that image, so that each "work session" within a specific area is contained to that virtual box, and it is never re-used again.

Some other things that will need to go onto the USB stick Linux is a setup for WiFi as well as removing certain standard services such as CUPS that is configured to startup automatically and listen to a port which can be accessed by users on the same network and effectively becomes a potential security hole.

With an installation of Ubuntu as the USB stick Linux, I feel fairly confident it'll be able to work on most computers' hardware it is plugged in to. WiFi can be an issue, but I guess the trick there is to keep the Ubuntu up-to-date.

Well, that's the plan for now. I'll keep you posted. [:)

[Permalink] [By morphex] [Technology (Atom feed)] [22 Mar 20:21 Europe/Oslo]

PyPi - the giftconomy

So, I've added a page about my PyPi stuff here:

It lists my published Python/Zope/Plone packages, and over 7000 downloads of them so far although I haven't prioritized PyPi until recently. Sweet deals all around!

[Permalink] [By morphex] [Python (Atom feed)] [07 Mar 14:14 Europe/Oslo]

Battery drain

I keep playing with the Galaxy Tab, and found that it was using up the battery quite quickly, even in "sleep" mode.

Well, I found "SystemPanel App / Task Manager" in the Android market after reading up a bit about it, and it runs in the background now and kills processes that are eating up battery, costing about 18 NOK to download and install from Nextapp.

The iPad had something like this built-in and battery lasted for a long time without any "hacks" being made, so score for Apple in the easy-to-use department there.

However, I do like the "rawness" of the Galaxy tab, installing the task manager gave me an overview of CPU usage etc. and which processes that are running, something more Linux-like than the iPad, and I've played with Linux for many years.

[Permalink] [By morphex] [Samsung Galaxy Tab (Atom feed)] [03 May 13:16 Europe/Oslo] - a cool streaming service

As mentioned earlier on this blog, I've found Voddler(.com) - a nice video streaming service.

I'm quite happy with it, as the process of viewing content and that it has new movies makes it nice to use.

It also has a host of free movies, some old, some new that we're watching in the evenings.

One nag I have about it all, is that when streaming starts up there is a "video jingle" of Voddle which is too loud, and it is annoying to turn the volume down, to then turn it up again because actors in the movie are inaudible.

[Permalink] [By morphex] [Voddler (Atom feed)] [30 Apr 14:38 Europe/Oslo]

First impressions, Samsung Galaxy Tab

So, I've played with the Samsung Galaxy Tab(let) now for a couple of days, and so far - I like it.

Early on I found a cool background feature, which creates a 3D animated background which also responds to touch gestures.

It is smaller, but thicker than an iPad. It also looks like it's good a good resolution, as games and other graphics are quite smooth on it.

One thing I find a bit nagging, is that scrolling in the browser for example, is a little bit choppy. On the iPad that was completely smooth scrolling.

There are lots of apps for the Galaxy Tab, and so far I've found Spotify, Tweetdeck, Firefox, Opera Mobile & Opera Mini + a Hold'em poker app and some other things.

That it is smaller than the iPad is nice, as I can but it in my jacket which makes it more portable.

It looks like it has a poorer battery life than the iPad, but that might be my settings and not closing apps.

So, impressions so far: good. A 4 out of 6.

[Permalink] [By morphex] [Samsung Galaxy Tab (Atom feed)] [30 Apr 14:31 Europe/Oslo]

Dealing with the old, finding the new

So, long time since the last update.

Today I got a Samsung Galaxy Tab in the mail and have a new toy to play with. My old iPad 1 got sold, and it took about an hour or two of advertising until a buyer bought it from me (maybe I sold it a bit too cheap).

Anyway, good to get rid of old things as they're likely to just collect dust anyway.

I've also after some ruminations found a good service for streaming movies (and maybe TV shows) on A little bit cheaper than renting physical DVDs - and that's OK.

I'm using Hilde's old laptop to stream movies, and it is *just* fast enough to stream movies. You'd think a dual core laptop processor @ 1.73 Ghz would be more than enough, but no. Hooked up via VGA to the TV, and the TV is connected to the surround system.

The old laptop is an Acer, and I think they had some problems for a while with a range of overheating laptops, so luckily I had an USB-pluggable cooling pad that lies beneath.

Otherwise in the health department, all things are looking up. Started exercising more and it helps. Some flashbacks and issues from the past are popping up but things are overall easier than before.

[Permalink] [By morphex] [Technology (Atom feed)] [26 Apr 17:24 Europe/Oslo]



[Permalink] [By morphex] [Technology (Atom feed)] [06 Dec 21:37 Europe/Oslo]

Too much data

I see that Facebook is happily tracking users.. There is more and more information becoming available..

And with these multi-input machines, one is ultimately susceptible for more sureveillance...

That's why I'd like a hardware switch, similar to what you use to turn the light on and off.

That way, you'd be able to make perfectly sure that noone is listening to what you're saying, or seeing through the camera on your device.. After all, people that understabd security, know that it is impossible to make a device unhackable, if it is connected to and used on the web.

[Permalink] [By morphex] [Technology (Atom feed)] [30 Nov 19:37 Europe/Oslo]

A bootable USB stick with Linux

So, I sold my Asus Eee PC to my brother Tor Inge a while ago, because I wasn't using it much.

I had installed Linux on it, so it had Windows XP and Ubuntu.

Well, the machine crashed in some way, and required a reinstall of XP. After some fiddling I found that partition 3 had an XP reinstall set of files, and using it didn't work (maybe because of repartitioning the PC to use Linux as well).

Well, I searched a bit and found - a great tool to setup a USB stick as a bootable device. I'm currently installing Puppy Linux.

And on a related note; sucks, it seems more like an advertisement trap than something that can help you get install bootable Linux on a USB stick.

[Permalink] [By morphex] [Technology (Atom feed)] [01 Nov 12:30 Europe/Oslo]

My next phone, and Apple, HTC and TomTom

I've been wondering what my next phone will be, at times I've been tired of my old Nokia E90.. It discharges very quickly these days, I'm not sure why, it seems as if the battery started getting worn out after I switched to the Telenor mobile operator.

I've bought a 2,5mm to 3,5mm plug, and am able to use Spotify with headphones and it works well. Volume buttons inside the E90 enables music at the right volume.

My next phone.. well, I might just buy a battery for the E90.

If not, the match is between iPhone and HTC Evo 4G. I asked a salesman at the local mobile store, and he quite plainly said that unless you're an Apple fan, the HTC Desire is a good choice or another HTC phone is the best.

I've been looking at the HTC HD2 with Windows mobile, but he said it basically sucked.

I feel the iPhone screen is a little too small, and the 4,3" display on the GPS feels a lot bigger. Which reminds me, TomTom could borrow a trick from Apple and implement a keyboard and touch system that doesn't suck.

[Permalink] [By morphex] [Technology (Atom feed)] [17 Jun 21:56 Europe/Oslo]

Some more impressions of the iPad

So, I've played a bit more with the iPad, and I'm getting comfortable with it. Discovered the Keyboard configuration screen, so I think autocompletion (auto-annoyance) should be better. I wouldn't mind autocompletion but I didn't like the way it worked and cludged up things.

I still think the keyboard could be better, I'm holding the iPad with both hands and typing with my thumbs.. there might have to be some special mode for that.

I've found two annoyances with Safari, one is that it doesn't scroll (some) textareas correctly (no scrollbar is present), the other is that it doesn't handle <iframe> elements correctly. Or, at least I know the iFrame and such works correctly on other browsers.

I see there are lots of apps, and I want to test many of them. In that case, the App store / iPad apps don't go all the way. I'd like to see some shareware-like feature where you can try an app for x active hours, 1-7 days or something similar.

I'd think that would save the app developers some time too, as they would be able to tick a box or two to enable shareware features, instead of building a separate app for demonstrations.

OK, the apps that demo one of their best features in the demo might come short, but try-before-you-buy.. that's something.

[Permalink] [By morphex] [iPad (Atom feed)] [08 May 18:01 Europe/Oslo]


I've played with the iPad for a day or so now, and the thing I'm stuck with is.. how?

How are they able to make such a thin, screen, really - behave like any computer? It feels sleek, the on-screen keyboard works well. I've even seen heavy-duty 3D racing games where you move the entire iPad as the driving interface (steering wheel).

How, how, how? :)

Well, it looks like Apple are doing a lot of things. Making a (somewhat closed) content and application delivery platform, a well-designed (aestetically) device and a prong for web standards. It's also easily usable by most people I would think.

[Permalink] [By morphex] [iPad (Atom feed)] [23 Apr 18:19 Europe/Oslo]

My first iPad

No description available

[Permalink] [By morphex] [iPad (Atom feed)] [22 Apr 22:07 Europe/Oslo]

Opera Mini, FTW

I've installed Opera Mini on my PC, while using the Nokia E 90 as a mobile modem.

Using the microemu program, I'm able to use Opera Mini at 1000x600 pixels or so, see (clickable) screenshot:

No description available

On a separate but slightly related note.. why doesn't VG (, one of the biggest newspapers in Norway, have automatic go-to-mobile version of the site for Opera Mini et al?

BTW, Opera Mini is FAST, and great.  :)  The microemu thing doesn't steal focus, lock the keyboard/mouse or anything.

[Permalink] [By morphex] [Technology (Atom feed)] [03 Apr 12:31 Europe/Oslo]

It's not all about music

Quite interesting application of hardware, software and microphones. I saw this on the Discovery channel. Ingenious really. :)

What a little math can do.

[Permalink] [By morphex] [Technology (Atom feed)] [02 Apr 16:48 Europe/Oslo]

Well, they can't even make drivers that work on Wintel

So it isn't a surprise that they have to prioritize. Some light could let their flowers bloom.

[Permalink] [By morphex] [Technology (Atom feed)] [26 Mar 23:57 Europe/Oslo]

Plone in Brasil

Brasilian government on Plone. Bra as we say in Norway. :)

[Permalink] [By morphex] [Plone (Atom feed)] [10 Mar 19:23 Europe/Oslo]

New phone and personal progress

So I'm thinking of a new phone again, and the iPhone looks tempting.. My second oldest brother's clique are into HTC Hero and that looks good too, but the iPhone is sleek.

So, I think I'll go for an iPhone soon, it has a large user-base and good momentum so yeah.. it looks good too. And brownie points for drawing the line regarding child labour.

I'm looking at the Telenor pages, as I'm also considering switching from Netcom to Telenor (it sucks to be at a friends cottage up on Geilo without coverage). I had a GREAT time there this weekend by the way.

Anyway, in slightly related news (about my health), I'm starting to feel again.. I think I've been numb for a long, long time, or at least feeling and thinking something different than what's usual. It is good, but also scary. I had a dream while taking a daytime nap about loosing Hilde, and it felt bad, like it should. I guess it is better to have nightmares while you're sleeping and waking up from it, rather than going around in some kind of emotional veggie-state.

I don't know what the fuck it has been, but I know for example that I could've been in a state of paranoia/delusion for a long time, and at times when I have taken the time to face it, I could beat the bad feeling and delusions and have a glimpse of normalcy, while at other times I guess I've just "worked them to death" and run away from it by being a workaholic, an internet addict and trying to fix my nightmare-ish thoughts by shoveling imagery of crap into my head.

[Permalink] [By morphex] [Technology (Atom feed)] [28 Feb 18:39 Europe/Oslo]

A treasure trove for those with hidden agendas

As it breaks in the news that people are being wiretapped ilegally, here's a choice quote:

'No 10 also issued a statement, saying: "The scale of this is absolutely breathtaking and an extreme cause for concern."'

The internet and the phone business is a jungle, with smartphones and unlimited data plans become the norm. Who bothers to check their data usage if it is unlimited and doesn't cost more?

If you get in a piece of malware (piece of data, some 3rd party advertiser with malware etc. or simply an MMS with a virus) you could be easily cooked.

People with hidden agendas can build up a treasure trove of information where they can analyze you to a tee, or just see what can be damaging or embarassing. It is a literal front door to your innermost being, with things you might not even share with your closest friends and could be a place dump damaging information. On the other hand, people with hidden agendas could also manipulate the input you get, by seeing where you surf and what you read and make things seem different than they are.

I guess you should assume that you're always compromised and that people can see EVERYTHING on your PC and Phone, and try your best not to become a Person Of Interest.

The internet is a big intertwined ball of connections without borders, and I think Psy-ops could be the new tool of choice. If it hasn't always been.

That's the web, free, open and unorganized. But also an uncharted jungle.

[Permalink] [By morphex] [Technology (Atom feed)] [24 Feb 18:28 Europe/Oslo]

Logitech ClearChat Comfort USB

So I bought a new headset, as seen above. Trying it out and it sounds good so far. Haven't tried the chat function yet, will have to save that for later.

I think it cost around 60 USD, and it feels like a fair deal so far.

[Permalink] [By morphex] [Audio (Atom feed)] [22 Jan 17:38 Europe/Oslo]

Interested in AI, I can take it, it'll make me stronger

[Permalink] [By morphex] [Technology (Atom feed)] [27 Oct 20:59 Europe/Oslo]

Ubuntu installed!

Today I got Ubuntu installed on the netbook. It was peaches. :)

But that's probably becaused I've got experience with installing Linux from somewhere in the middle of the nineties (Red Hat, Slackware)...

So, I read up here and there on what to do. Lots of documentation and heplful hints. After reading through various docs, I found

Unetbootin, which could transform a USB-stick into a bootable .. thingy. So, I fired up Unetbootin, plugged in a USB-stick and selected the latest Ubuntu Netinstall. It didn't take long, maybe half a minute and I had a bootable stick.

Another thing documentation mentions on the net is that you need to press the Esc key when the Eee is starting up, to get to select the USB-stick as a boot device.

That's what I did and the Linux installer started booting.

As I mentioned, I've installed Linux countless times, and the Ubuntu console install is pretty similar to Debian which we use at Nidelven IT, so this was familiar. However, I hit one snag, and that was the retrieval/install/configure phase of the installation of Ubuntu...

I'd selected the basic, desktop, netbook remix and openssh server options for package groups, and the installer choked on that after progressing 10% or so.

So, in something that was a Zen-like moment, I unselected the netbook remix group and tried again - and it worked. :)

I've now got Windows XP and Ubuntu installed on the netbook, and it seems to be working just fine!

[Permalink] [By morphex] [Asus PC Eee 1000HE 10" black (Atom feed)] [31 Jul 00:28 Europe/Oslo]

Getting used to the keyboard

So, after having used this .. "mini-pc" for a day or so, I'm starting to get used to the keyboard. Switching back to my old laptop earlier today was weird though.. not used to the keys being where they are.

This thing performs well, it was a bit sluggish earlier today, but that was because of the scheduled virus scans.. I've got a trial of some software (AVG) installed and will probably buy that when the trial is over.

Unless I get Ubuntu installed, and can start using that.

So far, very happy with my new PC. :)

[Permalink] [By morphex] [Asus PC Eee 1000HE 10" black (Atom feed)] [30 Jul 17:59 Europe/Oslo]

Asus PC Eee 1000HE 10" black

Today I picked up a new netbook, the Asus PC Eee 1000HE. It runs Windows XP and is fairly snappy.

I've installed the essentials (Thunderbird, Firefox, putty, Spotify and AVG) and it seems to be working well. Even updated via Windows update to get the latest fixes.

One gripe is the keyboard which is taking some getting used to, but if I use this as my main work PC it shouldn't take long to get used to.

The touchpad is a bit sucky, but it might be that it just requires some use before it becomes.. usable.

Next thing to do is to get Ubuntu installed

guess I'll have to get a USB stick for that. I think this will be a good tool to use, feeling optimistic about it. More posts about it later.

[Later..] Getting slightly more accustomed to the keyboard, but it is scary how close and easy it is to mix up the enter and backspace keys.. don't want to be working with 'rm -rf' too much there. :)

[Permalink] [By morphex] [Technology (Atom feed)] [29 Jul 21:43 Europe/Oslo]

Windows copy

[Permalink] [By morphex] [Windows (Atom feed)] [23 Jul 12:20 Europe/Oslo]

Opera mini

I've found that Opera mini is quite good when surfing on my mobile phone. It is fast in use (scrolling etc.) but as I understand it, they also compress the content retrieved, scaling down images etc. One gripe I have about the Nokia E90 is that it is slow and sluggish. With Opera mini however, it works well.

[Permalink] [By morphex] [Internet (Atom feed)] [21 Jun 19:04 Europe/Oslo]

Decisions, decisions..

[Permalink] [By morphex] [Firefox (Atom feed)] [31 Dec 10:31 Europe/Oslo]

Old school ASCII art

(Thanks to Skjaeve for the link)

[Permalink] [By morphex] [Technology (Atom feed)] [19 Dec 11:14 Europe/Oslo]


Python 3.0 is released:

[Permalink] [By morphex] [Python (Atom feed)] [04 Dec 13:10 Europe/Oslo]

I'd like to see that as well;cid=2400...

I'm sure a lot of people have had that thought before.

[Permalink] [By morphex] [Web (Atom feed)] [30 Jun 22:22 Europe/Oslo]


[Permalink] [By morphex] [Firefox (Atom feed)] [13 Jun 11:23 Europe/Oslo]

Cool stuff

Whisking away in a car at 90 km/h in the middle of nowhere, and I still get EDGE level internet access on my phone - that is very cool. Will be visiting family this weekend, and attending a festival called Vømmølfestivalen. Maybe do some linkage afterwards, so you'll see what it is all about. :)

[Permalink] [By morphex] [Technology (Atom feed)] [29 May 20:45 Europe/Oslo]


I've been skipping reading blogs and feeds for a while (using Bloglines for feed reading, works great).

Anyway, after reading Mozillazine's post on the latest Firefox beta:

and seeing you could install a separate version of Firefox without it messing around with the Firefox version I use regularly I thought why not.

Here's the link to the portable app version:

I'm playing around with Vista these days, and I don't have the time (or inclination) to learn about how to backup the default Firefox profile so yeah, it seemed like a good idea.

What can I say, Firefox 3 rocks. It looks good, and it is fast as hell. Props to all the developers for this one. If I had to use one word to describe Firefox 3 it would be snappy.

I've seen Vista get a lot of flack, but it isn't that bad actually. A bit slow perhaps, and it gives the BSOD every time I try to connect to Nokia Communicator E90, but otherwise it's OK.

Oh well, have to test new things I guess, back to Ubuntu soon. :)

[Permalink] [By morphex] [Firefox (Atom feed)] [27 Mar 12:27 Europe/Oslo]

Editing online

Using my phone to blog a bit, and it is working well.. Surprisingly, the javascript features I added a long time ago still work, even if it is an unusual browser.

Oh well.. time to chill. :)

[Permalink] [By morphex] [E 90 (Atom feed)] [28 Oct 17:02 Europe/Oslo]

Top ten

VG, I guess the biggest newspaper in Norway, both in print and online, have a top-ten list over good reasons to choosing Linux:

Guess you don't need a big marketing budget when the product.. sells itself through word of mouth. :)

[Permalink] [By morphex] [Ubuntu (Atom feed)] [19 Oct 02:56 Europe/Oslo]


I noticed there were some problems with my feed this morning, which made it break badly. Well, it is duct-tape fixed for now, but I'll be pushing out a new release soon with a better fix.

[Permalink] [By morphex] [Issue Dealer (Atom feed)] [14 Oct 14:28 Europe/Oslo]

On second thought

I read a very interesting comment on /.:;thresho...

and giving it some thought, I think those at the top @ Microsoft might know that there are holes in the dam and that the desktop monopoly is about to bust. Maybe it is just about buying time to entrench other markets and earn some more money on the desktop bit while they can..

[Permalink] [By morphex] [I <3 my Linux (Atom feed)] [11 Oct 23:55 Europe/Oslo]


It's the newest, hottest thing in communication. Being based on commodities, it easily becomes a platform for 3rd party developers. Its compact design and tasteful color makes it a perfect accessory for those of you who are.. consumed by how things look.

For example, you can easily create a multimedia messaging system on it, by using simple things such as a rubber band and a Polaroid picture. Fasten the picture to your iBrick and throw it through your friends window. For extra effect, you can scream before, during and after the throw - imagine that!

Of course, with such treatment it may scratch or wear out, but that's no problem as the monetary benefits of your new social status with the iBrick will enable you to buy to your hearts content.

[Permalink] [By morphex] [Apple (Atom feed)] [11 Oct 18:34 Europe/Oslo]

I <3 my Linux

Yesterday I bought myself a printer; I haven't had one for years as I've been trying to go "paperless".. but, things being what they are, you have to print documents at times, sign them and get them scanned in some cases.

That's why I bought an all-in-one printer from HP (Officejet) which supports printing, scanning and faxing.

Yesterday the printer was setup, and setting up the printer on Linux was peaches; just search for a printer, and there it was found - on the network.

Today though I had to scan some things as well, and XSane couldn't find the scanner, so I had to download and run the HPLIP installer:

it asked a bunch of questions, un-installed the default HPLIP installation and installed itself. Easy enough, but maybe not that easy for mortal users.

So, now I have a printer and scanner on the network, and it's working quite well. I remember the days where setting up a printer in Linux could be quite a job, with kernel compiling, library dependencies, special applications and whatnot.

Linux sure has come a long way, and in some areas it is better than Windows, even though Linux is Free.. it's interesting to see Ballmer the monkey scream and jump around about how Linux infringes on their intellectual property, trying to scare people and organizations from using it and getting a cut.

Sure, some things in Linux are copied or pretty similar to what's in Windows, but then again, how much has Microsoft copied from others without paying a dime? And how many dirty tricks has Microsoft used throughout the years to build and maintain their monopoly?

The distaste for Microsoft grows for each day, and even if they come up with cool things every now and then, it just doesn't appeal to me, getting or using something that is tainted by their past and current antics.

What would the world have looked like today, without Microsoft? One can only wonder..

[Permalink] [By morphex] [Ubuntu (Atom feed)] [11 Oct 17:44 Europe/Oslo]

Re-installing Ubuntu

A while ago I managed to screw up my Ubuntu installation by upgrading to an experimental version, and as a result of that I ended up running Windows XP for a while, because I didn't want to spend time fixing my Ubuntu installation.

But, lately I've been having problems with my Windows installation lagging and being irritatingly slow, so I'm back to Ubuntu Linux again. At least with Linux, I know when it is my fault when something breaks.

I'm actually blogging this from the computer I'm currently installing on, which is in itself a very cool thing. Wireless and everything works out of the box.

[Permalink] [By morphex] [Ubuntu (Atom feed)] [10 Oct 16:35 Europe/Oslo]

Another view of Facebook

[Permalink] [By morphex] [Facebook (Atom feed)] [09 Oct 00:42 Europe/Oslo]

This E 90 is a sweet device

I'm really warming up to the E 90. Been playing some more with it now, and yes, it was a good buy.

Not 100% comfortable with the keyboard yet, but all the bells and whistles on this phone are just great.

I can set different ringtones for SMS messages (even MP3s), received calls and other things (currently using some pretty cheesy but funny ringtones), it works as a modem for my laptop (which came in handy, as my ISP has issues right now).

Using the E 90 as a modem was painless. Just plug it in, start the Nokia suite and open the internet connectivity tool, connect and start surfing.. yay for price caps on internet access!

Getting 198 kbit/s down and 67 kbit/s up when surfing via the phone, which is nice. :)

[Permalink] [By morphex] [E 90 (Atom feed)] [28 Sep 01:56 Europe/Oslo]

E 90

So, I've been playing a bit with my Nokia E 90, which I received last week.

First impressions: it's a big phone. Not only in size, but also in its capabilities. It plays Youtube videos, lets me download just about any music I want ( thank you very much) and it's all good.

One small gripe with the device is the keyboard however. It just doesn't fit, and finding keys in the dark is proving difficult (maybe that gets easier).

So far I've installed instant messaging, an IRC client, a SSH client (putty for Symbian, yay) and some other things.

It's cool that the device has two screens; one big internal one, and one regular "mobile phone" display. So I can load up a video in Youtube using the browser and navigating with the keyboard, then close the phone and have the video display on the front. Neat.

I'm going to try to use it as a "connecting device" for my laptop soon as well, to see if its wireless, 3G and other capabilities enable me to use it as a kind of modem. Will let you know how it goes.

[Permalink] [By morphex] [Nokia (Atom feed)] [24 Sep 17:03 Europe/Oslo]

Go play yourself

A new release of the Issue Dealer is out of the door, mostly a bugfix release which caught some bugs that I missed earlier.

As always, available from here


[Permalink] [By morphex] [Issue Dealer (Atom feed)] [26 Apr 12:09 Europe/Oslo]


I joined Facebook a little while ago, and after using for a couple of weeks, I must say, that's the best social networking site I've ever used.

I've found old friends that I haven't talked to in a looong time, and I'm sure there will be a lot of things happening as a result.

Orkut, Tribe, Myspace and so on - beaten hands down. I'm hooked on Facebook. :)

[Permalink] [By morphex] [Internet (Atom feed)] [22 Apr 07:59 Europe/Oslo]

More time

Well, another release of the Issue Dealer is out the door. Now you've got more ways of seeing issues past their due date.

Next release will contain a fix for the "zope" search bug, thx Shastry!


[Permalink] [By morphex] [Issue Dealer (Atom feed)] [05 Apr 21:38 Europe/Oslo]

Two quick hits

Recently I ran into a couple of .. issues where customers had either made mistakes or couldn't figure out things.

These were issues that I had run into earlier so being slightly annoyed (itch) I decided it was time to do something about it (scratch).

The first was a customer who managed to run a link-checker on their Plone site, and having the link-checker be logged in, which wrecked havoc as a lot of things in Plone can be done by clicking links. So they had well over a thousand transactions done in the course of 4-5 hours. Restoring from backup would've been simple enough but some important changes had been made prior to this "bot attack" so I didn't see reverting to backup as an option.

This is something that has been a problem earlier as well, so I decided to dig a bit into the undo machinery of Zope to see if it could be fixed. And there, after reading a little bit of code I could see that it would be possible to undo things based on a date. So I wrote up a tool in a couple of hours to test this theory and to my pleasurable surprise it worked.

The product-ified version of this fix can be found here

it should probably be a part of the Zope core distribution (it's an obvious, useful feature) but I'm too lazy to get it submitted. If someone wants to do it, feel free to do so - I'll slip it under the ZPL or something similar.

Another thing that bugged me was a customer that was using up a lot of diskspace (itch) (which we would have to charge for) but they claimed they weren't adding large objects to the database. So, fair enough - this is something I've dealt with before and I got another idea: use the database export feature to get a readout on which objects in the database were using the space (scratch); the result is here:

a rather cool hack in my opinion, which uses a dummy file to get a count on which objects are taking up space. Turns out something in the customer's system was writing transactions (and often) so a database pack discarding *all* old transactions was all that was needed.

Now, it would be interesting (and fairly easy) to see what's writing all those transactions as well, but that's one for later.

[Permalink] [By morphex] [Zope (Atom feed)] [13 Mar 19:31 Europe/Oslo]

4 years and more

Tomorrow it will be 4 years since I registered the Issue Dealer on freshmeat. Yay.

I don't remember the exactly the day I started writing the code, but that's life. :)

[Permalink] [By morphex] [Issue Dealer (Atom feed)] [09 Mar 14:02 Europe/Oslo]

Mail whoes

Got a nasty surprise today after working on the Issue Dealer and setting it up as a support back-end for email. Had some mail aliases and such going and email addresses that wasn't registered with the mail handler so things started looping.

Ended up with 10's of thousands of mail messages in my inbox, and managed to starve our main mail system of resources so that some customers complained about being able to login and receiving mail.

But oh well, lesson learned here as well. Be very, very careful with aliases and programming email applications. Sending is simple enough; but receiving, handling and sending is another matter entirely.

[Permalink] [By morphex] [Internet (Atom feed)] [01 Mar 00:57 Europe/Oslo]

More features

Added some features to the Issue Dealer in the latest release. Incoming mail messages can now be tagged and have due dates, for improved control..

Get your fix here:

Maybe I should get off my butt soon and start pushing this product. Or maybe do juuust a little bit more? ;)

[Permalink] [By morphex] [Issue Dealer (Atom feed)] [20 Feb 18:46 Europe/Oslo]

New external harddrive and mouse

Got another external harddrive today, a casing and a harddrive. Easy to setup and works like a charm in Ubuntu, just plug it in. It runs a bit hot though, and I guess it is a bit noisy. But it works.

I'd namedrop it, but the packing doesn't say anything. Oh, it does say in the order confirmation: Zynet hard drive cabinet. So there you go. A nice Samsung Spinpoint hard drive as well.

Also got a new Logitech mouse, an LX3. The scroll wheel is a bit flaky, but it works too, was also just plugging in.

Gotta love Linux these days.

[Permalink] [By morphex] [Hardware (Atom feed)] [13 Feb 16:21 Europe/Oslo]

Don't drink (and get very drunk) and do websites

I'm sitting here sipping some Baileys and thinking to myself - "this is good stuff." So I thought I'd visit the Baileys website ( and have a look.

First I get asked where I am and what my birth date. Fair enough, I guess they have to do this stuff for legal reasons. I enter Norway, 10th of May 1980 click on "remember" and enter. Then I get a page which says "You're not authorized to bla bla." That's what the fuck #1.

So I enter and voilà, the website shows up. I see some flash icons (I have flash blocker installed, thank god) and select to view the flash things since obviously the site depends on it. I click on a "link" and once more, the flash symbols appear. That's what the fuck #2.

What is it with these brand/media sites and having flash? Can they not create a website that makes *subtle* use of flash? I mean, what the fuck? ;)

[Later..] Aha. Just got an idea. Maybe the flash blocker should have an "enable flash for this website" thing? It does have a whitelist, but it is kinda hard to get at. Hmm.

[Permalink] [By morphex] [Web (Atom feed)] [08 Feb 01:41 Europe/Oslo]

Zelda is pretty good

Been playing around with Zelda some more, with Remi - my sisters boyfriend. After the initial few hours of gameplay (which didn't impress me much) I'm growing fonder of the game. Maybe it just took some getting used to.

The graphics were not all that to begin with, but after a while they become good enough and it is really the playability that counts. The Wii controllers are something else, and it is easy to spend hours in front of Zelda without noticing how time flies by.

Unfortunately I don't have a wireless router, so I'm not able to connect to the net yet, but once I do, I'll be downloading some of the classic games, like Super Mario Bros 3. I'm maybe getting a bit old for games like this, but what the heck, remembering how fun and all-absorbing it was to play these games in the past, I'd love to have that feeling again.

I have great respect for what Nintendo has done, from their NES to the Wii today, and at some point in my career, I'd like to work with them to see how they manage to create these marvelous things, and maybe make some significant contributions.

[Permalink] [By morphex] [Nintendo Wii (Atom feed)] [23 Jan 16:13 Europe/Oslo]


Purchased a Wii console today, along with Zelda. First impression: this could be interesting.

The console also came with Wii Sports, a collection of things you can play, like baseball, boxing, tennis and so on.

Will post more about it later, now I've gotta try this thing out. :)

[Permalink] [By morphex] [Nintendo Wii (Atom feed)] [19 Jan 13:06 Europe/Oslo]

Idling by

There's something screwy with my internet connection, so surfing the web and reading email is a bit .. annoying because of the slowness and connection timeouts.

Luckily the gym opens in less than 2 hours, so I'll be able to go work out a bit. Going for the step-master (or whatever you call it) and doing some weights afterwards.

For breakfast this morning I took some left-over cheese cake but couldn't finish it (was super-hungry so I just had to grab something). Felt stuffed after eating a little over half of the slice so the rest is still left. I'm not sure what exactly is in it, but I think there's a lot of sugar, eggs and butter, quite the energy bomb.

These days there isn't enough time to do everything, there's customers on the one hand that want stuff, and cool behind-the-scenes stuff to do on the other. I'm looking forward to having a bigger company with more employees so that people can take care of and learn about stuff that I already know, so that I can work on more creative and challenging things.

But that time will come, for sure. Last year we had quite a growth and it looks like we'll be growing a lot more this year. In less than 3 weeks of the new year I've already gotten tentative approvals for new deals that amount to 15% of the total revenue we had last year. And that's not counting all the small fish.. :)

I'm enjoying this period. There's a little bit too much to do, but some customers are very understanding and flexible, so we're able to take care of everyone, if not at a breakneck pace.

Good times.

[Permalink] [By morphex] [Internet (Atom feed)] [18 Jan 04:47 Europe/Oslo]


I'm sitting here tailing my logfile, just idling waiting for something to happen.

It would be cool to see who's visiting the site, just have some sort of feed updating with visitor URLs or somesuch - with a link to the visitors webpage. You can have people reading your blog and linking to it, but not everyone is a blogger.

An X-visitor header could be something...

[Permalink] [By morphex] [Web (Atom feed)] [17 Jan 08:30 Europe/Oslo]

How about that, Flash 9 for Linux

Nice to see that version 9 of Flash is available for Linux. It sounds like it even supports esd so sound is working nicely too, even if I've got other things playing.

How cool.

[Permalink] [By morphex] [Web (Atom feed)] [17 Jan 06:09 Europe/Oslo]

Screen shot

A screenshot of an uncluttered desktop:

No description available

This is another excellent mandolux background.  Right click
the image an click on "view image" or something similar
to get the full-size picture.

[Permalink] [By morphex] [Sweetness (Atom feed)] [17 Jan 01:46 Europe/Oslo]

Some desktop backgrounds

Here you'll find some desktop backgrounds for your screen setup. Most backgrounds fit for 2 screens, some even for 3:

[Permalink] [By morphex] [Sweetness (Atom feed)] [15 Jan 17:51 Europe/Oslo]

!!! and one

A new release of the Issue Dealer has been dropped (0.9.112). This feature sports improved mail handling, including much stricter sanitation of incoming HTML messages, as well as verification for senders, meaning successful incoming spam messages should go down close to Zero. Enjoy! :) :)

[Permalink] [By morphex] [Issue Dealer (Atom feed)] [14 Jan 09:11 Europe/Oslo]

Speaking of interesting phones

Sure looks like a sweet phone, with embedded Linux and everything. I was thinking of getting an iPhone as it had a lot of the features I've been looking for, but if there is a phone delivered with Linux and can be extended with Linux-based apps - it would probably beat anything else, hands down.

I just wonder how good the keyboard will be, or if a good keyboard is available as an accessory.

[Permalink] [By morphex] [Technology (Atom feed)] [12 Jan 02:23 Europe/Oslo]


After playing around a bit with the X configuration on Ubuntu, I've finally got a dual screen setup working.

It is running Gnome, and the best part is that I not only have a dual screen setup, those dual screens work on each virtual desktop as well! On virtual desktop 1 I have Rhytmbox running in the left screen and various internet messaging tools in the right screen. On the second virtual desktop I have Thunderbird at the left and Firefox at the right.

This, people, is going to rock!

Here's a (poor) shot:

No description available

[Permalink] [By morphex] [Ubuntu (Atom feed)] [11 Jan 04:13 Europe/Oslo]

A little Christmas present

Pushed a new version of the Issue Dealer today, with improved mail handling. Good enough mail handling to put into production use, so now you have support for handling issues that come through the mail as well.


[Permalink] [By morphex] [Issue Dealer (Atom feed)] [24 Dec 12:32 Europe/Oslo]