<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Screenage &#187; Allgemein</title>
	<atom:link href="http://www.screenage.de/blog/category/allgemein/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.screenage.de/blog</link>
	<description></description>
	<lastBuildDate>Sun, 13 Nov 2011 10:33:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Recovering Linux file permissions</title>
		<link>http://www.screenage.de/blog/2011/11/13/recovering-file-permissions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recovering-file-permissions</link>
		<comments>http://www.screenage.de/blog/2011/11/13/recovering-file-permissions/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 10:28:23 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=337</guid>
		<description><![CDATA[I recently ran into a server, where somebody accidently issued a &#8220;chown -R www-data:www-data /var&#8221;. So all files and directories within /var where chowned to the www-data which actually means a complete system fuckup as everything from logging over mail &#8230; <a href="http://www.screenage.de/blog/2011/11/13/recovering-file-permissions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a server, where somebody accidently issued a &#8220;chown -R www-data:www-data /var&#8221;. So all files and directories within /var where chowned to the www-data which actually means a complete system fuckup as everything from logging over mail and caching to databases relies on a correct setup there. Sadfully this was a remote production server so I had to find a quick solution to get a least a state good enough for the next days. </p>
<p>I started peaking around a possibity to reset file permissions based on .deb package details. There are at least <a href="http://serverfault.com/questions/221447/how-to-repair-restore-ubuntu-10-04-after-sudo-chmod-777/221454#221454">approaches</a> (the method there misses a pre-download of all installed .deb packages) to do this (and I remember running a program years ago that checked file permissions based on .deb files &#8211; just did not find it via apt-get). Nonetheless this approach lacks the possibility of handling application created files. Files in /var/log for instance don&#8217;t have to be declared in a .deb file but urgently need the right file permissions.</p>
<p>So I came to a different approach: cloning permissions. By chance we had a quite similar server running meaning same Linux distribution and nearly the same services installed. I wrote a one liner to save the file permissions on the healthy server:</p>
<pre>$ find /var -printf "%p;%u;%g;%m\n" > permissions.txt</pre>
<p>The command writes a text file with the following format:</p>
<p>dir/filename;user;group;mode</p>
<p>Please note, I started using &#8220;:&#8221; as a separator but noted that at least some Perl related files have a double colon in there name.  </p>
<p>Now I only needed a simple shell script that sets the file permissions on the broken server based on the text file we just generated. It came down to this:</p>
<pre>#!/bin/bash

ENTRIES=$(cat permissions.txt)

for ENTRY in ${ENTRIES}
do
	echo ${ENTRY} | sed "s/;/ /g" | {
		read FILE USER GROUP MODE
		chown ${USER}:${GROUP} "${FILE}"
		chmod ${MODE} "${FILE}"
	}
done</pre>
<p>The script reads every line of the text file, splits it&#8217;s content into variables and sets the user and group via &#8220;chown&#8221; as well as the mode via &#8220;chmod&#8221;. It doesn&#8217;t check if a directory/file exists before chowning/chmodding it, as it actually doesn&#8217;t matter. If it&#8217;s not there, it just won&#8217;t do something harmfull.</p>
<p>After you&#8217;ve run this, it&#8217;s a good idea to restart all services and start watching log files. You have to take care of all services that rely on fast changing files in /var. For instance a mail daemon puts a lot of unique file names into /var/spool and the script above won&#8217;t be able to take care of that. You have to double check database directories like /var/lib/mysql, hosted repositories and so on. But the script will provide with a state where most services are at least running and you get an idea of how to switch back the remaining directories. It might be helpfull to search for suspicious files, like </p>
<pre>$ find /var -user www-data</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2011/11/13/recovering-file-permissions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RubyGems 9.9.9 packaged &#8211; Fake install RubyGems on Debian/Ubuntu</title>
		<link>http://www.screenage.de/blog/2011/07/02/rubygems-9-9-9-packaged-fake-install-rubygems-on-debianubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rubygems-9-9-9-packaged-fake-install-rubygems-on-debianubuntu</link>
		<comments>http://www.screenage.de/blog/2011/07/02/rubygems-9-9-9-packaged-fake-install-rubygems-on-debianubuntu/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 20:27:10 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[Puppet]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=322</guid>
		<description><![CDATA[For a lot of reasons I often rely on a mixture of a Debian/Ubuntu pre packaged Ruby with a self compiled RubyGems. It helps you in situations where you don&#8217;t care that much about the Ruby interpreter itself but need &#8230; <a href="http://www.screenage.de/blog/2011/07/02/rubygems-9-9-9-packaged-fake-install-rubygems-on-debianubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For a lot of reasons I often rely on a mixture of a Debian/Ubuntu pre packaged Ruby with a self compiled RubyGems. It helps you in situations where you don&#8217;t care that much about the Ruby interpreter itself but need an up to date RubyGems. While this is easy to install, you might run into trouble when installing packages that depend on Ruby and RubyGems, namely packages like &#8220;rubygems&#8221;, &#8220;rubygems1.8&#8243; and &#8220;rubygems1.9&#8243;.</p>
<p>After unsuccessfully playing around with dpkg for a while (you can put packages on &#8220;hold&#8221; which prevents them from being installed automatically, I came to the conclusion, the best way is to install a fake package that is empty but satisfies depencies.</p>
<p><a title="RubyGems 9.9.9 Fake Package" href="http://www.screenage.de/blog/files/rubygems_9.9.9_all.deb">So, here it is: The shiny new RubyGems 9.9.9</a> which delivers rubygems, rubygems1.8 and rubygems1.9 right away. Just install it (e.g. with dpkg) and you&#8217;ll be able installing packages that rely on a rubygems package.</p>
<p>In case you want to play around with the package and customize it to your needs, e.g. only deliver rubygems1.8 or rubygems1.9, take</p>
<p><strong>1. Install equivs</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> equivs</pre></div></div>

<p><strong>2. create a control file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ equivs-control rubygems</pre></div></div>

<p><strong>3. edit the control file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">vim</span> rubygems</pre></div></div>

<p>You can compare the default settings in the control file with the output of e.g. &#8220;apt-cache show rubygems&#8221;. The crucial field is &#8220;Provides:&#8221; where you can put a comma separated list of packages you want to fake install. Choose a high version for  there &#8220;Version: &#8221; field as this will mark the package newer as the distribution&#8217;s own package. This prevents the packager from replacing it.</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">Section: universe/interpreters
Priority: optional
Homepage: http://www.screenage.de/blog/
Standards-Version: 3.6.2
&nbsp;
Package: rubygems
Version: 9.9.9
Maintainer: Caspar Clemens Mierau &lt;ccm@screenage.de&gt;
Provides: rubygems1.8,rubygems1.9,rubygems
Architecture: all
Description: Fake RubyGems replacement
 This is a fake meta package satisfying rubygems dependencies.
 .
 This package can be used when you installed a packaged ruby but want
 to use rubygems from source and still rely on software that depends
 on ruby and rubygems</pre></div></div>

<p>4. build the package</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">$ equivs-build rubygems</pre></div></div>

<p>p.s.: You can also use equivs for easily building meta packages containing a list of packages you want to install at a glance, e.g. for semi automated server bootstrapping.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2011/07/02/rubygems-9-9-9-packaged-fake-install-rubygems-on-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootstrapping a Puppet agent/master on Ubuntu</title>
		<link>http://www.screenage.de/blog/2011/06/06/boostrapping-a-puppet-agentmaster-on-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=boostrapping-a-puppet-agentmaster-on-ubuntu</link>
		<comments>http://www.screenage.de/blog/2011/06/06/boostrapping-a-puppet-agentmaster-on-ubuntu/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 09:37:29 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Puppet]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=314</guid>
		<description><![CDATA[Though it&#8217;s really great that Puppet made it into Ubuntu&#8217;s main repository, the provided version is rather outdated which prevents you from using advanced language features when writing your manifests. So sooner or later you end up installing Puppet manually. &#8230; <a href="http://www.screenage.de/blog/2011/06/06/boostrapping-a-puppet-agentmaster-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Though it&#8217;s really great that Puppet made it into Ubuntu&#8217;s main repository, the provided version is rather outdated which prevents you from using advanced language features when writing your manifests. So sooner or later you end up installing Puppet manually. In order to speed up installation I stripped it down to the following:</p>
<p>install agent:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-qO</span> - https:<span style="color: #000000; font-weight: bold;">//</span>bit.ly<span style="color: #000000; font-weight: bold;">/</span>install-puppet-agent<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>install master:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-qO</span> - https:<span style="color: #000000; font-weight: bold;">//</span>bit.ly<span style="color: #000000; font-weight: bold;">/</span>install-puppet-master<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>The call fetches the most recent version of the install script from github, installs Ubuntu&#8217;s Ruby (which is good enough for running Puppet), fetches an upstream version of gem itself and updates it to the most recent version and finally installs the Puppet gem.</p>
<p>You can, of course, also download, review and run the scripts manually. Just have a look at <a href="https://github.com/moviepilot/puppet/tree/master/tools">https://github.com/moviepilot/puppet/tree/master/tools</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2011/06/06/boostrapping-a-puppet-agentmaster-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>slides from the &#8216;From MySQL to MariaDB&#8217; presentation</title>
		<link>http://www.screenage.de/blog/2011/05/14/slides-from-the-from-mysql-to-mariadb-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=slides-from-the-from-mysql-to-mariadb-presentation</link>
		<comments>http://www.screenage.de/blog/2011/05/14/slides-from-the-from-mysql-to-mariadb-presentation/#comments</comments>
		<pubDate>Sat, 14 May 2011 19:09:44 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=304</guid>
		<description><![CDATA[As announced, I held a short talk on switching from MySQL community edition (especially 5.1) to MariaDB (currently 5.2.6) at this years LinuxTag in Berlin. Here are the (German) slides for reference: (In case you cannot see the embedded presentation, &#8230; <a href="http://www.screenage.de/blog/2011/05/14/slides-from-the-from-mysql-to-mariadb-presentation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As announced, I held a <a href="http://www.linuxtag.org/2011/de/program/freies-vortragsprogramm/popup/vortragsdetails.html?no_cache=1&#038;talkid=390">short talk on switching from MySQL community edition (especially 5.1) to MariaDB (currently 5.2.6)</a> at this years LinuxTag in Berlin.</p>
<p>Here are the (German) slides for reference:</p>
<p><iframe src="https://docs.google.com/present/embed?id=dc7c88tp_77dxchh4c7&#038;interval=5&#038;size=m" frameborder="0" width="555" height="451"></iframe></p>
<p>(In case you cannot see the embedded presentation, you can also <a href="https://docs.google.com/present/view?id=dc7c88tp_77dxchh4c7&#038;interval=5">click here</a>)</p>
<p>Please note: There are a lot of good English slides around. If you want give a talk on MariaDB, the &#8220;Beginner&#8217;s Guide&#8221; might be a good start:</p>
<p><a title="View A Beginner's Guide to MariaDB Presentation on Scribd" href="http://www.scribd.com/doc/53200698/A-Beginner-s-Guide-to-MariaDB-Presentation" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">A Beginner&#8217;s Guide to MariaDB Presentation</a><iframe class="scribd_iframe_embed" src="http://www.scribd.com/embeds/53200698/content?start_page=1&#038;view_mode=slideshow&#038;access_key=key-23nny9uco9ufyu2i9l08" data-auto-height="true" data-aspect-ratio="1.33333333333333" scrolling="no" id="doc_22767" width="100%" height="600" frameborder="0"></iframe><script type="text/javascript">(function() { var scribd = document.createElement("script"); scribd.type = "text/javascript"; scribd.async = true; scribd.src = "http://www.scribd.com/javascripts/embed_code/inject.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(scribd, s); })();</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2011/05/14/slides-from-the-from-mysql-to-mariadb-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using backuppc as a dirty distributed shell</title>
		<link>http://www.screenage.de/blog/2011/05/09/using-backuppc-as-a-dirty-distributed-shell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-backuppc-as-a-dirty-distributed-shell</link>
		<comments>http://www.screenage.de/blog/2011/05/09/using-backuppc-as-a-dirty-distributed-shell/#comments</comments>
		<pubDate>Mon, 09 May 2011 14:00:12 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[CommandLine]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=281</guid>
		<description><![CDATA[Backuppc is a neat server-based backup solution. In Linux envorinments it is often used in combination with rsync over ssh &#8211; and, let&#8217;s be hontest &#8211; often fairly lazy sudo or root rights for the rsync over ssh connection. This &#8230; <a href="http://www.screenage.de/blog/2011/05/09/using-backuppc-as-a-dirty-distributed-shell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://backuppc.sourceforge.net/">Backuppc</a> is a neat server-based backup solution. In Linux envorinments it is often used in combination with rsync over ssh &#8211; and, let&#8217;s be hontest &#8211; often fairly lazy sudo or root rights for the rsync over ssh connection. This has a lot of disadvantages, but at least, you can use this setup as a cheap distributed shell, as a good maintained backuppc server might have access to a lot of your servers.</p>
<p>I wrote a small wrapper, that reads the (especially Debian/Ubuntu packaged) backuppc configuration and iterates through the hosts, allowing you to issue commands on every valid connection. I used it so far for listing used ssh keys, os patch levels and even small system manipulations.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">SSH_KEY</span>=<span style="color: #ff0000;">&quot;-i /var/lib/backuppc/.ssh/id_rsa&quot;</span>
<span style="color: #007800;">SSH_LOGINS</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>backuppc<span style="color: #000000; font-weight: bold;">/</span>hosts <span style="color: #000000; font-weight: bold;">|</span> \
 <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;root@&quot;$1&quot; &quot;}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
 <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">':a;N;$!ba;s/\n//g'</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> SSH_LOGIN <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${SSH_LOGINS[@]}</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">do</span>
 <span style="color: #007800;">HOST</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${SSH_LOGIN}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;@&quot;</span> <span style="color: #ff0000;">'{print $2'</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">`</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------&quot;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;checking host: <span style="color: #007800;">${HOST}</span>&quot;</span>
 <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-C</span> <span style="color: #660033;">-qq</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;NumberOfPasswordPrompts=0&quot;</span> \
 <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;PasswordAuthentication=no&quot;</span> <span style="color: #800000;">${SSH_KEY}</span> <span style="color: #800000;">${SSH_LOGIN}</span> <span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>You can easily change this to your needs (e.g. changing login user, adding sudo and so on).  </p>
<pre>
$ ./exec_remote_command.sh "date"
--------------------------------------------
checking host: a.b.com
Mo 9. Mai 15:40:26 CEST 2011
--------------------------------------------
checking host: b.b.com
[...]
</pre>
<p>Make sure to quote your command, especially when using commands with options, so the script can handle the command line as one argument.</p>
<p>A younger sister of the script is the following ssh key checker that lists and sorts the ssh keys used on systems by their key comment (feel free to include the key itself):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">SSH_KEY</span>=<span style="color: #ff0000;">&quot;-i /var/lib/backuppc/.ssh/id_rsa&quot;</span>
<span style="color: #007800;">SSH_LOGINS</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>backuppc<span style="color: #000000; font-weight: bold;">/</span>hosts <span style="color: #000000; font-weight: bold;">|</span> \
 <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;root@&quot;$1&quot; &quot;}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
 <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">':a;N;$!ba;s/\n//g'</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> SSH_LOGIN <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${SSH_LOGINS[@]}</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">do</span>
 <span style="color: #007800;">HOST</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${SSH_LOGIN}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;@&quot;</span> <span style="color: #ff0000;">'{print $2'</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">`</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------------&quot;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;checking host: <span style="color: #007800;">${HOST}</span>&quot;</span>
 <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-C</span> <span style="color: #660033;">-qq</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;NumberOfPasswordPrompts=0&quot;</span> \
 <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;PasswordAuthentication=no&quot;</span> <span style="color: #800000;">${SSH_KEY}</span> <span style="color: #800000;">${SSH_LOGIN}</span> \
 <span style="color: #ff0000;">&quot;cut -d: -f6 /etc/passwd | xargs -i{} egrep -s <span style="color: #000099; font-weight: bold;">\
</span> '^ssh-' {}/.ssh/authorized_keys {}/.ssh/authorized_keys2&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> \
 <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">3</span>- <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span>
 <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-C</span> <span style="color: #660033;">-qq</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;NumberOfPasswordPrompts=0&quot;</span> \
 <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;PasswordAuthentication=no&quot;</span> <span style="color: #800000;">${SSH_KEY}</span> <span style="color: #800000;">${SSH_LOGIN}</span> \
 <span style="color: #ff0000;">&quot;egrep -s '^ssh-' /etc/skel/.ssh/authorized_keys <span style="color: #000099; font-weight: bold;">\
</span> /etc/skel/.ssh/authorized_keys2&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">3</span>- <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>A sample output of the script:</p>
<pre>
$ ./check_keys.sh 2>/dev/null
--------------------------------------------
checking host: a.b.com
ccm@host1.key
backuppc@localhost
some random key comment
--------------------------------------------
checking host: b.b.com
[...]
</pre>
<p>That&#8217;s all for now. Don&#8217;t blame me for doing it this way &#8211; I am only the messenger <img src='http://www.screenage.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2011/05/09/using-backuppc-as-a-dirty-distributed-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu (Berlin) Global Jam at c-base and Daniel Holbach&#8217;s notebook</title>
		<link>http://www.screenage.de/blog/2010/08/30/ubuntu-berlin-global-jam-at-c-base-aand-daniel-holbachs-notebook/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-berlin-global-jam-at-c-base-aand-daniel-holbachs-notebook</link>
		<comments>http://www.screenage.de/blog/2010/08/30/ubuntu-berlin-global-jam-at-c-base-aand-daniel-holbachs-notebook/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 08:32:31 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Berlin]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[GlobalJam]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=256</guid>
		<description><![CDATA[Members of &#8220;Ubuntu Berlin&#8221; met yesterday at c-base within the Ubuntu Global Jam. While it was nice seeing new and international faces showing up and introducing newcomers to advanced Launchpad usage, my main attraction of the day was Daniel Holbach&#8217;s &#8230; <a href="http://www.screenage.de/blog/2010/08/30/ubuntu-berlin-global-jam-at-c-base-aand-daniel-holbachs-notebook/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Members of &#8220;Ubuntu Berlin&#8221; met yesterday at c-base within the Ubuntu Global Jam. While it was nice seeing new and international faces showing up and introducing newcomers to advanced Launchpad usage, my main attraction of the day was Daniel Holbach&#8217;s notebook. He asserted it runs Maverick and starts up within five seconds, which made me laugh at first as my netbook&#8217;s startup time tripled from Lucid to Maverick to round about 45 seconds (which will at least change back until release I assume).</p>
<div id="attachment_259" class="wp-caption alignnone" style="width: 650px"><a href="http://www.screenage.de/blog/uploads/globajam-2010-081.jpg"><img class="size-full wp-image-259" title="Ubuntu Berlin at Ubuntu Global Jam (c-base) - August 2010" src="http://www.screenage.de/blog/uploads/globajam-2010-081.jpg" alt="Ubuntu Berlin at Ubuntu Global Jam (c-base) - August 2010" width="640" height="192" /></a><p class="wp-caption-text">Ubuntu (Berlin) Global Jam at c-base </p></div>
<p>To make it short: Between bug triaging and patching Daniel showed the startup procedure two or three times on his X61s (with an solid state disk, one has to add) and as promised it started up in five seconds after Grub. Actually this isn&#8217;t more than a fast booting notebook, but it shows the results of focussed efforts from the last one and a half year. Remember the initial &#8220;10s&#8221; <a href="https://lists.ubuntu.com/archives/ubuntu-devel/2009-June/028308.html">posting</a> and the bunch of changes it took.</p>
<p>So I am happy looking forward to improvements for Maverick on my netbook. And yes: I am happy with 10 seconds, too.</p>
<p>[update]</p>
<p>Daniel noted, that it&#8217;s a X61s, not a T61. Changed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2010/08/30/ubuntu-berlin-global-jam-at-c-base-aand-daniel-holbachs-notebook/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu Berlin @ LinuxTag 2010 &#8211; pickings</title>
		<link>http://www.screenage.de/blog/2010/06/16/ubuntu-berlin-linuxtag-2010-pickings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-berlin-linuxtag-2010-pickings</link>
		<comments>http://www.screenage.de/blog/2010/06/16/ubuntu-berlin-linuxtag-2010-pickings/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 04:16:26 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[BBQ]]></category>
		<category><![CDATA[Berlin]]></category>
		<category><![CDATA[c-base]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=237</guid>
		<description><![CDATA[Saturday evening this years LinuxTag, Europes largest open source fair, closed its doors. As LinuxTag is presented at Berlin, the &#8220;Ubuntu Berlin&#8221; was happy to support it in different activities. Let me sum up some of them: 1) Ubuntu Community &#8230; <a href="http://www.screenage.de/blog/2010/06/16/ubuntu-berlin-linuxtag-2010-pickings/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Saturday evening this years LinuxTag, Europes largest open source fair, closed its doors. As LinuxTag is presented at Berlin, the &#8220;Ubuntu Berlin&#8221; was happy to support it in different activities. Let me sum up some of them:</p>
<p><strong>1) Ubuntu Community booth</strong></p>
<p>The &#8220;ubuntu Deutschland e.V.&#8221;, Ubuntu and Kubuntu community presented their work at a community hosted booth. A bunch of Ubuntu Berlin members supported the booth, answered hundreds of questions and helped with the proceedings.</p>
<p><strong>2) Talks</strong></p>
<p>Saturday Featured a lot of Ubuntu focussed talks. For the first time &#8220;Ubuntu Berlin&#8221; and its members hosted a remarkable amount of them, e.g.:</p>
<ul>
<li><a href="http://mnemonikk.org/">Anselm Helbig</a> &#8211; Ubuntu Berlin Lightning Talks (tmux)</li>
<li><a href="http://overbenny.wordpress.com/">Benjamin Drung</a> &#8211; Ubuntu in 50 minutes, Packaging for Debian and Ubuntu</li>
<li>Caspar Clemens Mierau &#8211; Ubuntu Berlin Lightning Talks (Vimperator), Gnome-Do, Ubuntu in 50 minutes</li>
<li><a href="http://daniel.holba.ch/blog/">Daniel Holbach</a> &#8211; Fixing Bugs in Ubuntu (<a href="http://people.canonical.com/~dholbach/talks/">see slides</a>), Ubuntu in 50 minutes, Ubuntu Berlin Lightning Talks (liblaunchpad)</li>
<li><a href="http://www.marceleichner.de/">Marcel Eichner</a> &#8211; Ubuntu Berlin Lightning Talks (Franklin)</li>
<li><a href="http://toddy-franz.de/">Torsten Franz</a> &#8211; Supporting Ubuntu</li>
</ul>
<p style="text-align: center;"><img class="alignnone size-full wp-image-238" title="Ubuntu in 50 minutes talk at LinuxTag 2010" src="http://www.screenage.de/blog/uploads/IMAG0155.jpg" alt="Ubuntu in 50 minutes talk at LinuxTag 2010" width="448" height="263" /><br />
minutes before the &#8220;Ubuntu in 50 minutes&#8221; talk</p>
<p><strong>3) Interviews for Radio Tux</strong></p>
<p>Several members of Ubuntu Berlin gave interviews to the well known German Podcast &#8220;<a href="http://blog.radiotux.de/">Radio Tux</a>&#8220;. Daniel&#8217;s <a href="http://archiv.radiotux.de/interviews/2010-06-12.RadioTux.Daniel.Holbach.bugjam.Linuxtag.mp3">talk on bugjamming has been released</a> already. Be sure to <a href="http://archiv.radiotux.de/interviews/">check the archive</a> for other releases within the next days.</p>
<p><strong>4) LinuxTag BBQ</strong></p>
<p>Last but not least: The  &#8221;End of LinuxTag BBQ&#8221; at <a href="http://c-base.org">c-base</a>, sponsored by Canonical, has been a great success again. Three barbacues and about ten &#8220;Grillmeister&#8221; (you cannot translate this) provided more than hundred visitors with tasty food. Members of various types of open source communities had interesting chats while relaxing at the banks of the Spree.</p>
<p>As Ubuntu Berlin&#8217;s support for the LinuxTag continuously increased within the last years, I am sure next year will even better. We&#8217;ll see.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2010/06/16/ubuntu-berlin-linuxtag-2010-pickings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://archiv.radiotux.de/interviews/2010-06-12.RadioTux.Daniel.Holbach.bugjam.Linuxtag.mp3" length="16325530" type="audio/mpeg" />
		</item>
		<item>
		<title>My Mom Runs Ubuntu &#8211; Update for Ada Lovelace Day</title>
		<link>http://www.screenage.de/blog/2010/03/24/my-mom-runs-ubuntu-update-for-ada-lovelace-day/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-mom-runs-ubuntu-update-for-ada-lovelace-day</link>
		<comments>http://www.screenage.de/blog/2010/03/24/my-mom-runs-ubuntu-update-for-ada-lovelace-day/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 23:01:42 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/?p=219</guid>
		<description><![CDATA[Just a couple of days ago I wrote update the upcoming &#8220;Ada Lovelace Day&#8221; &#8211; celebrating women in technology on the 24nd of March, which happens to be today. The day pledges for blog posts about this topic and here &#8230; <a href="http://www.screenage.de/blog/2010/03/24/my-mom-runs-ubuntu-update-for-ada-lovelace-day/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a couple of days ago I wrote update the upcoming &#8220;Ada Lovelace Day&#8221; &#8211; celebrating women in technology on the 24nd of March, which happens to be today. The day pledges for blog posts about this topic and here we go with an Ubuntu flavored version.</p>
<p>At Ubucon 2008 in Göttingen, a German Ubuntu User Conference, I noticed that a lot people hanging around discussed how nicely their parents and especially moms are using Ubuntu. No hazzle, no further explanations needed &#8211; it just worked. And often they don&#8217;t even know or notice that they are using Ubuntu, as they just standard software like Firefox and Thunderbird. As this user group doesn&#8217;t belong to the tweeting, facebooking, social web society, I decided to found a launchpad group named &#8220;<a title="My Mom Runs Ubuntu on Launchpad" href="https://launchpad.net/~my-mom-runs-ubuntu">My Mum Runs Ubuntu</a>&#8220;, that has no further meaning than joining it means your mother runs Ubuntu &#8211; a simple way of giving this &#8220;silent&#8221; user group at least a number and a marker on a map.</p>
<p>I was surprised how fast the member list grew and happy to see that it&#8217;s members came and come from all over the world as you can see below:</p>
<div id="attachment_218" class="wp-caption alignnone" style="width: 310px"><a href="http://www.screenage.de/blog/uploads/ubuntu-moms-map-2010.jpg"><img class="size-medium wp-image-218" title="&quot;My Mom Runs Ubuntu&quot; global map (map by Google)" src="http://www.screenage.de/blog/uploads/ubuntu-moms-map-2010-300x152.jpg" alt="&quot;My Mom Runs Ubuntu&quot; global map (map by Google)" width="300" height="152" /></a><p class="wp-caption-text">&quot;My Mom Runs Ubuntu&quot; global map (map by Google)</p></div>
<p>So this is not about a single heroine in technology &#8211; it is about a general movement:  I am convinced, especially Ubuntu with it&#8217;s focus on an intuitive interface seems to keep the entry level very low and therefore attracts user groups that might be a suprprise for a lot of people. I know dozens of techie people stating that free operating systems are way too complicated to use for them. When telling about &#8220;My Mom Runs Ubuntu&#8221; they run out of reasons. At least there is nothing more convincing on using free software than people that are just using it on a daily basis without the need of telling everybody as they just take it as normal. I am sure, this user group continues to grow and am</p>
<p>So, if you already have a Launchpad account and your mum runs Ubuntu, too, give her a voice by just <a href="https://launchpad.net/~my-mom-runs-ubuntu/+join">joining the group</a>.</p>
<p>And if you think, this post misses real techie heroines, check the &#8220;<a href="http://ubuntu-women.org/">Ubuntu Women</a>&#8221; project, featuring some of the <a href="http://wiki.ubuntu-women.org/Profiles">most active member</a>s of the Ubuntu community.</p>
<div class="wp-caption alignnone" style="width: 360px"><img title="Ada Lovelace Day Logo" src="http://blog.findingada.com/wp-content/uploads/2010/03/lovelacedayshirtmucha-Lorin-white.png" alt="Ada Lovelace Day Logo" width="350" height="352" /><p class="wp-caption-text">Ada Lovelace Day Logo</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2010/03/24/my-mom-runs-ubuntu-update-for-ada-lovelace-day/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A quick note on MySQL troubleshooting and MySQL replication</title>
		<link>http://www.screenage.de/blog/2009/04/18/a-quick-note-on-mysql-troubleshooting-and-mysql-replication-recovery/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-quick-note-on-mysql-troubleshooting-and-mysql-replication-recovery</link>
		<comments>http://www.screenage.de/blog/2009/04/18/a-quick-note-on-mysql-troubleshooting-and-mysql-replication-recovery/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 14:09:21 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[CommandLine]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/2009/04/18/a-quick-note-on-mysql-and-mysql-replication-recovery/</guid>
		<description><![CDATA[PLEASE NOTE: I am currently reviewing and extending this document. While caring for a remarkable amount of MySQL server instances, troubleshooting becomes a common task. It might of interest for you which Recovering a crashed MySQL server After a server &#8230; <a href="http://www.screenage.de/blog/2009/04/18/a-quick-note-on-mysql-troubleshooting-and-mysql-replication-recovery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>PLEASE NOTE: I am currently reviewing and extending this document.</p>
<p>While caring for a remarkable amount of MySQL server instances, troubleshooting becomes a common task. It might of interest for you which</p>
<p><strong>Recovering a crashed MySQL server</strong></p>
<p>After a server crash (meaning the system itself or just the MySQL daemon) corrupted table files are quite common. You&#8217;ll see this when checking the /var/log/syslog, as the MySQL daemon checks tables during its startup.</p>
<pre>Apr 17 13:54:44 live1 mysqld[2613]: 090417 13:54:44 [ERROR]
  /usr/sbin/mysqld: Table './database1/table1' is marked as
  crashed and should be repaired</pre>
<p>The MySQL daemon just told you that it found a broken MyISAM table. Now it&#8217;s up to you fixing it. You might already know, that there is the &#8220;REPAIR&#8221; statement. So a lot of people enter their PhpMyAdmin afterwards, select database and table(s) and run the REPAIR statements. The problem with this is that in most cases your system is already in production &#8211; for instance is up again and the MySQL server already serves a bunch of requests. Therefore a REPAIR request gets slowed down dramatically. Consider taking your website down for the REPAIR &#8211; it will be faster and it&#8217;s definitely smarter not to deliver web pages based on corrupted tables.</p>
<p>The other disadvantage of the above method is, that you probably just shut down your web server and your PhpMyAdmin is down either or you have dozens of databases and tables and therefore it&#8217;s just a hard task to cycle through them. The better choice is the command line in this case.</p>
<p>If you only have a small number of corrupted tables, you can use the &#8220;mysql&#8221; client utility doing something like:</p>
<pre>$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.75-0ubuntu10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; REPAIR TABLE database1.table1;
+--------------------+--------+----------+----------+
| Table              | Op     | Msg_type | Msg_text |
+--------------------+--------+----------+----------+
| database1.table1   | repair | status   | OK       |
+--------------------+--------+----------+----------+
1 row in set (2.10 sec)</pre>
<p>This works, but there is a better way: First, using OPTIMIZE in combination with REPAIR is suggested and there is a command line tool only for REPAIR jobs. Consider this call:</p>
<pre>$ mysqlcheck -u root -p --auto-repair --check --optimize database1
Enter password:
database1.table1      OK
database1.table2      Table is already up to date</pre>
<p>As you see, MySQL just checked the whole database and tried to repair and optimize it.</p>
<p>The great deal about using &#8220;mysqlcheck&#8221; is, that it can also be run against all databases in one run without the need of getting a list of them in advance:</p>
<pre>$ mysqlcheck -u root -p --auto-repair --check --optimize \
  --all-databases</pre>
<p>Of course you need to consider if an optimize of all your databases and tables might just take too long if you have huge tables. On the other hand a complete run prevents of thinking about a probably missed table.</p>
<p>[update]</p>
<p>nobse pointed out in the comments, that it&#8217;s worth having a look at the automatic MyIsam repair options in MySQL. So have a look at them if you want to automate recovery:<a href="http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_myisam-recover"></a></p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_myisam-recover">option_mysqld_myisam-recover</a></p>
<p><strong>Recovering a broken replication</strong></p>
<p>MySQL replication is an easy method of load balancing database queries to multiple servers or just continuously backing up data. Though it is not hard to setup, troubleshooting it might be a hard task. A common reason for a broken replication is a server crash &#8211; the replication partner notices that there are broken queries &#8211; or even worse: the MySQL slave just guesses there is an error though there is none. I just ran into the latter one as a developer executed a &#8220;DROP VIEW&#8221; on a non-existing VIEW on the master. The master justs returns an error and ignores. But as this query got replicated to the MySQL SLAVE, the slave thinks it cannot enroll a query and immediately stopped replication. This is just an example of a possible error (and a hint on using &#8220;IF EXISTS&#8221; as often as possible).</p>
<p>Actually all you want to do now, is telling the slave to ignore just one query. All you need to do for this is stopping the slave, telling it to skip one query and starting the slave again:</p>
<pre>$ mysql -u root -p
mysql&gt; STOP SLAVE;
mysql&gt; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
mysql&gt; START SLAVE;</pre>
<p>That&#8217;s all about this.</p>
<p><strong>Recreating databases and tables the right way</strong></p>
<p>In the next topic you&#8217;ll recreate databases. A common mistake when dropping and recreating tables and databases is forgetting about all the settings it had &#8211; especially charsets which can run you into trouble later on (&#8220;Why do all these umlauts show up scrambled?&#8221;). The best way of recreating tables and databases or creating them on other systems therefore is using the &#8220;SHOW CREATE&#8221; statement. You can use &#8220;SHOW CREATE DATABASE database1&#8243; or &#8220;SHOW CREATE TABLE database1.table1&#8243; providing you with a CREATE statement with all current settings applied.</p>
<pre>mysql&gt; show create database database1;
+-----------+--------------------------------------------------------------------+
| Database  | Create Database                                                    |
+-----------+--------------------------------------------------------------------+
| database1 | CREATE DATABASE `database1` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+-----------+--------------------------------------------------------------------+
1 row in set (0.00 sec)</pre>
<p>The important part in this case is the &#8220;comment&#8221; after the actual create statement. It is executed only on compatible MySQL server versions and makes sure, your are running utf8 on the database.</p>
<p>Keep this in mind and it might save you a lot of trouble.</p>
<p><strong>Fixing replication when master binlog is broken</strong></p>
<p>When your MySQL master crashes there is a slight chance that your master binlog gets corrupted. This means that the slaves won&#8217;t receive updates anymore stating:</p>
<p>[ERROR] Slave: Could not parse relay log event entry. The possible reasons are: the master&#8217;s binary log is corrupted (you can check this by running &#8216;mysqlbinlog&#8217; on the binary log), the slave&#8217;s relay log is corrupted (you can check this by running &#8216;mysqlbinlog&#8217; on the relay log), a network problem, or a bug in the master&#8217;s or slave&#8217;s MySQL code. If you want to check the master&#8217;s binary log or slave&#8217;s relay log, you will be able to know their names by issuing &#8216;SHOW SLAVE STATUS&#8217; on this slave. Error_code: 0</p>
<p>You might have luck when only the slave&#8217;s relay log is corrupted as you can fix this with the steps mentioned above. But a corrupted binlog on the master might not be fixable though the databases itself can be fixed. Depending on your time you try to use the &#8220;SQL_SLAVE_SKIP_COUNTER&#8221; from above but actually the only way is to setup</p>
<p><strong>Setting up replication from scratch</strong></p>
<p>There are circumstances forcing you to start replication from scratch. For instance you have a server going live for the first time and actually all those test imports don&#8217;t need to be replicated to the slave anymore as this might last hours. My quick note for this (consider backing up your master database before!)</p>
<pre>slave: STOP SLAVE;
slave: RESET SLAVE;
slave: SHOW CREATE DATABASE datenbank;
slave: DROP DATABASE datenbank;
slave: CREATE DATABASE datenbank;

master: DROP DATABASE datenbak;
master: SHOW CREATE DATABASE datenbank;
master: CREATE DATABASE datenbank;
master: RESET MASTER

slave: CHANGE MASTER TO MASTER_USER="slave-user", \
MASTER_PASSWORD="slave-password", MASTER_HOST="master.host";
slave: START SLAVE</pre>
<p>You just started replication from scratch, check &#8220;SHOW SLAVE STATUS&#8221; on the slave and &#8220;SHOW MASTER STATUS&#8221; on the master.</p>
<p><strong>Deleting unneeded binlog files</strong></p>
<p>Replication needs binlog files &#8211; a mysql file format for storing database changes in a binary format. Sometimes it is hard to decide how many of the binlog files you want to keep on the server possibly getting you into disk space trouble. Therefore deleting binlog files that have already been transferred to the client might be a smart idea when running low on space.</p>
<p>First you need to know which binlog files the slave already fetched. You can do this by having a look on &#8220;SHOW SLAVE STATUS;&#8221; on the slave. Now log into the MySQL master and run something like:</p>
<pre>mysql&gt; PURGE BINARY LOGS TO 'mysql-bin.010';</pre>
<p>You can even do this on a date format level:</p>
<pre>mysql&gt; PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';</pre>
<p><strong>Conclusion</strong></p>
<p>The above hints might save you same time when recovering or troubleshooting a MySQL server. Please note, that these are hints and you have &#8211; at any time &#8211; make sure, that your data has an up to date backup. Nothing will help you more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2009/04/18/a-quick-note-on-mysql-troubleshooting-and-mysql-replication-recovery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ubuntu developers visiting Ubuntu Berlin and c-base &#8211; plus interview with Mark Shuttleworth</title>
		<link>http://www.screenage.de/blog/2009/02/06/ubuntu-developers-visiting-ubuntu-berlin-and-c-base-with-interview-with-mark-shuttleworth/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-developers-visiting-ubuntu-berlin-and-c-base-with-interview-with-mark-shuttleworth</link>
		<comments>http://www.screenage.de/blog/2009/02/06/ubuntu-developers-visiting-ubuntu-berlin-and-c-base-with-interview-with-mark-shuttleworth/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 16:28:24 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Berlin]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/2009/02/06/ubuntu-developers-visiting-ubuntu-berlin-and-c-base-with-interview-with-mark-shuttleworth/</guid>
		<description><![CDATA[A couple of months ago I started annoying people by telling them, I&#8217;d like to show the Ubuntu Berlin community and c-base to Mark Shuttleworth as he is interested in community personally on one side and Ubuntu Berlin is a &#8230; <a href="http://www.screenage.de/blog/2009/02/06/ubuntu-developers-visiting-ubuntu-berlin-and-c-base-with-interview-with-mark-shuttleworth/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago I started annoying people by telling them, I&#8217;d like to show the <a href="http://www.ubuntu-berlin.de/">Ubuntu Berlin</a> community and <a href="http://www.c-base.org/">c-base</a> to <a href="http://www.markshuttleworth.com/">Mark Shuttleworth</a> as he is interested in community personally on one side and Ubuntu Berlin is a great example on the other. So this&#8217;s rather inviting an important member of the community than celebrating a &#8220;meet and greet&#8221;. Of course telling people plans like this makes them smile, but when you raise your finger and say &#8220;It will happen&#8221; with certainty, they&#8217;ll get uncertain. So the plan was actually to invite Mark to one of our great traditional release parties which you shouldn&#8217;t miss when you are around Berlin at release time.</p>
<p>By chance the Ubuntu Developer Sprint happened to be in Berlin for the next Jaunty release this week. If I got it right, the Canonical Ubuntu developers meet five days around two weeks before a release feature freeze and work in groups and issues that need to be decided/designed or just fixed immediatly. The incredible <a href="http://daniel.holba.ch/blog/">Daniel Holbach</a> had the idea of inviting the bunch of developers right into the c-base after their work. So he did and we scheduled it for an evening when the Ubuntu Berlin crew also meets at c-base for their monthly jour fix.</p>
<p>We did not announce this meeting externally as we tried to make the whole evening as comfortable as possible for everyone. And we did, I think. Right in time at 19:30 this Wednesday evening about thirty Ubuntu developers entered the c-base. Just among them Mark who seemed to like the whole c-base hackerspace, Ubuntu Berlin, community, space and future thing a lot. The Canonical crowd got several guided tours through the whole base by __t, while housetier provided the others with &#8220;German beer&#8221; and Club Mate. We had a lot of chats in smaller groups, things, you always wanted to ask the developer of your choice and just relaxed smalltalks about space, canooeing the c-base project &#8220;<a href="http://www.openmoon.info/">OpenMoon</a>&#8221; (trying to send a rocket to the moon), and more. Mark seemed to be amazed about asking people why they joined to Ubuntu Berlin team, what they were currently doing and so on &#8211; so, what the community thing is about right here and right now.</p>
<p>We had no schedule for the evening. Therefore we spent about two and a half hour at c-base without any official part and a cosy diner in smaller groups afterwards. We only asked some people for an interview for the <a href="http://www.youtube.com/user/jocognito">c-base statement studio channel</a> where already people like <a href="http://www.youtube.com/watch?v=pR95TYHDJFE&amp;feature=channel_page">Nokias Peter Schneider</a> and <a href="http://www.youtube.com/watch?v=4gygQ2GgN10&amp;feature=channel_page">Mozillas CEO John Lilly</a> showed up. Mark took the time for an interview by <a href="http://www.youtube.com/user/jocognito">jocognito</a>. The results of this short talks are already online on Youtube:</p>
<p>Interview #1: (when the inbound video doesn&#8217;t show up, <a href="http://www.youtube.com/watch?v=jCz_OXEOrpo">click here</a>)</p>
<div class="youtube-video"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="264" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/jCz_OXEOrpo&amp;hl=de&amp;fs=1&amp;rel=0" /><embed type="application/x-shockwave-flash" width="425" height="264" src="http://www.youtube.com/v/jCz_OXEOrpo&amp;hl=de&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>Interview #2: (when the inbound video doesn&#8217;t show up, <a href="http://www.youtube.com/watch?v=44-PP_yBruc&amp;feature=related">click here</a>)</p>
<div class="youtube-video"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="264" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/44-PP_yBruc&amp;hl=de&amp;fs=1&amp;rel=0" /><embed type="application/x-shockwave-flash" width="425" height="264" src="http://www.youtube.com/v/44-PP_yBruc&amp;hl=de&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<div class="youtube-video">Another interview with <a href="http://castrojo.wordpress.com/">Jorge Castro</a> and <a href="http://jameswestby.net/weblog">James Westby</a> has also been taped and will be published soon. Funny guys talking about Ubuntu on the moon. I&#8217;ll post the Youtube links, when the edited version is online.</div>
<div class="youtube-video">So what&#8217;s next? I hope everybody liked (Ubuntu) Berlin and c-base and we got a good start for possible events in the future.</div>
<div class="youtube-video">Thanks again to Daniel who initiated the visit!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2009/02/06/ubuntu-developers-visiting-ubuntu-berlin-and-c-base-with-interview-with-mark-shuttleworth/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

