<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title># Defining Chaos In Order</title>
	
	<link>http://mattiasgeniar.be</link>
	<description>Tips, Tricks &amp; Rants of a DevOps</description>
	<lastBuildDate>Thu, 16 May 2013 13:21:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mattiasgeniar" /><feedburner:info uri="mattiasgeniar" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><feedburner:emailServiceId>mattiasgeniar</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Setting custom puppet facts from within your Vagrantfile</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/YVb4CS7AcHE/</link>
		<comments>http://mattiasgeniar.be/2013/05/16/setting-custom-puppet-facts-from-within-your-vagrantfile/#comments</comments>
		<pubDate>Wed, 15 May 2013 22:17:38 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3994</guid>
		<description><![CDATA[You may want to set custom puppet facts in your development environment by specifying them in your Vagrantfile, so you can have a unique fact per developer or identify your own environment. Here's a quick way to do that. First: make sure you are running the latest version of facter (yum update facter), it should [...]]]></description>
				<content:encoded><![CDATA[<p>You may want to set custom puppet facts in your development environment by specifying them in your Vagrantfile, so you can have a unique fact per developer or identify your own environment. Here's a quick way to do that.<br />
<span id="more-3994"></span><br />
First: make sure you are running the latest version of facter (yum update facter), it should be at least version 1.7 as it supports custom facts easily (check with 'facter --version').</p>
<pre>$ facter --version
1.7.1</pre>
<p>Now, before the Vagrantfile changes, your facter facts will look like this. The solution is within the :shell provider, in the first few lines of the Vagrantfile.</p>
<pre>$ facter | grep 'custom'
[empty]</pre>
<p>Your Vagrantfile can now be modified to look like this, to set up custom facts.</p>
<pre>Vagrant::Config.run do |config|<strong>
  # First: run a shell provisioner to set up the custom facts
  config.vm.provision :shell do |shell|
    shell_cmd = ""

    # Make sure the facts directory exists
    shell_cmd << "mkdir -p /etc/facter/facts.d/; "

    # Add as much of these lins for any custom fact you want
    shell_cmd << "echo 'custom_fact1=the value of the fact' > /etc/facter/facts.d/custom_fact1.txt; "

    # Run the inline shell to create those facts
    shell.inline = "#{shell_cmd}"
  end
</strong>
  # Then: run puppet like you normally would
  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "manifests"
    puppet.manifest_file = "my_manifest.pp"
  end
end</pre>
<p>After a 'vagrant provision', your facts will be updated.</p>
<pre>$ facter | grep custom
custom_fact1=the value of the fact</pre>
<p>And you can now use the $::custom_fact1 variable within your manifests/modules.</p>
<p><strong>Update 16/5</strong>: as <a href="https://github.com/dieterdemeyer">Dieter De Meyer</a> <a href="https://gist.github.com/dieterdemeyer/5591083">pointed out</a>, there's a more elegant solution using the puppet provider itself. The downside is the facts are only available if you use 'vagrant provision' to start a Puppet run, if you use Puppet from within the virtual machine, these facts won't be present (see the <a href="https://github.com/mattiasgeniar/puppet-vagrant_helper_scripts">Vagrant Helper Scripts for Puppet</a> to speed up your Puppet deployments).</p>
<pre>Vagrant::Config.run do |config|
  config.vm.define :test do |vmconfig|
    vmconfig.vm.provision :puppet do |puppet|
      puppet.manifests_path = "manifests"
      puppet.manifest_file = "test.pp"
      puppet.module_path = [ "../", "./modules" ]
      puppet.facter = {
        "custom_fact1" => "value1",
        "custom_fact2" => "value2"
      }
      puppet.options = "--verbose"
    end
  end
end</pre>
<p>Thanks!</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/YVb4CS7AcHE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2013/05/16/setting-custom-puppet-facts-from-within-your-vagrantfile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2013/05/16/setting-custom-puppet-facts-from-within-your-vagrantfile/</feedburner:origLink></item>
		<item>
		<title>Nginx: nginx: [warn] load balancing method redefined</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/0w83x9ilVrQ/</link>
		<comments>http://mattiasgeniar.be/2013/04/25/nginx-nginx-warn-load-balancing-method-redefined/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 14:57:18 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3989</guid>
		<description><![CDATA[You may receive the following warning when reloading/configtesting an Nginx configuration that uses upstreams. $ service nginx configtest nginx: [warn] load balancing method redefined in /etc/nginx/conf.d/upstream.conf:5 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful This can occur when you conflicting variables inside your upstream, like such: $ cat [...]]]></description>
				<content:encoded><![CDATA[<p>You may receive the following warning when reloading/configtesting an Nginx configuration that uses upstreams.</p>
<pre>$ service nginx configtest
nginx: [warn] load balancing method redefined in /etc/nginx/conf.d/upstream.conf:5
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful</pre>
<p>This can occur when you conflicting variables inside your upstream, like such:</p>
<pre>$ cat upstream.conf 
upstream upstream_name {
  # Use max # keepalive connections
  keepalive 120;
  # Use the backend with least number of connections
  least_conn;
  # All upstream members defined below
  server 192.168.1.5:80  weight=24;
  server 192.168.1.6:80   weight=24;
}</pre>
<p>The warning is causde by the mixing of 'keepalive' and 'least_conn', use either one but don't mix both.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/0w83x9ilVrQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2013/04/25/nginx-nginx-warn-load-balancing-method-redefined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2013/04/25/nginx-nginx-warn-load-balancing-method-redefined/</feedburner:origLink></item>
		<item>
		<title>CentOS / RHEL: configure: error: C++ compiler g++ does not work or no compiler found</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/KN6ON7ftyqw/</link>
		<comments>http://mattiasgeniar.be/2013/04/15/centos-rhel-configure-error-c-compiler-g-does-not-work-or-no-compiler-found/#comments</comments>
		<pubDate>Mon, 15 Apr 2013 13:16:33 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3985</guid>
		<description><![CDATA[Probably means you're missing the g++ compiled at all, which isn't install with a groupinstall of the development tools. configure: error: C++ compiler g++ does not work or no compiler found Solution: $ yum install gcc gcc-c++ And that's it.]]></description>
				<content:encoded><![CDATA[<p>Probably means you're missing the g++ compiled at all, which isn't install with a groupinstall of the development tools.</p>
<pre>configure: error: C++ compiler g++ does not work or no compiler found</pre>
<p>Solution:</p>
<pre>$  yum install gcc gcc-c++</pre>
<p>And that's it.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/KN6ON7ftyqw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2013/04/15/centos-rhel-configure-error-c-compiler-g-does-not-work-or-no-compiler-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2013/04/15/centos-rhel-configure-error-c-compiler-g-does-not-work-or-no-compiler-found/</feedburner:origLink></item>
		<item>
		<title>RVM: Installing Ruby 1.8.7 on Mac OSX 10.8</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/knKOUd6ZyaY/</link>
		<comments>http://mattiasgeniar.be/2013/04/11/rvm-installing-ruby-1-8-7-on-mac-osx-10-8/#comments</comments>
		<pubDate>Thu, 11 Apr 2013 08:02:59 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ruby rvm]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3979</guid>
		<description><![CDATA[Just a quick command copy/paste to remind me in the future to help compile/configure ruby 1.8.7 via RVM on Mac OSX 10.8. $ rvm install 1.8.7 Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.8/x86_64/ruby-1.8.7-p371. Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. [...]]]></description>
				<content:encoded><![CDATA[<p>Just a quick command copy/paste to remind me in the future to help compile/configure ruby 1.8.7 <a href='https://rvm.io/'>via RVM</a> on Mac OSX 10.8.<span id="more-3979"></span></p>
<pre>$ <strong>rvm install 1.8.7</strong>
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.8.7-p371.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
<strong>The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.</strong></pre>
<p>That sucks. Work-around as such:</p>
<pre>$ <strong>rvm install 1.8.7 --with-gcc=clang </strong>
Installing Ruby from source to: /Users/name/.rvm/rubies/ruby-1.8.7-p371, this may take a while depending on your cpu(s)...
ruby-1.8.7-p371 - #downloading ruby-1.8.7-p371, this may take a while depending on your connection...
ruby-1.8.7-p371 - #extracted to /Users/name/.rvm/src/ruby-1.8.7-p371 (already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p371 - #configuring
<strong>ruby-1.8.7-p371 - #compiling
Error running 'make', please read /Users/name/.rvm/log/ruby-1.8.7-p371/make.log
There has been an error while running make. Halting the installation.</strong></pre>
<p>Which also sucks. Turns out rvm sort of bugs out for Ruby compiles if it includes tk/tcl support, something you most likely don't need anyway. Workaround is as such:</p>
<pre>$ <strong>rvm install 1.8.7 --with-gcc=clang --without-tcl --without-tk</strong>
Installing Ruby from source to: /Users/name/.rvm/rubies/ruby-1.8.7-p371, this may take a while depending on your cpu(s)...
ruby-1.8.7-p371 - #downloading ruby-1.8.7-p371, this may take a while depending on your connection...
ruby-1.8.7-p371 - #extracted to /Users/name/.rvm/src/ruby-1.8.7-p371 (already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p371 - #configuring
ruby-1.8.7-p371 - #compiling
ruby-1.8.7-p371 - #installing 
Retrieving rubygems-1.8.25
Extracting rubygems-1.8.25 ...
Removing old Rubygems files...
Installing rubygems-1.8.25 for ruby-1.8.7-p371 ...
Installation of rubygems completed successfully.
Saving wrappers to '/Users/name/.rvm/bin'.
ruby-1.8.7-p371 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.8.7-p371 - #importing default gemsets, this may take time ...
<strong>Install of ruby-1.8.7-p371 - #complete</strong></pre>
<p>Win!</p>
<pre>$ <strong>rvm list</strong>

rvm rubies

   ruby-1.8.7-p371 [ i686 ]
   ruby-1.9.2-p320 [ x86_64 ]
   ruby-1.9.3-p374 [ x86_64 ]</pre>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/knKOUd6ZyaY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2013/04/11/rvm-installing-ruby-1-8-7-on-mac-osx-10-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2013/04/11/rvm-installing-ruby-1-8-7-on-mac-osx-10-8/</feedburner:origLink></item>
		<item>
		<title>Gearman Queue error: mysql_stmt_execute failed: Unknown prepared statement handler (1)</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/jS22JNbuU1Y/</link>
		<comments>http://mattiasgeniar.be/2013/02/20/gearman-queue-error-mysql_stmt_execute-failed-unknown-prepared-statement-handler-1/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 08:36:34 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[gearman]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3970</guid>
		<description><![CDATA[If you're running Gearman from a self-compiled version (or self-packaged version), you can run into the following error. This is the same on Ubuntu, Debian or CentOS/RHEL clones. [ proc ] mysql_stmt_execute failed: Unknown prepared statement handler (1) given to mysqld_stmt_execute -> libgearman-server/plugins/queue/mysql/queue.cc:356 [ proc ] gearman_server_job_add gearman_server_run_command(QUEUE_ERROR) -> libgearman-server/server.cc:284 The above is visible from [...]]]></description>
				<content:encoded><![CDATA[<p>If you're running Gearman from a self-compiled version (or self-packaged version), you can run into the following error. This is the same on Ubuntu, Debian or CentOS/RHEL clones.</p>
<pre> [  proc ] mysql_stmt_execute failed: Unknown prepared statement handler (1) given to mysqld_stmt_execute -> libgearman-server/plugins/queue/mysql/queue.cc:356
 [  proc ] gearman_server_job_add gearman_server_run_command(QUEUE_ERROR) -> libgearman-server/server.cc:284</pre>
<p>The above is visible from the /var/log/gearmand/gearmand.log logs, that which calls the queue will fail with an error message as such:</p>
<pre>Warning: GearmanClient::doBackground(): _client_run_tasks(GEARMAN_SERVER_ERROR) queue_insert_error:QUEUE_ERROR -> libgearman/client.cc:1522 in /path/to/script.php on line xxx</pre>
<p>The solution is relatively simply: you probably don't have the <strong>uuid</strong> package installed. The package is meant to generate unique IDs that Gearman would use to assign to each job, without the package the unique ID's can not be generated. If you're running a MySQL persistent backend for your Gearman, inserts would fail without such a unique ID because of primairy key violations.</p>
<p>As such, install it:</p>
<pre>$ apt-get install uuid
$ yum install uuid</pre>
<p>Depending on your OS, use either apt/yum.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/jS22JNbuU1Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2013/02/20/gearman-queue-error-mysql_stmt_execute-failed-unknown-prepared-statement-handler-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2013/02/20/gearman-queue-error-mysql_stmt_execute-failed-unknown-prepared-statement-handler-1/</feedburner:origLink></item>
		<item>
		<title>Stop. Caching. Static. Files.</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/DsSrQq0akS0/</link>
		<comments>http://mattiasgeniar.be/2012/11/28/stop-caching-static-files/#comments</comments>
		<pubDate>Tue, 27 Nov 2012 22:15:13 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[Varnish]]></category>
		<category><![CDATA[varnish rant]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3943</guid>
		<description><![CDATA[I maintain a Varnish Configuration Repository that everyone can commit to. It's meant to be a good base to start any kind of Varnish implementation. I use it as my personal Varnish Boilerplate. And I personally have always disliked configurations such as these: # Remove all cookies for static files if (req.url ~ "^[^?]*\.(css&#124;jpg&#124;js&#124;gif&#124;png&#124;xml&#124;flv&#124;gz&#124;txt&#124;...)(\?.*)?$") { [...]]]></description>
				<content:encoded><![CDATA[<p>I maintain a <a href='https://github.com/mattiasgeniar/varnish-3.0-configuration-templates' target='_blank'>Varnish Configuration Repository</a> that everyone can commit to. It's meant to be a good base to start any kind of Varnish implementation. I use it as my personal Varnish Boilerplate. And I personally have always disliked configurations such as these:</p>
<pre># Remove all cookies for static files
if (req.url ~ "^[^?]*\.(css|jpg|js|gif|png|xml|flv|gz|txt|...)(\?.*)?$") {
  unset req.http.Cookie;
  return (lookup);
}</pre>
<p>The snippet above will strip all cookies from static files causing them to be cached by default. Why do I dislike this? Because it seems like this is causing people to cheer at their 99% cache hitrate but is causing more cache evictions because their memory is so limited. <strong>The only moment you should ever cache static file is if you have memory to spare</strong>.<span id="more-3943"></span></p>
<h3>Static files do not cause load.</h3>
<p>Sure, they cause disk access. Not just for reading the file, but for logging their entry in the webserver logs as well (<i>if you have not excluded caching static content from your server logs</i>). And your webserver needs to send the file back to the client.</p>
<p>But in all likeliness, your OS probably has your most frequent static files in their buffer meaning no disk access is required to serve the file. And your webserver should simply be good at serving static files, or you should consider switching (to, say, lighttpd or nginx).</p>
<h3>You're staring blindly at the cache rate</h3>
<p>If a default config caches all static files without exception, you'll see high cache hitrates. You (and your client) will be happy. And you'll be mislead in thinking that the performance bottlenecks have been solved. It's not the static files that cause your webserver load, it's the PHP/Ruby/Perl/... scripts that are hitting your database and are calling external API's. Those are the requests that need to be cached, not a static file that's not causing any CPU load.</p>
<h3>Proceed with spare memory</h3>
<p>Therefore, focus should be given to the dynamic pages causing server load. Those cached requests actually make a difference. Then, if you have spare memory, open up some static file requests to be cached. And continue to monitor your cache size, because if static files are causing heavy PHP pages to be evicted from memory, you will only hurt your performance further.</p>
<p>Nearly no one has the capacity to store all their static content in a Varnish memory cache. Don't sacrifice a 5ms static file request for a 500ms PHP processing script. I've commented all entries that cause static files to be cached explaining this, and I hope that people don't blindly copy <a href='https://github.com/mattiasgeniar/varnish-3.0-configuration-templates' target='_blank'>the config templates</a> but read through them and think about this.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/DsSrQq0akS0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/11/28/stop-caching-static-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/11/28/stop-caching-static-files/</feedburner:origLink></item>
		<item>
		<title>Public jPackage Repository Mirror</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/7rIQYv2v2Ko/</link>
		<comments>http://mattiasgeniar.be/2012/10/29/public-jpackage-repository-mirror/#comments</comments>
		<pubDate>Mon, 29 Oct 2012 10:40:38 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[jpackage tomcat]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3937</guid>
		<description><![CDATA[If you're running CentOS 5/6 or RHEL 5/6 and have need for a recent Tomcat version, you're most likely familiar with the jPackage repositories. In fact, just about any guide you may find in the interwebs will point you to that repository for up-to-date packages. It's not that convenient that the repository is offline then, [...]]]></description>
				<content:encoded><![CDATA[<p>If you're running CentOS 5/6 or RHEL 5/6 and have need for a recent Tomcat version, you're most likely familiar with the jPackage repositories. In fact, just about any guide you may find in the interwebs will point you to that repository for up-to-date packages.</p>
<p>It's not that convenient that the repository is offline then, is it? With no sign yet on when it's coming back, <a href='http://www.nucleus.be/en' target='_blank'>we</a> dedicated to announce our own jPackage mirror for the time being, until the official ones come back. It won't be updated (since the upstream appears to be dead), but for new installs it may still be usefull.</p>
<p>You can find the mirror at <a href='http://mirror.nucleus.be/jpackage/' target='_blank'>http://mirror.nucleus.be/jpackage/</a>, with an example Yum Repository file included.</p>
<p>Hope it helps!</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/7rIQYv2v2Ko" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/10/29/public-jpackage-repository-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/10/29/public-jpackage-repository-mirror/</feedburner:origLink></item>
		<item>
		<title>Disconnecting</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/EFfvHHNz-jQ/</link>
		<comments>http://mattiasgeniar.be/2012/09/01/disconnecting/#comments</comments>
		<pubDate>Sat, 01 Sep 2012 12:12:59 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[About me]]></category>
		<category><![CDATA[personal kukoo]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3913</guid>
		<description><![CDATA[It feels like I'm suffering from the same "problem" that most tech-savvy people experience: the constant need to be online and respond. Whether it's a new e-mail that came in, a Facebook or Twitter notification, a new text message, ... there's always something that draws my attention away from what's happening around me and back [...]]]></description>
				<content:encoded><![CDATA[<p>It feels like I'm suffering from the same "problem" that most tech-savvy people experience: the constant need to be online and respond. Whether it's a new e-mail that came in, a Facebook or Twitter notification, a new text message, ... there's always something that draws my attention away from what's happening around me and back to my smartphone or laptop.</p>
<p>That 960&#215;640 pixel iPhone display is dominating me. It needs to stop. Now.</p>
<p>I'm already spending an unhealthy amount of time in front of a laptop, tablet or smartphone so that every time I'm away from them -- I should really be <em>away</em>, you know? No distractions. Nothing to pull me back in. Enjoy the non-digital life.</p>
<p>The last few weeks I've been able to do this better, with the help of a few little tweaks to how I work.<span id="more-3913"></span></p>
<h2>Disable notification sounds</h2>
<p>Among the first things I had to disable were the notification sounds that every application on the iPhone makes by default. It's a silly thing, and I'm sure some can resist this urge, but whenever I hear that notification sound I <em>have</em> to check what it is.</p>
<p>Even if it's something meaningless as a Retweet on Twitter or a tag on Facebook, I was distracted and stopped whatever I was doing to check it. Disabling these sounds made my life, quite literally, calmer.</p>
<h2>A cleaner homescreen</h2>
<p>As most iPhone users, my default home-screen on the device consisted of the Twitter/Facebook app, the Mail, Phone and  Messages app, the Camera and the Music player (Spotify in my case). This default layout resulted in me seeing the amount of new e-mails I had every time I would take a picture or change a song on my phone.</p>
<p>With every relaxing action I would normally do, such as look at pictures, use the Camera app to take new ones, change a song, browse the net, ... I would see that big Mail icon with the even bigger 'Unread Mail' counter on it. That also meant that I would open my Mail app nearly every time I unlocked the phone to see what was new. </p>
<p>I'm jealous of people that can leave their work on a Friday evening and never look at it again until Monday. I know I'll never be able to do that, but by simply moving those distractions away to another screen on the phone I'm able to relax more and not think of work all the time.</p>
<p><a href="http://mattiasgeniar.be/wp-content/uploads/2012/09/foto-1.png" rel="lightbox[3913]"><img src="http://mattiasgeniar.be/wp-content/uploads/2012/09/foto-1-199x300.png" alt="" title="foto 1" width="199" height="300" class="alignleft size-medium wp-image-3916" /></a><a href="http://mattiasgeniar.be/wp-content/uploads/2012/09/foto-2.png" rel="lightbox[3913]"><img src="http://mattiasgeniar.be/wp-content/uploads/2012/09/foto-2-199x300.png" alt="" title="foto 2" width="199" height="300" class="alignleft size-medium wp-image-3917" /></a></p>
<p>The left screen was my normal configuration. I would always see how many mails were awaiting me, I couldn't resist opening the Facebook or Twitter app on every notification, ... I was addicted. </p>
<p>The right screen is the new way to go: Mail is no longer present on the main screen, the Facebook &#038; Twitter app have been moved back as well, notifications from work (Prowl) moved to another screen, ... Less big red numbers flashing in my eyes and distracting me.</p>
<p>Whenever I open my Mail app now, it's deliberate with the purpose of actually reading and replying to emails.</p>
<h2>More structure in e-mails: Kukoo</h2>
<p>Simply moving a few icons around helped, but only on the smartphone. I would still get all my mails on the laptop. And since I managed my appointments and contacts in the same application that also receives my mail (Outlook), it meant that whenever I opened it, I'd received all my new mails and feel at work once again.</p>
<p>To get a calmer mailbox with less distractions, I've been using <a href="http://kukoo.com/" target="_blank">Kukoo</a> for around 2 months now and it's helped me tremendously. With <a href="http://kukoo.com/" target="_blank">Kukoo</a>, I decide when mail will be delivered into my mailbox. Even if I open my Outlook to check an old e-mail or my calendar, I won't get any new mails because <em>that's how I configured it</em>. The mails will only be delivered when I want it.</p>
<p>And since I'll be reading my e-mails less, I need to alert my correspondents that would normally received a reply back within 30 minutes that it'll take a bit longer this time. For that, I have a public page that displays when I'll read my next mails: <a href="http://kukoo.com/mattias" target="_blank">kukoo.com/mattias</a>. It's present in my mail signature so the people I mail with know about it. For new mails that I receive, I can send an autoreply with the exact time that I'll be reading my mail again. </p>
<p>In the meantime? I can focus on my work or on relaxing properly once again.</p>
<h2>1 + 1 = relax</h2>
<p>Those 2 changes mentioned above, modifying the smartphone to be less present and using Kukoo for a more structured mailbox, have helped me a lot. I'm able to get away from my digital life more often and enjoy the real life around me.</p>
<p>I'm sure for some this seems like overkill or perhaps blown out of proportion, but for me these changes were a necessity. Life is busy enough as it is, you need to make time to calm down and enjoy the non-work life from time to time. :-)</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/EFfvHHNz-jQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/09/01/disconnecting/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/09/01/disconnecting/</feedburner:origLink></item>
		<item>
		<title>Using telnet from the VMware 5.x ESXi shell</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/GzAHTgS0LgY/</link>
		<comments>http://mattiasgeniar.be/2012/08/31/using-telnet-from-the-vmware-5-x-esxi-shell/#comments</comments>
		<pubDate>Fri, 31 Aug 2012 09:09:24 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[vmware telnet]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3907</guid>
		<description><![CDATA[The short answer is: you can't use telnet. But you can use alternatives, obviously. For instance, to troubleshoot some iSCSI connectivity problems, you would be used to doing something as this. ~ # telnet 10.0.2.3 3260 -ash: telnet: not found Instead, you can use netcat to test the connectivity. ~ # nc -z 10.0.2.3 3260 [...]]]></description>
				<content:encoded><![CDATA[<p>The short answer is: you can't use telnet. But you can use alternatives, obviously.</p>
<p>For instance, to troubleshoot some iSCSI connectivity problems, you would be used to doing something as this.</p>
<pre>~ # telnet 10.0.2.3 3260
-ash: telnet: not found</pre>
<p>Instead, you can use <strong>netcat</strong> to test the connectivity.</p>
<pre>~ # nc -z 10.0.2.3 3260
Connection to 10.0.2.3 3260 port [tcp/*] succeeded!</pre>
<p>If you were to test this on a closed TCP port, the error would look like this.</p>
<pre>~ # nc -z 10.0.2.3 32600
(empty response)</pre>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/GzAHTgS0LgY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/08/31/using-telnet-from-the-vmware-5-x-esxi-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/08/31/using-telnet-from-the-vmware-5-x-esxi-shell/</feedburner:origLink></item>
		<item>
		<title>Now stop using dsbl.org blacklisting: it’s offline</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/hVQ4qhrA_7w/</link>
		<comments>http://mattiasgeniar.be/2012/08/10/now-stop-using-dsbl-org-blacklisting-its-offline/#comments</comments>
		<pubDate>Fri, 10 Aug 2012 13:13:06 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[dnsbl]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3896</guid>
		<description><![CDATA[It seems a lot of Blacklist filters still use the old DSBL DNS Blacklist, but it's been dead for few years already. Since March 2009, to be exact. However, something changed in the last 24 hours that actually made them go offline. The result is that any system still using that blacklist sends out bounce [...]]]></description>
				<content:encoded><![CDATA[<p>It seems a lot of Blacklist filters still use the old DSBL DNS Blacklist, but it's been <a href="http://dsbl.org/node/3">dead</a> for few years already. <a href="http://en.wikipedia.org/wiki/Distributed_Sender_Blackhole_List">Since March 2009</a>, to be exact. However, something changed in the last 24 hours that actually made them <em>go offline</em>.</p>
<p>The result is that any system still using that blacklist sends out bounce messages such as this.</p>
<pre>The following recipient(s) cannot be reached: xxx
Service unavailable; Client host [x.x.x.x] <strong>blocked using list.dsbl.org</strong></pre>
<p>If you still have legacy systems running that use the list.dsbl.org blacklist, you may want to remove any references to the DSBL in your configs and stop using that blacklist.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/hVQ4qhrA_7w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/08/10/now-stop-using-dsbl-org-blacklisting-its-offline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/08/10/now-stop-using-dsbl-org-blacklisting-its-offline/</feedburner:origLink></item>
		<item>
		<title>e2fsck: Error allocating directory block array: Memory allocation failed</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/KVZJ5N7NYu4/</link>
		<comments>http://mattiasgeniar.be/2012/08/05/e2fsck-error-allocating-directory-block-array-memory-allocation-failed/#comments</comments>
		<pubDate>Sat, 04 Aug 2012 22:55:33 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[e2fsck]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3884</guid>
		<description><![CDATA[When you try to filecheck a large partition on a system with insufficient RAM, you can encounter the following error. $ e2fsck -p -f /dev/vg_mnt/lv_mnt01 /dev/vg_mnt/lv_mnt01: Error allocating icount structure: Memory allocation failed /dev/vg_mnt/lv_mnt01: Error allocating directory block array: Memory allocation failed e2fsck: aborted This happens because the e2fsck tries to store all inode information [...]]]></description>
				<content:encoded><![CDATA[<p>When you try to filecheck a large partition on a system with insufficient RAM, you can encounter the following error.</p>
<pre>$ e2fsck -p -f /dev/vg_mnt/lv_mnt01
/dev/vg_mnt/lv_mnt01: Error allocating icount structure: Memory allocation failed
/dev/vg_mnt/lv_mnt01: Error allocating directory block array: Memory allocation failed
e2fsck: aborted</pre>
<p><span id="more-3884"></span></p>
<p>This happens because the <em>e2fsck</em> tries to store all inode information in memory, which may exceed the available memory size on the system.</p>
<p>To fix this, either upgrade the system with more memory or try to set additional options that allow e2fsck to create a temporary directory on a system with sufficient (several GB's) free disk space. Not that this only works for <strong>e2fsck version 1.40 or higher</strong> (<em>meaning: CentOS and RHEL users are screwed since they only provide 1.39</em>).</p>
<pre>$ rpm -qa | grep e2fsprogs
e2fsprogs-libs-1.39-34.el5_8.1
e2fsprogs-devel-1.39-34.el5_8.1
<strong>e2fsprogs-1.39-34.el5_8.1</strong></pre>
<p>To run the e2fsck with a recent version, try the following.</p>
<pre>$ cd /usr/local/src
$ wget "http://kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.5/e2fsprogs-1.42.5.tar.gz"
$ tar xzf e2fsprogs-1.42.5.tar.gz
$ rm -f e2fsprogs-1.42.5.tar.gz
$ cd e2fsprogs-1.42.5
$ yum install gcc make
$ ./configure
$ make</pre>
<p>The above will download e2fsck (the latest version as of this writing), compile and make it but leave it in the directory of the build (/usr/local/src/e2fsck), it won't copy the binaries to your system. That means you can use the newly compiled binary at <em>/usr/local/src/e2fsprogs-1.42.5/e2fsck/e2fsckw</em>.</p>
<p>Now, since you have a e2fsck version higher than 1.40, you can set the options to use a scratch-disk and avoice the Out-of-Memory errors. First, create the directory.</p>
<pre>$ mkdir -p /var/cache/e2fsck</pre>
<p>And create a custom file called <em>/etc/e2fsck.conf</em> that contains the following content.</p>
<pre>$ cat /etc/e2fsck.conf 
[scratch_files]
directory = /var/cache/e2fsck</pre>
<p>This tells <em>e2fsck</em> to use a directory on disk if the total available memory is insufficient to host all inode information of the partition.</p>
<p>If you had to make a new e2fsck yourself because the OS didn't have a recent version, start the new e2fsck as such.</p>
<pre>$ /usr/local/src/e2fsprogs-1.42.5/e2fsck/e2fsck -f /dev/vg_mnt/lv_mnt01</pre>
<p>If you had a recent version already, you can simply restart e2fsck with the system binary.</p>
<pre>$ e2fsck -f /dev/vg_mnt/lv_mnt01</pre>
<p>When the new e2fsck is running, you should see additional information appear in the cache-directory.</p>
<pre>$ ls /var/cache/e2fsck/
total 475M
-rw-------  1 root root 106M Aug  5 13:16 2fb8a70e-8ee3-4c9c-b95b-0e42ae1ecebd-dirinfo-jthsIm
-rw-------  1 root root 368M Aug  5 13:16 2fb8a70e-8ee3-4c9c-b95b-0e42ae1ecebd-icount-ZxFa0u</pre>
<p>If the directory is empty, your e2fsck is not using the scratch_files options set in /etc/e2fsck.conf and would probably indicate that it is running an older version that does not yet support this. See the compile commands above to compile the latest version yourself.</p>
<p>Happy fscking!</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/KVZJ5N7NYu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/08/05/e2fsck-error-allocating-directory-block-array-memory-allocation-failed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/08/05/e2fsck-error-allocating-directory-block-array-memory-allocation-failed/</feedburner:origLink></item>
		<item>
		<title>Facter/Puppet: Could not retrieve selinux: Invalid argument – /proc/self/attr/current</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/JtopZORAnv0/</link>
		<comments>http://mattiasgeniar.be/2012/07/31/facterpuppet-could-not-retrieve-selinux-invalid-argument-procselfattrcurrent/#comments</comments>
		<pubDate>Tue, 31 Jul 2012 09:33:56 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3878</guid>
		<description><![CDATA[I recently ran into the following issue on a CentOS 5 server. $ facter Could not retrieve selinux: Invalid argument - /proc/self/attr/current Could not retrieve selinux: Invalid argument - /proc/self/attr/current Could not retrieve selinux: Invalid argument - /proc/self/attr/current Could not retrieve selinux: Invalid argument - /proc/self/attr/current ... After checking the sestatus, it should have been [...]]]></description>
				<content:encoded><![CDATA[<p>I recently ran into the following issue on a CentOS 5 server.</p>
<pre>$ facter
Could not retrieve selinux: Invalid argument - /proc/self/attr/current
Could not retrieve selinux: Invalid argument - /proc/self/attr/current
Could not retrieve selinux: Invalid argument - /proc/self/attr/current
Could not retrieve selinux: Invalid argument - /proc/self/attr/current
...</pre>
<p><span id="more-3878"></span></p>
<p>After checking the sestatus, it should have been disabled.</p>
<pre>$ sestatus
SELinux status:                 <strong>disabled</strong></pre>
<p>Yet the /selinux directory on the server contained content that would contradict that.</p>
<pre>$ ls -alh /selinux/
total 20K
drwxr-xr-x  2 root root 4.0K May 11  2011 .
drwxr-xr-x 23 root root 4.0K Jul 31 11:27 ..
<strong>-rw-r--r--  1 root root    2 Oct  6  2010 enforce</strong></pre>
<p>That file should not be there if the selinux is in fact disabled. If all selinux related configurations have been disabled (as verified by <em>sestatus</em> and the selinux config file at <em>/etc/selinux/config</em>) you can safely remove that file.</p>
<pre>$ rm -f /selinux/enforce</pre>
<p>The Puppet/Facter code would check if that file exists in the /selinux directory -- if that does not fully match your selinux config, you can get funky messages as the ones shown above.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/JtopZORAnv0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/07/31/facterpuppet-could-not-retrieve-selinux-invalid-argument-procselfattrcurrent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/07/31/facterpuppet-could-not-retrieve-selinux-invalid-argument-procselfattrcurrent/</feedburner:origLink></item>
		<item>
		<title>Prevent cronjobs from overlapping in Linux</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/dxsT37LCDN8/</link>
		<comments>http://mattiasgeniar.be/2012/07/24/prevent-cronjobs-from-overlapping-in-linux/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 09:52:35 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[cronjobs]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3844</guid>
		<description><![CDATA[It's an unfortunate common problem on many systems: you have scheduled tasks defined in cronjobs and for some reason, they take longer to execute than anticipated. This eventually means that they start to overlap and run at the same time. If those are cronjobs that are acting on the same data from a database, it [...]]]></description>
				<content:encoded><![CDATA[<p>It's an unfortunate common problem on many systems: you have scheduled tasks defined in cronjobs and for some reason, they take longer to execute than anticipated. This eventually means that they start to overlap and run at the same time. If those are cronjobs that are acting on the same data from a database, it may mean data corruption. If they're doing heavy processing of data, it could mean the server load is rising too high. Because of that high load, those cronjobs are taking longer than usual and before you know it there's a vicious circle in which cronjobs keep launching and overlapping eachother.</p>
<p>Obviously, you don't want this. The good news is, this is fairly easy to prevent.<span id="more-3844"></span></p>
<h2>Using flock</h2>
<p><a href="http://linux.die.net/man/1/flock">Flock</a> is a very interesting tool for managing <em>lock files</em>. Those lock files are used to determine if a script or application is already running (comparable to a <em>PID file</em> that contains the Process ID of the running script). If the lock exists, the cronjob won't start. If the lock doesn't exist, it's safe to launch the cron.</p>
<p>Take the following common example, where a cron is run every minute on the server.</p>
<pre>$ crontab -l
* * * * * /usr/bin/php /path/to/cron.php</pre>
<p>If the script takes longer than a minute to execute, they'll begin to overlap. To prevent it, you can change it with the flock example below.</p>
<pre>$ crontab -l
* * * * * /usr/bin/flock -w 0 /path/to/cron.lock /usr/bin/php /path/to/cron.php</pre>
<p>The example above requires <strong>flock</strong> to manage those lock files. If it does not yet exist on your system, installation should be as simple as a <strong>yum install flock</strong> or <strong>apt-get install flock</strong>, depending on your Linux Distribution (see: <a href="http://mattiasgeniar.be/2008/10/05/how-to-find-out-your-current-distribution-version/">how to find your current Linux Distribution</a>).</p>
<p>The moment flock starts, is <em>locks the lock-file</em> you specify in the command. You can see that by requesting the user/script that is having the lock on that file.</p>
<pre>$ fuser -v /path/to/cron.lock
                     USER        PID ACCESS COMMAND
cron.lock:           root       7836 f.... flock
                     root       7837 f.... php</pre>
<p>It will show you the Process IDs (PIDs) of the script that is holding the lock. If no script is holding the lock, the <em>fuser</em> command will simply return nothing.</p>
<pre>$ fuser -v /path/to/cron.lock</pre>
<p>So <em>flock</em> is a pretty good way to prevent cronjobs from overlapping by using an extra Command Line tool.</p>
<h2>Using pgrep</h2>
<p>Another method, without using lock files, is using a rather simple bash-one liner that checks for the current running file and executes it if it's not running. The trick is to wrap your crontask in a uniquely-named bash-script, as such.</p>
<pre>$ cat /path/to/cron.sh
#!/bin/bash
/usr/bin/php /path/to/cron.php

$ chmod +x /path/to/cron.sh</pre>
<p>In your crontab, it should be listed as such now.</p>
<pre>$ crontab -l
* * * * * /path/to/cron.sh</pre>
<p>The command above will, just as the first example, execute our PHP script every minute through a bash script. To prevent it from overlapping, it can also be changed to this.</p>
<pre>$ crontab -l
* * * * * /usr/bin/pgrep -f /path/to/cron.sh > /dev/null 2> /dev/null || /path/to/cron.sh</pre>
<p>The <strong>pgrep</strong> command will return <strong>false</strong> if it does not find a running process matching the first argument, <em>/path/to/cron.sh</em>. If it returns false, it'll process the second part of the <strong>OR comparison</strong> (the double vertical line, ||). If the running process was found, pgrep will return the Process ID (PID) and Bash will not continue to the second part of the OR statement since the first already returned <strong>true</strong>. </p>
<p>The trick here is to use very unique scriptnames. If the name is too generic (such as "cron.sh"), pgrep may return Process IDs from other running cron jobs and not execute the cron you wanted.</p>
<h2>Using lock-files within the script</h2>
<p>If the examples above are not available to you, you can still use the concept of lock files in your application. One of the first commands in your script could be to check for the existance of a lock-file. If it exists, the script would simply <em>exit(1)</em> out of the application and stop running. If the lock-file does not exist, the script could create it and prevent the next job from executing.</p>
<p>As a last step in your script you remove the lock file to indicate that the script has finished and allowing the next run to continue.</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/dxsT37LCDN8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/07/24/prevent-cronjobs-from-overlapping-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/07/24/prevent-cronjobs-from-overlapping-in-linux/</feedburner:origLink></item>
		<item>
		<title>Reinstall the Linux Kernel on CentOS or RHEL</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/vHrRuUsu8o0/</link>
		<comments>http://mattiasgeniar.be/2012/07/23/reinstall-the-linux-kernel-on-centos-or-rhel/#comments</comments>
		<pubDate>Mon, 23 Jul 2012 08:42:50 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3836</guid>
		<description><![CDATA[One would expect that yum's reinstall command would do the trick, but alas -- it does not. # yum reinstall kernel Package kernel-2.6.18-194.32.1.el5.x86_64 is allowed multiple installs, skipping Package kernel-2.6.18-274.12.1.el5.x86_64 is allowed multiple installs, skipping Package kernel-2.6.18-194.el5.x86_64 is allowed multiple installs, skipping Package kernel-2.6.18-308.1.1.el5.x86_64 is allowed multiple installs, skipping Package kernel-2.6.18-308.11.1.el5.x86_64 is allowed multiple installs, [...]]]></description>
				<content:encoded><![CDATA[<p>One would expect that yum's reinstall command would do the trick, but alas -- it does not.<span id="more-3836"></span></p>
<pre># yum reinstall kernel
Package kernel-2.6.18-194.32.1.el5.x86_64 is allowed multiple installs, skipping
Package kernel-2.6.18-274.12.1.el5.x86_64 is allowed multiple installs, skipping
Package kernel-2.6.18-194.el5.x86_64 is allowed multiple installs, skipping
Package kernel-2.6.18-308.1.1.el5.x86_64 is allowed multiple installs, skipping
Package kernel-2.6.18-308.11.1.el5.x86_64 is allowed multiple installs, skipping
Nothing to do</pre>
<p>To reinstall the kernel, you actually have to remove it first and then install it again. You can remove your currently running kernel since it's operating completely from memory and does not rely on the physical files at the moment you're trying to reinstall it. So, first find out your current version.</p>
<pre># uname -r
2.6.18-308.11.1.el5</pre>
<p>And see what other kernels you may have installed.</p>
<pre># rpm -qa | grep kernel | sort
kernel-2.6.18-194.32.1.el5
kernel-2.6.18-194.el5
kernel-2.6.18-274.12.1.el5
kernel-2.6.18-308.1.1.el5
<strong>kernel-2.6.18-308.11.1.el5</strong>
kernel-headers-2.6.18-308.1.1.el5</pre>
<p>If you don't need the older kernels, you can safely remove them. You should keep at least one extra, just in case this reinstall fails (or if the new kernel is giving you problems).</p>
<pre># yum remove kernel-2.6.18-194.32.1.el5 kernel-2.6.18-194.el5</pre>
<p>Now, to reinstall the kernel you want, first remove it by specifying the exact version (usually the currently running kernel, see <em>uname -r</em> above).</p>
<pre># yum remove kernel-2.6.18-308.11.1.el5
=====================================================================
 Package       Arch       Version               Repository    Size
=====================================================================
Removing:
 kernel        x86_64     2.6.18-308.11.1.el5   installed     98 M

Transaction Summary
=====================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y</pre>
<p>Confirm that the kernel is actually removed.</p>
<pre># rpm -qa | grep kernel | sort -n               
kernel-2.6.18-308.1.1.el5
kernel-headers-2.6.18-308.11.1.el5</pre>
<p>It's not showing up (only the older kernel), so reinstall it.</p>
<pre># yum install kernel-2.6.18-308.11.1.el5
=======================================================================
 Package       Arch       Version              Repository      Size
=======================================================================
Installing:
 kernel        x86_64     2.6.18-308.11.1.el5  updates         21 M

Transaction Summary
=======================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 21 M
Is this ok [y/N]: y</pre>
<p>And you should see the Kernel appear again.</p>
<pre># rpm -qa | grep kernel | sort -n                
kernel-2.6.18-308.11.1.el5
<strong>kernel-2.6.18-308.1.1.el5</strong>
kernel-headers-2.6.18-308.11.1.el5</pre>
<p>After that, reboot the server again to make sure everything went as expected and you should have a cleanly reinstalled Linux Kernel available to you (for whatever reason this may have been necessary).</p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/vHrRuUsu8o0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/07/23/reinstall-the-linux-kernel-on-centos-or-rhel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/07/23/reinstall-the-linux-kernel-on-centos-or-rhel/</feedburner:origLink></item>
		<item>
		<title>My thoughts on mobile webdesign</title>
		<link>http://feedproxy.google.com/~r/mattiasgeniar/~3/dBKctdESCoI/</link>
		<comments>http://mattiasgeniar.be/2012/07/06/my-thoughts-on-mobile-webdesign/#comments</comments>
		<pubDate>Fri, 06 Jul 2012 13:52:12 +0000</pubDate>
		<dc:creator>Mattias Geniar</dc:creator>
				<category><![CDATA[Devops]]></category>
		<category><![CDATA[mozbx]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://mattiasgeniar.be/?p=3814</guid>
		<description><![CDATA[Around 2 years ago, I decided I wanted to play around a bit with mobile designs for websites. I also had a practical use case; I would use an API provided by our monitoring solution and hack together a mobile site that I could use to quickly (and with low bandwidth) check the state of [...]]]></description>
				<content:encoded><![CDATA[<p>Around 2 years ago, I decided I wanted to play around a bit with mobile designs for websites. I also had a practical use case; I would use an API provided by <a href="http://www.zabbix.com/">our monitoring solution</a> and hack together a mobile site that I could use to quickly (and with low bandwidth) check the state of <a href="http://www.nucleus.be/en/">our servers</a>, see graphs, etc. As a bonus, it would allow me to easily acknowledge events that I know don't really matter at that time. This helps a lot when it happens at 4 o'clock during the night. And so, <a href="http://www.mozbx.net/">MoZBX was born</a>.</p>
<h2>You just need bigger buttons, right?</h2>
<p>My though back then was: mobile websites? That's just the same as any other site, but <strong>with bigger buttons</strong>. You know, fat finger touching etc. Take a normal button, multiply it by x2, and done. You have a mobile site.<span id="more-3814"></span></p>
<p>So with that in mind, I built the very <a href="http://mattiasgeniar.be/2010/09/19/mozbx-the-mobile-zabbix-client/">first version of MoZBX</a> using <a href="http://www.jqtouch.com/">jQTouch</a>, which back then was a combination of jQuery and some mobile enhancements (they now offer <a href="http://zeptojs.com/">Zepto.js</a> as well instead of jQuery, which seems to speeds it all up instead of the slow monster that I experienced jQuery to be on mobile devices). It was relatively easy to get a first prototype up and running, but it annoyed me. You see, I'm mostly a backend developer. I don't care about designs, I care about functional PHP code. I love to hack my solutions together in my own way and not have to follow rules other tools force me to use. I like my freedom.</p>
<p>That's when my frustration with jQTouch began: you needed certain ways of structuring your data, you need to follow strict rules on how to create forms, lists, styles, ... (with annoying submit-actions on forms, what's up with that jQTouch?), everything is being loaded via AJAX which makes UI testing a pain, ... It pulled the joy of creating a new project right out of me. MoZBX worked, but I wasn't happy with it. Windows Phone users couldn't access it, BlackBerry support was ... well ... a joke, ... I needed something else.</p>
<p>So I looked at other solutions, such as <a href="http://jquerymobile.com/">jQuery Mobile</a>, <a href="http://www.kendoui.com/">Kendo UI</a>, ... but none suited my needs. The reason I looked at those 'Mobile Frameworks' in the first place is my absolute lack of design skills, both in graphics and in CSS-styles.</p>
<h2>Bootstrap FTW!</h2>
<p>And then, out of the blue, came <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>, which I shall name "<em>a backend developer's wet dream for creating decent looking websites</em>" from now on.  So, trying to be hip and cool, I redid the UI for MoZBX in Twitter Bootstrap and threw away everything that was ever related to jQTouch. And there was much joy.</p>
<p>It took me a few evenings of work to test how Twitter Bootstrap worked, how I could use it in MoZBX and what would be the best way to get started. And a few days later, the new MoZBX was born.</p>
<h2>Sites vs Native App</h2>
<p>My conclusion so far is: throw away all those mobile frameworks you use if you want a mobile website. If you want those App-like feelings with swipe effects and page transitions, build an app instead. If you want a mobile site (see: it's even in the words, you're building <em>a website</em>, not an <em>app</em>), use plain old HTML and CSS for a responsive website. Stop hogging mobile UI's with frameworks that are overly complex and add overhead to each page request -- let alone the development overhead of adjusting the app to fit into that particular framework.</p>
<p>Granted, in 6 months, every website will look like it's been made with Twitter Bootstrap, but I don't blame them -- it's easy to use and it just works. No need to dabble in new 'frameworks' to get your mobile site going. <strong>Use CSS and HTML, create bigger buttons, and you've got yourself a mobile site.</strong></p>
<p><em>Side note: if you're a graphics designer working on a mobile website for the last 6 months, I apologize for the overly simplified statement of 'mobile just means bigger buttons'. I do appreciate all the work you put into creating beautiful pages. For me however (and in particular, this monitoring project), it's overkill. I just needed bigger buttons.</em></p>
<img src="http://feeds.feedburner.com/~r/mattiasgeniar/~4/dBKctdESCoI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattiasgeniar.be/2012/07/06/my-thoughts-on-mobile-webdesign/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattiasgeniar.be/2012/07/06/my-thoughts-on-mobile-webdesign/</feedburner:origLink></item>
	</channel>
</rss>
