MySQL 5.6 – Die zweite Auflage des Handbuchs für Administratoren

Fanfare, Freude, Feuerwerk! Vor wenigen Tagen ist die zweite Auflage unseres MySQL Administrationshandbuchs erschienen. Eva Zangerle, Wolfgang Gassler und ich haben uns in den letzten Monaten wieder an die Arbeit gemacht und alle wichtigen und vielschichtigen Neuerungen der Version 5.6 von MySQL in eine neue Auflage eingearbeitet. Vor zwei Jahren ist die erste Version dieses Buchs erschienen. Wir haben tolles Feedback bekommen, mit Lesern diskutiert und dabei selbst sehr viel gelernt. Nicht nur das Buchcover ist frisch und erstrahlt in neuem Glanz, denn die brandneue Auflage umfasst sehr viele Neuerungen. Wir haben sowohl die teilweise subtilen Änderungen von Variablen, Einstellungen und Tuningparameter an die aktuelle Version 5.6 angepasst, als auch ganze Kapitel überarbeitet. In die zweite Auflage haben wir gänzlich neue Themen und Features aufgenommen, welche die neue GA Version von MySQL auszeichnen.

Zu den besonderen Neuerungen in dieser Auflage zählen vor allem:

  •  die neue NoSQL-Schnittstelle für skalierbare Webanwendungen
  •  der Volltextindex jetzt auch für InnoDB
  •  das neue PERFORMANCE_SCHEMA zur Performanceanalyse
  •  aktuelle Programmierschnittstellen wie Node.js
  •  erweiterte Sicherheitsfeatures

Natürlich werden diese Neuerungen mit dem altbewährten und durchgängigen Praxisbeispiel vorgestellt und erläutert. Aktuelle Details und News finden Sie auf unserem Buchblog <www.mysqladmin.at>

Compile the Memcached-Libraries

MySQL provides NoSQL features since version MySQL 5.6 via the Memcached plugin. To use these advanced features for your instance you compiled from source, some modifications are required. Install libevent-dev to obtain the appropriate event libraries via apt.

apt-get install libevent-dev

Then, modify the cmake script and switch the option flag for the Memcached Plugin from OFF to ON. Open the File CMakeLists.txt and search for this line:

OPTION(WITH_INNODB_MEMCACHED "" OFF)

Change this line to:

OPTION(WITH_INNODB_MEMCACHED "" ON)

Then compile MySQL by using these commands:

rm CMakeCache.txt; make clean: cmake . ; make

Then copy the shared libraries into your plugin folder:

cp ./plugin/innodb_memcached/daemon_memcached/libmemcached.so /usr/local/mysql/lib/plugin/
 cp ./plugin/innodb_memcached/innodb_memcache/innodb_engine.so /usr/local/mysql/lib/plugin/

Then from the MySQL-Console, issue these two commands (without the mysql>):

mysql> SOURCE /usr/local/mysql/share/innodb_memcached_config.sql;
mysql> NSTALL PLUGIN daemon_memcached soname "libmemcached.so";

Installing Mint 14 and Windows 7 on Samsung Ultrabook Series 5 535U3C

After reading several articles about a firmware bug on Samsung Ultrabook Laptops, that would destroy the device when attempting to boot a Linux kernel, I was quite skeptical whether to get one or not. The price was tempting (499€) and the design and specs quite nice. But there exist these reports about a bug in the current firmware would brick certain Samsung laptops immediately if booted via UEFI. The device ships with a preinstalled Windows 8, which uses UEFI. For this reason installing Linux Mint (or any other distribution) bears a risk. As I work with Linux but for some tasks simply need a Windows installation (and this class of notebook is too weak for virtualization) I wanted both systems with dual boot. As I didn’t know for sure if my 535U3C was using the critical firmware, I pursued the following steps and ended up with a perfectly working device featuring Windows 7 and Mint Linux:

  1. You need two USB pen drives for convenience.
  2. Prepare a Linux Mint bootable USB stick with the Mint ISO
  3. Prepare a second USB stick with a Windows 7 ISO
  4. Boot the preinstalled Windows 8 and install latest BIOS update
  5. Reboot, press F2 and switch boot mode to CSM legacy mode
  6. Insert the Linux Live USB stick and boot from it.
  7. Install gdisk with sudo apt-get install gdisk
  8. Use it to remove the GPT as described here
  9. Reboot, attach the Windows 7 USB drive and boot from it
  10. The Windows 7 setup has a bug when booting from a USB stick (:-)). It will complain that no drivers are present to read the data from the drive (yes, the installation routine has already started… from this very drive…). Now unplug the USB stick and plug it into a different USB port. Then press Cancel and retry. Now it should work.
  11. Install Windows 7, then reboot
  12. Now install Mint Linux from the second drive just as usual
  13. Enjoy!

Raspberry Pi XBMC

The Raspberry Pi is a creditcard sized micro computer that runs various Linux operating system flavors. Its amazingly cheap prize (35$), the small size and its little power comsumption render it a great gadget for many purposes. With very little effort the Raspberry can be converetd into a mediacenter for watching HD movies or stream movies from Youtube. The setup is quite easy and just involves a few steps. You can comfortably control the device with the App Yatse  on your Android phone. Try it! Its great!

MySQL – Das Handbuch für Administratoren

Seit kurzem gibt es ein neues Buch im Portfolio von Galileo Computing: MySQL – Das Handbuch für Administratoren. Dieses Buch ist für mich etwas ganz besonders, nicht nur, weil es das erfolgreichste Open Source Datenbankmanagementsystem der Welt zum Inhalt hat, sondern weil es sich dabei um den erfolgreichen Abschluss eines sehr spannenden und komplexen Projektes handelt.  Gemeinsam mit Eva Zangerle und Wolfgang Gassler habe ich in den letzten Monaten so gut wie jede freie Minute für dieses Buch aufgewendet und seit wenigen Wochen ist es nun veröffentlicht worden.

Details dazu sind auf der offiziellen Buch-Homepage www.mysqladmin.at zu finden und in diesem Blog.

VirtualBox 4 – Performance Problems Solved

For a current project I am working on, I need several Linux machines running simultaneously, in order to perform some test-runs. Further more, I need a Windows 7 installation, because I have to use some software only available for Microsoft Systems. Therefore, the virtualization solution VirtualBox, is quite handy to manage all of systems. Although my host system is not really state of the art ( Dual-Core E5200 @ 2.50GHz , 6GB RAM), the system performs quite nicely with several guests up and running at the same time. Only if I would perform complex tasks within a Linux guest, such as compiling software from source, the whole system would freeze and be unusable until a reset. After googeling for a while, I

found a solution to this problem. The trick is to set the kernel option nohz=off in the GRUB boot menu file, you can find in /boot/grub/menu.lst. Open this file as root user and locate the record of your current kernel. Simply add the before mentioned option to this line and reboot the host system. The complete kernel boot section should no be similar to this one here:


title           Ubuntu 10.10, kernel 2.6.35-28-generic-pae
uuid            94e1022f-4ffd-4825-b8ca-2e86eca07d10
kernel          /boot/vmlinuz-2.6.35-28-generic-pae root=UUID=94e1..d10 ro quiet splash
                        nohz=off
initrd          /boot/initrd.img-2.6.35-28-generic-pae
quiet

After I added this option, the system behaved much better and did not freeze anymore.

Microsoft Office 2007 and Ubuntu

You really need Microsoft Office for work but you are not willing to switch to a Microsoft brand operating system? No problem! Office 2007 works like charm with the windows compatible runtime environment Wine. Just follow this tutorial and you can start using MS office, which is still not completely replaceable by open source software, especially if you have to exchange documents with other people using it. For the record: I still prefer Latex, but sometimes one has to bite the bullet, which is actually not that much of a problem.

Parsing KML files with PHP

KML with PHP. As the format is XML based, open and clearly defined, its actually pretty simple. The following code uses the Document Object Model in order to retrieve all nodes from a , which contain the string of coordinates as their element content.

function parseKML(){

// Create a new DOM model  
$doc = new DOMDocument();  
// Load a KML file  
$doc->load( &#8216;example.kml&#8217; );  
//Pick all Point &#8211; Elements  
$points = $doc->getElementsByTagName( &#8220;Point&#8221; );  
// For every point, extract the coordinates  
foreach( $points as $point ){  
$coordinates = $point->getElementsByTagName( &#8220;coordinates&#8221; );  
$coordinate = $coordinates->item(0)->nodeValue;  
$geoPoint = parseCoord($coordinate);

}

The following function applies a regular expression to the given string of coordinates. This regex filters the longitude and the latitude of a given set of coodinates and creates a new GeoPoint, which is simply a class called GeoPoint, having the two parameters as member variables.


function parseCoord($coordinate){  
$geopoint = null;  
// Delete all blanks  
$coordinate = str_replace(&#8221; &#8220;, &#8220;&#8221;, $coordinate);  
//Regular expression  
$regex = &#8220;/([-+]{0,1}[0-9]{1,}\.{1}[0-9]{1,})\,([-+]{0,1}[0-9]{1,}\.{1}[0-9]{1,})/&#8221;;  
// Apply regex  
try {

$match = preg_match($regex, $coordinate,$result);

// If the string is valid, retrieve results  
if($match>0){  
$long = $result[1];  
$lat = $result[2];  
$geopoint = new GeoPoint($long, $lat);  
}  
} catch (Exception $e) {  
echo &#8216;There was an error: &#8216;,  $e->getMessage(), &#8220;\n&#8221;;  
}  
return $geopoint;  
}

How to setup a MIDI-Keyboard in Ubuntu

I finally got myself a small (actually, it’s tiny) MIDI-Masterkeyboard for “tinkling the ivories”, which is a wonderful passion for lazy afternoons. Isn’t it cute:

I decided to get an Akai LPK 25, which doesn’t use much space, is cheap and quite sufficient for my purposes. In order to use it with Linux, one has to follow a few steps in order to get some sound out of that instrument. First of all, one needs to setup a real time kernel, because otherwise, one would have small delays, which is quite annoying. With the standard kernel, the delay on my machine was up to 30 milliseconds, which does not sound much but it is too much to be ignored. In order to install the real time kernel, type:

sudo apt-get install linux-image-2.6.31-9-rt

Then, reboot your system and choose the new kernel in the Grub menu at the startup. Further more, MIDI in Ubuntu is unfortunately not just plug and play. One has to setup the JACK Audio Connection Kit, which is described nicely here.

Then, one can install a software synthesizer like Hexter, which is basically a software model of the Yamaha DX7 synthesizer. Install it by typing:

sudo apt-get install hexter

At last, one has to wire everything together by the use of the Jack Control Center. Therefore, launch the control center and Hexeter. Switch to Jackd and choose the “Alsa Midi” Tab in the Connections menu. Then simply connect the LPK25 keyboard on the left hand side to the hexeter DX7 emulator on the right hand side. Thats it. More advanced setups with Rosegarden or LMMS will be described as soon as I figure it out how to use them.

Ubuntu Update from 9.04 ( Jaunty Jackalope ) to 9.10 ( Karmic Koala )

I finally took the courage of updating to the latest Ubuntu release on my PCs and notebooks. Major upgrades always bear a risk of incompatibilities of installed components. So I decided to wait one month after the new version of Ubuntu was released, in order to wait for possible problems to be solved by the developing team meanwhile. Long story short:

  • Core2Duo custom PC: like charm
  • Sony Vaio VGN-F221E (work): no problems, except Exim4 denied to work out of the box and Firefox has some display errors
  • Samsung NC10 Netbook: Ubuntu Netbook Remix. No fuss, except hotkeys don’t work

Benefits: See the technical feature list

Getting static – with WordPress

As I moved to a new server recently, I decided to convert my blog which I had during my semester abroad into static HTML, as the blog itself won’t change anyway. The easiest way to do so was to download the original blog with HTTrack completely to my local system. This tool converts dynamic links into static, relative ones, which is needed in order to move the blog to a new location. HTTrack preserves the page’s structure completely and includes all files such as images. After the download was complete, I just copied the whole, static website to its new destination. Great 🙂

How to extract some pages from a multi-page PDF?

It may be necessary to split a set of pages from a multi-page PDF into a separate document. Usually, this can be done by using the „Print to PDF“ function of Ubuntu, but not all applications are supported now. Otherwise, one could just print the desired pages to a new PDF file. Another solution would be cups-pdf, a virtual printer. But the quality is very low and insufficient for some purposes.

Finally, I found this nice tool: pdftk

Install it with sudo apt-get install pdftk and then simply enter the following, in order to extract pages 3 to 17 from input.pdf and write them into output.pdf:

pdftk input.pdf cat 3-17 output output.pdf

Nvidia 9500 GT and Ubuntu

As I do not really play computer games but still enjoy a little bit of hardware accelerated graphics (Compiz is really an eye candy and – believe it or not – enhances usability), I decided to get myself a GeForce 9500 GT from Nvidia, which is very cheap. Unfortunately, I had troubles with using device’s 3D-features from the very first. Neither using envy, the comfortable tool in order to install 3D video cards, nor installing the Nvidia binary drivers with Synaptic, nor compiling the drivers from scratch did work. Although I could use accelerated graphics after installing and restarting the Xserver, the settings seemed to get messed up after one or even after some reboots of my system. After restarting my computer, the screen would turn and remain black, when ever GDM was or should be started. The solution can be found by following the link below

The solution to this problem was to completely remove all nvidia packages, which accumulated during various installation odysseys. In order to do so, switch to a console (Alt+Ctrl+F2), log in and stop GDM by using the command
sudo /etc/init.d/gdm stop
Then, search for all packages with the command
dpkg -l | nvidia
and feed all found packages into the uninstallation routine from apt-get with the command
apt-get remove [package name]
If you have removed all found packages, make sure that there are no references to Nvidia packages or modules in /etc/init.d by searching for leftover files with
ls -a | grep nvi
Remove found files, renaming does not help! Then, install the original driver for your Nvidia card obtained by the Nvidia servers and follow the instructions. Finally, a reboot should bring you into your preferred Desktopenvironment again, now with nice graphics.

Thunderbird, Lightning and Google Calendar on Ubuntu 8.10

It is a known bug, that the calendar extension Lightning does not work correctly with the latest versions of Thunderbird. In my case, I was not able to create a new calendar at all. In order to fix this, just install libstdc++5:

sudo aptitude install libstdc++5

Works fine with Tb 2.0.0.19 and Lightning 0.9