Desktop build – an expensive attempt

no comments

Planning my next desktop build, here’s an attempt at putting together a modern machine that will last. Only problem is, at more then €2000, it’s a bit too expensive. Maybe the SSD and RAM prices will go back down to reasonable levels towards the end of the day. And maybe some of the wishes will have be be compromised on.


At €1783 in new parts, and about €2085 in total, it’s a bit too expensive for a “normal” desktop machine, and can probably not be justified by what it will be used for. Some thoughts on the parts.

CPU: AMD’s new Ryzen CPU is interesting, however, the top of the line is expensive. Going for a slower clocked Ryzen 7 would save a bit, while going down to Ryzen 5 would be about half the price.

GPU: It would be fun to play with some machine learning and Tensorflow, but at the same time have a quiet passively cooled card. At €160, the Palit GeForce 1050 is already cheap, however, 4 GB RAM is maybe on the low side.

RAM: More is better, and 32 GB seems about right these days for a high-end developer machine. However, with current RAM prices, it’s too much. If they go down to about half within the year, it’s fine.

Motherboard: Asus has always been a personal favorite, and in the AM4 socket and top X370 chipset range there’s only so much to choose from. However, there might be other cheaper options besides the Crosshair VI Hero, which is an arbitrary choice at the moment. Besides the obvious component compatibility, requirements include 8 SATA ports; NVMe M.2; excellent audio I/O.

SSD: At 3500 read and 2100 write MB/s speeds, a NVMe based drive is very tempting. However, this Tom’s Hardware review points out that to get the full benefit, you’ll have to look upwards in size, and price. Again, SSD might come down towards the end of the year, but speed is always going to come at a premium.
Using my existing, but old, 2.5″ SSD is also an option, and would reduce the price further.

HDD: These will be transfered from my existing machine, so do not incur extra cost. When time comes, and the oldest 3 TB version fails, replacing with a 8+ TB drive is probably reasonable.

Case: I’ve done one previous build with the Fractal Define case, and it really gave a taste for more. At about €100, the R5 a fairly standard price for a midi-tower.

PSU: Again going fanless for no-noise, but I hope 520W is enough for the parts listed above.

CPU cooler: Even though the Ryzen packages come with a cooler, I assume it will not be cool / quiet enough. Noctua CPU coolers are the best around, and with two 14 cm fans, they only have to run at around 300 – 400 RPM to keep the CPU cool under normal load. That is almost not audible, and will then be the only fans strictly needed. (The case also comes with two fans, but through bios tuning, they can be set to trigger only when it gets to hot).




The rest

Hello World with Docker

no comments

Docker is a nice and easy way to isolate and precisely define and execution environment, both for production and testing. The following includes basic setup and start-up steps for few basic Docker Container instances. For details on all the commands, see the official Docker documentation.


Initial installation of the Docker service is documented here. On a newer Debian (8 and up) system, it boils down to:

apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
apt-get update
apt-get install docker-ce

Hello World

Once installed, predefined images can be downloaded and executed easily. As a normal user, either use sudo in front of every docker command, or add yourself to the docker group. Be aware that the latter has security implications in a shared environment.

sudo groupadd docker

Now download and execute the official hello-world image.

docker run hello-world

It will search for the image locally first, and download it if necessary. The image itself merely prints a welcome message and exits.

A clean image

Docker Hub contains thousands of predefined images, including very small installations of the most common Linux distributions. The following downloads, starts the latest Ubuntu image (16.04 at the time of writing), and executes bash. The -i and -t arguments leave an interactive shell into the running Docker Container.

docker run -it ubuntu bash
cat /etc/issue

For detailed documentation about the various docker commands, see here.

A custom image

It is easy to built on top-of existing images; it is after all what Docker is designed for. Each line in a Dockerfile defines another layer upon the previous. It means, that if the previous layer is already downloaded or built, Docker will simply pick up from the step it needs to alter first. For this reason, it can be useful to think through the combination of alterations which will be applied. Even though it is possible to do a lot on a single line, it might be useful to break unstable commands up. Conversely, it might make sense to combine multiple install commands if they are dependent or belong together.

The following minimal image definition takes the latests ubuntu image and installs some useful utilities. See here for the detailed Dockerfile reference.

FROM ubuntu
RUN apt-get update && \
    apt-get install -y htop tree 

To build this Docker image, enter into the directory where the Dockerfile exists, and execute the following, where the -t option gives a name to the new image.

docker build -t my_ubuntu .

DealExtreme orders

Comments Off

Products ordered from DealExtreme over the years.

Comments Off

Review: “Sapiens: A Brief History of Humankind”, Yuval Noah Harari

Comments Off

In “Sapiens: A Brief History of Humankind”, Yuval Noah Harari sets out to tell the story of Sapiens’ early beginnings, the revolutions that shaped us (cognitive, 70000 years ago; agricultural, 11000 years ago; scientific, 500 years ago; industrial, 250 years ago; and finally information 50 years ago), and our possible future from the coming “biotechnological revolution”. The potential for an interesting and insightful book was there, however, Harari squanders it on poorly researched, poorly referenced, or usually no referenced at all, and opinionated misleading sensationalism.

Harari is a professor, yet, this book has very little to do with academy, or history for that matter. Instead, it’s an iteration over anecdotes which he uses to create fridge-magnet poetry. The more one knows about the topic he covers, the more painful and frustrating it becomes to read. The section on genetic programming and computer virus (chapter 20; “Another life”) is case in point, where it seems the talking points are taken from a Dan Brown or Michael Crichton novel.

There is little else to say about the facts or history covered in the book. None of it can be trusted, and untangling Harari’s poetic babbling from actual facts will take hours of research for each chapter. As a list of discussion topics, it can work, as long as the problem with the facts and references are clear.

Unfortunate and potentially harmful

If Harari and his work had stayed fringe and unknown, it would have been a case of “nothing to see here, move along”. However, through TED talks and clever marketing, he has gained a world-wide following; the book is translated to some thirty languages and is popular everywhere. That is very unfortunate, and potentially harmful.

In today’s political climate, dealing with facts have become a fluid process, where anybody can declare something they disagree with as “fake news”, and then present “alternative facts”. US president Trump has made this type of political rhetoric mainstream, and it’s already leaking across to Europe: When boots crushed skulls in the Catalonian attempt at an election, PM Mariano Rajoy simply declared the pictures of blood as fake news. When an election does not produce the desired result, we can simply blame it on Russian meddling (see Brexit), and so on.

In politics, lies have always been part of the game, while in science the standard have been facts and evidence. Although, there are exceptions, like Ron Hubbard’s book “Dianetics” which is the basis for Scientology. Its rhetorical style is similar to Harari’s, where the former tends to conclude “this can be scientifically proven”, while the latter usually prefers “scholars agree”. Neither support their claims with facts, evidence or references.

Popularizing this kind of pseudoscience is dangerous, and should not be taken lightly. Scientology has caused a lot of harm to many people, even if their organization is by now known to be predatory. By creating a following of more pseudoscience, Harari risks legitimizing both political and scientific opinion based “evidence”. Throughout the “Sapiens” book, he declares his skepticisms towards almost any invention, discovery or change after the scientific revolution. In fact, in discussing happiness, Harari suggests that the hunter-gatherer or medieval farmer was happier than today’s city dweller. We risk regressing back to a pre-Renaissance pre-science forum, where anybody can claim anything and get a following, no matter how ludicrous.

To some extent, that has already been going on for a while. Discussing the science and politics of global warming is already problematic, starting with agreeing on observable scientific facts. Fascists have used pseudoscience in an attempt to prove the Aryan race superior. Creationists, whom Harari unwittingly lends a bone, promote Intelligent Design to be taught alongside evolution and science. Yet all of the nonsense from these groups have not been a great problem because their voices have stayed fringe, and have easily been sidelined by hard facts and science.

Harari might not have intended to support these kind of fringe groups, but by legitimizing and popularizing pseudoscience and biased opinionated facts, he unintentionally gives credibility to those whom should not be given any. That is potentially harmful.

Comments Off

Historical Cost of Computer Memory and Storage

Comments Off

Following up on the last post, here is the long view of cost of computer storage. In the categories magnetic disks; RAM; and flash / SSD, it plots the cheapest USD-per-byte option over time. It confirms the stagnation of price improvements previously discussed. RAM is going through its cyclic volatility, and is now at a local peak (due to supply shortage; see below), while prices for magnetic drives are flatting out. Finally, SSD have gotten more expensive over the last year, also due to supply issue. Crossing the HDD trajectory is far of, and according to Western Digital’s projections in the chart below, it will not happen in the next ten years.

The first three charts below (in white) zoom in on these developments in recent years, linear scale, at USD / GB. That way, it becomes a bit easier to examine current trends, without having to deal with the prices from 60 years ago which were twelve magnitudes higher. The following two charts use logarithmic USB / MB scale to visualize the full history, which makes the very consistent longterm trends clear.

Detailed analysis continues below the charts.

See here for the updated data and charts, and detailed information.


HDD: Recent history 2005 – present; Linear scale; USD / GB



SSD: Recent history 2005 – present; Linear scale; USD / GB



RAM: Recent history 2005 – present; Linear scale; USD / GB


Recent history 2005 – present; Logarithmic scale; USD / MB



Full history 1957 – present; Logarithmic scale; USD / MB


(Click image for larger version)


Despite sobering movements in price, there are interesting news on the horizon: Heat Assisted Magnetic Recording (HAMR) is now not too far away. Seagate talked about their plans for 2018 already at the beginning of this year, mentioning a 16 TB HAMR option. And this autumn, Western Digital demonstrated their first helium Microwave-Assisted Magnetic Recording (MAMR) drive. The principle of energized assistance in dealing with smaller magnetized areas is the same as HAMR, but MAMR uses a microwave while HAMR uses a laser. Western Digital talked about MAMR technology enabling growth to 40 TB by 2025.

Meanwhile, Toshiba announced a 9 platter PMR drive at 14 TB. This is probably closer to market than MAMR technology, and should see shelves in 2018. Even though nine platters is a very impressive feat, that direction will eventually stagnate, and so will PMR. That’s way WD’s chart below shows PMR flattening out, while in their opinion, MAMR will produce a drive double the size by 2025. Most likely, this will be realized combining all these technologies: helium filled drives; nine platters and MAMR.

It’s interesting to note that with these developments, WD believes the 10x margin from SSD will continue for at least another ten years. However, with the sizes of the HDD options now available, we might also be at a point where it has saturated the “average” consumer demand. Except for special interests like photo, video or hoarding, a 1 or 2 TB SSD is still plenty of space in a laptop, everything else is “in the cloud” anyway. Therefore, the demand for large HDD will come from data centers and other corporate systems. They can afford higher prices, so the large drives might not see the same exponential decrease in price as the smaller consumer options.


The prices of SSDs still suffer from a supply shortage of NAND chips since autumn 2016. This has caused prices to increase during 2017. Furthermore, transition from 2D planer to 3D based technology has caused problems and delays for some manufacturers.

Future developments in SSD is now more focused on IO speed, and size, than reduction in price. Samsung’s massive 15 TB PM1633a became available last year, but at $10.000, that’s for special interest only. Micron is following, and recently announced a 11 TB NVMe based drive, and interestingly designing its own rack solution for SSDs in “shared storage” configuration for the data centre.

Even for the home user, it looks like SATA based SSD storage will soon be over, with newer solutions connecting to the PCIe bus over NVMe using the M.2 or U.2 connectors, or directly through PCIe HHHL (half-height half-length) cards. This gives extreme bandwidth potential, and Kingston’s DCP1000 1.6TB has reached 7 GB/s (in RAID configuration). It’s amusing to see that the PCIe the card merely a container for four M.2 drives.

It seems SATA will be left behind in the SSD market, as most high-end products now connect to the faster PCIe bus, either over M.2 or U.2 connectors, or directly with a HHHL (half-length half-height) PCIe slot card.


Finally, memory prices have also been increasing over the last year, again due to supply shortage. Some blame Apple’s latest iPhone, and expect the supply shortage to last into 2018, when “Samsung and SK Hynix [are] expected to begin production at additional factories”.

Technology wise, DDR4 is now well established, and Corsair just released a 32 GB kit at 4 GHz, while G.Skill announced a 16 GB 4.6 GHz kit. Meanwhile, Rambus is planning the next generation: DDR5 and HBM3 (High Bandwidth Memory for GPUs). They plan to move to a 7 nm process (down from 28 nm in DDR4), and expect 4.8 – 6.4 Gb/s bandwidth. However, products will not show up before 2019, the earliest.

Comments Off

Storage prices – end of 2017

Comments Off


Since last year’s update, there are a few interesting newcomers in the very large HDD section, including 10 TB and 12 TB offerings from Western Digital and Seagate. WD has also just released a 14TB helium SMR (shingled magnetic recording) drive, and we can expect it to be available soon. However, these drives are still expensive, and the most byte-for-buck is still in the 8 TB SMR Seagate, even though it has almost kept its price-point since a year ago.

In documenting the newer drives, it has become increasingly difficult to find information on what technology they use. Product listing often don’t mention numbers of platters, helium (or not) or SMR vs. PMR (perpendicular magnetic recording), and not even WD’s own technical specification sheets go into detail. Thus, some of it has become guess-work. I’m assuming that all drives at 8 TB and above have to use helium to be able to include more platters. Furthermore, it seems anything beyond 14 TB will need to combine helium and SMR. This is more or less in line with this prediction from 2014, where the next technology stage for the next fives years is Heat Assisted Magnetic Recording (HAMR).


SSDs continue to grow in size, however, have moved only a little in price. The 1 TB Samsung EVO basic was €316 last year, and is now €238, or a 25% reduction. Most offerings are at least 10x more expensive per byte than HDD, which has always been the case.

More interestingly, NVM-M.2 based SSDs are becoming more common, and faster. The Samsung EVO 960 is now at 3500 MB/s read and 2100 MB/s write, and the 512 GB version costs €281, or a 2x premium from 2.5″ SSDs. Whether they will make a noticeable difference in day-to-day applications is up for discussion.


Finally, flash cards and drives of all types are also increasing in size, and decreasing somewhat in price. Furthermore, several modules from SanDisk have significantly increased IO speeds, with the Extreme Pro micro SDXC range at 275 MB/s read and 100 MB/s write. And the Extreme Pro CFast series, using the newer CFast standard reaches 525 MB/s read and 450 MB/s write. (However, it is not compatible with the old CF standard).

Media Type Product Capacity Price CHF Price Euros Euros / GB GBs / Euro
HDD-SMR Seagate ARCHIVE HDD 8TB 8000 GB 233.00 199.15 0.02 40.17
HDD Western Digital Blue, 5400 RPM 4TB 4000 GB 120.00 102.56 0.03 39.00
External 3.5 Western Digital My Book 8TB, USB3 8000 GB 249.00 212.82 0.03 37.59
HDD Western Digital Blue, 5400 RPM 6TB 6000 GB 199.00 170.09 0.03 35.28
External 3.5 Western Digital My Book 6TB, USB3 6000 GB 205.00 175.21 0.03 34.24
External 3.5 Western Digital My Book 4TB, USB3 4000 GB 139.00 118.80 0.03 33.67
HDD-He Western Digital Red 8TB 8000 GB 279.00 238.46 0.03 33.55
HDD Western Digital Blue, 5400 RPM 3TB 3000 GB 105.00 89.74 0.03 33.43
HDD Western Digital Red 6TB 6000 GB 215.00 183.76 0.03 32.65
HDD Western Digital Red 4TB 4000 GB 145.00 123.93 0.03 32.28
HDD-He Seagate Enterprise Capacity 12TB 12000 GB 448.00 382.91 0.03 31.34
HDD Western Digital Blue, 5400 RPM 2TB 2000 GB 75.00 64.10 0.03 31.20
HDD Western Digital Red 3TB 3000 GB 115.00 98.29 0.03 30.52
HDD-He Western Digital Red 10TB 10000 GB 385.00 329.06 0.03 30.39
HDD-He Seagate Enterprise Capacity 8TB 8000 GB 320.00 273.50 0.03 29.25
HDD Western Digital Blue, 5400 RPM 5TB 5000 GB 204.00 174.36 0.03 28.68
HDD-He Seagate Barracuda Pro 10TB 10000 GB 410.00 350.43 0.04 28.54
HDD-He Seagate Enterprise Capacity 10TB 10000 GB 411.00 351.28 0.04 28.47
External 2.5 Western Digital Elements Portable 3TB, USB3 3000 GB 125.00 106.84 0.04 28.08
External 2.5 Western Digital Elements Portable 2TB, USB3 2000 GB 85.00 72.65 0.04 27.53
HDD-He Seagate IronWolf Pro 10TB 10000 GB 425.00 363.25 0.04 27.53
External 2.5 Western Digital My Passport Ultra 4TB, USB3 4000 GB 175.00 149.57 0.04 26.74
Blu-ray Verbatim BD-R SL 50 @ 25GB 1250 GB 55.00 47.01 0.04 26.59
HDD-He Seagate IronWolf Pro 12TB 12000 GB 529.00 452.14 0.04 26.54
HDD-He Hitachi Ultrastar He8 8TB 8000 GB 362.00 309.40 0.04 25.86
HDD-He Seagate Barracuda Pro 12TB 12000 GB 557.00 476.07 0.04 25.21
HDD Western Digital Red 2TB 2000 GB 94.00 80.34 0.04 24.89
External 2.5 Western Digital My Passport Ultra 3TB, USB3 3000 GB 155.00 132.48 0.04 22.65
HDD Western Digital Blue, 5400 RPM 1TB 1000 GB 55.00 47.01 0.05 21.27
External 2.5 Western Digital Elements Portable 1TB, USB3 1000 GB 65.00 55.56 0.06 18.00
External 2.5 Western Digital My Passport Ultra 1TB, USB3 1000 GB 89.00 76.07 0.08 13.15
Blu-ray Verbatim BD-R SL 10 @ 25GB 250 GB 23.10 19.74 0.08 12.66
Blu-ray Verbatim BD-R DL 10 @ 50GB 500 GB 47.70 40.77 0.08 12.26
DVD-R Verbatim 16x DVD-R 100 @ 4,7GB 470 GB 46.00 39.32 0.08 11.95
DVD+R DL Verbatim 8x DVD+R DL 50 @ 8,5GB 425 GB 81.50 69.66 0.16 6.10
DVD+R DL Verbatim 8x DVD+R DL 25 @ 8,5GB 213 GB 41.00 35.04 0.16 6.06
SSD Samsung SSD 850 EVO Basic, TLC, 1TB 1000 GB 279.00 238.46 0.24 4.19
SSD Crucial MX300 SSD, 3D, 2000GB 2000 GB 579.00 494.87 0.25 4.04
SSD Crucial MX300 SSD, 3D, 1050GB 1050 GB 309.00 264.10 0.25 3.98
SSD Crucial MX300 SSD, 3D, 525GB 525 GB 165.00 141.03 0.27 3.72
USB Flash SanDisk Ultra, USB 3.0, 256GB 256 GB 84.90 72.56 0.28 3.53
SSD Samsung SSD 850 EVO Basic, TLC, 2TB 2000 GB 699.00 597.44 0.30 3.35
SSD Samsung SSD 850 EVO Basic, TLC, 500GB 500 GB 175.00 149.57 0.30 3.34
SSD Crucial MX300 SSD, 3D, 275GB 275 GB 99.00 84.62 0.31 3.25
SSD Samsung SSD 850 EVO Basic, TLC, 4TB 4000 GB 1475.00 1260.68 0.32 3.17
USB Flash SanDisk Ultra, USB 3.0, 64GB 64 GB 24.40 20.85 0.33 3.07
SSD Samsung SSD 850 EVO Basic, TLC, 250GB 250 GB 103.00 88.03 0.35 2.84
USB Flash SanDisk Ultra, USB 3.0, 32B 32 GB 14.60 12.48 0.39 2.56
SSD Samsung SSD 850 Pro, MLC, 1024GB 1024 GB 479.00 409.40 0.40 2.50
SSD Samsung SSD 850 Pro, MLC, 2048GB 2048 GB 969.00 828.21 0.40 2.47
SSD Samsung SSD 850 Pro, MLC, 512GB 512 GB 255.00 217.95 0.43 2.35
CD-R Verbatim CD-R 100 @ 700MB 70 GB 35.70 30.51 0.44 2.29
SSD Samsung SSD 850 Pro, MLC, 256GB 256 GB 145.00 123.93 0.48 2.07
SDXC SanDisk Extreme Pro SDXC U3, Class 10/UHS 3 95/90MB/s, 128GB 128 GB 79.60 68.03 0.53 1.88
SDXC SanDisk Extreme Pro SDXC U3, Class 10/UHS 3 95/90MB/s, 256GB 256 GB 160.00 136.75 0.53 1.87
SSD-NVM-M.2 Samsung SSD 960 Pro, M.2 2280, MLC, 3500/2100MB/s, 1000GB 1000 GB 629.00 537.61 0.54 1.86
SSD-NVM-M.2 Samsung SSD 960 Pro, M.2 2280, MLC, 3500/2100MB/s, 2000GB 2000 GB 1279.00 1093.16 0.55 1.83
SSD-NVM-M.2 Samsung SSD 960 Pro, M.2 2280, MLC, 3500/2100MB/s, 512GB 512 GB 329.00 281.20 0.55 1.82
SDXC SanDisk Extreme Pro SDXC U3, Class 10/UHS 3 95/90MB/s, 64GB 64 GB 47.90 40.94 0.64 1.56
SDXC SanDisk Extreme Pro SDXC U3, Class 10/UHS 3 95/90MB/s, 512GB 512 GB 389.00 332.48 0.65 1.54
microSDXC SanDisk Extreme Pro microSDXC, Class 10, 100/90MB/s, 64GB 64 GB 50.10 42.82 0.67 1.49
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 64GB 64 GB 75.00 64.10 1.00 1.00
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 256GB 256 GB 326.00 278.63 1.09 0.92
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 128GB 128 GB 168.00 143.59 1.12 0.89
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 32GB 32 GB 44.00 37.61 1.18 0.85
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 64GB 64 GB 92.70 79.23 1.24 0.81
microSDXC SanDisk Extreme Pro microSDXC, Class 10, 100/275MB/s, 128GB 128 GB 220.00 188.03 1.47 0.68
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 32GB 32 GB 57.20 48.89 1.53 0.65
microSDXC SanDisk Extreme Pro microSDXC, Class 10, 100/275MB/s, 64GB 64 GB 125.00 106.84 1.67 0.60
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 16GB 16 GB 37.00 31.62 1.98 0.51
Compact Flash SanDisk Extreme Pro 450MB/s, CFast 2.0, 128GB 128 GB 389.00 332.48 2.60 0.38
Compact Flash SanDisk Extreme Pro 450MB/s, CFast 2.0, 64GB 64 GB 236.00 201.71 3.15 0.32

Exchange rate: 1 Euro = 1.170000 CHF.

Comments Off

Gettings started with Jenkins plugin development

Comments Off

Getting started with Jenkins plugin development is surprisingly easy. There is neat integration with Maven for building and testing a debug instance, and the build artifact can quickly be installed to an existing Jenkins instance.

Dev dependencies

Setting up the developer environment on a new system can be done through the following apt-get. However, on an older Debian (e.g. 8) or Ubuntu (~16 or older), you’d want to download Java JDK; Eclipse and Maven from their respective homes.

apt-get install openjdk-8-jdk eclipse-jdt maven

Starting from an existing plugin

Starting from an existing plugin is probably most straight forward, since a lot of the details are usually already in place. The “Test Results Analyzer Plugin” serves as a nice stand-alone example.

git clone
cd test-results-analyzer-plugin

To create an Eclipse workspace which later can be opened as an existing project in Eclipse:

mvn -DdownloadSources=true -DoutputDirectory=target/eclipse-classes -Declipse.workspace=~/test-results-analyzer-plugin eclipse:eclipse eclipse:configure-workspace

To build the .hpi file which can be installed through Jenkins:

mvn hpi:hpi

For development and debugging, to create and launch a new Jenkins instance, which will have the new plugin installed.

mvn hpi:run

New plugin

Or, if you’d rather start from a clean plate, the following will create the skeleton structure.

mkdir foobar; cd foobar
mvn -U

Once created, the commands above also apply, but you probably want to dive into the pom.xml file first, and define project information, dependencies.


For further details, see:

Comments Off

Spain: Political censorship

Comments Off

First they came for the …

The slippery slope of censorship, surveillance and oppression expressed through variations of Martin Niemöller’s speech have become cliché by now. Over the last 16 years, authoritarian regimes have chipped away at basic freedoms, piece by piece and law by law. Still, many believed that the countries of the Western world, or at least western Europe, or at least the country where “I” live, would remain free, democratic and with legitimate governments. At the very least, the authorities would not bother me if “I had nothing to hide”, or did nothing wrong.

That fantasy bubble has now popped, as the true faces of our rulers reveal themselves more and more. In the case of Spain, perhaps it should come as little surprise, where Francisco Franco ruled as a dictator up until 1975. Ironically, making jokes about that dark past is considered “glorifying terrorism”, as one Spanish woman learnt her lesson this year, and got a one-year jail sentence for a Twitter message. In Amnesty International’s report from the beginning of this year, they urge Spain and other European countries to respect Human Rights, specifically freedom of speech and right to political expression. In February 2016, Spanish children’s puppeteers were arrested for including an ETA banner in their show. (See page 41 of the report).

Yet, even all of these events have been considered anecdotes, and the warnings have been heard as fringe voices from the sideline. In Spain, that is now changing. In the dispute between Catalonian separatists and the central government, the silk gloves are off, with thousands of police deployed. The prime minister Mariano Rajoy commands people to “stop the disobedience”.

In an unprecedented move for a European country in the last decades, the offices of the central Internet name registrar for the Catalonian .cat top level domain were raided. It is shocking, because it is such a blatant attempt at control and censorship of political speech. However, it is also concerning because it strikes at the center of the Internet infrastructure, and risks indiscriminately affecting all websites with .cat domains. Catalan leaders compare the move to Turkey, China and North Korea. In a follow up, Google was instructed by the High Court to remove an app related to the 1 October vote.

Regardless of which side of that particular conflict one stands, there is no denying that the blocking, suppression and censorship Spain’s regime is now carrying out is of political nature. It is trying to win the political argument through censorship and authoritarian control of information and communication tools normal citizens rely on. Spain’s government is using the court and police to force its political agenda, when the opposition is talking about a democratic vote.

The government which was voted in to uphold and protect a free democratic state has now failed at that task. As such, it can no longer be considered a legitimate government. If Spaniards know what’s good for them and their country, the will vote Mariano Rajoy and the Partido Popular out of office, while they still have the chance to do so.

Comments Off

Wired: Mother Earth Mother Board

Comments Off

In a blast from the past, this 1996 Wired article about the intrigues of the underwater optical fiber cable business resurfaced. It’s a real long-read about the construction of the 28000 km long FLAG cable, connecting UK to Japan, and various countries and obstacles along the way. Still, it’s well worth the journey. Enjoy!

Comments Off

Review: “Against the Fascist Creep”, Alexander Reid Ross

Comments Off

In Against the Fascist Creep (2017), Alexander Reid Ross summarizes the history of the fascist political and cultural movement from its beginnings in Italy in the early 20th century, and up to recent political developments and elections in Europe and US. He iterates the leading figures and key organizations which have influenced and developed the fascists ideology and thinking over the last hundred years in Europe and US.

A key argument in Ross’ narrative is the idea that fascists and extreme right politics and members have co-opted the left, either by borrowing its tactics or infiltrating its ranks. He provides several examples of where there have been cross-over between extreme left and right groups, and several key members who have “switched sides” either way. The problem with that argument, is that it intermingles ideology, political goals and tactical means. Fringe groups of any kind usually share at least one enemy: the establishment; as Ross also mentions. As under-powered forces, they tend to use similar tactics of asymmetrical resistance and independent loosely coupled and distributed cells as opposed to a central organization. However, the similar tactics and politics does not equate similar ideology.

Throughout the book, Ross seems to lump all and any group or opinion which might have any relation, however tangent, to fascism under the same banner. This creates a polarized view, which is unfortunate, and sometimes leaves questions-marks with some of the facts.

For especially interested only

Ross offers a well researched, thoroughly referenced summary of the fascist history. However, the narrative gets somewhat uninteresting as organization after organization, country after country, and people and relations are iterated through. What is probably lacking is the analysis into the bigger picture and political context. And where there is analysis, it comes with a hint of bias, to support the “fascist creep” argument.

The topic Ross cover is very relevant, especially given most recent events in the US. However, beyond iterating names and groups, the book does not analyze the problem let alone any solution.

If you are particularly interested in the history, organizations and key figures in fascism, this book offers a good summary. Otherwise, it’s a rather boring read, and can better be skipped.

Comments Off

DIY passive audio mixer

Comments Off

In previous posts, I’ve mentioned my TB-03 synthesizer and TR-8 drum machine. While both offer analog audio input and output to chain the sound, it gets tricky when trying to record since there are multiple volume nobs essentially daisy-chained. Adding even more devices breaks down the whole setup.

So I needed a simple audio mixer, and decided to put together something myself. The only requirement was to adjust the volume of the stereo out of each device, and mix it together into one signal. A simple solution adds a potentiometer on each input line (right and left), and combines each line down to one output. I used 10k ohm dual logarithmic rotary potentiometers (which I found at a local electronics shop – which means they’re probably quite old). The input and output connectors are all stereo mini-jack.

As the pictures show, it’s a simple small box, with four inputs, four rotary knobs, and one output. I liked the knobs, however, had wished they could be flush with the surface of the box. They were not made for the potentiometers I got, and it took some Dremel work to make them fit at all. The wiring got a bit messy, and combined dual or even three wire would have made it look better on the inside.

The mixer and volume adjustment work, however, I’m not sure if 10k ohm is enough to adjust the devices. It is not enough to mute the sound. This article suggest adding a 1k resistor in series, which I might try later. It would also be interesting to see at what resistance level the sound is completely muted. Other implementations connects the third pin of the potentiometer to ground from the input. In my box, all ground wires from all inputs and output are combined directly, which I’m not sure if is correct.

Oh, and as can be seen, there’s no scale to indicate the setting of each knob. These can all go to 11 if you like!

Comments Off

Hello World with Qt 5

Comments Off

Getting started with Qt development is rather easy. As with other C++ development discussed earlier, all tools and libraries are native in the Debian / Ubuntu repositories. The following packages should take care of the basic setup:

apt-get install gcc g++ gdb cmake make build-essential qtcreator qt5-default qtdeclarative5-dev qt5-doc qt5-doc-html qtbase5-doc-html qtbase5-examples

Once installed, this small “Hello World” example, inspired by this tutorial but updated for Qt 5, will verify that everything is setup correctly.

Notice that it is important that this file has the extension .cpp, e.g. helloworld.cpp.

#include <QtWidgets/QApplication>
#include <QtWidgets/QPushButton>

int main( int argc, char **argv ) {
  QApplication a( argc, argv );

  QPushButton hello( "Hello world!", 0 );
  hello.resize( 100, 30 );;
  return a.exec();

Once this file is in place, a Qt .pro project must be generated. (This should only be executed once, to generate the file).

qmake -project

It will create a file based on the name of the current directory, with the extension .pro. Edit the file to include the following two lines:

QT += core gui
QT += widgets

If backwards compatibility with older Qt versions is a concern, change the last line to:

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

Now, the application can be compiled and linked into a binary:

qmake && make && ./helloworld

It should generate a Makefile, make or compile the source code, and start the binary. If everything works out, a new application window with a small button like below will appear.

Comments Off

Review: “The New Tsar: The Rise and Reign of Vladimir Putin”, Steven Lee Myers

Comments Off

Lee Myers’ book is a fascinating and detailed biography of Putin’s life; from early childhood in a poor family in St. Petersburg; as a low level KGB officer; a loyal adviser of the St. Petersburg major Sobchak in the early 90s; and then suddenly and unexpectedly as first prime minister and then president of Russia at the turn of the century. The story includes detailed political and personal events up until the annexation of Crimea in 2014. Lee Myers balances the personal anecdotes, which give glimpses of Putin’s character, with overall political history and background. Throughout, all is very well researched and referenced, with the list of references taking up some fifty pages of a five hundred pages book.

Although some of the sources are clearly biased, as they come from stories told by Putin himself, his wife, or other loyal to Putin, Lee Myers paints a picture of Putin as extremely hard working, determined and goal oriented. Clearly, his unquestioning loyalty was something which got him forward in his early political career in the 1990s. Later on, and especially as president, he has expected the same unquestioning loyalty and servitude from his subordinates and even business interests. Where there has been opposition and resistance, it has been crushed decisively and sometimes brutally, including assassinations and other KGB style methods.

Putin’s upbringing and early life in Soviet Russia and background in the KGB, and also briefly as director of its reincarnation FSB, is a central part of his character, and still shapes his presidency and politics today. The US and the West is still seen as the enemy or at least opposition of Russia, and the politics and wars in Eastern Europe, Yugoslavia; Chechnya; Ukraine; Crimea, as well as the Middle East; Iraq; Afghanistan; Syria must be seen in this light. Thus it becomes clear why Russia is against the Americans in Syria: It is not to support Bashar al-Assad, but rather to avoid American forces on the footsteps of Russia, and furthermore to keep their naval base in the Mediterranean sea at Tartus at the east coast of Syria.

Lee Myers’ book ends in 2014, but hints at the next milestone in Russian politics: The upcoming presidential election in 2018, where Putin legally can sit a second term (which overall would be his fourth term). If he does, it means he will rule until 2024, since he extended the presidential term from four to six years while prime minister under Medvedev in 2011.

Most interesting

As mentioned, Lee Myers’ book is fascinating and a page turner, which is a good achievement when writing about politics. The blend between political and historical events, and personal anecdotes make it entertaining, and also something to quote. Personal favorites include the story from the business meeting between Putin and US business leaders, among them Robert Kraft, owner of the New England Patriots football team. He showed Putin his Super Bowl ring, who understood it as a gift, and put it in his pocket. Mr. Kraft was forced to announce it as a gift to avoid at diplomatic embarrassment.

Understanding Putin’s Russia goes a long way to explain many key world events and decisions over the last decades. Given that it looks like he will be at the head for another seven years, for almost quarter of a century in total, his reign will shape world affairs for decades to come.

Comments Off

C++ and gtest setup

Comments Off

The neat thing about C and C++ on Linux, is that it’s very much a native language. It means that compilers, tools and libraries are part of the core repositories, and easily installed. The following includes the basic setup to get started with C++ development.

apt-get install gcc g++ gdb cmake make libgtest-dev

Unit tests are great, and the Google Test (gtest) framework makes it straight forward to write and run. The gtest Debian / Ubuntu package requires a bit of manual installation as well, as described here. The crux of it:

cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp *.a /usr/lib

The following is a minimal example, which includes the test code and method under test in the same file for the sake of simplicity. Normally, the tests and code would of course be split.

#include "gtest/gtest.h"
int multiply(int a, int b) {
  return a * b;
TEST(HelloTest, Multiply) {
  EXPECT_EQ(2, multiply(1, 2));	
int main(int argc, char **argv) {
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();

To compile the code above, take care to include all required arguments. The default executable binary output is “a.out” (or use the -o option to set a custom name), which can be executed, and the test result output should show.

g++ -pthread hello_test.c -lgtest_main -lgtest

Comments Off

QNAP compatible encrypted disks

Comments Off

I’ve previously written about encryption on the QNAP TS-431P NAS and basic cryptsetup usage. Since then, encryption standards and defaults have changed, and it is now easy to create an external encrypted disk which cannot be mounted by a QNAP NAS. The following shows how to work around the issues with cipher and ext4 journaling settings.

The first issue has to do with the default cipher algorithms on Ubuntu and QNAP. As of Ubuntu 16.10, the default cipher is Advanced Encryption Standard (AES) in xts-plain64 mode with a SHA256 hash. The default and supported encryption on the QNAP NAS is also AES, using “128-bit block size, with key sizes of 128, 192 or 256 bits”. However, the supported mode is cbc-essiv:sha256 with hash spec SHA1, as with older Ubuntu and Debian distributions. When trying to decrypt the drive on the NAS, you might see errors like “Failed to setup dm-crypt key mapping for device /dev/sdc1. Check that kernel supports aes-xts-plain64 cipher (check syslog for more info)” and in /var/log/storage_lib.log an error like “crypt: IV mechanism required”.

It should be noted that this is most likely not an issue with volumes created by the NAS itself on its internal drives, unless you start moving drives from one NAS box to another, which is probably not recommended in the first place.

To see the supported ciphers, both on a normal GNU/Linux distribution and the QNAP, use the following commands:

cat /proc/crypto
cryptsetup --help

Also, to see the currently used cipher and LUKS formatted volume, use the luksDump command:

cryptsetup luksDump /dev/sdX1


If you start from scratch, it’s easy to work around the incompatibility. Follow the instructions in the cryptsetup basics article, but add the following options for cipher and hash function to the luksFormat command. Note that this will format and erase all data on the partition.

cryptsetup luksFormat --cipher aes-cbc-essiv:sha256 --hash sha1 /dev/sdX1

You might also consider ext3 over ext4, since the former seems better supported by the QNAP NAS at the time of writing. See below for further details.

Changing the cipher

If on the other hand, you discover the incompatibility a bit too late, and have already filled up the external disk with a lot of content, you’re not all out of luck. You’ll just have to decide which way you’d like to waste your time: You can transfer it all over to another disk, reformat, and then transfer back. It will take a few hours, and a bit of work. Or, you can change the encryption cipher on the existing volume, using the cryptsetup-reencrypt tool. However, you’ll probably have to wait multiple days while the whole disk is re-encrypted. On a 2 TB external disk over USB 2.0, it took about 35 hours to complete.

cryptsetup-reencrypt --cipher aes-cbc-essiv:sha256 --hash sha1 --key-file /tmp/keyfile --key-slot 0 /dev/sdX1

Notice that the command uses the same cipher and hash arguments above. However, it adds arguments for the key file to unlock the volume, and which key slot that file is linked to. This is necessary to avoid being asked about each and every password for each of the key slots. Of course, if you have only added a single password based key slot, these arguments can be skipped, and you’ll have to type the password once.

ext4 journaling compatibility

Once the encrypted volume can be opened, there might still be hurdles. The default settings for the ext4 journaling might also not be compatible with the QNAP NAS. At this point, I have to admit I lost interest in researching exactly what the cause was, and fired off multiple changes at once. The error when using the mount command was “mount: wrong fs type, bad option, bad superblock on /dev/mapper/sdc1, missing codepage or other error”.

The default features set from the Ubuntu 16.10 created ext4 formatted partition was:

dumpe2fs /dev/mapper/sdc1
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum

The following commands removed a few of them, changed to 32 bits, finished with a check:

tune2fs -O ^huge_file /dev/mapper/sdc1
tune2fs -O ^dir_nlink /dev/mapper/sdc1
tune2fs -O ^extra_isize /dev/mapper/sdc1
tune2fs -O ^metadata_csum /dev/mapper/sdc1
e2fsck -f /dev/mapper/sdc1
tune2fs -O ^64bit /dev/mapper/sdc1
resize2fs -s /dev/mapper/sdc1

In the end, the following features remained, and the volume mounted.

Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file uninit_bg

Comments Off