Mar 26, 2014

How to get executed SQL-Queries from MySQL/MariaDB

I have a program, which queries a mysql database, but I wanted to know the
query it executes.

To activate the logging of the queries to a databasetable I found the hint here.

It is as simple as executing the following statements:

SET GLOBAL log_output='TABLE';
SET GLOBAL general_log='ON';

After this just query the databasetable general_log in the mysql database.

use mysql;
select * from general_log;

Mar 22, 2014

docker on Fedora 20

Docker is  a kind of virtualization software, feeling a little bit like zones in
Solaris.

In the REPO for Fedora 20, there is a package containing a lot of
examples for docker containers.

The package is named fedora-dockerfiles.noarch and put's its files into

[ewer@lxewer usr]$ cd /usr/share/fedora-dockerfiles/
[ewer@lxewer fedora-dockerfiles]$ ls
apache   firefox    mongodb  nginx   postgres  ssh
couchdb  memcached  mysql    nodejs  rabbitmq  wordpress_single_container

Building the first container:

cd /usr/share/fedora-dockerfiles/mysql
docker build -rm -t ewer/MySQL .


I had problems building the container, because I'm sitting behind a proxy to
the internet and the yum update failed. 

I added the following entry into /usr/lib/systemd/system/docker.service

EnvironmentFile=/etc/sysconfig/docker

into the section [Service]

the docker-Environment file /etc/sysconfig/docker contains:

HTTP_PROXY=http://<ip>:<port>                                          
http_proxy=$HTTP_PROXY
HTTPS_PROXY=$HTTP_PROXY
https_proxy=$HTTP_PROXY

export HTTP_PROXY HTTPS_PROXY http_proxy https_proxy

After restarting the docker-service

systemctl restart docker.service

the building of the container succeeded and it could be started:

docker run -d -p 3306:3306 <yourname>/MySQL

The README.md in the fedora-dockerfiles/mysql/README.md contains all the hints including the default password for mysql.

To get the IP adresse of the container execute

docker inspect <container_id> | grep -i ipaddr


and you can connect with the mysql client.


After stopping the container with

docker stop <Container-ID> 

where the container-ID is retrieved by

docker ps

you can restart the same container with

docker start <Container-ID> 

which you get with

docker ps -a

if the container is not up.


To attach to the container you can use lxc

docker ps -a --no-trunc
lxc-attach --name=<Full Container ID>

My current problem is, that the container doesn't start, if there is only the
WLAN adapter active and the physical LAN is not connected.


Mar 19, 2014

MemoryAnalyzer Tool based on Eclipse coredumps in libsoup on Fedora 20

I've downloaded MAT ( Memory Analyzer Tool ) for linux x64 and unzipped
on my Fedora 20 installation.

But when starting MemoryAnalyzer, the JVM dumps a core:

[ewer@lxewer mat]$ ./MemoryAnalyzer
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000033b6a70061, pid=9044, tid=140447298418432
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build 1.8.0-b132)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b70 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsoup-2.4.so.1+0x70061]  soup_session_feature_detach+0x11
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tools/DevTools/mat/hs_err_pid9044.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
This problem is already known and there is also a workaround:

Adding
-Dorg.eclipse.swt.browser.DefaultType=mozilla
to the ini-File. In this case the MemoryAnalyzer.ini.

After adding this line, the Analyzer starts.

Mar 13, 2014

Using docker behind a http-proxy on Fedora 20 with systemd starting the docker-service

On my Fedora 20 System docker is started by systemd.

The problem during installing an image is, that I'm living behind a proxy.

In the systemd configuration file you can set a file to load the environment from.

In my case this is /usr/lib/systemd/system/docker.service

Under the section [Service] add the entry for Environmentfile:


[Service]                                                                      
EnvironmentFile=/etc/sysconfig/docker
ExecStart=/usr/bin/docker -d
Restart=on-failure
 
In /etc/sysconfig/docker, the proxy variables are set:

HTTP_PROXY=http://<IP>:<Port>                                         
http_proxy=$HTTP_PROXY
HTTPS_PROXY=$HTTP_PROXY
https_proxy=$HTTP_PROXY

export HTTP_PROXY HTTPS_PROXY http_proxy https_proxy

After a refresh of the new config with

sudo systemctl daemon-reload

and restart

sudo systemctl restart docker.service

I can install an image:

sudo docker build -rm -t ewer/MySQL .
[sudo] password for ewer:
Uploading context 55.81 kB
Uploading context
Step 0 : FROM fedora:20
Pulling repository fedora
58394af37342: Download complete
511136ea3c5a: Download complete
8abc22fbb042: Download complete
 ---> 58394af37342


Mar 7, 2014

Skype-Integration in Gnome3 / Fedora 20. with a visible state icon on the topbar

I already found this extension some time ago and attempted to install it
in $HOME/.local/share/gnome-shell/extensions/SkypeNotification@chrisss404.gmail.com

During that time I didn't get the extension visible.

Today after starting the Debug-Tool LookingGlass lg with <Alt>-<F2>, the
Extension tab showed this extensions.

Now after starting gnome-tweak-tool an enabling the skype-Extension, I got
the state-symbol.





Developertools for Gnome3 - memory management...

When you have troubles with the gnome-shell you can start the
command-prompt with the key-shortcut <Alt>-<F2> and type the
letter 'r', which restarts the shell.

I knew from long ago, that there is also something like a garbage collector
and now I've found a collection of tips here.

To get to the developer tools of gnome-shell get to the command prompt with <Alt>-<F2> and insert 'lg'.

In the appearing window you can switch over to the memory and issue a
FullGC