Docker container with broken Mysql database. Lesson learned. Backup often. Backup your DB or at least the container.

I’ve been updating lxc-docker every time a new version is suggested by my Linux OS. While the apt-get install lxc-docker was working it stops and starts again with the new Docker version. Usually nothing happens with the containers being forced stop and started that way but today I’ve had a broken Mysql DB for this WordPress installation and couldn’t restore it from its data directory no matter what I’ve tried. Because I didn’t want to loose more time I decided I can restore previous commits to the same image that container is running from.

I’ve found the docker history imagename command and tried it. I’ve added a couple of commits to this image and I’ve had a couple of lines with the history commands. I’ve picked the commit before the broken state and ran the wordpress container the same way I am running it with the :latest tag but this time used the commit ID. It ran well and I’ve made a commit from it to its image. Stopped and removed the wordpress container and ran it with the usual command using the latest imagename command this time and now it’s running well.

Now I know that when I am going to stop the images and update the Docker executable I must backup the databases, files and commit the latest state of the containers (not much by the rules because the container should be able to be rebuilt at any time keeping the data outside the container).

Broken WordPress Visual Editor and Admin pages? There’s a strange fix for that.

If you like me after updating to the latest wordpress version have troubles and JS errors while starting a new post or browsing through the admin pages you need to edit your wp-config.php file in your WordPress installation directory and add at the top:

define(‘SCRIPT_DEBUG’, true);

Save the file and refresh the pages, browse through the admin pages, start a new post. Everything is looking fine now.

This fix is not a total solution but it works so far so let’s see what the next update will do for us.

GitWeb theme and improvements from kogakure/gitweb-theme

For the full documentation go here: kogakure/gitweb-theme @ GitHub.

This is a GitHub like theme for GitWeb.

To install it execute the following:

git clone
cd gitweb-theme/
./setup -vi --install

This is the log I’ve had with a successfull install:

./setup -vi --install
./setup: [NOTICE] - Target not set, using default path: '/usr/share/gitweb'
./setup: Is this ok? [y] | [n] : t./setup: Is this ok? [y] | [n] : y
./setup: Backing up original files, continue? [y] | [n] : y
./setup: Backing up...
'/usr/share/gitweb/static/gitweb.css' -> '/usr/share/gitweb/static/gitweb.css.bak'
'/usr/share/gitweb/static/git-favicon.png' -> '/usr/share/gitweb/static/git-favicon.png.bak'
'/usr/share/gitweb/static/git-logo.png' -> '/usr/share/gitweb/static/git-logo.png.bak'
./setup: ...done
./setup: Linking theme files, continue? [y] | [n] : y
./setup: Linking...
'/usr/share/gitweb/static/gitweb.css' -> '/root/gitweb-theme/gitweb.css'
'/usr/share/gitweb/static/git-favicon.png' -> '/root/gitweb-theme/git-favicon.png'
'/usr/share/gitweb/static/git-logo.png' -> '/root/gitweb-theme/git-logo.png'
./setup: ...done
./setup: [NOTICE] - Installation complete!

Install the syntax highlighting feature:

Under Ubuntu:

apt-get install highlight

and then put this line in /etc/gitweb.conf:

$feature{'highlight'}{'default'} = [1];

For Gravatar support in GitWeb put this line in /etc/gitweb.conf:

$feature{'avatar'}{'default'} = ['gravatar'];

If it doesn’t work for you, you have to manually replace the css, logo and favicon files or edit /etc/gitweb.conf and change the paths to point to the new theme.