<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[what's up, .net?]]></title><description><![CDATA[Thoughts, stories and ideas.]]></description><link>https://cbmdk.azurewebsites.net/</link><generator>Ghost 0.11</generator><lastBuildDate>Wed, 06 May 2026 11:13:06 GMT</lastBuildDate><atom:link href="https://cbmdk.azurewebsites.net/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Setting up multiple hosts with nginx]]></title><description><![CDATA[<h2 id="prerequisites">Prerequisites</h2>

<p>Before you start, make sure to have Docker and Nginx installed, here’s how to do that:</p>

<p>To install Docker follow the steps here: <br>
<a href="https://www.digitalocean.com/community/questions/how-to-install-and-run-docker-on-digitalocean-dorplet">https://www.digitalocean.com/community/questions/how-to-install-and-run-docker-on-digitalocean-dorplet</a></p>

<p>To install Nginx follow the steps here: <br>
<a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04">https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04</a></p>

<p>Once you have both</p>]]></description><link>https://cbmdk.azurewebsites.net/untitled-2/</link><guid isPermaLink="false">c7690587-cf51-4861-8c51-6ae2604cb8c1</guid><dc:creator><![CDATA[cbm]]></dc:creator><pubDate>Tue, 22 Nov 2022 10:18:19 GMT</pubDate><content:encoded><![CDATA[<h2 id="prerequisites">Prerequisites</h2>

<p>Before you start, make sure to have Docker and Nginx installed, here’s how to do that:</p>

<p>To install Docker follow the steps here: <br>
<a href="https://www.digitalocean.com/community/questions/how-to-install-and-run-docker-on-digitalocean-dorplet">https://www.digitalocean.com/community/questions/how-to-install-and-run-docker-on-digitalocean-dorplet</a></p>

<p>To install Nginx follow the steps here: <br>
<a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04">https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04</a></p>

<p>Once you have both installed, you can continue with the steps:</p>

<h2 id="step1runyourdockercontainers">Step 1 - run your Docker containers</h2>

<p>For the same of simplicity, I will run a simple and I’ll run 2 small httpd containers.</p>

<p>Run your first container and map port 8080 on your host:  </p>

<pre><code class="language-bash">docker run -dit --name container-1 -p 8080:80 httpd:2.4  
</code></pre>

<p>Now if you visit <a href="http://your-dropets-ip:8080">http://your-dropets-ip:8080</a>, you should be able to see a message saying  </p>

<pre><code class="language-bash">It Works!.  
</code></pre>

<p>Just so that we could differentiate the two containers, let’s update the It works! message with Container 1 for example:</p>

<p>First get your container ID  </p>

<pre><code class="language-bash">docker ps  
</code></pre>

<p>Then run the following sed command to update the message:</p>

<pre><code class="language-bash">docker exec CONTAINER_ID sed -i 's/It works!/Container 1/' /usr/local/apache2/htdocs/index.html  
</code></pre>

<p>This would basically run a search and replace for the <code>It works!</code> string and update it with <code>Container 1</code> in the default <code>index.html</code> file in the container itself.</p>

<p>If you visit your Droplet's IP again in your browser the message should change from <code>It works!</code> to <code>Container 1</code>.</p>

<p>Let's do the same thing for container 2, but map it to port <code>8081</code> instead:</p>

<pre><code>docker run -dit --name container-2 -p 8081:80 httpd:2.4  
</code></pre>

<p>Then agian get your container ID</p>

<pre><code>docker ps  
</code></pre>

<p>Then run the <code>sed</code> command again to update the <code>It works!</code> message to <code>Container 2</code>:  </p>

<pre><code class="language-bash">docker exec CONTAINER_ID sed -i 's/It works!/Container 2/' /usr/local/apache2/htdocs/index.html  
</code></pre>

<p>Now if you visit <a href="http://your-dropets-ip:8081">http://your-dropets-ip:8081</a>, you should be able to see a message saying <code>Container 2</code>. </p>

<h2 id="step2configurenginx">Step 2 - Configure Nginx</h2>

<p>Now that we have our containers up and running we can go ahead and configure our Nginx server blocks, I will go ahead and use the following two subdomain names for this example:</p>

<ul>
<li>container1.bobbyiliev.com</li>
<li>container2.bobbyiliev.com</li>
</ul>

<p>To keep things as simple as possible, I will create 2 server blocks with the following content:</p>

<ul>
<li>Server block #1:</li>
</ul>

<p>Create a new file called <code>container1.bobbyiliev.com.conf</code> in the <code>/etc/nginx/sites-available/</code> directory and add the following content:  </p>

<pre><code class="language-bash">server { listen 80; server_name container1.bobbyiliev.com;

location / { proxy_pass http://localhost:8080; } }  
</code></pre>

<ul>
<li>Server block #2:</li>
</ul>

<p>Create a new file called <code>container2.bobbyiliev.com.conf</code> in the <code>/etc/nginx/sites-available/</code> directory and add the following content:  </p>

<pre><code class="language-bash">server { listen 80; server_name container2.bobbyiliev.com;

location / { proxy_pass http://localhost:8081; } }  
</code></pre>

<p>Then once you have the two config files ready <code>cd</code> to the <code>/etc/nginx/sites-enabled</code> directory, and run the following commands:  </p>

<pre><code class="language-bash">ln -s …/sites-available/container1.bobbyiliev.com.conf .  
</code></pre>

<pre><code class="language-bash">ln -s …/sites-available/container2.bobbyiliev.com.conf .  
</code></pre>

<p>Run a config test to make sure that there are no errors:  </p>

<pre><code class="language-bash">nginx -t  
</code></pre>

<p>And if you get <code>Syntax OK</code> message, restart Nginx:  </p>

<pre><code class="language-bash">systemctl restart nginx  
</code></pre>

<p>Note, for more information about Nginx server blocks, I would recommend taking a look at this tutorial here: <br>
<a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04">https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04</a></p>

<h2 id="step3testthesetup">Step 3 - Test the setup</h2>

<p>That is pretty much it, now if I visit container1.bobbyiliev.com I should be able to see the <code>Container 1</code> message and the same for container2.bobbyiliev.com. </p>

<p>To test that I could run a simple <code>curl</code> request:</p>

<pre><code class="language-bash">curl container1.bobbyiliev.com  
</code></pre>

<p>You should see the following output  </p>

<pre><code class="language-bash">&lt;h1&gt;Container 1&lt;/h1&gt;  
</code></pre>

<p>Then run the same request for container2.bobbyiliev.com:  </p>

<pre><code class="language-bash">curl container2.bobbyiliev.com  
</code></pre>

<p>And agian you should see the following output  </p>

<pre><code class="language-bash">&lt;h1&gt;Container 2&lt;/h1&gt;  
</code></pre>

<p>taken from <a href="https://www.digitalocean.com/community/questions/how-to-host-multiple-docker-containers-on-a-single-droplet-with-nginx-reverse-proxy">https://www.digitalocean.com/community/questions/how-to-host-multiple-docker-containers-on-a-single-droplet-with-nginx-reverse-proxy</a></p>]]></content:encoded></item><item><title><![CDATA[UDM Fan control speed]]></title><description><![CDATA[<p>FYI:</p>

<p>I've also installed the netdata docker/podman. It shows me the actual fan speeds and temps in a graph. It helped me a lot to solve this issue.</p>

<pre><code>podman run --privileged -d --name=netdata --restart always \
 --net="host" \
 --pid="host" \
 -v netdatalib:/var/lib/netdata \
 -v netdatacache:/var/cache/</code></pre>]]></description><link>https://cbmdk.azurewebsites.net/udm-fan-control-speed/</link><guid isPermaLink="false">94517dc5-fdd5-4d57-b022-3005eb4db1de</guid><dc:creator><![CDATA[cbm]]></dc:creator><pubDate>Tue, 01 Mar 2022 13:35:14 GMT</pubDate><content:encoded><![CDATA[<p>FYI:</p>

<p>I've also installed the netdata docker/podman. It shows me the actual fan speeds and temps in a graph. It helped me a lot to solve this issue.</p>

<pre><code>podman run --privileged -d --name=netdata --restart always \
 --net="host" \
 --pid="host" \
 -v netdatalib:/var/lib/netdata \
 -v netdatacache:/var/cache/netdata \
 -v /etc/passwd:/host/etc/passwd:ro \
 -v /etc/group:/host/etc/group:ro \
 -v /proc:/host/proc:ro \
 -v /sys:/host/sys:ro \
 -v /etc/os-release:/host/etc/os-release:ro \
 --cap-add SYS_PTRACE \
 --security-opt apparmor=unconfined \
 netdata/netdata
</code></pre>

<p>Fan1 <mark>= CPU fan </mark>= pwm2 <br>
Fan2 <mark>= Disk 40mm fan </mark>= pwm1 <br>
The CPU fan can't be fully stopped. It wil always run minimal at ~800 rpm. <br>
The disk fan can be fully stopped. It wil obviously show 0 rpm when stopped.</p>

<p>The CPU fan minimum start offset is "77" and is ~800 rpm . <br>
The disk fan minimum start offset is "35" and is ~800 rpm (if you would like to keep it running for airflow).</p>

<p>CPU fan: <br>
    echo 77 >/sys/class/hwmon/hwmon0/device/pwm2</p>

<p>Disk fan: <br>
   echo 35 >/sys/class/hwmon/hwmon0/device/pwm1</p>

<p>Making this survive a reboot does indeed need the on-boot-script. I've made a simple script which surives a reboot:</p>

<p>Install on-boot-script <br>
Make a file with VI called "11-set-fan-speed.sh" in /mnt/data/on<em>boot.d/ <br>
Make the boot script executable chmod +x /mnt/data/on</em>boot.d/11-set-fan-speed.sh <br>
Reboot and enjoy the silence <br>
11-set-fan-speed.sh:</p>

<p>!/bin/sh</p>

<p>echo 77 >/sys/class/hwmon/hwmon0/device/pwm2 <br>
echo 35 >/sys/class/hwmon/hwmon0/device/pwm1 <br>
I can confirm that it DOES survive a reboot. Got it working on 1.8.5. Display also shows correct values. Running stable at 44 degrees Celsius on CPU and 41 degrees Celsius board-temp.</p>]]></content:encoded></item><item><title><![CDATA[Configure PostgreSQL to allow remote connection]]></title><description><![CDATA[<p>By default PostgreSQL is configured to be bound to "localhost".</p>

<p><code>$ netstat -nlt
Proto Recv-Q Send-Q Local Address           Foreign Address         State <br>
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN <br>
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN <br>
tcp        0      0 0.</code></p>]]></description><link>https://cbmdk.azurewebsites.net/untitled/</link><guid isPermaLink="false">790f3964-36b0-4077-bb08-7ecee6ab5faa</guid><dc:creator><![CDATA[cbm]]></dc:creator><pubDate>Fri, 17 Dec 2021 14:31:58 GMT</pubDate><content:encoded><![CDATA[<p>By default PostgreSQL is configured to be bound to "localhost".</p>

<p><code>$ netstat -nlt
Proto Recv-Q Send-Q Local Address           Foreign Address         State <br>
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN <br>
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN <br>
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN <br>
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN <br>
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN <br>
tcp        0      0 127.0.0.1:3737          0.0.0.0:*               LISTEN <br>
tcp6       0      0 :::22                   :::*                    LISTEN</code></p>

<p>As we can see above port 5432 is bound to 127.0.0.1. It means any attempt to connect to the postgresql server from outside the machine will be refused. We can try hitting the port 5432 by using telnet.</p>]]></content:encoded></item><item><title><![CDATA[Welcome to Ghost]]></title><description><![CDATA[<p>You're live! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. You can manage your content by signing in to the admin area at <code>&lt;your blog URL&gt;/ghost/</code>. When you arrive, you can select this post from a list</p>]]></description><link>https://cbmdk.azurewebsites.net/welcome-to-ghost/</link><guid isPermaLink="false">930ee856-91e7-453a-9a53-b20f032058e8</guid><category><![CDATA[Getting Started]]></category><dc:creator><![CDATA[cbm]]></dc:creator><pubDate>Mon, 25 Sep 2017 07:18:21 GMT</pubDate><content:encoded><![CDATA[<p>You're live! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. You can manage your content by signing in to the admin area at <code>&lt;your blog URL&gt;/ghost/</code>. When you arrive, you can select this post from a list on the left and see a preview of it on the right. Click the little pencil icon at the top of the preview to edit this post and read the next section!</p>

<h2 id="gettingstarted">Getting Started</h2>

<p>Ghost uses something called Markdown for writing. Essentially, it's a shorthand way to manage your post formatting as you write!</p>

<p>Writing in Markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use <em>shortcuts</em> to <strong>style</strong> your content. For example, a list:</p>

<ul>
<li>Item number one</li>
<li>Item number two
<ul><li>A nested item</li></ul></li>
<li>A final item</li>
</ul>

<p>or with numbers!</p>

<ol>
<li>Remember to buy some milk  </li>
<li>Drink the milk  </li>
<li>Tweet that I remembered to buy the milk, and drank it</li>
</ol>

<h3 id="links">Links</h3>

<p>Want to link to a source? No problem. If you paste in a URL, like <a href="http://ghost.org">http://ghost.org</a> - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to <a href="http://ghost.org">the Ghost website</a>. Neat.</p>

<h3 id="whataboutimages">What about Images?</h3>

<p>Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:</p>

<p><img src="https://ghost.org/images/ghost.png" alt="The Ghost Logo"></p>

<p>Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:</p>

<h3 id="quoting">Quoting</h3>

<p>Sometimes a link isn't enough, you want to quote someone on what they've said. Perhaps you've started using a new blogging platform and feel the sudden urge to share their slogan? A quote might be just the way to do it!</p>

<blockquote>
  <p>Ghost - Just a blogging platform</p>
</blockquote>

<h3 id="workingwithcode">Working with Code</h3>

<p>Got a streak of geek? We've got you covered there, too. You can write inline <code>&lt;code&gt;</code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.</p>

<pre><code>.awesome-thing {
    display: block;
    width: 100%;
}
</code></pre>

<h3 id="readyforabreak">Ready for a Break?</h3>

<p>Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.</p>

<hr>

<h3 id="advancedusage">Advanced Usage</h3>

<p>There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.</p>

<p><input type="text" placeholder="I'm an input field!"></p>

<p>That should be enough to get you started. Have fun - and let us know what you think :)</p>]]></content:encoded></item></channel></rss>