<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Some projects and stuff</title>
        <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
        <link>https://blog.bj13.us/</link>
        <description></description>
        <pubDate>Tue, 10 Apr 2018 20:32:10 +0000</pubDate>
        
        <item>
            <title>Enabling general features in Nuxt</title>
            <link>/vuex/nuxt/vue/vue-router/2018/04/05/nuxt-enabling-basic-features.html</link>
            <guid isPermaLink="true">/vuex/nuxt/vue/vue-router/2018/04/05/nuxt-enabling-basic-features.html</guid>
            <description>&lt;h2 id=&quot;setting-up-vuex-store&quot;&gt;Setting up vuex store&lt;/h2&gt;
&lt;p&gt;To enable Vuex, all you have to do is add an &lt;code class=&quot;highlighter-rouge&quot;&gt;index.js&lt;/code&gt; in the &lt;code class=&quot;highlighter-rouge&quot;&gt;store&lt;/code&gt; directory. Here is a basic vuex store file:&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;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Vuex&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'vuex'&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;store&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;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Vuex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Store&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;state&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;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;mutations&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;increment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&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;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;counter&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;resetCounter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&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;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&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;na&quot;&gt;actions&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;resetCounter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;commit&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;commit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'resetCounter'&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;na&quot;&gt;getters&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;getCounter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;counter&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;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;store&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Once added, the vuex store can be accessed in pages using &lt;code class=&quot;highlighter-rouge&quot;&gt;this.$store&lt;/code&gt;. (i.e. &lt;code class=&quot;highlighter-rouge&quot;&gt;this.$store.state&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;this.$store.getters&lt;/code&gt;)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: the variable is called &lt;strong&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;$store&lt;/code&gt;&lt;/strong&gt; &lt;em&gt;not&lt;/em&gt; &lt;strong&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;$state&lt;/code&gt;&lt;/strong&gt;!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;dynamic-pages&quot;&gt;Dynamic pages&lt;/h2&gt;
</description>
            <pubDate>Thu, 05 Apr 2018 15:40:01 +0000</pubDate>
        </item>
        
        <item>
            <title>Firefox Sync in Alpine Linux</title>
            <link>/2018/02/19/firefox-sync-in-alpine-linux.html</link>
            <guid isPermaLink="true">/2018/02/19/firefox-sync-in-alpine-linux.html</guid>
            <description>&lt;p&gt;This is a guide to setup Firefox Sync Server 1.5 in Alpine Linux. This guide is based off the &lt;a href=&quot;https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html&quot;&gt;official documentation available from Mozilla.&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Let’s install the things we need to get moving.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;python-dev git py-virtualenv build-base sqlite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;download-and-build&quot;&gt;Download and build&lt;/h2&gt;
&lt;p&gt;Now that the pre-reqs are setup, we can download the code and build it.&lt;/p&gt;

&lt;div class=&quot;language-bash 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;nb&quot;&gt;mkdir&lt;/span&gt; /opt
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /opt

git clone https://github.com/mozilla-services/syncserver
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;syncserver
make build
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;configure&quot;&gt;Configure&lt;/h2&gt;
&lt;p&gt;Edit &lt;code class=&quot;highlighter-rouge&quot;&gt;/opt/syncserver.ini&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Update &lt;code class=&quot;highlighter-rouge&quot;&gt;public_url&lt;/code&gt; to use proper domain name or ip address&lt;/li&gt;
  &lt;li&gt;Un-comment line with &lt;code class=&quot;highlighter-rouge&quot;&gt;sqluri&lt;/code&gt; configuration, and change the path for &lt;code class=&quot;highlighter-rouge&quot;&gt;syncserver.db&lt;/code&gt; to a directory outside of &lt;code class=&quot;highlighter-rouge&quot;&gt;/tmp&lt;/code&gt; (i.e. &lt;code class=&quot;highlighter-rouge&quot;&gt;/opt/syncserver/data.db&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Set up secret by running &lt;code class=&quot;highlighter-rouge&quot;&gt;head -c 20 /dev/urandom | sha1sum&lt;/code&gt; to get new value and pasting in &lt;code class=&quot;highlighter-rouge&quot;&gt;syncserver.ini&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;run&quot;&gt;Run&lt;/h2&gt;
&lt;p&gt;Run &lt;code class=&quot;highlighter-rouge&quot;&gt;make serve&lt;/code&gt; from the &lt;code class=&quot;highlighter-rouge&quot;&gt;/opt/syncserver&lt;/code&gt; directory. You should be able to hit the sync server from a web browser and get an &lt;code class=&quot;highlighter-rouge&quot;&gt;it works!&lt;/code&gt; message. If not, you should get some helpful error message.&lt;/p&gt;

&lt;h2 id=&quot;start-at-system-boot&quot;&gt;Start at system boot&lt;/h2&gt;
&lt;p&gt;First, you need to enable the &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; service&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rc-update add &lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next we need to add a script for the &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; service to run on startup. Create the file &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/local.d/firefox_sync.start&lt;/code&gt; and past in the following code:&lt;/p&gt;
&lt;div class=&quot;language-bash 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;#!/bin/sh&lt;/span&gt;
/usr/bin/make serve &lt;span class=&quot;nt&quot;&gt;--directory&lt;/span&gt; /opt/syncserver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the file, and make it executable:&lt;/p&gt;
&lt;div class=&quot;language-bash 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;nb&quot;&gt;chmod&lt;/span&gt; +x /etc/local.d/firefox_sync.start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Test it by running: &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/local.d/firefox_sync.start&lt;/code&gt;. You should see the sync server starting up.&lt;/p&gt;

&lt;p&gt;Fully test by restarting the Alpine server. After logging in, you should be able to see the gunicorn server running when you run the &lt;code class=&quot;highlighter-rouge&quot;&gt;top&lt;/code&gt; command.&lt;/p&gt;

&lt;h2 id=&quot;setting-up-firefox&quot;&gt;Setting up Firefox&lt;/h2&gt;
&lt;p&gt;You now need to setup Firefox to point at your Sync Server.&lt;/p&gt;

&lt;p&gt;To configure desktop Firefox to talk to your new Sync server, go to &lt;code class=&quot;highlighter-rouge&quot;&gt;about:config&lt;/code&gt;, search for &lt;code class=&quot;highlighter-rouge&quot;&gt;identity.sync.tokenserver.uri&lt;/code&gt; and change its value to the URL of your server with a path of &lt;code class=&quot;highlighter-rouge&quot;&gt;token/1.0/sync/1.5&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Example: &lt;code class=&quot;highlighter-rouge&quot;&gt;http://sync.myurl.com:5000/token/1.0/sync/1.5&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You should now be able to log in with your Firefox Account and sync your data to your personal Sync Server.&lt;/p&gt;
</description>
            <pubDate>Mon, 19 Feb 2018 04:32:21 +0000</pubDate>
        </item>
        
        <item>
            <title>Install PHP7 running in NGINX on Alpine Linux</title>
            <link>/2017/11/10/install-php7-running-in-nginx-on-alpine-linux.html</link>
            <guid isPermaLink="true">/2017/11/10/install-php7-running-in-nginx-on-alpine-linux.html</guid>
            <description>&lt;ol&gt;
  &lt;li&gt;Add community repository&lt;/li&gt;
  &lt;li&gt;Install nginx &amp;amp; php7-fpm&lt;/li&gt;
  &lt;li&gt;update &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/nginx/conf.d/default.conf&lt;/code&gt; to include some of the following:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
     listen 80 default_server&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     listen &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;::]:80 default_server&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

     root /var/www/html&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     index index.html index.htm index.nginx-debian.html index.php&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;


     &lt;span class=&quot;c&quot;&gt;# Everything is a 404&lt;/span&gt;
     location / &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
             try_files &lt;span class=&quot;nv&quot;&gt;$uri&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$uri&lt;/span&gt;/ &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;404&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

     location ~ &lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;php&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
             include fastcgi.conf&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
             fastcgi_pass 127.0.0.1:9000&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

     location ~ /&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;ht &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
             deny all&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
     &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Start &lt;code class=&quot;highlighter-rouge&quot;&gt;php-fpm7&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;nginx&lt;/code&gt; services&lt;/li&gt;
  &lt;li&gt;Create the file &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/www/html/index.php&lt;/code&gt; and add the following code to test:
    &lt;div class=&quot;language-php 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;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;phpinfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</description>
            <pubDate>Fri, 10 Nov 2017 15:11:49 +0000</pubDate>
        </item>
        
        <item>
            <title>Add database &amp; user to PostgreSQL</title>
            <link>/2017/11/07/add-database-user-to-postgresql.html</link>
            <guid isPermaLink="true">/2017/11/07/add-database-user-to-postgresql.html</guid>
            <description>&lt;p&gt;These are the steps to creating a new database with it’s own admin user for PostgreSQL.&lt;/p&gt;

&lt;div class=&quot;language-sql 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;o&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;psql&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;U&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;log&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;into&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;postgres&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;role&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newdbadmin&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;login&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;password&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'pa$$word'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;                                                                          

&lt;span class=&quot;k&quot;&gt;create&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;database&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;grant&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;all&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;privileges&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;database&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newdb&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newdbadmin&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;

</description>
            <pubDate>Tue, 07 Nov 2017 02:06:24 +0000</pubDate>
        </item>
        
        <item>
            <title>How to set up a home router as an access point</title>
            <link>/2017/10/30/how-to-set-up-a-home-router-as-an-access-point.html</link>
            <guid isPermaLink="true">/2017/10/30/how-to-set-up-a-home-router-as-an-access-point.html</guid>
            <description>&lt;p&gt;Many consumer routers don’t have a built-in feature to deploy as an access point. They can, however, be used as an access point by turning off a few features and wiring it up correctly.&lt;/p&gt;

&lt;h3 id=&quot;disable-services&quot;&gt;Disable services&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;Disable DHCP&lt;/li&gt;
  &lt;li&gt;Change LAN IP &amp;amp; subnet mask to something in your existing subnet&lt;/li&gt;
  &lt;li&gt;Disable RIP&lt;/li&gt;
  &lt;li&gt;Disable UPnP&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;wiring&quot;&gt;Wiring&lt;/h3&gt;
&lt;p&gt;Plug a cable between the switch ports on your new AP into a switch on your existing network (do &lt;strong&gt;NOT&lt;/strong&gt; plug into the WAN/internet port).&lt;/p&gt;
</description>
            <pubDate>Mon, 30 Oct 2017 00:55:22 +0000</pubDate>
        </item>
        
        <item>
            <title>Add support for less in .vue files</title>
            <link>/2017/09/13/add-support-for-less-in-vue-files.html</link>
            <guid isPermaLink="true">/2017/09/13/add-support-for-less-in-vue-files.html</guid>
            <description>&lt;p&gt;This wasn’t immediately obvious and took me longer than it should have to figure out considering how simple it is. All you have to do is install 2 npm packages, and then tell the &lt;code class=&quot;highlighter-rouge&quot;&gt;.vue&lt;/code&gt; file to use less.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npm &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--save&lt;/span&gt; less less-loader
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you can update the style section of the &lt;code class=&quot;highlighter-rouge&quot;&gt;.vue&lt;/code&gt; file like so:&lt;/p&gt;

&lt;div class=&quot;language-html 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;nt&quot;&gt;&amp;lt;style &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;scoped&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;less&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Restart the dev server and it should be working.&lt;/p&gt;
</description>
            <pubDate>Wed, 13 Sep 2017 01:25:38 +0000</pubDate>
        </item>
        
        <item>
            <title>Restore SQL Server database into SQL Server running on Docker from the command line</title>
            <link>/2017/09/07/restore-sql-server-database-into-sql-server-running-on-docker-from-the-command-line.html</link>
            <guid isPermaLink="true">/2017/09/07/restore-sql-server-database-into-sql-server-running-on-docker-from-the-command-line.html</guid>
            <description>&lt;p&gt;I needed to restore a database backup file to a locally running SQL Server running in a Docker container. I was using a Mac and had no desire to install SSMS in parallels.&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Sql Server is running in docker. &lt;a href=&quot;https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker&quot;&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;A SQL Server account w/ adequate permissions&lt;/li&gt;
  &lt;li&gt;A &lt;code class=&quot;highlighter-rouge&quot;&gt;.bak&lt;/code&gt; file to restore from&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;restore-the-database&quot;&gt;Restore the Database&lt;/h2&gt;
&lt;h3 id=&quot;overview&quot;&gt;Overview&lt;/h3&gt;
&lt;p&gt;In order to restore the restore the backup file into SQL Server on Docker we will have to take the following steps:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Copy backup file into container&lt;/li&gt;
  &lt;li&gt;Log into SQL Server and run &lt;code class=&quot;highlighter-rouge&quot;&gt;sqlcmd&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Determine which files will be restored from the backup&lt;/li&gt;
  &lt;li&gt;Run the restore command&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;copy-file-into-container&quot;&gt;Copy file into container&lt;/h4&gt;
&lt;p&gt;We can use the &lt;code class=&quot;highlighter-rouge&quot;&gt;docker cp&lt;/code&gt; command to copy a file into the container. We will copy our file into SQL Server’s data directory&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker &lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; &amp;lt;mydb.bak&amp;gt; &amp;lt;sql-server&amp;gt;:/var/opt/mssql/data/mydb.bak

&lt;span class=&quot;c&quot;&gt;# where:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# &amp;lt;sql-server&amp;gt; is the name of the container&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# &amp;lt;mydb.bak&amp;gt; is the name of the backup file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;determine-files-to-be-restored&quot;&gt;Determine files to be restored&lt;/h4&gt;
&lt;p&gt;Run the following command to see what files the backup file includes:&lt;/p&gt;
&lt;div class=&quot;language-sql 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;n&quot;&gt;RESTORE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FILELISTONLY&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DISK&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'mydb.bak'&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;p&gt;This command will output a list of files that we will need to account for when running the restore command. Here is an example output:&lt;/p&gt;

&lt;table&gt;
&lt;thead style=&quot;font-weight: bold&quot;&gt;
&lt;tr&gt;
&lt;td&gt;LogicalName&lt;/td&gt;&lt;td&gt;PhysicalName&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;mydb&lt;/td&gt;&lt;td&gt;D:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\mydb.mdf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mydb_log&lt;/td&gt;&lt;td&gt;D:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\mydb_log.mdf&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;We will need the LogicalName and the filename in the PhysicalName columns for the restore command.&lt;/p&gt;

&lt;h4 id=&quot;run-restore-command&quot;&gt;Run restore command&lt;/h4&gt;
&lt;p&gt;When we run the restore database command, we have to indicate where the different logical files will live on the filesystem. Since this is running in a Docker container, it lives in a Linux filesystem and the files will have to use Linux paths.&lt;/p&gt;

&lt;p&gt;You should be able to see in the following example where the Logical names are used with the &lt;code class=&quot;highlighter-rouge&quot;&gt;MOVE&lt;/code&gt; command and the Physical file names are used in the &lt;code class=&quot;highlighter-rouge&quot;&gt;TO&lt;/code&gt; portion.&lt;/p&gt;

&lt;p&gt;Update the query to reflect your backup file name and the information gathered from the previous step.&lt;/p&gt;

&lt;div class=&quot;language-sql 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;n&quot;&gt;RESTORE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;DATABASE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mydb&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DISK&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'mydb.bak'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WITH&lt;/span&gt; 
&lt;span class=&quot;k&quot;&gt;MOVE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'mydb'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/var/opt/mssql/data/&amp;lt;mydb.mdf&amp;gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;MOVE&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'mydb_log'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/var/opt/mssql/data/&amp;lt;mydb_log.ldf&amp;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;p&gt;Run the command and you should be good to go.&lt;/p&gt;

&lt;h2 id=&quot;gotchas&quot;&gt;Gotchas&lt;/h2&gt;
&lt;h4 id=&quot;restore-database-is-terminating-abnormally&quot;&gt;RESTORE DATABASE is terminating abnormally&lt;/h4&gt;
&lt;p&gt;If you run the command and get an error like this:&lt;/p&gt;
&lt;div class=&quot;language-sql 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;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;restore&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;database&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mydb&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;disk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'mydb.bak'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;go&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Msg&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5133&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Level&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d9d263f75eb0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Directory&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lookup&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;D:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\P&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;rogram Files&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;icrosoft SQL Server&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SSQL13.MSSQLSERVER&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SSQL&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\D&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ATA&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\m&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ydb.mdf&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;failed&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;operating&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;The&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cannot&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;find&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;specified&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.).&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Msg&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3156&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Level&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;State&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;n&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d9d263f75eb0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;File&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'mydb'&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cannot&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;restored&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'D:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\P&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;rogram Files&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;icrosoft SQL Server&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;SSQL13.MSSQLSERVER&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;SSQL&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\D&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ATA&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\m&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ydb.mdf'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Use&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WITH&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;MOVE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;identify&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;valid&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Msg&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5133&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Level&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d9d263f75eb0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Directory&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;lookup&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;D:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\P&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;rogram Files&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;icrosoft SQL Server&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SSQL13.MSSQLSERVER&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;SSQL&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\D&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ATA&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\m&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ydb_log.ldf&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;failed&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;operating&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;The&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cannot&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;find&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;specified&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.).&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Msg&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3156&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Level&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;State&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;n&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d9d263f75eb0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;File&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'mydb_log'&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cannot&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;restored&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'D:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\P&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;rogram Files&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;icrosoft SQL Server&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;SSQL13.MSSQLSERVER&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\M&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;SSQL&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\D&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ATA&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\m&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ydb_log.ldf'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Use&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WITH&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;MOVE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;identify&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;valid&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Msg&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3119&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Level&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d9d263f75eb0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Problems&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;were&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;identified&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;planning&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RESTORE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;statement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Previous&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;messages&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Msg&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3013&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;Level&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;State&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d9d263f75eb0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Line&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;RESTORE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;DATABASE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;terminating&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;abnormally&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;p&gt;This error is caused when you are not indicating where your files should be moved to. Make sure that you are using the &lt;code class=&quot;highlighter-rouge&quot;&gt;MOVE TO&lt;/code&gt; command for all files in the backup file.&lt;/p&gt;

&lt;h4 id=&quot;no-such-file-or-directory&quot;&gt;No such file or directory&lt;/h4&gt;
&lt;p&gt;This error has to do with the location of your backup file on the Docker filesystem. The directory it needs to be in is &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/opt/mssql/data/&lt;/code&gt;. You can use the &lt;code class=&quot;highlighter-rouge&quot;&gt;ls&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;mv&lt;/code&gt; commands in the container to troubleshoot the location of the &lt;code class=&quot;highlighter-rouge&quot;&gt;.bak&lt;/code&gt; file.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;sql-server &lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; /var/opt/mssql/data/

mydb.bak      &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; Backup file should be &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;this directory
master.mdf
mastlog.ldf
model.mdf
modellog.ldf
msdbdata.mdf
msdblog.ldf
tempdb.mdf
templog.ldf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
            <pubDate>Thu, 07 Sep 2017 15:44:01 +0000</pubDate>
        </item>
        
        <item>
            <title>Proxmox Quick Hints &amp; Tips</title>
            <link>/2016/11/11/proxmox-quick-hints-tips.html</link>
            <guid isPermaLink="true">/2016/11/11/proxmox-quick-hints-tips.html</guid>
            <description>&lt;h2 id=&quot;mount-a-host-folder-in-a-container&quot;&gt;Mount a host folder in a container&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;Stop the container&lt;/li&gt;
  &lt;li&gt;Run the &lt;code class=&quot;highlighter-rouge&quot;&gt;pct set&lt;/code&gt; command like the example below to create a mapping:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pct &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &amp;lt;vmid&amp;gt; &lt;span class=&quot;nt&quot;&gt;-mp0&lt;/span&gt; /media/1tb,mp&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/media/1tb 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;&lt;strong&gt;What does this command mean?&lt;/strong&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;pct set&lt;/code&gt; - command to change container settings&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;vmid&amp;gt;&lt;/code&gt; - id of the container (i.e. 103)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-mp0&lt;/code&gt; - identifier of the mountpoint. Multiple mountpoints would be subsequently named. (i.e. -mp1, -mp2, -mp3, etc.)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;/media/1tb&lt;/code&gt; - folder on host&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;,mp=/media/1tb&lt;/code&gt; - destination mount folder inside container&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;repository-pinning&quot;&gt;Repository Pinning&lt;/h2&gt;
&lt;p&gt;Alpine allows you to ‘pin’ repositories so that you can pull packages from different package streams. Add the repositories in &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/apk/repositories&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;@edge http://nl.alpinelinux.org/alpine/edge/main
@testing http://nl.alpinelinux.org/alpine/edge/testing
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Save and update your repositories. You can then install from the pinned repos.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk update
apk add stableapp newapp@edge bleedingapp@testing
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h5 id=&quot;install-a-specific-version-of-an-app&quot;&gt;Install a specific version of an app.&lt;/h5&gt;
&lt;p&gt;Specific app versions can be installed using a simple syntax:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk add &lt;span class=&quot;nv&quot;&gt;asterisk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1.6.0.21-r0
&lt;span class=&quot;c&quot;&gt;# or&lt;/span&gt;
apk add &lt;span class=&quot;s1&quot;&gt;'asterisk&amp;lt;1.6.1'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;cron-in-alpine-ie-busybox-cron&quot;&gt;Cron in Alpine (i.e. BusyBox Cron)&lt;/h2&gt;
&lt;p&gt;The easiest way to get a script to run is to place it in one of several pre-setup directories:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/etc/periodic/15min
/etc/periodic/hourly
/etc/periodic/daily
/etc/periodic/weekly
/etc/periodic/monthly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If these don’t work for you, you can add your script the normal way in &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/crontabs/root&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&quot;tips&quot;&gt;Tips&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;Make sure your script is executable by root!&lt;/li&gt;
  &lt;li&gt;Your script should &lt;em&gt;NOT&lt;/em&gt; end with &lt;code class=&quot;highlighter-rouge&quot;&gt;.sh&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;important-directories&quot;&gt;Important Directories&lt;/h2&gt;
&lt;h6 id=&quot;container-configuration-file&quot;&gt;Container configuration file&lt;/h6&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/pve/lxc/&amp;lt;CTID&amp;gt;.conf&lt;/code&gt;&lt;/p&gt;
&lt;h6 id=&quot;default-container-os-configuration-files&quot;&gt;Default container OS configuration files&lt;/h6&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt; /usr/share/lxc/config/&amp;lt;ostype&amp;gt;.common.conf&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;remove-proxmox-subscription-nag-popup&quot;&gt;Remove Proxmox subscription nag popup&lt;/h2&gt;
&lt;h4 id=&quot;proxmox-43&quot;&gt;Proxmox 4.3&lt;/h4&gt;
&lt;ol&gt;
  &lt;li&gt;Backup the file &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/share/pve-manager/ext6/pvemanagerlib.js&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Edit the file &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/share/pve-manager/ext6/pvemanagerlib.js&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Find the line that says &lt;code class=&quot;highlighter-rouge&quot;&gt;if (data.status !== 'Active')&lt;/code&gt; (around line 557)&lt;/li&gt;
  &lt;li&gt;Change to &lt;code class=&quot;highlighter-rouge&quot;&gt;if (false)&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Save and quit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You may need to reload your browser and/or clear your cache&lt;/p&gt;
</description>
            <pubDate>Fri, 11 Nov 2016 05:18:46 +0000</pubDate>
        </item>
        
        <item>
            <title>How to send yourself a Telegram message from BASH</title>
            <link>/2016/09/06/how-to-send-yourself-a-telegram-message-from-bash.html</link>
            <guid isPermaLink="true">/2016/09/06/how-to-send-yourself-a-telegram-message-from-bash.html</guid>
            <description>&lt;p&gt;In order to send yourself a message via Telegram you need to do 3 things. Create a bot, get your chat id, start a chat with that bot, and finally send a message via the command line.&lt;/p&gt;

&lt;h2 id=&quot;step-1-set-up-your-bot&quot;&gt;Step 1: Set up your bot&lt;/h2&gt;
&lt;p&gt;All Telegram bots have global visibility. This is important when setting the name for your bot. I have several bot, so I name them myusername_botname. This makes it so my bots all have similar names.&lt;/p&gt;

&lt;p&gt;In order to set up a bot, you need to start a chat with &lt;code class=&quot;highlighter-rouge&quot;&gt;@botfather&lt;/code&gt;. Send the message &lt;code class=&quot;highlighter-rouge&quot;&gt;/newbot&lt;/code&gt; and the BotFather will walk you though setting up your new bot. This is what a typical conversation will look like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-irc&quot;&gt;
[2:21:03 PM] George:
/newbot

[2:21:03 PM] BotFather:
Alright, a new bot. How are we going to call it? Please choose a name for your bot.

[2:21:08 PM] George:
test_123456

[2:21:07 PM] BotFather:
Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.

[2:21:26 PM] George:
test_123456_bot

[2:21:25 PM] BotFather:
Done! Congratulations on your new bot. You will find it at telegram.me/test_123456_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.

Use this token to access the HTTP API:
102932392:AAGjexEEZBJ3D09ubEb57zAAhq_qF8MDEI

For a description of the Bot API, see this page: https://core.telegram.org/bots/api
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Congratulations, you have created a bot! Make sure you save the access token (i.e. api key)! You will need it to create requests.&lt;/p&gt;

&lt;h2 id=&quot;step-2-get-your-chat-id&quot;&gt;Step 2: Get your chat id&lt;/h2&gt;
&lt;p&gt;To get your chat id you will need to start a chat with &lt;code class=&quot;highlighter-rouge&quot;&gt;@idbot&lt;/code&gt;, and send the message &lt;code class=&quot;highlighter-rouge&quot;&gt;/getid&lt;/code&gt;. The chat id will be a number like 394882049.&lt;/p&gt;

&lt;h2 id=&quot;step-3-start-chat-with-your-new-bot&quot;&gt;Step 3: Start chat with your new bot&lt;/h2&gt;
&lt;p&gt;This is easy. Just start a new chat with &lt;code class=&quot;highlighter-rouge&quot;&gt;@your_bot_name&lt;/code&gt;. This is necessary, though, or your bot will be unable to send messages to you.&lt;/p&gt;

&lt;h2 id=&quot;step-4-send-message-via-bash&quot;&gt;Step 4: Send message via BASH&lt;/h2&gt;
&lt;p&gt;You need cURL installed. Use the following command to test your bot.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;https://api.telegram.org/bot&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$API_KEY&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/sendMessage?chat_id=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$CHAT_ID&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;amp;text=helloworld&quot;&lt;/span&gt;

Make sure to replace the variables:
&lt;span class=&quot;nv&quot;&gt;$API_KEY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; the access token from Step 1
&lt;span class=&quot;nv&quot;&gt;$CHAT_ID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; the chat &lt;span class=&quot;nb&quot;&gt;id &lt;/span&gt;from step 2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You should get a JSON response to let you know if it was successful.&lt;/p&gt;

&lt;h2 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If you get the error &lt;code class=&quot;highlighter-rouge&quot;&gt;{&quot;ok&quot;:false,&quot;error_code&quot;:400,&quot;description&quot;:&quot;Bad Request: chat not found&quot;}#&lt;/code&gt; that either means that your &lt;code class=&quot;highlighter-rouge&quot;&gt;chat_id&lt;/code&gt; is incorrect, or that you haven’t started a conversation with the bot yet (see step 3)&lt;/p&gt;

</description>
            <pubDate>Tue, 06 Sep 2016 02:08:33 +0000</pubDate>
        </item>
        
        <item>
            <title>Install NGiNX with Let's Encrypt in an Alpine Linux Container</title>
            <link>/2016/08/13/install-nginx-in-an-alpine-linux-container.html</link>
            <guid isPermaLink="true">/2016/08/13/install-nginx-in-an-alpine-linux-container.html</guid>
            <description>&lt;p&gt;This is a quick and easy one.&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;An Alpine Linux container&lt;/li&gt;
  &lt;li&gt;An internet connection&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;install-nginx&quot;&gt;Install nginx&lt;/h2&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk add nginx
rc-update add nginx default
rc-service nginx start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;nginx-configuration&quot;&gt;Nginx Configuration&lt;/h3&gt;
&lt;p&gt;Config file is located at &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/nginx/nginx.conf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Use &lt;code class=&quot;highlighter-rouge&quot;&gt;service nginx reload&lt;/code&gt; to reload the configuration after editing it.&lt;/p&gt;

&lt;h2 id=&quot;install-certbot&quot;&gt;Install Certbot&lt;/h2&gt;
&lt;p&gt;Currently certbot only lives in the community repository. You can find out which repo a package is in by looking at the &lt;a href=&quot;https://pkgs.alpinelinux.org/packages?name=certbot&amp;amp;branch=&amp;amp;repo=&amp;amp;arch=&amp;amp;maintainer=&quot;&gt;Alpine Packages&lt;/a&gt; website. You’ll need to add the community repository by editing &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/apk/repositories&lt;/code&gt; and adding the following line:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;@community http://dl-2.alpinelinux.org/alpine//v3.4/community
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;Note that this is for version 3.4. You may have to update the version number&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After editing your repositories you need to update them and install certbot.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk update &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; apk upgrade
apk add certbot@community
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;adding-a-new-cert&quot;&gt;Adding a new cert&lt;/h3&gt;
&lt;p&gt;Certificates can be added with certbot using the wizard. Don’t forget to stop any instances of nginx first!&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot certonly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;updating-certs-automatically&quot;&gt;Updating certs automatically&lt;/h3&gt;
&lt;p&gt;Let’s Encrypt certs only last 3 months. This is by design. One of the beautiful parts of Let’s Encrypt is that we can update the certs automatically. I have created a script in &lt;code class=&quot;highlighter-rouge&quot;&gt;etc/periodic/weekly&lt;/code&gt; to update my scripts. It only has one line:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/bin/certbot renew &lt;span class=&quot;nt&quot;&gt;--standalone&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--pre-hook&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;service nginx stop&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--post-hook&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;service nginx start&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;blockquote&gt;
  &lt;p&gt;Don’t forget to make this script executable!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This script is run by cron on a weekly basis. It automatically stops nginx before it starts and starts it back up when it’s finished.&lt;/p&gt;

</description>
            <pubDate>Sat, 13 Aug 2016 04:04:19 +0000</pubDate>
        </item>
        
        <item>
            <title>Step-by-step guide to creating an Alpine container in Proxmox</title>
            <link>/2016/06/12/step-by-step-guide-to-creating-an-alpine-container-in-proxmox.html</link>
            <guid isPermaLink="true">/2016/06/12/step-by-step-guide-to-creating-an-alpine-container-in-proxmox.html</guid>
            <description>&lt;h2 id=&quot;download-the-alpine-template&quot;&gt;Download the Alpine template&lt;/h2&gt;
&lt;p&gt;Templates can be downloaded directly from the Proxmox web interface, though it’s a bit hidden. You have to go to &lt;em&gt;Storage View –&amp;gt; local –&amp;gt; Content –&amp;gt; Templates&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-1-29-55-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; is the name of my local storage, but yours may be different. Find out where your container templates are stored by going to Datacenter –&amp;gt; Storage and see where ‘Container Templates are stored.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From here you can just click on the ‘Templates’ button, locate the Alpine Linux template and download.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-1-34-51-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This will download the file to &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/lib/vz/template/cache&lt;/code&gt; by default. You can also upload templates manually to that location if you wish.&lt;/p&gt;

&lt;h2 id=&quot;creating-the-container&quot;&gt;Creating the container&lt;/h2&gt;
&lt;p&gt;Let’s start by creating a new container from the Proxmox web interface.
&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-7-46-01-AM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;general-information&quot;&gt;General Information&lt;/h4&gt;
&lt;p&gt;Next we’ll fill out the general information about the container
&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-7-49-28-AM-1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;td&gt;Physical machine that the container will live on. I only have one server in my 'cluster' so that is my only choice.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM ID&lt;/td&gt;
&lt;td&gt;Proxmox's internal vmid for this container. We will be using this number a lot, especially when using the command line tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hostname&lt;/td&gt;
&lt;td&gt;Self-explanitory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resource pool&lt;/td&gt;
&lt;td&gt;Only important if you're using resource pools. Can be ignored if you have a simple setup.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;td&gt;Password for root user&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;h4 id=&quot;template&quot;&gt;Template&lt;/h4&gt;

&lt;p&gt;Here you will want to select the Alpine template that we downloaded previously
&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-7-58-47-AM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;root-disk&quot;&gt;Root Disk&lt;/h4&gt;
&lt;p&gt;The only thing I usually change on this tab is the root disk size. That being said, if you’re creating a container that you plan on using a lot of storage, don’t add it here. You can mount host directories in the container directly.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-8-00-57-AM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;cpu&quot;&gt;CPU&lt;/h4&gt;
&lt;p&gt;Just set your CPU core limit and be on your way. Don’t worry about oversubscribing to CPU cores, this is just the limit that a single container can use. Also see &lt;a href=&quot;https://forum.proxmox.com/threads/q-lxc-configuration-wizard-what-is-cpu-limit-cpu-unit.22661/&quot;&gt;this thread&lt;/a&gt; if you want to know about CPU units.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-8-07-25-AM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;memory&quot;&gt;Memory&lt;/h4&gt;

&lt;p&gt;Set the memory and swap space that you want allocated to the container. Remember that containers are much more lightweight than VMs, so you don’t need to give them as much RAM. You can guess low on this page, and then easily increase it in the future as needed.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-1-39-08-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;network&quot;&gt;Network&lt;/h4&gt;

&lt;p&gt;Here is a basic network setup that I use. I like to leave a static IP address and set the last octet to the vmid assigned by Proxmox (112 in this case). This makes life easier if you’re running a relatively simple network.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-1-41-58-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;dns&quot;&gt;DNS&lt;/h4&gt;

&lt;p&gt;Here you can leave all the defaults. Only change this section if you know why you’re changing this section.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-1-45-47-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;confirm-and-finish&quot;&gt;Confirm and Finish&lt;/h4&gt;

&lt;p&gt;You’re ready to rip. You should see a successful creation as shown below.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-12-at-1-47-02-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;start-and-access-your-new-container&quot;&gt;Start and access your new container&lt;/h2&gt;

&lt;p&gt;From here on out I prefer to use the command line tools to interact with my containers. This is done from an SSH session on the host machine.&lt;/p&gt;

&lt;p&gt;Proxmox uses the &lt;code class=&quot;highlighter-rouge&quot;&gt;pct&lt;/code&gt; tool to manage containers. We’ll also need to know the vmid that Proxmox assigned to the container upon creation.&lt;/p&gt;

&lt;div class=&quot;language-bash 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;# Start the container&lt;/span&gt;
pct start &amp;lt;vmid&amp;gt;

&lt;span class=&quot;c&quot;&gt;# List all containers w/ status&lt;/span&gt;
pct list

&lt;span class=&quot;c&quot;&gt;# Access the container&lt;/span&gt;
pct enter &amp;lt;vmid&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once you &lt;code class=&quot;highlighter-rouge&quot;&gt;pct enter&lt;/code&gt; your container, you should be able to &lt;code class=&quot;highlighter-rouge&quot;&gt;apk update &amp;amp;&amp;amp; apk upgrade&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# pct enter 112                                                                                    
/ # apk update &amp;amp;&amp;amp; apk upgrade
fetch http://dl-2.alpinelinux.org/alpine//v3.3/main/x86_64/APKINDEX.tar.gz
v3.3.3-57-gb0ca6a4 [http://dl-2.alpinelinux.org/alpine//v3.3/main]
OK: 5317 distinct packages available
(1/2) Upgrading libcrypto1.0 (1.0.2g-r0 -&amp;gt; 1.0.2h-r0)
(2/2) Upgrading libssl1.0 (1.0.2g-r0 -&amp;gt; 1.0.2h-r0)
OK: 6 MiB in 16 packages
/ # 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s all there is to it! You can now download any package from the &lt;a href=&quot;https://pkgs.alpinelinux.org/packages&quot;&gt;APK Repository&lt;/a&gt;, or &lt;a href=&quot;/tag/lxc-homelab/&quot;&gt;follow one of my guides&lt;/a&gt;.&lt;/p&gt;
</description>
            <pubDate>Sun, 12 Jun 2016 19:02:58 +0000</pubDate>
        </item>
        
        <item>
            <title>Why I moved my homelab over to Alpine Linux containers</title>
            <link>/2016/06/12/why-i-moved-my-homelab-almost-entirely-over-to-alpine-linux-containers.html</link>
            <guid isPermaLink="true">/2016/06/12/why-i-moved-my-homelab-almost-entirely-over-to-alpine-linux-containers.html</guid>
            <description>&lt;p&gt;Ever since I purchased my home server (a Dell T20) I have been running &lt;a href=&quot;https://www.proxmox.com/en/&quot;&gt;Proxmox&lt;/a&gt; for all of my home server needs. I had never used containers before and I assumed that I would be using it to manage virtual servers. I tried using OpenVZ containers (because it’s so easy in Proxmox) running Debian and found that they worked great for all of my use cases. I ended up not creating a single real VM.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pve.proxmox.com/wiki/Roadmap#Proxmox_VE_4.2&quot;&gt;Proxmox 4.2&lt;/a&gt; introduced support for Alpine Linux and I decided to move as much as I could over.&lt;/p&gt;

&lt;h2 id=&quot;containers-vs-vms&quot;&gt;Containers vs VMs&lt;/h2&gt;
&lt;p&gt;The biggest benefit of using containers over virtual machines is the reduction of overhead. Each virtual machine you run has virtual hardware and it’s own kernel. If you have 5 virtual machines running on your server, you have 5 sets of virtualized hardware and 5 separate operating system kernels: even if they’re exactly the same!&lt;/p&gt;

&lt;p&gt;Containers solve this problem by sharing the same kernel. If you have 5 containers on your system you still just have one instance of the kernel. This makes it so that you can run many more containers on a server than you would virtual machines.&lt;/p&gt;

&lt;p&gt;Wait! Not all operating systems use the same kernel! You’re right. This is a limitation of containers. You can’t run a BSD-based OS on a Linux container host, and Windows is out of the question. Fortunately for us, you can do pretty much everything with Linux.&lt;/p&gt;

&lt;p&gt;Another nice benefit of Proxmox is that it can also manage virtual machines, so you could create one in a pinch.&lt;/p&gt;

&lt;h2 id=&quot;so-docker-is-like-the-best-container-thingie-right&quot;&gt;So Docker is like the best container thingie, right?&lt;/h2&gt;
&lt;p&gt;Docker is so hot right now. It has tons of support, but it’s not a good choice for a homelab. Docker was designed for the enterprise environment. It was designed so that each container would really only house a single process. This is an extremely powerful idea, but it comes with a complexity doesn’t add much value to a home server setup.&lt;/p&gt;

&lt;p&gt;Here’s an example. Let’s say that you want to run a Wordpress website. Docker would recommend that you install Wordpress in one container and MySQL in a separate container, and have a third data volume for static content. You would then have to use Docker tools to wire the three containers together so that they can talk to each other. This extra overhead can be a pain in a homelab situation, because we’re not going to be using the scaling benefits that it provides.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://openvz.org/Main_Page&quot;&gt;OpenVZ&lt;/a&gt; and &lt;a href=&quot;https://linuxcontainers.org/&quot;&gt;LXC&lt;/a&gt; containers are designed with the purpose of replicating the native OS environment. They feel like regular full-fledged operating systems. They are made to run multiple processes. You can run you Wordpress server, database server in the same container and you can have persistent data. Yes please!&lt;/p&gt;

&lt;h2 id=&quot;alpine-linux&quot;&gt;Alpine Linux&lt;/h2&gt;
&lt;p&gt;I first built my homelab on Debian containers. Everything worked great, but offsite backups were a bit heavy for my abysmal upload rate. I came across Alpine as a possible alternative, and I had to give it a go.&lt;/p&gt;

&lt;p&gt;From the &lt;a href=&quot;http://www.alpinelinux.org/about/&quot;&gt;Alpine&lt;/a&gt; web site:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Alpine Linux is built around musl libc and busybox. This makes it smaller and more resource efficient than traditional GNU/Linux distributions. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They’re not kidding about how small it is, checkout &lt;code class=&quot;highlighter-rouge&quot;&gt;top&lt;/code&gt; running on a brand new installation:
&lt;img src=&quot;/assets/img/Screen-Shot-2016-06-11-at-9-39-09-PM.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In my experience, Alpine has packages for almost everything I want (Plex is the big exception, but they do have Emby). It may take a little more wrenching than a more popular distribution, but it’s worth it for me.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Summary:&lt;/strong&gt; It’s tiny and has tons of easily-installed packages&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;real-life-size-differences&quot;&gt;Real life size differences&lt;/h2&gt;
&lt;p&gt;I have been most impressed by how small the containers are. My container backups have gone from 1Gb+ to 8-100MiB. This makes a huge difference for my off-site backup bandwidth.&lt;/p&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;Application&lt;/th&gt;
&lt;th&gt;Backup Size (gzip)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ghost Blog&lt;/td&gt;
&lt;td&gt;59MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Laverna&lt;/td&gt;
&lt;td&gt;69MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transmission w/ OpenVPN client&lt;/td&gt;
&lt;td&gt;5MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Squid&lt;/td&gt;
&lt;td&gt;9MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SickRage&lt;/td&gt;
&lt;td&gt;69MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Selenium w/ Firefox&lt;/td&gt;
&lt;td&gt;105MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;h2 id=&quot;guides&quot;&gt;Guides&lt;/h2&gt;
&lt;p&gt;I’ve documented my process for others to follow:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;/step-by-step-guide-to-creating-an-alpine-container-in-proxmox/&quot;&gt;Create an Alpine Container in Proxmox&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/roll-your-own-http-proxy-with-squid-alpine-and-lxc/&quot;&gt;Squid&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/how-to-install-transmission-with-vpn-in-an-alpine-lxc-container/&quot;&gt;Transmission&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/install-sickrage-in-an-alpine-linux-container/&quot;&gt;SickRage&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/how-to-install-ghost-on-alpine-linux-on-lxc/&quot;&gt;Ghost&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/how-to-install-laverna-in-an-alpine-lxc-container/&quot;&gt;Laverna&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/install-a-headless-selenium-server-in-an-alpine-linux-container/&quot;&gt;Selenium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have fun!&lt;/p&gt;
</description>
            <pubDate>Sun, 12 Jun 2016 03:13:54 +0000</pubDate>
        </item>
        
        <item>
            <title>Install a Headless Selenium server in an Alpine Linux container</title>
            <link>/2016/06/11/install-a-headless-selenium-server-in-an-alpine-linux-container.html</link>
            <guid isPermaLink="true">/2016/06/11/install-a-headless-selenium-server-in-an-alpine-linux-container.html</guid>
            <description>&lt;p&gt;&lt;a href=&quot;http://www.seleniumhq.org/&quot;&gt;Selenium&lt;/a&gt; is a web automation tool. It can be used to crawl and scrape websites. It requires a web browser installed to use as a web driver: we’re going to use Firefox. We’ll also need to trick Firefox into thinking there is a display attached: we’ll user Xvfb for that.&lt;/p&gt;

&lt;p&gt;One setup, you’ll be able to run Selenium scripts at your pleasure.&lt;/p&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;A virgin Alpine Linux container&lt;/li&gt;
  &lt;li&gt;A medium knowledge of Linux&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;add-firefox-repository-to-apk&quot;&gt;Add Firefox repository to APK&lt;/h2&gt;
&lt;p&gt;As of this blog post, Firefox is not available in the main alpine repository. You can &lt;a href=&quot;https://pkgs.alpinelinux.org/packages?name=firefox&amp;amp;branch=&amp;amp;repo=&amp;amp;arch=&amp;amp;maintainer=#&quot;&gt;search the Alpine repository&lt;/a&gt; to find out where you can install Firefox from. In my case, it is available in the &lt;code class=&quot;highlighter-rouge&quot;&gt;community&lt;/code&gt; repository branch &lt;code class=&quot;highlighter-rouge&quot;&gt;v3.3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With that information, I can add the following line to &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/apk/repositories&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;http://dl-2.alpinelinux.org/alpine//v3.3/community
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Update your cache to pull from the new repository&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk upgrade &lt;span class=&quot;nt&quot;&gt;--update-cache&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--available&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;install-selenium-dependencies&quot;&gt;Install Selenium dependencies&lt;/h2&gt;
&lt;p&gt;Now you should be install Firefox and all other Selenium dependencies without issue.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk add xvfb firefox dbus py-pip ttf-dejavu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here is what we just installed:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;td&gt;&lt;b&gt;Repository&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Purpose&lt;/b&gt;&lt;/td&gt;
&lt;/thead&gt;
&lt;tr&gt;
&lt;td&gt;xvfb&lt;/td&gt;
&lt;td&gt;A virtual display driver. We're building a headless system, so we need a virtual display for our web browser to run in.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;firefox&lt;/td&gt;
&lt;td&gt;We will use the Firefox driver for Selenium. This is what we will use for scraping web sites.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;py-pip&lt;/td&gt;
&lt;td&gt;Used to install Selenium drivers for Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ttf-dejavu&lt;/td&gt;
&lt;td&gt;Fonts! These are required for Firefox to render pages&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;h2 id=&quot;setup-xvfb-virtual-display-server&quot;&gt;Setup Xvfb virtual display server&lt;/h2&gt;
&lt;h4 id=&quot;test-xvfb-is-setup-properly&quot;&gt;Test Xvfb is setup properly&lt;/h4&gt;
&lt;p&gt;We should be able to run the Xvfb virtual display server by running&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Xvfb :99 &lt;span class=&quot;nt&quot;&gt;-ac&lt;/span&gt; &amp;amp;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Check to make sure your display server is running using the &lt;code class=&quot;highlighter-rouge&quot;&gt;top&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you get an error complaining about a machine-id, install the &lt;code class=&quot;highlighter-rouge&quot;&gt;dbus&lt;/code&gt; package and run &lt;code class=&quot;highlighter-rouge&quot;&gt;dbus-uuidgen &amp;gt; /etc/machine-id&lt;/code&gt;. You can then uninstall dbus.&lt;/em&gt;&lt;/p&gt;

&lt;h4 id=&quot;setup-xvfb-to-start-on-system-boot&quot;&gt;Setup Xvfb to start on system boot&lt;/h4&gt;
&lt;p&gt;We will use the &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; service to create a basic script that will start our service at boot time. We’ll start by enabling the &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; service to run at boot.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rc-update add &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;default
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we need to create our start script. When &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; service is enabled, it will run all executable scripts in the &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/local.d/&lt;/code&gt; that end with &lt;code class=&quot;highlighter-rouge&quot;&gt;.start&lt;/code&gt; at boot time. It will run all &lt;code class=&quot;highlighter-rouge&quot;&gt;.stop&lt;/code&gt; scripts when the &lt;code class=&quot;highlighter-rouge&quot;&gt;local&lt;/code&gt; service is stopped&lt;/p&gt;

&lt;p&gt;In our case, we just need a single script &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/local.d/Xvfb.start&lt;/code&gt; with the following lines:&lt;/p&gt;
&lt;div class=&quot;language-bash 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;#!/bin/sh&lt;/span&gt;
/usr/bin/Xvfb :99 &lt;span class=&quot;nt&quot;&gt;-ac&lt;/span&gt; &amp;amp;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now make it executable:&lt;/p&gt;
&lt;div class=&quot;language-bash 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;nb&quot;&gt;chmod&lt;/span&gt; +x /etc/local.d/Xvfb.start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; Now is a good time to test that everything is working smoothly. Stop and start your container and then check to see if the Xvfb service is running&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; Creating a script to shutdown Xvfb is left as an exercise for the reader&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;install-selenium-with-python&quot;&gt;Install Selenium with Python&lt;/h2&gt;
&lt;p&gt;We’re going to use Python Selenium bindings because it’s really easy to get started.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pip &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--upgrade&lt;/span&gt; pip &lt;span class=&quot;c&quot;&gt;# ensure pip is upgraded to latest version&lt;/span&gt;
pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;selenium requests
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it. You can checkout the Selenium Python &lt;a href=&quot;http://selenium-python.readthedocs.io/getting-started.html&quot;&gt;Getting Started Guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
</description>
            <pubDate>Sat, 11 Jun 2016 14:42:36 +0000</pubDate>
        </item>
        
        <item>
            <title>How to install Laverna in an Alpine LXC container</title>
            <link>/2016/06/08/how-to-install-laverna-in-an-alpine-lxc-container.html</link>
            <guid isPermaLink="true">/2016/06/08/how-to-install-laverna-in-an-alpine-lxc-container.html</guid>
            <description>&lt;p&gt;This guide will get you &lt;a href=&quot;https://laverna.cc/index.html&quot;&gt;Laverna&lt;/a&gt; running inside a super tiny and secure &lt;a href=&quot;http://alpinelinux.org/&quot;&gt;Alpine Linux&lt;/a&gt; container.&lt;/p&gt;

&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;A server with &lt;a href=&quot;https://wiki.debian.org/LXC&quot;&gt;LXC installed&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;A basic Alpine LXC container setup - &lt;a href=&quot;https://www.flockport.com/new-micro-containers-based-on-alpine-linux/&quot;&gt;Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;setup-laverna&quot;&gt;Setup Laverna&lt;/h3&gt;
&lt;h4 id=&quot;install-dependencies&quot;&gt;Install dependencies&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk add openssl unzip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;download-laverna-files&quot;&gt;Download Laverna files&lt;/h4&gt;
&lt;div class=&quot;language-bash 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;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /var/www/
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /var/www/
wget https://github.com/Laverna/static-laverna/archive/gh-pages.zip &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; laverna.zip
unzip &lt;span class=&quot;nt&quot;&gt;-uo&lt;/span&gt; laverna.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;install-nginx&quot;&gt;Install Nginx&lt;/h4&gt;
&lt;p&gt;We need a web server to serve Laverna. We’re going to use nginx.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apk add nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We need to update nginx to point at the directory that houses Laverna. This only takes one change in &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/nginx/nginx.conf&lt;/code&gt;. Change the &lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt; value under &lt;code class=&quot;highlighter-rouge&quot;&gt;server&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/www/laverna&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-diff 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;gd&quot;&gt;- root http
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+ root /var/www/laverna
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;start-your-new-site&quot;&gt;Start your new site&lt;/h4&gt;
&lt;p&gt;All we have left is to start nginx, and set it to start at boot.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rc-update add nginx
rc-service start nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You can now visit your site at &lt;code class=&quot;highlighter-rouge&quot;&gt;http://[ip address]&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;clean-up&quot;&gt;Clean Up&lt;/h3&gt;
&lt;p&gt;In an effort to keep our container as small as possible, we should clean up after ourselves.&lt;/p&gt;
&lt;div class=&quot;language-bash 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;nb&quot;&gt;rm&lt;/span&gt; /var/www/laverna.zip
apk del unzip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;start-laverna-container-at-system-boot&quot;&gt;Start Laverna container at system boot&lt;/h3&gt;
&lt;p&gt;We’ve setup our Laverna service to start up when the container boots, but we also need to set up our Laverna container to start when the host boots.&lt;/p&gt;

&lt;p&gt;From the host machine, edit &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/lib/lxc/laverna/config&lt;/code&gt; to add the following line:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lxc.start.auto &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To test to make sure your container will boot on startup, shut down the container and then run the following command:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lxc-autostart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This command starts all containers that are marked to boot on startup. After running this command you should be able to navigate to Laverna from your web browser.&lt;/p&gt;

&lt;h3 id=&quot;now-what&quot;&gt;Now what?&lt;/h3&gt;
&lt;p&gt;Take some actual notes&lt;/p&gt;
</description>
            <pubDate>Wed, 08 Jun 2016 15:21:37 +0000</pubDate>
        </item>
        
        <item>
            <title>How to setup OpenVPN on an Alpine LXC container</title>
            <link>/2016/04/09/how-to-setup-transmission-with-vpn-on-an-alpine-lxc-container.html</link>
            <guid isPermaLink="true">/2016/04/09/how-to-setup-transmission-with-vpn-on-an-alpine-lxc-container.html</guid>
            <description>&lt;p&gt;&lt;a href=&quot;alpinelinux.org&quot;&gt;Alpine&lt;/a&gt; on &lt;a href=&quot;linuxcontainers.org&quot;&gt;LXC&lt;/a&gt; is an excellent base for setting up an application. This guide will show you how to setup an &lt;a href=&quot;https://openvpn.net/index.php/open-source.html&quot;&gt;OpenVPN&lt;/a&gt; connection that connects automatically when the container is started.&lt;/p&gt;

&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;A server with &lt;a href=&quot;https://wiki.debian.org/LXC&quot;&gt;LXC installed&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;A basic Alpine LXC container setup - &lt;a href=&quot;https://www.flockport.com/new-micro-containers-based-on-alpine-linux/&quot;&gt;Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;setup-tun-module&quot;&gt;Setup tun module&lt;/h3&gt;
&lt;p&gt;In order to connect to an OpenVPN server, we need to have a tun adapter setup in our container. Enabling the tun adapter on the host system is beyond the scope of this guide. You’ll have to Google it.&lt;/p&gt;

&lt;p&gt;Add the following lines to the container’s config file in &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/lib/lxc/vpn/config&lt;/code&gt; to give your container permission to use the host’s tun module, and create the tun node on startup:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Add as last item in devices section
lxc.cgroup.devices.allow = c 10:200 rwm

# Create tun node on bootup
# Add as last item in file
lxc.hook.autodev = sh -c &quot;modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Proxmox Note:&lt;/strong&gt; if you’re using Proxmox, your container config will be located in &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/pve/lxc/&amp;lt;vmid&amp;gt;.conf&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;setup-openvpn-client&quot;&gt;Setup OpenVPN client&lt;/h3&gt;
&lt;p&gt;Enter the container and install OpenVPN&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lxc-attach &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; vpn
apk add openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Marvel that your container is a mere 12MB!&lt;/p&gt;
&lt;h5 id=&quot;openvpn-configuration&quot;&gt;OpenVPN configuration&lt;/h5&gt;
&lt;p&gt;You should be able to obtain the OpenVPN configuration from your OpenVPN provider. A &lt;a href=&quot;https://openvpn.net/index.php/open-source/documentation/howto.html#client&quot;&gt;sample configuration&lt;/a&gt; is available from the OpenVPN website. This file will need to be copied to your container to &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/openvpn/openvpn.conf&lt;/code&gt;. This is the default config file that is picked up when the OpenVPN service is started.&lt;/p&gt;

&lt;p&gt;Now you can test the VPN connection manually&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openvpn /etc/openvpn/openvpn.conf

&lt;span class=&quot;c&quot;&gt;# Ensure the tunnel was created by running&lt;/span&gt;
ifconfig
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;start-openvpn-at-boot&quot;&gt;Start OpenVPN at boot&lt;/h4&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rc-update add openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That’s it!&lt;/p&gt;
&lt;h3 id=&quot;test-your-configuration&quot;&gt;Test your configuration&lt;/h3&gt;
&lt;p&gt;Exit your container and reboot it&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lxc-stop &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; vpn
lxc-start &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; vpn
lxc-attach &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; vpn
ifconfig
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You should be able to see a &lt;code class=&quot;highlighter-rouge&quot;&gt;tun0&lt;/code&gt; connection in the list of interfaces.&lt;/p&gt;

&lt;h3 id=&quot;what-next&quot;&gt;What Next?&lt;/h3&gt;
&lt;p&gt;You may want to use OpenVPN on several containers. The easiest way to accomplish this is to stop your new is to clone this container into a new container:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lxc-clone vpn newvpn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That was easy.&lt;/p&gt;
</description>
            <pubDate>Sat, 09 Apr 2016 03:01:51 +0000</pubDate>
        </item>
        
    </channel>
</rss>