Ubuntu - Building own Kernel

One of the reasons why I like Ubuntu is its simple usage. Most stuff works out-of-the-box or is configurable pretty easy. So it's also pretty easy to compile your own kernel.

The reason I wanted to build my own kernel were some issues with the amdgpu graphics card. Since Kernel 4.15 AMD has pushed it's recent open-source drivers upstream, so I wanted to give it a try.

In a nutshell

In principle you have to follow those simple steps

  1. MAKE SURE GRUB HAS A TIMEOUT so you can select an old kernel, in case something went wrong
  2. Download kernel sources from kernel.org
  3. Extract the sources into a directory and change into that directory
  4. Copy current configuration from /boot/config-uname -r to .config
  5. Check current configuration using make localmodconfig
  6. Compile using make [-j8]
  7. Install by using sudo make modules_install install

More details

For now I'm assuming we want to compile the current stable kernel, witch is 4.15.6

  1. Download kernel sources from kernel.org - I won't post a direct link to a kernel, because that will become outdated pretty soon!
  2. Extract the sources into a directory and change into that directory

I download the file and extract it with tar. For me it was like

In general it's save to hit the return key and just use the default values. But keep that in mind, if you run into problems you might have a more detailed look and the options

Now it's time to compile the kernel. Use -j4 to use 4 threads for building. I in general use up to 16, but that depends on your system. People report in general good results in taking a number between 1x and 2x the number of CPU cores you have. I have 8, so I choose 16, but that's up to you

Now watch the build process and grab a cup of coffee. That might take a while ....

If the build process completes, then run a simply a make modules_install and make install to install the new kernel

In Ubuntu this triggers a grub-update as well, so it should work the next time you boot into your system.

Nice πŸ™‚

Visualisation for the poor man

A very quick and cheap visualisation method for skymaps. Print out 1's and 0's, choose a text editor of your choice without line break, turn down the font size and voilΓ 

Very cheap and quick visualisation for the poor man πŸ™‚

UPDATE - Here's a suggestion for a ASCII opacity table:

Thanks to goliath who has extracted the ASCII opacity table somewhere from Irrlicht

Firefox 57 - Enable U2F

I really love the new Firefox. I have the impression it runs much smoother, especially with some bloated sites. I also guess it won't take too long until webdesigners are making their websites even more bloaty, so that in some months from now we will be at the same time again.
Let's see how many new JS frameworks it will trigger πŸ˜‰

Jokes aside, with Firefox 57 now disabling all legacy add-ons I was wondering, if U2F is finally supported. Turns out, it is, but you have first to enable it manually.

It's hidden in the about:config preferences. Search for webauth and enable the following options:

  • security.webauth.u2f
  • security.webauth.webauthn_enable_softtoken

Here you can see a Screenshot, in order to do so.


The Yubikey-demo page swollows the Yubikey - Seems to work!


Update - On Arch Linux it was not working out of the box. I had to follow the instructions from https://michaelheap.com/yubikey-on-arch/

1. Enable udev rules for Yubikey

2.Install U2F modules

Enjoy!

SQLite3 C++ Wrapper Class

I really love sqlite3 databases. They are small, scalable and just do the job. The only thing they need is a file, so they are also much easier to configure, maintain and backup than heavy database solutions like MariaDB, MySQL or PostgreSQL. For bigger class applications they do a very good job, for most of my personal projects I prefer sqlite3, because they are just slim and easy-to-use.

Due to my affinity to Python I wrote a small C++ Wrapper Class, that should make it easier to handle Sqlite3 database connections in C++. In just 200 lines C++ code. It's really easy, no Voodoo involved.

But have a look yourself at this 13 lines C++ code, that create a table, insert values and read them out.

Tested under Ubuntu 16.04 and Arch Linux. I suppose it also runs on other platforms, but I've not tested it. Use at own risk πŸ˜‰

Lightning Monitor - Update

Because of heavy rain and thunderstorms this weekend, I had some time to work on my lightning monitor again. With success, I could reduce the "DISTURBER DETECTED" messages significantly by putting the device away from the laptop.

Even better, it was starting to measure lightnings during one of the thunderstorms! Great πŸ™‚

The data makes sense, since we really have been in the center of the thunderstorm. I could verify that the distance estimation works pretty nice, because another thunderstorm that was in a nearby village was giving me lightnings with a distance of 5 km.

The current Arduino sketchbook is, as usual, on GitHub.


Nice thing for a rainy Sunday!

Lightning detector - Kickoff

I recently purchased a MOD-1016 chip for lightning detection in order to improve my weather station. The chip is based on the AS3935 chip and ships as a complete I2C-ready breakout module from embedded adventures.

First steps

I skip the following parts because I consider them trivial:

  • Soldering
  • Wiring to a Arduino Nano

The wiring part is actually the most tricky part, I will provide the schematics once I have a running system. For now I focus on getting the system online. The wiring on the following picture is accurate:

Wiring of the MOD-1016 to the Arduino Nano

I put everything together in a nice box to protect the electronics from the environment. In the end it will end up outdoors in my garden.
The box is IP55 compliant, so when deployed for real I will put it in additional plastic bag to avoid any issues that comes from rain. For the first experiments IP55 is fine. And this is how it looks like

Wired box, open

A small reader program is in my meteo repository (in the Lightning directory) on GitHub, and I let it run for 1.5 days.
I had some problems with the serial port on high baud rates, so i configured it for 9600 baud. The serial connection over this period was fine, but it seems that the location has too much interference.
All I got was constant "DISTURBER DETECTED"

Right now all I get out is "DISTURBER DETECTED"

Looks like I need some fine-tuning. I disconnected the device and will run some tests with my laptop on the go.

For now I have a running serial connection, the chip delivers some output, so I'm expecting that with some fine-tuning I should get this thingy running soon.

The joy of multicore processors

I recently came back from an amazing trip to Iceland. Had a glorious time there - it was an outstanding adventure!

After this trip I had to convert 3200 photos from RAW to JPEG. Turns out, that usually it takes something like 15 seconds for my computer to process 1 file. 3200 * 15 is roughly a bit more than 13 hours.

Some minutes later and a python script I could distribute the work my 8 processor cores of a FX-8350. The script is ugly and very very dirty, that's why I don't want to publish it.
I've started the script, went outside for a longer time and when I returned the process was completed.


This is just one example of things, where a large number of CPU makes sense on a workstation computer. Even normal users benefit more and more from increased CPU cores more and more.

AMD made good work when they were increasing the number of CPU's. And nowadays I willingly have a bit lower single-thread performance but twice as much CPU cores. Makes totally sense for multimedia converting, large picture editing, compiling, ecc.

Intel Skylake Hyperthreading broken

Hyperthreading in Skylake and Kaby LakeΒ seems to be broken and should be disabled in BIOS/UEFI.

My Laptop is also affected by this bug, but I will try to update the Microcode. Since I'm running Arch Linux I should get the update rather fast.

UPDATE
I underestimated the effect of this bug. For now I disable Hyperthreading completely. Hope a fix will be available, if one is even possible.