<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>mhu.dev</title>
    <subtitle>DevOoops</subtitle>
    <link rel="self" type="application/atom+xml" href="https://mhu.dev/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://mhu.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-07-02T00:00:00+00:00</updated>
    <id>https://mhu.dev/atom.xml</id>
    <entry xml:lang="en">
        <title>Extractig Generic Substates in Axum</title>
        <published>2024-07-02T00:00:00+00:00</published>
        <updated>2024-07-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2024-07-02-axum-generic-substate/"/>
        <id>https://mhu.dev/posts/2024-07-02-axum-generic-substate/</id>
        
        <summary type="html">&lt;p&gt;In this post I&#x27;ll show you how to extract a generic substate in Axum handlers, without resorting to dynamic dispatch.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Developing NixOS (and Home Manager) Modules</title>
        <published>2024-01-15T00:00:00+00:00</published>
        <updated>2024-01-15T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2024-01-15-developing-nixos-modules/"/>
        <id>https://mhu.dev/posts/2024-01-15-developing-nixos-modules/</id>
        
        <summary type="html">&lt;p&gt;If you use NixOS or Home Manager, chances are that you have (unknowingly) created a NixOS module. In this post, I&#x27;ll document my learnings around how they work, and how to easily test them in isolation.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>NixOS on Hetzner Dedicated</title>
        <published>2024-01-06T00:00:00+00:00</published>
        <updated>2024-01-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2024-01-06-nixos-on-hetzner/"/>
        <id>https://mhu.dev/posts/2024-01-06-nixos-on-hetzner/</id>
        
        <summary type="html">&lt;p&gt;As it is currently fashionable for the Nerd interested in all things Nix(OS), I have set up my own NixOS Server on Hetzner Dedicated. I&#x27;ll first go over the setup details, and then describe how I set everything up. Unfortunately, Documentation around the Nix ecosystem is pretty &quot;meh&quot; (being used the high quality of documentation in the Rust ecosystem), so maybe this helps someone else along the way.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Kubernetes resource management and you</title>
        <published>2021-03-01T00:00:00+00:00</published>
        <updated>2021-03-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2021-03-01-kubernetes-resource-management/"/>
        <id>https://mhu.dev/posts/2021-03-01-kubernetes-resource-management/</id>
        
        <summary type="html">&lt;p&gt;Scheduling and resource management is a topic many Kubernetes users seem to struggle with, even though it is vital to understand it and correctly configure your workload to ensure optimal resource usage and application availability. In this article, I&#x27;ll explain what scheduling and resource management exactly is, how you configure and use them, and go into some best practices.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Continuously Deploying DNS records with DnsControl and CircleCI</title>
        <published>2018-04-20T00:00:00+00:00</published>
        <updated>2018-04-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2018-04-20-continuously-deploying-dns-records-with-dnscontrol-and-circleci/"/>
        <id>https://mhu.dev/posts/2018-04-20-continuously-deploying-dns-records-with-dnscontrol-and-circleci/</id>
        
        <summary type="html">&lt;p&gt;In the &lt;a href=&quot;https:&#x2F;&#x2F;mhu.dev&#x2F;posts&#x2F;2018-04-19-managing-dns-records-the-devops-way&#x2F;&quot;&gt;previous post&lt;&#x2F;a&gt;, I gave a quick introduction to &lt;a href=&quot;https:&#x2F;&#x2F;stackexchange.github.io&#x2F;dnscontrol&#x2F;&quot;&gt;DnsControl&lt;&#x2F;a&gt;, what it does and how it works. In this post, I&#x27;ll show you how to continuously deploy your changes to &lt;a href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;dns&#x2F;&quot;&gt;Google Cloud DNS&lt;&#x2F;a&gt; using &lt;a href=&quot;https:&#x2F;&#x2F;circleci.com&#x2F;&quot;&gt;CircleCI&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Managing DNS records the DevOps way</title>
        <published>2018-04-19T00:00:00+00:00</published>
        <updated>2018-04-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2018-04-19-managing-dns-records-the-devops-way/"/>
        <id>https://mhu.dev/posts/2018-04-19-managing-dns-records-the-devops-way/</id>
        
        <summary type="html">&lt;p&gt;Managing DNS records has always been a bit of a hassle for me. Most DNS providers have some sort of web gui where you have to manually fiddle in all records manually. Besides the fact that this is really tedious, this is quite error-prone. Humans are horrible at doing manual work! So let&#x27;s automate this!&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Working with Git submodules</title>
        <published>2016-08-11T00:00:00+00:00</published>
        <updated>2016-08-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2016-08-11-working-with-git-submodules/"/>
        <id>https://mhu.dev/posts/2016-08-11-working-with-git-submodules/</id>
        
        <summary type="html">&lt;p&gt;Here&#x27;s a quick primer on how to work with Git submodules!&lt;&#x2F;p&gt;
</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Java: Create self-signed TLS&#x2F;SSL certificates for Tomcat</title>
        <published>2016-02-09T00:00:00+00:00</published>
        <updated>2016-02-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2016-02-09-java-create-self-signed-ssl-certificates-for-tomcat/"/>
        <id>https://mhu.dev/posts/2016-02-09-java-create-self-signed-ssl-certificates-for-tomcat/</id>
        
        <content type="html" xml:base="https://mhu.dev/posts/2016-02-09-java-create-self-signed-ssl-certificates-for-tomcat/">&lt;p&gt;To use an TLS certificate with Tomcat, you need to store it in a Java keystore File. You can generate both the keystore and the certificate using the Java command &lt;code&gt;keytool&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-0-find-your-keytool&quot;&gt;Step 0: Find your &lt;code&gt;keytool&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Make sure you have Java and &lt;code&gt;keytool&lt;&#x2F;code&gt; command (ships with Java) installed. If you installed the JDK or JRE yourself it may not be in your &lt;code&gt;$PATH&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For example, my &lt;code&gt;keytool&lt;&#x2F;code&gt; is in &lt;code&gt;.&#x2F;jdk1.8&#x2F;bin&#x2F;&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you do not know where to look, use the following commmand:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;find &#x2F; -name keytool -type f 2&amp;gt;&#x2F;dev&#x2F;null
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;step-1-generate-the-keystore-and-the-certificate&quot;&gt;Step 1: Generate the keystore and the certificate&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, a note about the &quot;alias&quot; and the &quot;common name&quot; of the certificate:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;alias&lt;&#x2F;strong&gt; is simply a &quot;label&quot; used by Java to identify a specific certificate in the keystore (a keystore can hold multiple certificates). It has nothing to do with the server name, or the domain name of the Tomcat service.&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;strong&gt;common name&lt;&#x2F;strong&gt; (CN) is an attribute of the TLS certificate. Your browser will usually complain if the CN of the certificate and the domain in the URI do not match (but since you&#x27;re using a self-signed certificate, your browser will probably complain anyway...). HOWEVER, when generating the certificate, the keytool will ask for &quot;your first and last name&quot; when asking for the CN, so keep that in mind. The rest of the attributes are not really that important&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;So let&#x27;s generate a strong 4096-bit certificate that is valid for 2 years. Adjust &lt;code&gt;ALIAS&lt;&#x2F;code&gt; and the path to the key store accordingly&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;keytool -genkey -keystore&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;srv&#x2F;jakarta&#x2F;.keystore&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -alias&lt;&#x2F;span&gt;&lt;span&gt; ALIAS \
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;    -keyalg&lt;&#x2F;span&gt;&lt;span&gt; RSA&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -keysize&lt;&#x2F;span&gt;&lt;span&gt; 4096&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -validity&lt;&#x2F;span&gt;&lt;span&gt; 720
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Enter keystore password = # well, enter something
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Re-enter new password = # same as above
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# What is your first and last name?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [Unknown]:  example.com # !!! IMPORTANT this is the domain name, NOT YOUR name
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# What is the name of your organizational unit?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [Unknown]:  # enter something or leave empty
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# What is the name of your organization?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [Unknown]:  # enter something or leave empty
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# What is the name of your City or Locality?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [Unknown]:  # enter something or leave empty
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# What is the name of your State or Province?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [Unknown]:  # enter something or leave empty
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# What is the two-letter country code for this unit?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [Unknown]:  # enter something or leave empty
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Is CN=example com, OU=Foo, O=Bar, L=City, ST=AA, C=FB correct?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#   [no]:  yes
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Enter key password for &amp;lt;ALIAS&amp;gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#     (RETURN if same as keystore password): # Press RETURN
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Great, now the keystore has been created (if it didn&#x27;t exist already) and your self-signed certificate has been added to it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-2-configure-tomcat&quot;&gt;Step 2: Configure Tomcat&lt;&#x2F;h2&gt;
&lt;p&gt;To use the new certificate, configure your Tomcat accordingly:&lt;&#x2F;p&gt;
&lt;p&gt;Activate the HTTPS-Connector in your &lt;code&gt;conf&#x2F;server.xml&lt;&#x2F;code&gt;. Adjust &lt;code&gt;keyAlias&lt;&#x2F;code&gt;, &lt;code&gt;keystoreFile&lt;&#x2F;code&gt; and &lt;code&gt;keystorePass&lt;&#x2F;code&gt; accordingly:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;xml&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-xml &quot;&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Connector &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;port&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;8443&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;protocol&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;org.apache.coyote.http11.Http11NioProtocol&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;           &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;maxThreads&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;150&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;SSLEnabled&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;scheme&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;https&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;secure&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;           &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;clientAuth&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;false&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;sslProtocol&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;TLS&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;           &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;keyAlias&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;ALIAS&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;keystoreFile&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;srv&#x2F;jakarta&#x2F;.keystore&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;           &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;keystorePass&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;PW from step 1&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &#x2F;&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s it! Restart Tomcat and you&#x27;re ready!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Make all *.local domains resolve to localhost</title>
        <published>2016-02-02T00:00:00+00:00</published>
        <updated>2016-02-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2016-02-02-make-all-local-domains-resolve-to-localhost/"/>
        <id>https://mhu.dev/posts/2016-02-02-make-all-local-domains-resolve-to-localhost/</id>
        
        <content type="html" xml:base="https://mhu.dev/posts/2016-02-02-make-all-local-domains-resolve-to-localhost/">&lt;p&gt;It&#x27;s time for my yearly blog post, so let&#x27;s get started!&lt;&#x2F;p&gt;
&lt;p&gt;Some development environments use &lt;code&gt;*.local&lt;&#x2F;code&gt;-domains which point to localhost. Creating a hosts-entry for every single domain is not an elegant solution, so let&#x27;s do something easier: let&#x27;s use dnsmasq to resolve ALL .local-domains to localhost!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Tested on CentOS 7, but should work similarly for other Linuxes.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;All commands assume you have root privileges. If you are not logged in as &lt;code&gt;root&lt;&#x2F;code&gt;, prepend &lt;code&gt;sudo&lt;&#x2F;code&gt; to all commands.&lt;&#x2F;p&gt;
&lt;p&gt;First, make sure &lt;strong&gt;dnsmasq&lt;&#x2F;strong&gt; is installed:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;yum install dnsmasq
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ok, now we have to tell dnsmasq to listen for queries. Add the following line to &lt;code&gt;&#x2F;etc&#x2F;dnsmasq.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;listen-address=127.0.0.1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, create a &quot;zone file&quot; for &lt;code&gt;.local&lt;&#x2F;code&gt;. Create a file &lt;code&gt;&#x2F;etc&#x2F;dnsmasq.d&#x2F;local&lt;&#x2F;code&gt; and add the following:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;address=&#x2F;local&#x2F;127.0.0.1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This tells dnsmasq to resolve queries to &lt;code&gt;*.local&lt;&#x2F;code&gt; to &lt;code&gt;127.0.0.1&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Now, start up dnsmasq. Also enable &quot;autostart&quot;:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;systemctl restart dnsmasq
&lt;&#x2F;span&gt;&lt;span&gt;systemctl enable dnsmasq
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ok, now that we set up a local DNS server, let&#x27;s tell our DHCP client to actually use it. Add the following line to &lt;code&gt;&#x2F;etc&#x2F;dhcp&#x2F;dhclient.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;prepend domain-name-servers=127.0.0.1;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Last step: let the DHCP client apply the new settings:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;dhclient
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s it! Let&#x27;s make a quick test:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ ping foo.local
&lt;&#x2F;span&gt;&lt;span&gt;PING foo.local (127.0.0.1) 56(84) bytes of data.
&lt;&#x2F;span&gt;&lt;span&gt;64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.017 ms
&lt;&#x2F;span&gt;&lt;span&gt;64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.068 ms
&lt;&#x2F;span&gt;&lt;span&gt;# ...
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Success!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Heredoc in Javascript</title>
        <published>2015-03-16T00:00:00+00:00</published>
        <updated>2015-03-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2015-03-16-heredoc-in-javascript/"/>
        <id>https://mhu.dev/posts/2015-03-16-heredoc-in-javascript/</id>
        
        <content type="html" xml:base="https://mhu.dev/posts/2015-03-16-heredoc-in-javascript/">&lt;p&gt;&lt;em&gt;Update 2023:&lt;&#x2F;em&gt; JavaScript now has &quot;native&quot; multiline strings for quite some time:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;js&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-js &quot;&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;const &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;monty &lt;&#x2F;span&gt;&lt;span&gt;= `&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;It&amp;#39;s only a model.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Who&amp;#39;s that then?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;On second thoughts, let&amp;#39;s not go there.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;It is a silly place.&lt;&#x2F;span&gt;&lt;span&gt;`;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ebcb8b;&quot;&gt;console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;monty&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; It&amp;#39;s only a model.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Who&amp;#39;s that then?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; On second thoughts, let&amp;#39;s not go there.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; It is a silly place.
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Original post for context below.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Most programming languages have a syntax for defining multiline string literals. Here&#x27;s an example for Ruby:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;ruby&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-ruby &quot;&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span&gt;monty = &amp;lt;&amp;lt;END
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;It&amp;#39;s only a model.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Who&amp;#39;s that then?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;On second thoughts, let&amp;#39;s not go there.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;It is a silly place.
&lt;&#x2F;span&gt;&lt;span&gt;END
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;puts&lt;&#x2F;span&gt;&lt;span&gt; monty.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;inspect
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#=&amp;gt; &amp;quot;It&amp;#39;s only a model.\nWho&amp;#39;s that then?\nOn second thoughts, let&amp;#39;s not go there.\nIt is a silly place.\n&amp;quot;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Javascript, however, does not have such a syntax. You can just insert newline characters yourself (&lt;code&gt;\n&lt;&#x2F;code&gt;), but then you have to escape the actual newline aswell... It&#x27;s quite messy!&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;javascript&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-javascript &quot;&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;var &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;monty &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;It&amp;#39;s only a model.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n\
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Who&amp;#39;s that then?&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n\
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;On second thoughts, let&amp;#39;s not go there.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n\
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;It is a silly place.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;There is, however, a funny hack :)&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;javascript&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-javascript &quot;&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;var &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;monty &lt;&#x2F;span&gt;&lt;span&gt;= (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;function&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;*Well, we did do the nose.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;What do you mean?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;She looks like one.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;You don&amp;#39;t vote for kings.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;*&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;}).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;toString&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;^&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\&#x2F;\*(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;^&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;)\*\&#x2F;\}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ebcb8b;&quot;&gt;console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;monty&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F;=&amp;gt; Well, we did do the nose.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F;=&amp;gt; What do you mean?
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F;=&amp;gt; She looks like one.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F;=&amp;gt; You don&amp;#39;t vote for kings.
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s how you do Heredocs in Javascript!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Continuous Deployment with Github Pages</title>
        <published>2013-12-12T00:00:00+00:00</published>
        <updated>2013-12-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2013-12-12-continuous-deployment-with-github-pages/"/>
        <id>https://mhu.dev/posts/2013-12-12-continuous-deployment-with-github-pages/</id>
        
        <content type="html" xml:base="https://mhu.dev/posts/2013-12-12-continuous-deployment-with-github-pages/">&lt;p&gt;Or &lt;strong&gt;how to let Travis-CI merge into master if the build is successful&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;It is way easier than I thought.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;travis&lt;&#x2F;code&gt; gem&lt;&#x2F;li&gt;
&lt;li&gt;Travis-CI integration up and running (ie &lt;code&gt;.travis.yml&lt;&#x2F;code&gt; is set up).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;step-1-acquire-github-access-token&quot;&gt;Step 1: Acquire Github Access Token&lt;&#x2F;h2&gt;
&lt;p&gt;This is required because we don&#x27;t want to write our Github username and password anywhere.
Go to your &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;settings&#x2F;applications&quot;&gt;Github Application Settings&lt;&#x2F;a&gt; and create a new Token.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-2-encrypt-the-token&quot;&gt;Step 2: Encrypt the token&lt;&#x2F;h2&gt;
&lt;p&gt;Even the Token is not something to post on your Twitter.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;travis&lt;&#x2F;span&gt;&lt;span&gt; encrypt&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -a&lt;&#x2F;span&gt;&lt;span&gt; - GITHUB_TOKEN=your_generated_token
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Your token will be encrypted and automatically added to your &lt;code&gt;.travis.yml&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-3-add-some-magic-to-your-travis-config&quot;&gt;Step 3: Add some magic to your Travis config&lt;&#x2F;h2&gt;
&lt;p&gt;&#x27;nuff said. Add these lines to .travis.yml (note this are only two lines):&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;after_success&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;- &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;[ &amp;quot;${TRAVIS_BRANCH}&amp;quot; = &amp;quot;stable&amp;quot; ] &amp;amp;&amp;amp; git push https:&#x2F;&#x2F;${GITHUB_TOKEN}:x-oauth-basic@github.com&#x2F;${TRAVIS_REPO_SLUG}.git HEAD:master&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now for some explanation:
The first part, &lt;code&gt;[ &quot;${TRAVIS_BRANCH}&quot; = &quot;stable&quot; ] &amp;amp;&amp;amp;&lt;&#x2F;code&gt; only runs the following command if the current branch name is &quot;stable&quot;. You can omit this if you want to merge from ANY branch, or change it to use another branch.&lt;&#x2F;p&gt;
&lt;p&gt;The second part, &lt;code&gt;git push https:&#x2F;&#x2F;${GITHUB_TOKEN}:x-oauth-basic@github.com&#x2F;${TRAVIS_REPO_SLUG}.git HEAD:master&#x27;&lt;&#x2F;code&gt; actually pushes the currently checked out state into master.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$GITHUB_TOKEN&lt;&#x2F;code&gt; holds our Token from above&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;$TRAVIS_REPO_SLUG&lt;&#x2F;code&gt; holds &lt;code&gt;github_username&#x2F;github_repo_name&lt;&#x2F;code&gt; (in my case this is &lt;code&gt;mhutter&#x2F;mhutte.github.io&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;back-story&quot;&gt;Back story&lt;&#x2F;h2&gt;
&lt;p&gt;To ensure new pages don&#x27;t break Jekyll (as I managed earlier this month), I use &lt;a href=&quot;https:&#x2F;&#x2F;travis-ci.org&#x2F;&quot;&gt;Travis-CI&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I started working on a development branch and only merging into master after the Travis build succeeded. However, being the lazy guy I am I asked myself: &quot;Wouldn&#x27;t it be nice to let Travis automatically merge into master if the build succeeds?&quot;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Install own CA-Certificate in Linux</title>
        <published>2012-03-27T00:00:00+00:00</published>
        <updated>2012-03-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2012-03-27-install-own-ca-certificate-in-linux/"/>
        <id>https://mhu.dev/posts/2012-03-27-install-own-ca-certificate-in-linux/</id>
        
        <content type="html" xml:base="https://mhu.dev/posts/2012-03-27-install-own-ca-certificate-in-linux/">&lt;p&gt;&lt;strong&gt;Overview&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mhu.dev&#x2F;posts&#x2F;2012-03-27-install-own-ca-certificate-in-linux&#x2F;#ubuntu-sles-debian&quot;&gt;Ubuntu, SLES, Debian&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mhu.dev&#x2F;posts&#x2F;2012-03-27-install-own-ca-certificate-in-linux&#x2F;#centos&quot;&gt;CentOS, RHEL&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;ubuntu-sles-debian&quot;&gt;Ubuntu, SLES, Debian&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;em&gt;Tested under &lt;strong&gt;Ubuntu&lt;&#x2F;strong&gt; and &lt;strong&gt;SLES 11&lt;&#x2F;strong&gt; so far.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;required-packages&quot;&gt;Required Packages&lt;&#x2F;h3&gt;
&lt;p&gt;install with &lt;code&gt;apt-get install ...&lt;&#x2F;code&gt; or similar&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;openssl&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;steps&quot;&gt;Steps&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Step 0: Convert the Certificate to PEM format
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span&gt; x509&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -inform&lt;&#x2F;span&gt;&lt;span&gt; der&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -in&lt;&#x2F;span&gt;&lt;span&gt; certificate.cer&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -out&lt;&#x2F;span&gt;&lt;span&gt; certificate.pem
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Step 0.5: Make sure there is only 1 Certificate in the File
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;grep &lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;BEGIN.* CERTIFICATE&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39; certificate.pem | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;wc -l &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# should output `1`
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Step 1: Verify it&amp;#39;s the correct Certificate
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span&gt; x509&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -noout -fingerprint -in&lt;&#x2F;span&gt;&lt;span&gt; certificate.pem
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Step 2: Copy the File to &#x2F;etc&#x2F;ssl&#x2F;certs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Do I really have to explain that? If you can&amp;#39;t do that on your own you
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# probably shouldn&amp;#39;t be installing CA-Certificates anyway...
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Step 3: Find out the Hash of your Cert
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span&gt; x509&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -noout -hash -in&lt;&#x2F;span&gt;&lt;span&gt; certificate.pem
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Step 4: Inside &#x2F;etc&#x2F;ssl&#x2F;certs, link your certificate to &amp;quot;hash.0&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ln -s&lt;&#x2F;span&gt;&lt;span&gt; certificate.pem `&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span&gt; x509&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -hash -noout -in&lt;&#x2F;span&gt;&lt;span&gt; certificate.pem`.0
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;centos&quot;&gt;CentOS&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;required-packages-1&quot;&gt;Required Packages&lt;&#x2F;h3&gt;
&lt;p&gt;install with &lt;code&gt;yum install ...&lt;&#x2F;code&gt; or similar&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ca-certificates&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;steps-1&quot;&gt;Steps&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Enable the CA configuration feature
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;update-ca-trust&lt;&#x2F;span&gt;&lt;span&gt; enable
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Add the new certificate to `&#x2F;etc&#x2F;pki&#x2F;ca-trust&#x2F;source&#x2F;anchors`
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cp&lt;&#x2F;span&gt;&lt;span&gt; certificate.cer &#x2F;etc&#x2F;pki&#x2F;ca-trust&#x2F;source&#x2F;anchors&#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# update the CA certs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;update-ca-trust&lt;&#x2F;span&gt;&lt;span&gt; extract
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And that&#x27;s it!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Apache: Redirect if domain name does not match</title>
        <published>2011-12-14T00:00:00+00:00</published>
        <updated>2011-12-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Manuel Hutter
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://mhu.dev/posts/2011-12-14-apache-redirect-if-domain-name-does-not-match/"/>
        <id>https://mhu.dev/posts/2011-12-14-apache-redirect-if-domain-name-does-not-match/</id>
        
        <content type="html" xml:base="https://mhu.dev/posts/2011-12-14-apache-redirect-if-domain-name-does-not-match/">&lt;p&gt;&lt;em&gt;Note: This post is mostly kept for nostalgic reasons :-)&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Redirect everything to dratir.ch:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;conf&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-conf &quot;&gt;&lt;code class=&quot;language-conf&quot; data-lang=&quot;conf&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;RewriteEngine &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;On
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Rewritecond &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;%{HTTP_HOST} &lt;&#x2F;span&gt;&lt;span&gt;!^dratir\.com
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;RewriteRule &lt;&#x2F;span&gt;&lt;span&gt;(.*) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;http:&#x2F;&#x2F;dratir.com&#x2F;$1&lt;&#x2F;span&gt;&lt;span&gt; [QSA,R=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;301&lt;&#x2F;span&gt;&lt;span&gt;,L]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
</feed>
