<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>pixelflush_ | Cloud Expertise</title>
    <description>Making the gears behind your cloud spin.
</description>
    <link>/</link>
    <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 05 Jul 2023 10:40:25 +0200</pubDate>
    <lastBuildDate>Wed, 05 Jul 2023 10:40:25 +0200</lastBuildDate>
    <generator>Jekyll v3.9.3</generator>
    
      <item>
        <title>Using Tailwind CSS</title>
        <description>&lt;p&gt;For a new project I finally got a chance to explore &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Tailwind CSS&lt;/code&gt;. A utility-first CSS
framework you’ve most likely heard of before.&lt;/p&gt;

&lt;p&gt;Tailwind is build on top of the vast JavaScript tooling that is flourishing around &lt;em&gt;Node.js&lt;/em&gt;.
We are lucky to have support for that in Rails since the introduction of &lt;em&gt;webpack&lt;/em&gt;
in &lt;em&gt;Rails 5.1&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I tried to find the smallest amount of steps needed to get Tailwind working in a
fresh, yet deployable Rails 6 application. Tailwind generates a bazillion CSS
classes, so clearing out all the unused ones is a must-do for production deployments
and therefore included in the following steps via &lt;em&gt;PurgeCSS&lt;/em&gt;.&lt;/p&gt;

&lt;h2 id=&quot;installing-the-needed-tools&quot;&gt;Installing the needed tools&lt;/h2&gt;

&lt;p&gt;The following creates a new rails application with &lt;em&gt;webpack&lt;/em&gt; included by default.
I’m choosing &lt;em&gt;PostgreSQL&lt;/em&gt; as database to allow deployments to &lt;em&gt;Heroku&lt;/em&gt; right away.
But feel free to pick something else.&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rails new freshwind &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; postgresql
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;freshwind
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;yarn add tailwindcss &lt;span class=&quot;nt&quot;&gt;--dev&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;yarn add @fullhuman/postcss-purgecss &lt;span class=&quot;nt&quot;&gt;--dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’m providing a &lt;a href=&quot;#git-patch&quot;&gt;Git patch&lt;/a&gt; at the end of this article you can apply
right after &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rails new ...&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;postcss-configuration&quot;&gt;PostCSS Configuration&lt;/h2&gt;

&lt;p&gt;From here on I’m basically following the
&lt;a href=&quot;https://tailwindcss.com/docs/installation/&quot;&gt;official installation guide&lt;/a&gt;
adjusted to Rails. &lt;em&gt;PurgeCSS&lt;/em&gt; is only run on production builds. I’m still using
regular Rails views in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./app/views/**/*.html.erb&lt;/code&gt;. Extend the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;content&lt;/code&gt; array
with more paths for &lt;em&gt;React&lt;/em&gt;, &lt;em&gt;Vue&lt;/em&gt;, etc.&lt;/p&gt;

&lt;div class=&quot;language-js highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// postcss.config.js&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;purgecss&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;@fullhuman/postcss-purgecss&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)({&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// Specify the paths to all of the template files in your project&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./app/views/**/*.html.erb&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// Include any special characters you&apos;re using in this regular expression&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;defaultExtractor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;[\w&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;(?&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;!:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;plugins&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;postcss-import&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;postcss-flexbugs-fixes&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;tailwindcss&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./app/javascript/css/tailwind.js&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;autoprefixer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;postcss-preset-env&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)({&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;autoprefixer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;flexbox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;no-2009&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;stage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}),&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NODE_ENV&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;production&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;purgecss&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;starting-to-use-tailwindcss&quot;&gt;Starting to use TailwindCSS&lt;/h2&gt;

&lt;p&gt;At this point &lt;em&gt;TailwindCSS&lt;/em&gt; is installed. Let’s adjust the default Rails layout
to start making use of it. In development &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stylesheet_pack_tag&lt;/code&gt; will return &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nil&lt;/code&gt;
while all your CSS is delivered through the JS pack. You can control this with
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;extract_css&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;webpacker.yml&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-erb highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- app/views/layouts/application.html.erb --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ... --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;%=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stylesheet_pack_tag&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;application&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;data-turbolinks-track&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;reload&apos;&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;&amp;lt;%=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;javascript_pack_tag&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;application&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;data-turbolinks-track&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;reload&apos;&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ... --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;/* app/javascript/css/application.css */&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* purgecss start ignore */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@tailwind&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;base&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@tailwind&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;components&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* purgecss end ignore */&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@tailwind&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;utilities&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-js highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// app/javascript/packs/application.js&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// ...&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;../css/application.css&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;deployment-to-heroku&quot;&gt;Deployment to Heroku&lt;/h2&gt;

&lt;p&gt;Allow Heroku to make use of modules in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;devDependencies&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;heroku config:set &lt;span class=&quot;nv&quot;&gt;NPM_CONFIG_PRODUCTION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;git-patch&quot;&gt;Git Patch&lt;/h2&gt;

&lt;p&gt;Apply everything mentioned here via patch file.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/downloads/0001-Add-TailwindCSS-with-PurgeCSS.patch&quot; class=&quot;btn btn-primary&quot;&gt;Download Git Patch&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sun, 09 Feb 2020 16:30:00 +0100</pubDate>
        <link>/blog/2020/02/09/tailwind-css-with-rails/</link>
        <guid isPermaLink="true">/blog/2020/02/09/tailwind-css-with-rails/</guid>
        
        
      </item>
    
      <item>
        <title>Upgrading PostgreSQL 9.5 to 9.6</title>
        <description>&lt;p&gt;There are plenty of guides to upgrade from 9.5 to 9.6, or any other minor version.
Here is the short story:&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;initdb /usr/local/var/postgres9.6 &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; utf8
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pg_upgrade &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  -d /usr/local/var/postgres -D /usr/local/var/postgres9.6 \
  -b /usr/local/Cellar/postgresql/9.5.5/bin -B /usr/local/Cellar/postgresql/9.6.3/bin
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /usr/local/var/postgres /usr/local/var/postgres9.5
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /usr/local/var/postgres9.6 /usr/local/var/postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, I never had much luck with this. There was always some extension conflict
or some other not-easy-to-fix issue.&lt;/p&gt;

&lt;p&gt;Something along the lines of:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FATAL:  incompatible library &quot;/usr/local/lib/postgresql/hstore.so&quot;: version mismatch
DETAIL:  Server is version 9.6, library is version 9.5.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So this is the more manual bare-bone approach through backup and restore.&lt;/p&gt;

&lt;h2 id=&quot;status-quo&quot;&gt;Status quo&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;macOS with PostgreSQL 9.6 installed through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;homebrew&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;PostgreSQL 9.5 is also still installed&lt;/li&gt;
  &lt;li&gt;PostgreSQL is not running&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;get-95-to-run-again&quot;&gt;Get 9.5 to run again&lt;/h2&gt;

&lt;p&gt;Start PostgreSQL with old binaries, libraries and data.&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /usr/local/lib/postgresql /usr/local/lib/postgresql9.6
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /usr/local/Cellar/postgresql/9.5.5/lib/postgresql postgresql
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/usr/local/Cellar/postgresql/9.5.5/bin/pg_ctl &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /usr/local/var/postgres start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;dump-the-whole-database&quot;&gt;Dump the whole database&lt;/h2&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/usr/local/Cellar/postgresql/9.5.5/bin/pg_dumpall &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; ~/dump.sql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;prepare-96&quot;&gt;Prepare 9.6&lt;/h2&gt;

&lt;p&gt;Restore everything to regular 9.6 status.&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/usr/local/Cellar/postgresql/9.5.5/bin/pg_ctl &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /usr/local/var/postgres stop
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; /usr/local/lib/postgresql
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /usr/local/lib/postgresql9.6 /usr/local/lib/postgresql
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /usr/local/var/postgres /usr/local/var/postgres9.5
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;initdb /usr/local/var/postgres &lt;span class=&quot;nt&quot;&gt;-E&lt;/span&gt; utf8
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pg_ctl &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /usr/local/var/postgres start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;restore-from-dump&quot;&gt;Restore from dump&lt;/h2&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;psql &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; ~/dump.sql postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;cleanup&quot;&gt;Cleanup&lt;/h2&gt;

&lt;p&gt;Make sure everything is there and works as expected. Then feel free to clean up
after yourself.&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; /usr/local/var/postgres9.5
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;brew cleanup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Wed, 21 Jun 2017 18:00:00 +0200</pubDate>
        <link>/blog/2017/06/21/postgresql-95-to-96-homebrew/</link>
        <guid isPermaLink="true">/blog/2017/06/21/postgresql-95-to-96-homebrew/</guid>
        
        
      </item>
    
      <item>
        <title>Sofa for Kodi</title>
        <description>&lt;p&gt;Just in time for the release of Apple Watch I’ve finished my first watch app &lt;a href=&quot;https://itunes.apple.com/US/app/id980204103?mt=8&quot; target=&quot;_blank&quot;&gt;Sofa for Kodi&lt;/a&gt;. A remote control for Kodi/XBMC. Something I wanted for myself.&lt;/p&gt;

&lt;center&gt;&lt;img src=&quot;/img/SofaForKodi_AppleWatch.jpg&quot; alt=&quot;&quot; width=&quot;&quot; /&gt;
&lt;span class=&quot;caption text-muted&quot;&gt;&lt;/span&gt;
&lt;/center&gt;

&lt;p&gt;It has one purpose and that’s starting movies and tv shows on the big screen right from your wrist. If your Kodi setup is anything like mine, a touch on the watch will start the movie, boot your AV-Receiver, fire up your TV and change all channels accordingly to present you the flick.&lt;/p&gt;

&lt;h2 id=&quot;features&quot;&gt;Features&lt;/h2&gt;

&lt;p&gt;Of course there is a little more to it than just starting movies and tv shows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;see which movies or episodes you’ve seen already&lt;/li&gt;
  &lt;li&gt;play, pause, stop and seek&lt;/li&gt;
  &lt;li&gt;update Kodi library (through force touch)&lt;/li&gt;
  &lt;li&gt;use multiple Kodi installations in parallel (through force touch)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last one is for people who have Kodi in multiple rooms (e.g. living room and bedroom). With &lt;em&gt;Sofa for Kodi&lt;/em&gt; you can control them all.&lt;/p&gt;

&lt;h2 id=&quot;download&quot;&gt;Download&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Sofa for Kodi&lt;/em&gt; is available for download on the App Store.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://itunes.apple.com/US/app/id980204103?mt=8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/img/Download_on_the_App_Store.svg&quot; alt=&quot;&quot; width=&quot;200&quot; /&gt;
&lt;span class=&quot;caption text-muted&quot;&gt;&lt;/span&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;icons&quot;&gt;Icons&lt;/h2&gt;

&lt;center&gt;&lt;img src=&quot;/img/SofaForKodi_AppIcons.jpg&quot; alt=&quot;&quot; width=&quot;&quot; /&gt;
&lt;span class=&quot;caption text-muted&quot;&gt;&lt;/span&gt;
&lt;/center&gt;
</description>
        <pubDate>Fri, 24 Apr 2015 14:00:00 +0200</pubDate>
        <link>/blog/2015/04/24/sofa-for-kodi-apple-watch/</link>
        <guid isPermaLink="true">/blog/2015/04/24/sofa-for-kodi-apple-watch/</guid>
        
        
      </item>
    
      <item>
        <title>Apple Watch Icon Template</title>
        <description>&lt;p&gt;With the &lt;strong&gt;Apple Watch&lt;/strong&gt; around the corner many of you may have started development of Apple Watch Apps. Apple is allowing Apple Watch App submissions to the App Store now and it’s time to generate the necessary assets.&lt;/p&gt;

&lt;h2 id=&quot;icon-template-for-sketch&quot;&gt;Icon Template for Sketch&lt;/h2&gt;

&lt;p&gt;I’ve created a Sketch preset with all the needed icons for 38mm and 42mm watches. The shown circle on each icon is just for guidance while you design your icons. You should not include the circles in your export. As with icons for iOS apps the icon mask will be applied automatically so your exported assets should fill the available rectangular space.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/apple-watch-icon-template-preview.png&quot; alt=&quot;&quot; width=&quot;&quot; /&gt;
&lt;span class=&quot;caption text-muted&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 id=&quot;download&quot;&gt;Download&lt;/h2&gt;

&lt;p&gt;The template is provided as is and free of charge. Do whatever you like with it but don’t hold me responsible for anything.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/downloads/AppleWatchIconTemplate.sketch&quot; class=&quot;btn btn-primary&quot;&gt;Download sketch preset&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;exports&quot;&gt;Exports&lt;/h2&gt;

&lt;p&gt;The preset includes predefined exports for all icons.&lt;/p&gt;
</description>
        <pubDate>Thu, 02 Apr 2015 21:00:00 +0200</pubDate>
        <link>/blog/2015/04/02/apple-watch-icon-template-sketch/</link>
        <guid isPermaLink="true">/blog/2015/04/02/apple-watch-icon-template-sketch/</guid>
        
        
      </item>
    
      <item>
        <title>Simplifying server logins with SSH keys</title>
        <description>&lt;p&gt;Developing applications means dealing with remote servers at some point. And dealing with remote servers means coming across SSH sooner or later. And using SSH often means remembering logins and passwords. But not only is a password something you need to remember, it’s also something not as secure as it should be. Well most of the time at least. I’m talking about choosing simple passwords to make them easier to remember or using the same all over the place. Or both.&lt;/p&gt;

&lt;p&gt;I’ve come to a point where I need to handle quite a lot of servers and all of them use SSH. Regardless of the amount of servers you have to deal with you should use SSH keys instead of passwords as means of authorization.&lt;/p&gt;

&lt;h2 id=&quot;ssh-keys&quot;&gt;SSH keys&lt;/h2&gt;

&lt;p&gt;SSH keys are pairs of keys always consisting of a private key as well as a public key. You could compare the private one to a physical &lt;em&gt;key&lt;/em&gt; and the public one to a physical &lt;em&gt;lock&lt;/em&gt;. It’s possible to install the same kind of lock all over the place but you have to keep the matching key well protected to yourself.&lt;/p&gt;

&lt;p&gt;It’s easy to generate a key pair with OpenSSL:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;ssh-keygen &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; rsa &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;your_email@example.com&quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;// you&apos;ll find the generated keys here:
~/.ssh/id_rsa
~/.ssh/id_rsa.pub&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now you can install the public key on all your servers while keeping the private one on your machine.&lt;/p&gt;

&lt;p&gt;To install the public key on a server you have to copy the key into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.ssh/authorized_keys&lt;/code&gt; on the remote machine. It’s possible to do this by hand for every server &amp;amp; user you’d like to use but I’d recommend using &lt;strong&gt;ssh-copy-id&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id=&quot;ssh-copy-id&quot;&gt;ssh-copy-id&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ssh-copy-id&lt;/strong&gt; is a small tool that takes care of transferring your public key from your local machine to the server of designation.&lt;/p&gt;

&lt;p&gt;Just run the tool and you are all good to go:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;ssh-copy-id username@server.example.com&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Remember to repeat this for every user account you’d like to access through SSH.&lt;/p&gt;

&lt;p&gt;In case you receive an error about ssh-copy-id not being found just install it with your trusted package manager. It’s available for all kinds of systems. For Mac OS X with Homebrew the command to install ssh-copy-id would look like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ssh-copy-id&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;disabling-password-authentication&quot;&gt;Disabling password authentication&lt;/h2&gt;

&lt;p&gt;Once your keys are installed you should disable password authorization for SSH on your remote machines. If this is not an option you could change your password to something long and complex.&lt;/p&gt;

&lt;p&gt;To disable SSH password login edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/ssh/sshd_config&lt;/code&gt; and add or change the following settings:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-apache&quot; data-lang=&quot;apache&quot;&gt;ChallengeResponseAuthentication &lt;span class=&quot;ss&quot;&gt;no&lt;/span&gt;
PasswordAuthentication &lt;span class=&quot;ss&quot;&gt;no&lt;/span&gt;
UsePAM &lt;span class=&quot;ss&quot;&gt;no&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Once you have SSH key authorization set up you won’t go back.&lt;/p&gt;
</description>
        <pubDate>Fri, 16 Jan 2015 17:00:00 +0100</pubDate>
        <link>/blog/2015/01/16/server-logins-with-ssh-keys-and-ssh-copy-id/</link>
        <guid isPermaLink="true">/blog/2015/01/16/server-logins-with-ssh-keys-and-ssh-copy-id/</guid>
        
        
      </item>
    
      <item>
        <title>Updating Samsung 840 EVO SSDs</title>
        <description>&lt;p&gt;Samsung found an issue with their &lt;strong&gt;SSD 840 EVO Series&lt;/strong&gt; that dramatically reduces the I/O Performance for old files. They created a new firmware to fix the problem. Unfortunatelly there is no easy-to-run-updater for Mac OS X. Instead they provide the &lt;strong&gt;Performance Restoration Software&lt;/strong&gt; as an ISO file which also rewrites all data after applying the update to get things back to speed.&lt;/p&gt;

&lt;p&gt;The new firmware &lt;strong&gt;EXT0CB6Q&lt;/strong&gt; is not listed as such and only available through the Performance Restoration Software. So even while fresh SSD wouldn’t need the restoration process this is the only way to update them on OS X (or Linux btw.).&lt;/p&gt;

&lt;p&gt;I couldn’t get the software to boot from a USB stick at first but with a little help from &lt;a href=&quot;http://rufus.akeo.ie&quot;&gt;a small Windows tool&lt;/a&gt; I got around this. But then I had to learn that the tool doesn’t work while FileVault is enabled. So I disabled it, waited a few hours for the decryption process to finish and tried again. Just to learn the tool doesn’t work when there is a second disk connected. So I had to disconnect the 2nd drive.&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure your time machine backup is up to date. Just in case.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If used, disable FileVault and wait for the decryption process to finish.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Unplug all other disks but the one you’d like to update.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Get access to Windows somehow (Virtual Windows works fine).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Download the &lt;a href=&quot;http://www.samsung.com/global/business/semiconductor/minisite/SSD/downloads/software/Samsung_Performance_Restoration.iso&quot;&gt;Performance Restoration Software ISO&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Download Rufus from &lt;a href=&quot;http://rufus.akeo.ie&quot;&gt;rufus.akeo.ie&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Use Rufus with default settings to put the downloaded ISO on a USB stick.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;update-process&quot;&gt;Update Process&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Make sure your Mac is plugged into the wall if it’s a laptop.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Start your Mac with the USB stick plugged in and hold down the alt key while it boots.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Select the yellow USB icon called &lt;em&gt;Windows&lt;/em&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Select your target disk (most likely 0) and say &lt;em&gt;yes&lt;/em&gt; to the warnings.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Wait. Wait. Wait. This takes quite a long time depending on the amount of data you have stored on your disk.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Don’t forget to re-enable FileVault.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now enjoy your fast-again SSD. I know it’s a little annoying to use Windows to prepare the USB stick but hey at least it’s not nessecary to put the SSD in a Windows machine just to update the firmware!&lt;/p&gt;
</description>
        <pubDate>Mon, 12 Jan 2015 02:00:00 +0100</pubDate>
        <link>/blog/2015/01/12/samsung-840-evo-ssd-performance-mac/</link>
        <guid isPermaLink="true">/blog/2015/01/12/samsung-840-evo-ssd-performance-mac/</guid>
        
        
      </item>
    
      <item>
        <title>The Pixelflush Blog</title>
        <description>&lt;p&gt;Hello. Everyone should write a blog, right? We’ll see. I’ve tried before on &lt;a href=&quot;http://m-schmidt.eu&quot;&gt;m-schmidt.eu&lt;/a&gt; but the old Wordpress installation caused more headache than anything. So most of the time when I felt like blogging I got turned off by some Wordpress problem or chore - like needing to update the system.&lt;/p&gt;

&lt;p&gt;Also while my old blog started out as a personal one, it  inevitably turned into something technical. So let’s define this one better.&lt;/p&gt;

&lt;p&gt;This new blog will mainly be about technical know-how I’ll (hopefully) gain throughout my work under the &lt;strong&gt;pixelflush&lt;/strong&gt; flag.&lt;/p&gt;

&lt;p&gt;For those who don’t know yet, &lt;strong&gt;pixelflush&lt;/strong&gt; is building and running scalable &lt;a href=&quot;http://en.wikipedia.org/wiki/Application_programming_interface&quot;&gt;APIs&lt;/a&gt; for mobile apps. So basically making sure apps get all the data they need and deserve from well performing server infrastructure and reliable, well-tested code.&lt;/p&gt;

&lt;p&gt;A lot of future content may come in form of notes to myself. Frequently I find myself doing something I’ve done before but forgot how I ended up doing it. So whenever I solve a problem I feel like coming across again I’ll publish my solution here. And maybe this will help someone like-minded later on.&lt;/p&gt;

&lt;p&gt;So let’s get started!&lt;/p&gt;
</description>
        <pubDate>Sun, 11 Jan 2015 22:00:00 +0100</pubDate>
        <link>/blog/2015/01/11/pixelflush-blog/</link>
        <guid isPermaLink="true">/blog/2015/01/11/pixelflush-blog/</guid>
        
        
      </item>
    
      <item>
        <title>Fix locale setting on Ubuntu EC2 instances</title>
        <description>&lt;p&gt;After booting a fresh EC2 instance with Ubuntu 12.10 this showed up right after login:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;WARNING! Your environment specifies an invalid locale.
This can affect your user experience significantly, including the
ability to manage packages.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And when running some apt-get commands I got this:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = &quot;de_DE.UTF-8&quot;,
    LANG = &quot;en_US.UTF-8&quot;
    are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are plenty of supposed solutions out there but none worked for me but this one:&lt;/p&gt;
&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# add this line to /etc/environment; then reboot
&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;LC_ALL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;en_US.UTF-8&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are some alternative commands you could try:&lt;/p&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;locale-gen de_DE.UTF-8 en_US.UTF-8
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;language-pack-en
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Fri, 29 Mar 2013 17:00:00 +0100</pubDate>
        <link>/blog/2013/03/29/fix-locale-setting-on-ubuntu-ec2-instances/</link>
        <guid isPermaLink="true">/blog/2013/03/29/fix-locale-setting-on-ubuntu-ec2-instances/</guid>
        
        
      </item>
    
      <item>
        <title>Develop memcached web apps with XAMPP under Mac OS X</title>
        <description>&lt;p&gt;While developing scalable web applications you will come across memcached at some point. Memcached is a free &amp;amp; open source, high-performance, distributed memory object caching system.&lt;/p&gt;

&lt;p&gt;XAMPP is great for development in a local environment but does not come with a php memcached extension preinstalled. Since there are 2 good memcached php extensions in the PECL repository (memcached and memcache) it could be as easy as installing them through XAMPPs PECL installer. Unfortunately XAMPP for Mac (1.7.3) is still compiled for 32bit and the PECL installer would create a 64bit snow leopard extension. So let’s do it manually by setting some 32bit flags…&lt;/p&gt;

&lt;p&gt;Install memcache PHP extension (2.2.5) for XAMPP (1.7.3) under Mac OS X 10.6 Snow Leopard (10.6.2).&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;make sure Apple Developer Tools (Xcode) are installed&lt;/li&gt;
  &lt;li&gt;make sure XAMPP Developer Package is installed&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;installation-process&quot;&gt;Installation Process&lt;/h2&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /tmp
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pecl download memcache
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;tar &lt;/span&gt;xzf memcache-2.2.5.tgz
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;memcache-2.2.5
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/Applications/XAMPP/xamppfiles/bin/phpize-5.3.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The next line looks just a bit complicated because it tries to deal with architecture problems between XAMPP (compiled for 32bit) and Snow Leopard (compiles everything by default to 64bit):&lt;/p&gt;
&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MACOSX_DEPLOYMENT_TARGET&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;10.6 &lt;span class=&quot;nv&quot;&gt;CFLAGS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;-O3 -fno-common -arch i386 -arch x86_64&apos;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;LDFLAGS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;-O3 -arch i386 -arch x86_64&apos;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;CXXFLAGS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;-O3 -fno-common -arch i386 -arch x86_64&apos;&lt;/span&gt; ./configure &lt;span class=&quot;nt&quot;&gt;--with-php-config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/Applications/XAMPP/xamppfiles/bin/php-config-5.3.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;make
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Change XAMPPs php.ini to load the extension:&lt;/p&gt;
&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# below [Dynamic Extensions]
&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;extension&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;memcache.so&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Those steps enable you to use memcached in your PHP Code. But to actually test the application and caching in your local development environment you have to start the memcached daemon. Fortunately memcached got already installed by the Mac OS X Developer Tools (Xcode).&lt;/p&gt;

&lt;p&gt;Just go ahead and start the memcached daemon:&lt;/p&gt;
&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;memcached &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 8 &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; 127.0.0.1 &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 11211 &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-m 8&lt;/code&gt; limits memcached to use a maximum of 8MB RAM to operate
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-l 127.0.0.1 -p 11211&lt;/code&gt; is the ip and port to listen on
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-d&lt;/code&gt; tells it to start as a daemon&lt;/p&gt;

&lt;p&gt;(instead of -l and -p you can also use -s to use an unix domain socket)&lt;/p&gt;
</description>
        <pubDate>Tue, 30 Mar 2010 18:00:00 +0200</pubDate>
        <link>/blog/2010/03/30/develop-memcached-web-apps-with-xampp-under-mac-os-x/</link>
        <guid isPermaLink="true">/blog/2010/03/30/develop-memcached-web-apps-with-xampp-under-mac-os-x/</guid>
        
        
      </item>
    
  </channel>
</rss>
