Blogging with LibreOffice

This post is just a WordPress workflow test.

The goal (heading 3)

The goal is to find a reasonable way to edit a blog post in WordPress without using the online editor (previous 5 words underlined). The reason is that my internet connection is sometimes unreliable and after having lost the whole text of blog posts during editing, I prefer to edit, format save the text offline using LibreOffice.

This text is therefore edited and formatted entirely in LibreOffice 5, complete with hyperlinks. Below, I also include a one column/2 row borderless table with an image in the first row and a centered caption in the second row:

Above is a random image.
This is the centered image caption, complete with some bolded text.

Having formatted the text, one should be able to transfer the whole thing into WordPress by copy/paste or some other simple process. It goues without saying the transfer should be complete with formatting, tables, links and images. But when I try direct copy/paste, everything just disappears (previous 3 words in italics).

The solution? (heading 3)

Searching the web, I found that lots of of people have similar needs. One tip that seemed interesting was to work around the problem by first pasting the formatted text into an Online HTML editor and then from that into WordPress.

If you read this post, it means the procedure works.

Code::Blocks with MSVC2013

This is a quick placeholder post on how to set up the C++ IDE Code::Blocks with the Microsoft Visual Studio 2013 tool chain. The main information is found in this PDF.

Quote from the PDF:

“This document aims to explain a way to configure Code::Blocks on Windows using different Visual
Studio C++ compilers and Windows SDKs. Where relevant it is discussed how to compile for x86
(32bit) and x64 (64bit) executables.

The general approach taken is to employ the Code::Blocks global variables for configuration of the
compiler and related tools, i.e. set the global variable values according to the needs of the compiler,
SDK and target processor architecture. Examples are provided for MSVC2010 and MSVC2013. By
extension, it should be feasible to reconfigure for other MSVC versions.”

If you have questions or comments to the method described, please comment below.

A pipe dream come true

The old sewage pipes have been a worry since we found out their condition recently. Fixing it seemed like a pipe dream. Today that dream came true, the plumber arrived and did a great job! The old cast iron pipes are out and modern plastic ones are in.  A last goodbye to the old rusted pipes:


The new plastic pipes have been installed, quite some difference compared to before:


A second pipe goes under the wall next to the fireplace. It continues under the chimney behind the wall and into a washing room.  A pipe from the kitchen also connects there. The big problem with the pipe under the chimney was that it was rusted and totally filled with old muck.  With a lot of effort and high water pressure, enough of it was cleaned to allow a slightly smaller plastic pipe to run inside it. We were saved!


Here is a detail of that connection.   The top one had to be cut a bit more after the image was taken as it was cracked. Luckily, the material further in was fine.


In the other end the pipes meet and go though the outside wall.


Tomorrow the new pipes will be covered by concrete, to prepare for pouring the new concrete floor on top.  A person from the company who will pour the floor showed up today so it seems to come together quite nicely now.


It has been a while since the last post, and it is for a reason. On September 2nd we experienced very heavy rainfall, I measured 143mm rain on my weather station that day. The result was that our basement was flooded, the water level was 7-8 cm above the floor. As the basement contained old furniture, library and a home office with desktop computers we found ourselves in crisis mode.

The first action was to limit the damage by moving everything away from the basement and start pumping water. That’s a long story in itself, but to cut it short we got assistance from the insurance company. The second realisation was that  the drainage system needed improvement, here is a small part of that effort:


My desktop computer found itself under water as well.  The water level was at least up to the bottom PCI slot in the image below. After cutting power and pouring water out of the cabinet, plus drying it for a couple of days, the machine actually rebooted. The only problem was that the motherboard sound card was fried and totally silent.  A cheap sound card was ordered and installed a few days later. It turned out the sound card (ASUS Xonar DG) had limited Linux support, but with a bit of effort it worked just fine, and the computer was back in business:


However, the basement was still a complete mess. The wooden floor with heating had been removed and under it we found rough concrete with sand used for levelling (the house is from 1969).  The sand was now all wet and very difficult to remove:


The solution was provided by these guys, who sucked out all the sand to allow the the floor to dry:


In theory, we could then start planning of the basement floor rebuilding. However, a “problem rarely arrives alone” as we say here.  As the house is from 1969 and the sewage pipes from that period are made from cast iron, it made sense to inspect them for damage.  That turned out to be a good idea…


The pipes are completely rusted and in urgent need of replacement. The needed repairs triggered by the flooding are just growing in magnitude and cost. They just have to be done. One might even argue that the good news is that due to the flooding we got a chance to inspect and replace the pipes.  The plumbers will arrive tomorrow…

This post could have been ten times longer, but the main idea is to explain the lack of recent blog posts.  Hopefully, we are now at the low point of this experience. Let the reconstruction begin!

Luk thung

I tend to enjoy a bit of variety, so therefore this post offers something out of the ordinary: a teaser on  popular rural Thai music.

‘Luk Thung’ (Thai: ลูกทุ่ง ) is short for ‘Phleng luk thung’  which means something like ‘song of a child of the fields’. It is a music style from the north-eastern provinces of Thailand, referred to as Isan, where rural life is dominated by the poor working in the fields under a blistering sun. Luk thung music is said to reflect the hardships in this kind of life. The tempo is slow and the style of singing is very different from  western popular music. Being different, it becomes interesting.

A westerner would perhaps assume this style of music is traditional folk music, but it really isn’t. It is a relative new creation not much older than western popular music, but with obvious influence from Thai culture and traditions.  Some of the luk thung artists are no less than superstars in Thailand, selling millions of records. Still, most people in the west have no idea of their existence.

There is an obvious language barrier, as the songs are performed exclusively in Thai, Lao and Isan dialects. However, when I was a kid I listened to English language music without understanding the words. Understanding the words is not always required in music, and I don’t pretend to understand the words of Luk thung music.

Below is an example of Luk Thung music, the artist is Tai Orathai .

Tai Orathai


For more information on Luk thung, see for example *Luk thung* (Thai country song) and the history of popular music in Thailand from the 1930s up to the present.


Back in the day – in 1969 – American space travel was inspiring. The mighty Saturn V rockets, 110m tall and 10m wide, launched Apollo 11 to the Moon and inspired everyone who saw it.

Saturn V Launch with Apollo 11


Recently, I discovered a model of the mighty rocket on Thingiverse so I thought it would be fun to print it.  the model was split according to the original rocket stages, i.e. 3 rocket stages and the parts which flew to the Moon.


The printed model is 30 cm tall, so essentially it is a 1/366 scale model of the original.  It was printed using 0.1 layer thickness, so each part took about 2-3 hours. It snapped together very nicely.


This model  will be allocated visible location in the living room!

Greece should be proud

I have been following the Greek story for a number of years and intensely the last months and weeks.

In short, the story began in earnest when Greece adopted the Euro 1 January 2002, only 13 years ago.  At that point, the country could no longer control its currency exchange rate, but suddenly it had almost unlimited access to low interest loans. For a country like Greece, this was an arrangement certain to fail. Greece was never qualified to adopt the Euro, but with the help of Goldman Sachs and its own corrupt elite, the books were cooked and Greece became an Euro member anyway. At that point the rules was well and truly bent, but the EU did not have any problem with broken rules in 2002.


Enter the money-lenders. Big, privately owned German, French and other banks offered huge loans for big projects like the Olympic Games in Athens 2004, plus a number of other large projects. As long as the economy was booming, no-one seemed to care about repayment.

In 2008, the financial crisis arrived, and Greece was hit like no other country in the EU as it entered into recession. The huge Euro debts it had acquired could not be paid back. If Greece had not already converted to the Euro, it could have devalued the Drachma and that way made imports more expensive and exports cheaper. That would have made Greek export more competitive, lowered domestic interest rates and they could have worked their way out of the problems, like many other countries had done before them. But since Greece no longer had the Drachma, it could no longer control its currency exchange rate and devaluation was not possible.

Greece was unable to pay its debts in 2010 and was bankrupt because of domestic and foreign mismanagement. A Greek default in 2010 would have caused major discomfort to the debtor banks. This did not happen, however, because the so called “Troika”, namely the EU, ECB (European central bank) and the IMF (International Monetary Fund), “helped” by giving Greece more loans, 110 billion Euros. Almost all of these new loans never entered Greece, it went straight into the bankrupt banks outside of Greece to cover the bankruptcy. It wasn’t Greece which was “bailed out”, it was the banks! Through this brilliant move, the debt was now suddenly on the tax payers of Europe. This is how you rob people, both in Greece and elsewhere in the EU.

The next stage was the stage of “reforms”. Now, in return for its “help”, the Troika demanded severe cuts in the Greek economy. This caused the Greek GDP to contract by 25-30% and caused mass unemployment, especially among young people. The ability to pay back the loans was steadily diminished because of this, and the problems naturally kept growing. Greece had no chance to limit its deficit to 3% as required by the EU, in 2009.

Greece is far from guilt free in this. Businesses didn’t pay enough taxes and the corrupt government enlisted banks like Goldman Sachs and JPMorgan Chase to cook the books once again, while the EU looked another way. The result is that in 2015, the Greek debt is about 180% of GDP, up from 100% in 2010, and 3 times the maximum allowed in the EU. As the the EU austerity policy forces the reduction in GDP, the debt/GDP ratio just grows. It is almost like someone wanted it to be that way.

Enter the January 2015 elections. The traditional corrupt Greek politicians (PASOK and New Democracy) were essentially swept aside and a new party, SYRIZA, comes out victorious. Their message is to end the damaging austerity policy and find an agreement with the EU so that the debt can be paid back. and the economy rebuilt.  For this to happen, the Greek economy must grow. As it stands, it is mathematically impossible to pay back the debt, it will just increase to infinity because of interests and the ever smaller size of the Greek GDP.

So what does the so called “EU leaders” propose to solve this conundrum? More austerity! It defies any logic, regardless of how you look at the former and current Greek politicians handling of the matter. The only logic that makes any sense is that the plan is to loot the country completely, both for the sake of the remaining Greek assets and as a “reminder” to other countries that may be on a similar path (make that Italy, Spain, Portugal, Ireland and maybe France).

After months of negotiations, where the Greek negotiators have bent over backwards to try to find a viable deal, i.e. one that allow them to pay their debts without killing the economy and the people, the only replies from the unelected EU bureaucrats have been more “reforms”, i.e. more of the same austerity policy that has transformed Greece from a problem area and into a disaster zone.

This behaviour from the EU is simply criminal, as it is well understood by the EU politicians and unelected EU bureaucrats. The former Greek finance minister Yanis Varoufakis said: “What they’re doing to Greece has a name: terrorism”.

In a surprise move on June 30th, the Greek prime minister Alexis Tsipras called a national referendum July 5, asking the Greeks if they would accept the conditions put forward by the EU and Troika. Instead of suggesting a referendum to the Troika, something which has led to “regime change” in Greece only a few years ago, Tsipras announced the referendum directly on TV. This was too short time for the media and EU machinery to manipulate the process, although they tried very hard to tell the Greeks to accept more austerity and that anything else would be catastrophic.

The result of the referendum was that about 61% voted OXI (“no”) to the EU conditions. This was a stunning lesson in democracy from the country where democracy was born, and the EU was totally naked. It was now much harder for the Troika to impose the policy that has been proven to not work (assuming their aim is to help Greece). Still they tried, disregarding mathematical laws.

This time, it seemed very important for the EU to “follow the rules”, rules they had themselves broken long ago. The reason for this irrational stance is that if the EU writes off enough of the Greek debt (it will never be repaid anyway), the tax payers of the Eurozone will be handed a huge bill. One suspects the bureaucrats think there could be “blood in the streets”. Secondly, many of these taxpayers live in France, Italy and Spain, countries with problems similar to Greece. The dominos will simply start to fall and the Euro and the EU will become history very quickly if countries like Spain have to pay the Greek debt.

So what is the best scenario for Greece and the EU?

The best scenario for Greece is to defaults on its debt, exit the Eurozone and adopt its traditional currency, the Drachma. Then devalue it to make export more competitive. This will be extremely hard on the Greek people, the times ahead will be very tough. However, through this move they regain their sovereignty and with time and hard work they will come back stronger than before, I am certain Greece will again be proud.

The EU will be able to show how deep the solidarity goes towards smaller countries. The EU will also be able to prove its assurances that the rest of the EU will be just fine after Greece exits the Eurozone and possibly even the EU. The fact of the matter is, however, that the EU has now been exposed, the peoples of Europa have seen who the unelected EU-bureaucrats and EU-politicians are, and who they represent. It is not the peoples in Europa.

Edit 11. July 2015: Yanis Varoufakis has written an article titled “Behind Germany’s refusal to grant Greece debt relief” in which he writes:

“Our government was elected on a mandate to end this doom loop; to demand debt restructuring and an end to crippling austerity. Negotiations have reached their much publicised impasse for a simple reason: our creditors continue to rule out any tangible debt restructuring while insisting that our unpayable debt be repaid “parametrically” by the weakest of Greeks, their children and their grandchildren.

In my first week as minister for finance I was visited by Jeroen Dijsselbloem, president of the Eurogroup (the eurozone finance ministers), who put a stark choice to me: accept the bailout’s “logic” and drop any demands for debt restructuring or your loan agreement will “crash” – the unsaid repercussion being that Greece’s banks would be boarded up.”


“Based on months of negotiation, my conviction is that the German finance minister wants Greece to be pushed out of the single currency to put the fear of God into the French and have them accept his model of a disciplinarian eurozone.”


In the Printrbot – Heated Bed post, I mentioned the covers to go over the wings of the heated bed.  I asked for comments to the blog posts, and today a request for the wings design files was posted in the comments of that post. I am therefore happy to say they are now available for download at

I have been using the printer with the wing covers quite extensively for about 3 weeks, and they work just as intended as far as I can tell.  Note that the photo shows a small rectangular hole on the left which is not in the uploaded model. The large rectangular hole is to allow access to the X belt tensioner. The smaller rectangular hole was not required and therefore removed in the model.

The covers are designed as solid parts, but printed with “hollow” infill and 0.8 mm skin. The parts should be hollow since air is a good heat insulator. With the insulation I can reach 60C bed temperature in 4-5 minutes and 100C in 19-20 minutes.

About comments

Almost every day I check for comments to the posts, but find that all I get is spam posts in the spam filter :-) Does that mean no-one reads this blog? Perhaps, but the visitor count is increasing …

If you happen to visit and find something of interest, you are now encouraged to make a comment, if you prefer you can do it anonymously. With comment feedback you may influence the contents of future posts, otherwise I get 100% of the votes and that’s not fair :-)

You can for example begin with a simple hello below this post!

A wheel centre cap

In the post about printing 3d gears, we saw that it was possible to print replacement gears for car parts. I have now received a report that the printed gear works after several weeks of in-car testing, so let us count that as a success. In fact, it was so successful that I got a request to print another part that was missing; a press-fit wheel centre cap, original as below.


The owner also wanted the logo on the replacement part. When you don’t pay, there is no limit to what you can ask for :-) Anyway, I thought we might give it a try.

First step was simply to place the original on the flatbed scanner and make an image of the logo. I could have found the logo on the web, but that is cheating. Instead the scanned image was imported into Photoshop and turned into a monochrome image and blurred/clipped and saved to a PNG file.


Then, OpenSCAD  was fired up, and the following script was edited


In the above code, the d1 to d4 parameters define measured diameters (using a caliper) on the original. d1 is the outermost diameter. Similarly h1 to h4 define the heights measured from the bottom when logo is pointing down.

The “logo()” module imports the scanned image and turns it into a 3d object. A slice of that is created by intersecting it with a “cube” (actually a cuboid). The intersection is then scaled, rotated and translated to fit the size and orientation of the printed object.

The “bottom()” module is simply a short cylinder minus the logo at bottom and a smaller cylinder on top, to create a “rim” on the bottom part.

The “teeth()” module describes the 2d profile of the teeth that grips the wheel and then performs a rotational extrude (360 degrees). This is then intersected with the result of the “cross()” module which simply defines a cross from 2 cuboids. The result is 4 teeth, separated by 90 degrees.

All in all, less than 60 lines of code. We then get this OpenSCAD model to export as an STL file.


There are many ways to process an STL file, but generally it needs to be run through a “slicer” program to generate the G-code that a printer can understand. There are many very good slicer programs, including slic3r and Cura, but recently I have been using KISSlicer, as it has many nice customization options.


After completing the slicing, we have the G-code to send to the printer. I am using OctoPrint running on a wireless Raspberry Pi to control the printer, so the G-code is sent to OctoPrint via the web browser on the PC. OctoPrint can also display the temperature of the hot end and the heated bed. All we have to do is check that the printer calibration is ok and commit the print:


When finished, we have something that closely resembles the OpenSCAD model.


When we turn the print around, we also see something that resembles the logo. It is not perfect, but it is there. One idea is to fill the void with some dark filler and sand the top surface a bit. Then it might pass :-)


A challenge with a part like this is that the printed part is relatively brittle compared to the original, so it is hoped that the teeth simply do not break off. This is why the printed teeth are made wider than in the original, where it is only the smaller teeth that grip the wheel.