Thursday, August 22, 2019

Firmware upgrade on ThinkPad

I do not know what could have been the last thing causing that much headache as the HDMI problem of my current laptop. After a succesful system update the external monitor was not recognized and stayed in a disconnected state. I spent some hours browsing false-positive forums hunting for a solution. Then I gave up and turned to the problem of updating the BIOS which in turn happened to be the solution to my display problem.
I was inspired by an article how easy it is to upgrade firmware on Linux nowdays. Of course my ThinkPad 13 is not supported by that... But at least it ignited my curiousity. Downloading the .iso image from the manufacturer's site was easy. To burn it on a pendrive - that was something! Lots of tool around the world to burn images, but noone tells you to unpack the .iso image first to a .img file. That was the missing link that I have learned from this video.
The main parts:
Thanks nixcraftcom!

Wednesday, February 7, 2018

Proxmox Backup to VirtualBox

When you backup a virtual host on a Proxmox VE, it is quite likely that you get a file named
something.vma.lzo . This happens to be an image packed twice. To unpack it one should call
  lzop -d a.c.lzo
Then
  vma extract  
But how can I get the vma command? It happens to be a Proxmox internal format. Fortunately a well built docker image is here to help:
  git clone https://github.com/ganehag/pve-vma-docker.git
  [sudo ]docker build -t vmaconverter .
  [sudo ]docker run -it -v [mydir]:/backup vmaconverter:latest /bin/bash
  vma extract ./file.vma -v ./vmaextract
As the last step the raw image will be converted to VirtualBox image:
  qemu-img convert vmaextract/disk-drive-scsi0.raw -O vdi disk.vdi
Cool.

Wednesday, December 16, 2015

Wind Screen Up

During evening developsing it might hurt to stay connected while database gets dumped. In the world of console driven operating systems there are several nice solution to that. One of them is the screen command.
With screen one can detach from an ssh session without interrupting the current execution, and later on it is easy to reattach and see what has happened.

Usage

Start it with:
$ screen
Detach:
$ <CTRL+a d>
Reattach:
$ screen -r
Reattach when multiple sessions:
$ screen -r <sid>
List running sessions:
$ screen -ls

Rejoyce!



Thursday, December 10, 2015

VPN breaks after 2 minutes

VPN breaks after 2 minutes

There is nothing worse than having a bad internet connection. I usually take some work home as operational tasks have to be done during the night. It is a bit funny that my internet connection at home is much stronger than the one in the office. But recently one of my VPN connections started to fail after 2 minutes. It was horrible, and I could not get a clue...
Of course it was my fault! Somehow my very own home network was configured in the IPv4 routes for the VPN connection. This caused a collision - a timed bomb.

Friday, April 24, 2015

Craft 2015

I just love it.
There is nothing comparable to the two days of technology recreation for a programmer.
Thank you for all the organizers and lecturers! It is unforgettable.
For all you poor fellows who could not make there, check out the site for the speeches!

Monday, September 29, 2014

Android on Budget

I have bought some budget Android phones for my children. It made me remember to my former phones where I had to take care of all the tiny details to get maximum power out of the machine.

The phones

Moto E

Amazing hardware for the price meets well optimized software.

Navon Mizu 502

Beast of a kind with dual SIM.

The problems

Cannot go back

To reach all the apps that I have bought on Play I have registered my very own account on their phone. One should take care though! When activating the phone the process takes time and you will not be able to turn of synchronization before it get started. When you get to turning off sync it should download a lot of information about you (calendar events, pics, etc.) already. Register first the account of the real user!
It seems to be a pain to move to a budget phone from a better one. 

State of ART

I wanted to test ART vs Dalvik. Actually the only real change was that apps cannot be moved to SD card. Do not turn on ART on a budget phone unless you know what you are doing!

SD card extension

As time went by I had to realize that there are some apps that cannot be moved to SD card. That was a bit strange to me first: it was allowed on former versions of Android. Nowadays the application providers can give their preference which does not help on phones with storage on diet.
Fortunately there is a possibility to change some preferences through adb to get into a better position.
And when you run into trouble with adb (like I did) it might be helpful to start the service as root.

No problem

Both phones are very useful, well built. It is just the memory that takes it all. At least kids have to learn taking care...

Wednesday, February 26, 2014

Unit Testing

I just have realized how far is my understanding of unit testing from my expectations.
While I was reading the book Programming Groovy, the strange feeling came that I do not seem to be professional in this area of programming. In the last 6 years I tried hard to make progress in applying Test Driven Development in my projects, but only the last year gave me some kind of peace.
Yeah, it is a process. But it took so long. And still I miss some points.
I am collecting the guides here that were helping me and I am trying to give good overview of some good testing practices.
But before we get lost in the details let us consider the reasons!

Reasoning

Besides the standard few points ("tested code is working", "test make you free to refactor", "prevents returning bugs") there are some more complex benefits of using unit tests.

Deliver Effective Code

The first thing came to my mind was that the code is always write-once-read-many. It is important to write code that is clean and can be read easily. Testing a code with lot of coupling is hard: a lot of mock code must be written and one naturally feels that it is plainly wrong. And it is even more important not to write code that is not used. Tests keep you focused on your main problem (the failing test case) and they help you avoid Featuritis.

Measure Progress

With the constant test-code-check-refactor-check cycle one can be aware of the progress of his coding. Sometimes we get lost in details and dive too deep in coding, that we miss the target. With tests onboard the target cannot be lost.
It also helps to jump into coding and avoid to much procrastination.

Share Knowledge

The unit test is a perfect example for using the given API in the manner as the creator supposed it to be used. All the funny details can be learned from the different test cases. For a programmer the code is the most effective documentation: it is terse, structured and readable.

Gain Knowledge

I also use UT for getting insight on a given API. I formulate my expectations in the form of test cases. And I even gain the possibility to debug the given behavior during real work.
That is how you gain experience by doing something.

(Feel free to add more in comments...)