Author Archives: Jochen Kirstaetter

Ghost Desktop on Xubuntu 17.04 won’t start

Ghost Desktop on Xubuntu 17.04 won't start

Already before the migration from Joomla to Ghost last weekend I run the Ghost Desktop application on Windows. Now, after the successful completion it was about time to get going on my other machines. You know, the ones away from the main rig... Usually used during the evening hours, just for fun, or experimenting.

Tonight, I decided to give one of my Linux systems some attention, started to upgrade some packages, and installed new software. Among those also Ghost Desktop App for Linux. On the Ghost website you get version 1.3.0 (as of writing), and it's a Debian package.

Knowing that the desktop app is an Electron-based application, and I already packaged a few Electron apps myself, it would run on any Ubuntu-based system, too.
Note: This post was written in Ghost Desktop running on Xubuntu 17.04 64bit

Installation of Ghost Desktop

Either you double-click on the downloaded .deb package and your system will prompt you to open/install the application in Software, or you can run the following command in the Terminal:

$ sudo dpkg -i ~/Downloads/ghost-desktop-1.3.0-debian.deb 

Ghost Desktop can then be launched via the Application Menu/Launcher under ghost-desktop or if you prefer the terminal:

$ Ghost

The problem: Ghost Desktop won't start

If you try to launch the application via the menu or any other GUI launcher you won't get any response at all. The software just isn't executed, it seems.

Compared to running it in the Terminal. This might produce the following output:

$ Ghost
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Unable to find a valid app
    at Object.<anonymous> (/usr/lib/Ghost/resources/electron.asar/browser/init.js:121:9)
    at Object.<anonymous> (/usr/lib/Ghost/resources/electron.asar/browser/init.js:173:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:424:7)
    at startup (bootstrap_node.js:147:9)

The solution: Set permissions

Fortunately, this has been reported already on GitHub by user letsjustfixit. The issue is caused by a missing permission bit on the Electron app. A temporary workaround has been documented until the package is going to be fixed.

Run the following chmod to set read and execute bits on the Electron app and dependent components. Then launch Ghost Desktop again.

$ sudo chmod -R +rx /usr/lib/Ghost/resources/app
$ Ghost 

 ⚡️  Welcome to Ghost  👻

Happy blogging!

It's great to see that such issues are handled on GitHub, and the "fix" is easily done.

As maintainer of own Electron-based applications I'm interested in the root cause. So far, I didn't come across a similar problem (touching wood!). Thankfully, I'm going to add this to my notes on Electron.

If you're familiar with this kind of problem regarding Electron packaging on Linux, give it try to fix it. On my side, I already cloned the Ghost-Desktop repository. Let's see whether I'm able to create a pull request for the Ghost community.

Installing Visual Studio Code on Linux (Ubuntu)

Installing Visual Studio Code on Linux (Ubuntu)

During this year's //build conference Microsoft officially announced a new member of the Visual Studio series called Code. As described by several people already it is a HTML5, JavaScript/TypeScript based text editor hosted inside the Electron shell and it runs natively on Windows, Mac OS X and Linux. This article hopefully gives you some ideas during installation and assistance to have an improved experience out of the box compared to the standard option - at least at the time of writing this article.

Getting Visual Studio Code

I started using Visual Studio Code since the first released version 0.1.0, and being part of the Insider Preview program for VS Code I managed to download and get the latest version always using this short-listed link:

https://aka.ms/vscode

Which is an alias for this web address: https://code.visualstudio.com/

Installing Visual Studio Code on Linux (Ubuntu)
Get the latest version of Visual Studio Code from the web site

Microsoft's web site of Code detects your operating system and directly offers you the best download option based on your current browser. I'm currently running Xubuntu 15.04 x64 - Vivid Vervet and the site offers me a direct link to get the latest 64-bit version of Visual Studio Code. In case that you'd like to download a different version please scroll down to the bottom of the site and check the additional options.

Note: Originally, I started using Code 0.1.0 on Xubuntu 14.10 and then upgraded my machine around mid of May. Also, on a different machine running Ubuntu 14.04 LTS I can confirm to use Visual Studio Code successfully.

Unzip the archive

After you downloaded the latest ZIP archive for your architecture, here: VSCode-linux-x64.zip, you should decide where to extract the content of the compressed file. Well, in my case, I'd like to have third party products below the appropriate location, and therefore I usually choose /opt. Eventually you might ask yourself why? Well, here's a decent chapter about the Linux Filesystem Hierarchy written by The Linux Documentation Project (TLDP):

1.13 /opt

This directory is reserved for all the software and add-on packages that are not part of the default installation. For example, StarOffice, Kylix, Netscape Communicator and WordPerfect packages are normally found here. To comply with the FSSTND, all third party applications should be installed in this directory. Any package to be installed here must locate its static files (ie. extra fonts, clipart, database files) must locate its static files in a separate /opt/'package' or /opt/'provider' directory tree (similar to the way in which Windows will install new software to its own directory tree C:\Windows\Progam Files\"Program Name"), where 'package' is a name that describes the software package and 'provider' is the provider's LANANA registered name.

Looks good to me, or?

Anyway, let's just use this as base - given that you're root on the machine - it's surely a good choice, otherwise feel free to unzip the archive in your personal user space below your home directory. Next, let's extract the content as suggested using the console (or terminal in case that you'd prefer this term):

$ cd /opt
/opt$ sudo unzip ~/Downloads/VSCode-linux-x64.zip

This is going to create a new directory VSCode-linux-x64 which contains the static binary to run Visual Studio Code on your system. Right now, you would be able to launch the text editor by executing the following command:

/opt$ ./VSCode-linux-x64/Code

Despite some warnings and errors on the console output, similar to those:

[3437:0724/220852:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

Visual Studio Code is up and running...

Installing Visual Studio Code on Linux (Ubuntu)
Welcome screen of Visual Studio Code on first start of the text editor

Adding a little bit more comfort

Hopefully, you were able to launch Visual Studio Code based on the description given above. Now, let's add a little bit more comfort to your user experience. Unfortunately, there is no out-of-the-box installation package for the usual distributions - at least not yet, and we are obliged to do some manual steps. Following, I'm going to give you my steps with some brief explanations about the why and how. Of course, there are always multiple choices and you might either skip one or the other step or even have better suggestions. Please use the comment section at the bottom to give me your tips & tricks. Thanks!

Version-(in)dependent folder and symbolic link

Not sure about you but given the manual installation steps I would like to have a better control each time I consider to install a newer version of Code. Also, this helps to keep some adjustments on constant path information like Application launcher and shortcuts to run Visual Studio Code. Okay, let's dig into that and first rename (move) the base directory of Code to a version-specific one:

/opt$ sudo mv VSCode-linux-x64 VSCode-0.5.0

Again, as of writing this article 0.5.0 was the latest available version. Meanwhile, the are good chances that you might have a higher version already - good! Next, I usually create a symbolic soft link back to the newly renamed folder in order to stay version-independent. Sounds confusing, right? Hold on, I'll explain it in a short, and you will see the benefits, too.

/opt$ sudo ln -s VSCode-0.5.0 VSCode

Your own /opt folder might look similar to this one right now:

Installing Visual Studio Code on Linux (Ubuntu)
Extract the Visual Studio Code zip archive below /opt directory and create a version-independent symlink

As you can see on the screenshot I've been using Code since the very beginning, and using this approach I am actually able to keep all versions installed side-by-side next to each other. The most interesting part is the version-independent symlink in the /opt directory. This allows me to launch Visual Studio Code by executing the following line from anywhere:

/opt/VSCode/Code

Like using the Application Finder on Xubuntu after pressing Alt+F2:

Installing Visual Studio Code on Linux (Ubuntu)
Launch Visual Studio Code from the Application Finder with fully qualified path to executable

This scenario gives us a good head start for further activities.

The power of PATH

Now that we have a "fixed" location for Visual Studio Code, it would be more comfortable to avoid to specify the full path information each time that we would like to launch the text editor. Also, looking to some of the cool command line options of Code on other platforms, it would be nice to have them as well on Linux. Okay, then let's do it using the PATH environment variable. The Linux Information Project has a good definition online:

PATH Definition

PATH is an environmental variable in Linux and other Unix-like operating systems that tells the shell which directories to search for executable files (i.e., ready-to-run programs) in response to commands issued by a user. It increases both the convenience and the safety of such operating systems and is widely considered to be the single most important environmental variable.

That sounds exactly like what we are looking for. And in compliance with other operating systems, we are going to create another symlink for our purpose, like this:

~$ sudo ln -s /opt/VSCode/Code /usr/local/bin/code

Changing the letter casing of the executable from proper writing - Code - to lower case writing - code - isn't a typo actually.

Update: Recently, I discovered that the official guide on Setting up Visual Studio Code on Linux also mentions the creation of a symlink as a tip.

Commonly, UNIX and Linux commands are written in lower-case writing anyway, so why should we break with this tradition? Of course, you will be able to launch the text editor now with this new path, too. Either on the console / terminal, like so

~$ code

or using the Application Finder - the choice is yours.

Installing Visual Studio Code on Linux (Ubuntu)
Launch Visual Studio Code from the Application Finder

Thanks to the PATH environment variable we can now completely omit the path information. Linux knows where to find our executable now.

Application launcher in Main Menu

Being able to start Visual Studio Code anywhere from the console has already given us some comfort but compared to Windows and Mac OS X users we are still living in the digital stone age, and no application is fully installed on your Linux OS without an application launcher in your main menu. In Xubuntu you would open Application Menu (or press Alt+F1) - Settings - Main Menu in order to add a new launcher to the menu. In the menu editor select the Development section or any other where you would like to place the launcher and click on New Item to define the Launcher Properties. Eventually, you might like to enter the following on your machine:

Installing Visual Studio Code on Linux (Ubuntu)
Add a new item to the main menu for Visual Studio Code

Unfortunately, this leaves us with an empty icon for now. Quickly open a new terminal and switch to an existing one and let's see which graphics are provided by Microsoft, like so:

~$ find /opt/VSCode/* -type f -iname '*.png'
/opt/VSCode/resources/app/vso.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-up.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-left.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-right.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-right-dark.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-left-dark.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-down-dark.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-down.png
/opt/VSCode/resources/app/client/vs/base/ui/scrollbar/impl/arrow-up-dark.png
/opt/VSCode/resources/app/client/vs/editor/diff/diagonal-fill.png
/opt/VSCode/resources/app/client/vs/editor/css/arrow-left.png
/opt/VSCode/resources/app/client/vs/editor/css/arrow-right.png
/opt/VSCode/resources/app/client/vs/workbench/contrib/daytona/TestPlugin/Resources/Images.png
/opt/VSCode/resources/app/client/vs/workbench/contrib/daytona/TestPlugin/Images/FileIdentifier.png
/opt/VSCode/resources/app/client/vs/workbench/contrib/daytona/TestPlugin/Images/icon2.png
/opt/VSCode/resources/app/client/vs/workbench/contrib/daytona/TestPlugin/Images/icon3.png
/opt/VSCode/resources/app/client/vs/workbench/contrib/daytona/TestPlugin/Images/icon1.png
/opt/VSCode/resources/app/client/vs/workbench/contrib/daytona/TestPlugin/Images/console-icons.png
/opt/VSCode/resources/app/client/vs/workbench/ui/parts/editor/media/letterpress.png
/opt/VSCode/resources/app/client/vs/workbench/ui/parts/editor/media/[email protected]
/opt/VSCode/resources/app/client/vs/workbench/ui/parts/editor/media/letterpress-dark.png
/opt/VSCode/resources/app/client/vs/workbench/ui/parts/editor/media/[email protected]
/opt/VSCode/resources/app/node_modules/emmet/Icon.png

Alternatively, you might also have a look at the SVG graphics provided by Visual Studio Code.

I chose the vso.png and to simplify my life in regards of future upgrades and unexpected changes, I placed a copy of the graphic file into the usual location on a Linux system:

~$ sudo cp /opt/VSCode/resources/app/vso.png /usr/share/icons/

Hint: Use the Move option in the window menu to relocate the dialog using the arrow keys, and then confirm your selection with a click on the OK button of the dialog.

Your Main Menu editor might look like this now:

Installing Visual Studio Code on Linux (Ubuntu)
Visual Studio Code as proper entry in the main menu of Xubuntu

Congratulations, your new application launcher has been added to the menu and you can either navigate into the Development section (or the one you chose) or type your choice into the application quick filter textbox to find and execute Visual Studio Code.

Installing Visual Studio Code on Linux (Ubuntu)
Navigate the application menu to launch Visual Studio Code

Installing Visual Studio Code on Linux (Ubuntu)
Use the quick filter entry of the application menu to launch Visual Studio Code

Creating a Desktop Entry file

As we are working with Linux there are always multiple ways to achieve the same or similar result. And eventually you might prefer the possibility to create and use a file-based application launcher which adds itself to the menu structure automatically. Creating a .desktop file is not too challenging and requires a simple text editor - like Visual Studio Code ;-) - to write the following definition into it:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Visual Studio Code
GenericName=Integrated Development Environment
Comment=Code Editing. Redefined. Build and debug modern web and cloud applications.
Exec=code
TryExec=code
Icon=vso
StartupNotify=true
Terminal=false
Type=Application
MimeType=text/x-csharp;application/x-mds;application/x-mdp;application/x-cmbx;application/x-prjx;application/x-csproj;application/x-vbproj;application/x-sln;application/x-aspx;text/xml;application/xhtml+xml;text/html;text/plain;
Categories=GNOME;GTK;Development;IDE;

Save it as vscode.desktop and then put this file into the appropriate location for a Linux system:

~$ sudo cp vscode.desktop /usr/share/applications/vscode.desktop

Thanks to the proper location of the shared icon and the symlinks we created earlier, we do not have to specify any absolute paths in our Desktop Entry file. As soon as the file has been copied below the shared applications folder it automatically appears in your main menu and is ready to be used.

For your extra comfort you might like to download the vscode.desktop file. You will have to rename the file and place it accordingly on your system.

Make it a launcher in Cairo Dock

As for the different options of Ubuntu I have to admit that I'm a long-year user of the Xfce environment, called Xubuntu, and on top I also like using a flexible dock panel (or two or three). Cairo dock is a fantastic package in case that you would like to have a little bit of Mac OS X flavour on your Linux desktop, and adding a launcher for Visual Studio Code is very simply to do.

Installing Visual Studio Code on Linux (Ubuntu)
Add Visual Studio Code to a dock panel like cairo dock or similar

First, run Visual Studio Code using one of the previously described methods. Next, after the application runs and an icon of code appears in the dock panel right-click the icon, then select the sub-menu entry "Make it a launcher" from the "code" context menu entry and you're done. That's actually similar to pinning an application to the taskbar in Windows 7, Windows 8 or Windows 10. Close the text editor and your new launcher will still remain in the dock panel.

Resume on installing Visual Studio Code

Without any question it is fantastic to have an identical text editor for all three major operating system. But Linux users are currently confronted with some lack of comfort compared to their Windows and Mac OS X friends. Although there are several and in my opinion easy ways to increase the user experience in using Visual Studio Code under Linux I'm a bit concerned whether Microsoft is keeping it on par to the other systems. Right now, installation takes some manual steps, there are essential parts missing in order to provide an excellent first contact and other editor features like automatic updates aren't yet available for the Linux variation compared to Windows and Mac OS X.

Bearing in mind that the product has been launched back in April/May this year only and we are currently on version 0.5.0, I am very interested in the future development. The documentation online has some neat features for you, and the team at Microsoft has an open ear to the feedback and wishes given on their UserVoice website, too.

That's all for the installation part of Visual Studio Code. Please leave your comments as well as tips & tricks for me.

Happy coding!

Ubuntu Jam at the University of Mauritius

Ubuntu Jam at the University of Mauritius

Operating systems are simply tools to do a job...

And therefore, I have to admit that even though I use Microsoft Windows on a daily base to earn my living, I'm also using Linux since almost two decades on various machines. Together with different types of virtualisation I actually do not care whether an OS is running on bare-metal or inside a virtual machine. And given the computing power of recent machines it's not a question after all anymore. Given this little insight, let's directly hop into the Ubuntu Jam event from February 2015.

Saturday is usually the time the children are on tour with me and so why not take them to the University of Mauritius and have some fun together. Also, they know quite a number of folks of the Linux User Group of Mauritius, too. When we arrived at the campus it was actually simple to get a proper parking - just speak to the security guys around POWA, they are actually very friendly and willing to help. ;-)

Next, we had to look for those Linux geeks and penguins... Near the cafeteria they said, as if I know where the cafeteria is. Frankly, it was on our direct way to ask a group of students. Even though they gave us a strange but curious look, they were really glad to help and we managed to be around in time. Well, even too early... Anyway, enough time to get our gear in place. Even though that my dear son was more busy with his Nintendo DS than a Linux-driven laptop but hey that's absolutely fine. He's already geeky enough. Actually, later on - I don't know he managed it - he was gaming on someone else's Android smartphone.

Disclaimer: I won't be accountable for any hacks and root kit installations on your device that he's going to do!

So better keep your smartphone under your control. Anyway, it seems that the phone owner and my son had a good time checking out some gaming apps. This gave me a bit of liberty to show my older laptop running on Xubuntu 14.10, to answer a couple of Xfce4 related questions and to advertise the Developers Conference. Yes, I keep a git clone on that machine, too - actually running on different TCP ports on Apache and nginx simultaneously. Geeky style... 

Ubuntu Jam at the University of Mauritius
Lots of hardware and software during the Ubuntu Jam - and the choice of tools covered a wide range...

Ubuntu Jam at the University of Mauritius
Despite some light spray of rain, we had a great time during the Ubuntu Jam at the University of Mauritius (UoM)

Thanks to the vicinity of the UoM cafeteria it was a no-brainer to just get inside and grab some drinks and food for the lunch-break. Quite surprisingly, they also offer power drinks and other selections. Now, again well fed and still ambitious to handle Linux questions, I managed to get some exchange with Ish, Nirvan, Nadim, Pritvi and others regarding the organisation and ideas for the DevCon. Even though that there was a slight spray of rain, it seems that we all had a good time on the campus and I'm looking forward to attend the next Linux Jam - maybe then on openSUSE Leap or other distributions.

Upgrade to Xubuntu 15.04 – Vivid Vervet

Upgrade to Xubuntu 15.04 - Vivid Vervet

Running an operating system like Ubuntu or any of its derivates, like ie. Xubuntu, comes with some nice treats (and threats?). One of the nice things is that you'll get a scheduled upgrade approximately every six months. Usually, around April and October of each year. Meaning there are two releases per year resulting in those version numbers [Year].04 and [Year].10. Also, ever two years the April edition of Ubuntu is classified as a Long-Term Support (LTS) version which keeps an extended period of time. A nice touch and surely interesting for professional installations of Ubuntu but eventually not too practical for the daily use at home or when you're interested in latest versions.

Preparing the system

These steps are the same every time you decide to upgrade to the latest release. Eventually, you might be interested to update older installation and have a read here: 

In general, you should have a look at the official upgrade documentation of Ubuntu. Next, get your recent system up-to-date before you consider to upgrade. Also, take care that there are no pending partial upgrades or packages on hold. This might have a negative impact on the installation process of the newer packages. So, before you think about upgrading you have to ensure that your current system is running on the latest packages. This can be done easily via a terminal like so:

$ sudo apt-get update && sudo apt-get -y dist-upgrade --fix-missing

Upgrade to Xubuntu 15.04 - Vivid Vervet

Next, we are going to initiate the upgrade itself:

$ sudo update-manager

As a result the graphical Software Updater should inform you that a newer version of Ubuntu is available for installation.

Upgrade to Xubuntu 15.04 - Vivid Vervet

Ubuntu's Software Updater informs you whether an upgrade is available

Running the upgrade

After clicking 'Upgrade...' or 'Yes, Upgrade Now' you will be presented with information about the new version.

Upgrade to Xubuntu 15.04 - Vivid Vervet

Details about Ubuntu 15.04 (Vivid Vervet)

Simply continue with the procedure and your system will be analysed for the next steps.

Upgrade to Xubuntu 15.04 - Vivid Vervet

Analysing the existing system and preparing the actual upgrade to 15.04

Upgrade to Xubuntu 15.04 - Vivid Vervet

Next, we are at the point of no return. Last confirmation dialog before having a coffee break while your machine is occupied to download the necessary packages. Not the best bandwidth at hand after all... yours might be faster.

Upgrade to Xubuntu 15.04 - Vivid Vervet

Are you really sure that you want to start the upgrade? Let's go and have fun!

Anyway, bye bye Unique Unicorn and Welcome Vivid Vervet!

In case that you added any additional repositories like Medibuntu or PPAs you will be informed that they are going to be disabled during the upgrade and they might require some manual intervention after completion.

Upgrade to Xubuntu 15.04 - Vivid Vervet

Ubuntu is playing safe and third party repositories are disabled during the upgrade

Well, depending on your internet bandwidth this might take something between a couple of minutes and some hours to download all the packages and then trigger the actual installation process. In my case I left my PC unattended during the night.

Upgrade to Xubuntu 15.04 - Vivid Vervet

At the end Xubuntu will ask you whether you would like to remove old and obsolete packages of the previous version.

Upgrade to Xubuntu 15.04 - Vivid Vervet

Time to reboot

Upgrade to Xubuntu 15.04 - Vivid Vervet

Finally, it's time to restart your system and see what's going to happen... In my case absolutely nothing unexpected. The system booted the new kernel 3.19.0 as usual and I was greeted by a new login screen.

Honestly, 'same' system as before - which is good and I love that fact of consistency - and I can continue to work productively. And also Software Updater confirms that we just had a painless upgrade:

Upgrade to Xubuntu 15.04 - Vivid Vervet

System is running Ubuntu 15.04 - Vivid Vervet - and up to date

See you in six months again... ;-)

Post-scriptum

In case that you would to upgrade to the latest development version of Ubuntu, run the following command in a console:

$ sudo update-manager -d

And repeat all steps as described above.

Lets rock with MySQL and MariaDB

Logo of MariaDB Sealion mascotSome weeks months ago...

What happens on Facebook

I saw an announcement made by Ronny on Facebook that he's about to organise a meeting about MySQL and MariaDB. Well, I have to admit that I didn't have that much contact with Ronny but I knew that he was involved in the initiation of the Linux User Group of Mauritius (LUGM), and that Ish already mentioned his name a couple of times, mostly because of the inspirational approach and other funny things. Well, long story short. Ronny mentioned that one of his friends will be around on the island for some vacation and that said person agreed to do a session on the history, the (eventual) future and some technical aspects of MySQL and MariaDB. Sounds great and having an expert from abroad doesn't happen too often...

Okay, next Ronny was looking for a decent location and I suggested to him that he might his luck at The Flying Dodo Brewery in Bagatelle. In general not a problem but those guys over there speak money and in order to get their side room with some conference aspirations they wouldn't agree on the usual deal for user groups. Meaning: Room for attendees consuming food & drinks. As I had personal interest in this session to happen, I backed Ronny's intentions to go forward with it and to let me know in case that there financial constraints to be expected. Running your business provides you with some benefits and allowances. Anyway, there was a little fee for the evening to be paid, and I was glad to cover those expenses through my business: IOS Indian Ocean Software Ltd.

Lets rock with MySQL and MariaDB

The "event" was scheduled for the evening hours, and after the official part it was commonly agreed that we are going to leverage the location and have a decent after-meeting session at the brewery. It's always nice to combine work with pleasure - particularly in that specific order.

Our presenter, an international consultant for MySQL and MariaDB working at SkySQL AB at that time, named Joffrey Michaie did a great job during the evening. First, he gave us a brief history lesson about the origins of MySQL, then elaborated on the recent purchase event during the last couple of years and went over the actual reasons why MariaDB has been created. Well, Sun and Oracle did a great job to get quite a number of good developers on MySQL as well as the community on their feet. The fork of MySQL into MariaDB is reasonable given that Oracle doesn't need to support two opposing RDBMS within the same company - astounishingly that's a very familiar constellation seeing Microsoft SQL Server and Microsoft Visual FoxPro (VFP) in the past. Anyway, approximately 90% (and more) of the original MySQL developers quit their job and went over to a company called SkySQL AB - which is solely temporarily and there had been a press release recently, that it's now officially MariaDB AB. Monty Widenius had his coup and the core development team is back to its roots.

And... best of all: MariaDB is an inplace-replacement for MySQL. In case that you're operating your website or blog on MySQL you can simply install and use MariaDB instead of. It works flawlessly.

Next, Jojo gave us some corner data about the wide-spread use of MySQL/MariaDB. Actually some big internet companies or better said their websites (like Facebook, SAP, Xing, etc.) are driven by MySQL installations spread over hundreds or even over thousands of machines. Of course, this requires some interesting architecture not only regarding the physical setup of machines and networks but also in terms of storage and replication features. High-availability (HA) is the magical keyword in this case. At a certain size you have to switch towards DB clusters and Joffrey gave us good information about one could setup such clusters using Galera. He also gave us a brief overview of some specialised storage engines available in MySQL/MariaDB which definitely go far beyond the capabilities of the standard types like MyISAM or InnoDB.

Full screen entertainment for geeks

The full presentation of a whooping 107 slides is available on SlideShare - Thanks to Joffrey and the LUGM!

On my side, I have to admit that I was a bit interruptive as I had a good number of questions regarding certain features I'm used to using either VFP or SQL Server. Especially given the fact that I was involved in the software architecture and development of client-server applications that run on roughly 100 instances of SQL Server including different types of data replication. Yes, we did partitioning and the database has a variety of replication scenarios for different tables; including typical master-slave replication but also enhanced 2-way replication. Also dealing with data volumes in 2-digit and even 3-digit regions is not unusual with my clients. And there is quite a difference between writing and running queries against a low amount of records compared to tables with 15+ million records. Not to forget about write and update operations. Patiently, Joffrey took note of my questions and he had very good answers how certain setups and requirements could be solved and handled with MariaDB. One of the interesting topics was the discussion about data types of "uniqueidentifier" versus "UUID" versus "Global Transaction ID (GTID)". Well, basically they are the same... Whereas SQL Server handles replication based on that specific data type, MySQL or MariaDB remains on dealing with integer-based column data types (comparable to Auto-Increment in SQL Server) - which I find problematic. 

MariaDB Enterprise Architecture v3.1
MariaDB is not just the database anymore; it's a platform for application developers and database administrators

Anyway, the evening had some interesting chunks of information for me and I enjoyed the whole presentation. Joffrey knows how to keep the audience focused and engaged into the topic. And shamelessly we extending the scheduled 1-hour session by at least 30 minutes or so. Until all questions have been asked and answered. And after all this talking and listening it was time to move over to the social aspects of the evening and to get some refreshments.

Networking session and future activities

Later on I managed to have a little smalltalk with Jojo and even though the meeting was under the aegis of the LUGM, I informed him about the existence, goals and intentions of the Mauritius Software Craftsmanship Community (MSCC). Dunno, how he took it but since then we are still in touch on social media networks, and have a chat from time to time. On my part I'm looking forward to the next opportunity to hear about MariaDB from Joffrey - and of course I won't hesitate to act as a sponsor again.

Oh, and thanks for the goodies - I really like that black MariaDB 10 T-Shirt.

Disclaimer: Images are courtesy of MariaDB Corporation Ab. MariaDB is a trademark or registered trademarks of MariaDB Corporation Ab in the European Union and United States of America and/or other countries. MySQL is a trademark of Oracle Corporation Inc.

Accessing your web server via IPv6

Being able to run your systems on IPv6, have automatic address assignment and the ability to resolve host names are the necessary building blocks in your IPv6 network infrastructure. Now, that everything is in place it is about time that we are going to enable another service to respond to IPv6 requests. The following article will guide through the steps on how to enable Apache2 httpd to listen and respond to incoming IPv6 requests.

This is the fourth article in a series on IPv6 configuration:

Piece of advice: This is based on my findings on the internet while reading other people's helpful articles and going through a couple of man-pages on my local system.

Surfing the web - IPv6 style

Enabling IPv6 connections in Apache 2 is fairly simply. But first let's check whether your system has a running instance of Apache2 or not. You can check this like so:

$ service apache2 status
Apache2 is running (pid 2680).

In case that you got a 'service unknown' you have to install Apache to proceed with the following steps:

$ sudo apt-get install apache2

Out of the box, Apache binds to all your available network interfaces and listens to TCP port 80. To check this, run the following command:

$ sudo netstat -lnptu | grep "apache2\W*$"
tcp6       0      0 :::80                   :::*                    LISTEN      28306/apache2

In this case Apache2 is already binding to IPv6 (and implicitly to IPv4). If you only got a tcp output, then your HTTPd is not yet IPv6 enabled.

Check your Listen directive, depending on your system this might be in a different location than the default in Ubuntu.

$ sudo nano /etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

Just in case that you don't have a ports.conf file, look for it like so:

$ cd /etc/apache2/
$ fgrep -r -i 'listen' ./*

And modify the related file instead of the ports.conf. Which most probably might be either apache2.conf or httpd.conf anyways.

Okay, please bear in mind that Apache can only bind once on the same interface and port. So, eventually, you might be interested to add another port which explicitly listens to IPv6 only. In that case, you would add the following in your configuration file:

Listen 80
Listen [2001:db8:bad:a55::2]:8080

But this is completely optional... Anyways, just to complete all steps, you save the file, and then check the syntax like so:

$ sudo apache2ctl configtest
Syntax OK

Ok, now let's apply the modifications to our running Apache2 instances:

$ sudo service apache2 reload
 * Reloading web server config apache2
   ...done.

$ sudo netstat -lnptu | grep "apache2\W*$"                                                                                              
tcp6       0      0 2001:db8:bad:a55:::8080 :::*                    LISTEN      5922/apache2   
tcp6       0      0 :::80                   :::*                    LISTEN      5922/apache2

There we have two daemons running and listening to different TCP ports.

Now, that the basics are in place, it's time to prepare any website to respond to incoming requests on the IPv6 address. Open up any configuration file you have below your sites-enabled folder.

$ ls -al /etc/apache2/sites-enabled/
...

$ sudo nano /etc/apache2/sites-enabled/000-default

<VirtualHost *:80 [2001:db8:bad:a55::2]:8080>
        ServerAdmin [email protected]
        ServerName server.ios.mu
        ServerAlias server

Here, we have to check and modify the VirtualHost directive and enable it to respond to the IPv6 address and port our web server is listening to. Save your changes, run the configuration test and reload Apache2 in order to apply your modifications. After successful steps you can launch your favourite browser and navigate to your IPv6 enabled web server.

Accessing an IPv6 address in the browser
Accessing an IPv6 address in the browser

That looks like a successful surgery to me...

Note: In case that you received a timeout, check whether your client is operating on IPv6, too.

Enabling DNS for IPv6 infrastructure

After successful automatic distribution of IPv6 address information via DHCPv6 in your local network it might be time to start offering some more services. Usually, we would use host names in order to communicate with other machines instead of their bare IPv6 addresses. During the following paragraphs we are going to enable our own DNS name server with IPv6 address resolving.

This is the third article in a series on IPv6 configuration:

Piece of advice: This is based on my findings on the internet while reading other people's helpful articles and going through a couple of man-pages on my local system.

What's your name and your IPv6 address?

$ sudo service bind9 status
 * bind9 is running

If the service is not recognised, you have to install it first on your system. This is done very easy and quickly like so:

$ sudo apt-get install bind9

Once again, there is no specialised package for IPv6. Just the regular application is good to go.

But of course, it is necessary to enable IPv6 binding in the options. Let's fire up a text editor and modify the configuration file.

$ sudo nano /etc/bind/named.conf.options

acl iosnet {
        127.0.0.1;
        192.168.1.0/24;
        ::1/128;
        2001:db8:bad:a55::/64;
};

listen-on { iosnet; };
listen-on-v6 { any; };

allow-query { iosnet; };
allow-transfer { iosnet; };

Most important directive is the listen-on-v6. This will enable your named to bind to your IPv6 addresses specified on your system. Easiest is to specify any as value, and named will bind to all available IPv6 addresses during start. More details and explanations are found in the man-pages of named.conf.

Save the file and restart the named service. As usual, check your log files and correct your configuration in case of any logged error messages. Using the netstat command you can validate whether the service is running and to which IP and IPv6 addresses it is bound to, like so:

$ sudo service bind9 restart

$ sudo netstat -lnptu | grep "named\W*$"
tcp        0      0 192.168.1.2:53        0.0.0.0:*               LISTEN      1734/named     
tcp        0      0 127.0.0.1:53          0.0.0.0:*               LISTEN      1734/named     
tcp6       0      0 :::53                 :::*                    LISTEN      1734/named     
udp        0      0 192.168.1.2:53        0.0.0.0:*                           1734/named     
udp        0      0 127.0.0.1:53          0.0.0.0:*                           1734/named     
udp6       0      0 :::53                 :::*                                1734/named 

 Sweet! Okay, now it's about time to resolve host names and their assigned IPv6 addresses using our own DNS name server.

$ host -t aaaa www.6bone.net 2001:db8:bad:a55::2
Using domain server:
Name: 2001:db8:bad:a55::2
Address: 2001:db8:bad:a55::2#53
Aliases:

www.6bone.net is an alias for 6bone.net.
6bone.net has IPv6 address 2001:5c0:1000:10::2

Alright, our newly configured BIND named is fully operational.

Eventually, you might be more familiar with the dig command. Here is the same kind of IPv6 host name resolve but it will provide more details about that particular host as well as the domain in general.

$ dig @2001:db8:bad:a55::2 www.6bone.net. AAAA

More details on the Berkeley Internet Name Domain (bind) daemon and IPv6 are available in Chapter 22.1 of Peter Bieringer's HOWTO on IPv6.

Setting up your own DNS zone

Now, that we have an operational named in place, it's about time to implement and configure our own host names and IPv6 address resolving. The general approach is to create your own zone database below the bind folder and to add AAAA records for your hosts. In order to achieve this, we have to define the zone first in the configuration file named.conf.local.

$ sudo nano /etc/bind/named.conf.local

//
// Do any local configuration here
//
zone "ios.mu" {
        type master;
        file "/etc/bind/zones/db.ios.mu";
};

Here we specify the location of our zone database file. Next, we are going to create it and add our host names, our IP and our IPv6 addresses.

$ sudo nano /etc/bind/zones/db.ios.mu

$ORIGIN .
$TTL 259200     ; 3 days
ios.mu                  IN SOA  ios.mu. hostmaster.ios.mu. (
                                2014031101 ; serial
                                28800      ; refresh (8 hours)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      server.ios.mu.
$ORIGIN ios.mu.
server                  A       192.168.1.2
server                  AAAA    2001:db8:bad:a55::2
client1                 A       192.168.1.3
client1                 AAAA    2001:db8:bad:a55::3
client2                 A       192.168.1.4
client2                 AAAA    2001:db8:bad:a55::4

With a couple of machines in place, it's time to reload that new configuration.

Note: Each time you are going to change your zone databases you have to modify the serial information, too. Named loads the plain text zone definitions and converts them into an internal, indexed binary format to improve lookup performance. If you forget to change your serial then named will not use the new records from the text file but the indexed ones. Or you have to flush the index and force a reload of the zone.

This can be done easily by either restarting the named:

$ sudo service bind9 restart

or by reloading the configuration file using the name server control utility - rndc:

$ sudo rndc reconfig

Check your log files for any error messages and whether the new zone database has been accepted. Next, we are going to resolve a host name trying to get its IPv6 address like so:

$ host -t aaaa server.ios.mu. 2001:db8:bad:a55::2
Using domain server:
Name: 2001:db8:bad:a55::2
Address: 2001:db8:bad:a55::2#53
Aliases:

server.ios.mu has IPv6 address 2001:db8:bad:a55::2

Looks good.

Alternatively, you could have just ping'd the system as well using the ping6 command instead of the regular ping:

$ ping6 server
PING server(2001:db8:bad:a55::2) 56 data bytes
64 bytes from 2001:db8:bad:a55::2: icmp_seq=1 ttl=64 time=0.615 ms
64 bytes from 2001:db8:bad:a55::2: icmp_seq=2 ttl=64 time=0.407 ms
^C
--- ios1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.407/0.511/0.615/0.104 ms

That also looks promising to me. How about your configuration?

Next, it might be interesting to extend the range of available services on the network. One essential service would be to have web sites at hand.

DHCPv6: Provide IPv6 information in your local network

Even though IPv6 might not be that important within your local network it might be good to get yourself into shape, and be able to provide some details of your infrastructure automatically to your network clients.

This is the second article in a series on IPv6 configuration:

Piece of advice: This is based on my findings on the internet while reading other people's helpful articles and going through a couple of man-pages on my local system.

IPv6 addresses for everyone (in your network)

Okay, after setting up the configuration of your local system, it might be interesting to enable all your machines in your network to use IPv6. There are two options to solve this kind of requirement... Either you're busy like a bee and you go around to configure each and every system manually, or you're more the lazy and effective type of network administrator and you prefer to work with Dynamic Host Configuration Protocol (DHCP). Obviously, I'm of the second type.

Enabling dynamic IPv6 address assignments can be done with a new or an existing instance of a DHCPd. In case of Ubuntu-based installation this might be isc-dhcp-server. The isc-dhcp-server allows address pooling for IP and IPv6 within the same package, you just have to run to independent daemons for each protocol version. First, check whether isc-dhcp-server is already installed and maybe running your machine like so:

$ service isc-dhcp-server6 status

In case, that the service is unknown, you have to install it like so:

$ sudo apt-get install isc-dhcp-server

Please bear in mind that there is no designated installation package for IPv6.

Okay, next you have to create a separate configuration file for IPv6 address pooling and network parameters called /etc/dhcp/dhcpd6.conf. This file is not automatically provided by the package, compared to IPv4. Again, use your favourite editor and put the following lines:

$ sudo nano /etc/dhcp/dhcpd6.conf

authoritative;
default-lease-time 14400; 
max-lease-time 86400;
log-facility local7;
subnet6 2001:db8:bad:a55::/64 {
    option dhcp6.name-servers 2001:4860:4860::8888, 2001:4860:4860::8844;
    option dhcp6.domain-search "ios.mu";
    range6 2001:db8:bad:a55::100 2001:db8:bad:a55::199;
    range6 2001:db8:bad:a55::/64 temporary;
}

Next, save the file and start the daemon as a foreground process to see whether it is going to listen to requests or not, like so:

$ sudo /usr/sbin/dhcpd -6 -d -cf /etc/dhcp/dhcpd6.conf eth0

The parameters are explained quickly as -6 we want to run as a DHCPv6 server, -d we are sending log messages to the standard error descriptor (so you should monitor your /var/log/syslog file, too), and we explicitely want to use our newly created configuration file (-cf). You might also use the command switch -t to test the configuration file prior to running the server.

In my case, I ended up with a couple of complaints by the server, especially reporting that the necessary lease file wouldn't exist. So, ensure that the lease file for your IPv6 address assignments is present:

$ sudo touch /var/lib/dhcp/dhcpd6.leases
$ sudo chown dhcpd:dhcpd /var/lib/dhcp/dhcpd6.leases

Now, you should be good to go. Stop your foreground process and try to run the DHCPv6 server as a service on your system:

$ sudo service isc-dhcp-server6 start
isc-dhcp-server6 start/running, process 15883

Check your log file /var/log/syslog for any kind of problems. Refer to the man-pages of isc-dhcp-server and you might check out Chapter 22.6 of Peter Bieringer's IPv6 Howto. The instructions regarding DHCPv6 on the Ubuntu Wiki are not as complete as expected and it might not be as helpful as this article or Peter's HOWTO. But see for yourself.

Does the client get an IPv6 address?

Running a DHCPv6 server on your local network surely comes in handy but it has to work properly. The following paragraphs describe briefly how to check the IPv6 configuration of your clients,

Linux - ifconfig or ip command

First, you have enable IPv6 on your Linux by specifying the necessary directives in the /etc/network/interfaces file, like so:

$ sudo nano /etc/network/interfaces

iface eth1 inet6 dhcp

Note: Your network device might be eth0 - please don't just copy my configuration lines.

Then, either restart your network subsystem, or enable the device manually using the dhclient command with IPv6 switch, like so:

$ sudo dhclient -6

You would either use the ifconfig or (if installed) the ip command to check the configuration of your network device like so:

$ sudo ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:1d:09:5d:8d:98 
          inet addr:192.168.160.147  Bcast:192.168.160.255  Mask:255.255.255.0
          inet6 addr: 2001:db8:bad:a55::193/64 Scope:Global
          inet6 addr: fe80::21d:9ff:fe5d:8d98/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

Looks good, the client has an IPv6 assignment. Now, let's see whether DNS information has been provided, too.

$ less /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
nameserver 192.168.1.2
nameserver 127.0.1.1

search ios.mu

Nicely done.

Windows - netsh

Per description on TechNet the netsh is defined as following:

"Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer. Netsh can also save a configuration script in a text file for archival purposes or to help you configure other servers."

And even though TechNet states that it applies to Windows Server (only), it is also available on Windows client operating systems, like Vista, Windows 7 and Windows 8.

In order to get or even set information related to IPv6 protocol, we have to switch the netsh interface context prior to our queries. Open a command prompt in Windows and run the following statements:

C:\Users\joki>netsh
netsh>interface ipv6
netsh interface ipv6>show interfaces

Show IPv6 network interfaces using netsh command on Windows

Select the device index from the Idx column to get more details about the IPv6 address and DNS server information (here: I'm going to use my WiFi device with device index 11), like so:

netsh interface ipv6>show address 11

Show IPv6 address information using netsh command on Windows

Okay, address information has been provided. Now, let's check the details about DNS and resolving host names:

netsh interface ipv6>show dnsservers 11

Show IPv6 DNS server configuration using netsh command on Windows

Okay, that looks good already. Our Windows client has a valid IPv6 address lease with lifetime information and details about the configured DNS servers.

Talking about DNS server...
Your clients should be able to connect to your network servers via IPv6 using hostnames instead of IPv6 addresses. Please read on about how to enable a local named with IPv6.