Posts

Welcome to cup of dev

All post publised as Morné Wolfaardt

My journey migrating from Wordpress to Azure static webapps

After many many years of hosmy blog on Wordpress I finally decided to move. Wordpress is a great platform to use to blog with, but I got hacked a few times, and I wanted to move away from the a database backend and massive amount of plugins running. My hosting provider also started charging me a lot more to host my blog, and I kept on receiving emails about the server running out of resources.

Use NGINX reverse proxy to resove docker hosts

NGINX reverse proxy request I use Docker to host my containers, and I love it, one thing I strugle with to remember the port number I’ve deployed the container on. It makes a lot more sence to make a hostname rather than an IP address, this is where NGINX comes it, there is a lot of other awesome reverse proxies out there but the quickest and easiest for me was NGINX.

Home Assistant Tip Split Automation Yaml Into Multiple Files

Home Assistant automation file I recently started adding more and more automation into my Home Assistant *automation.yaml config file. One thing I’ve realized is that the file grows quickly and it get difficult to track your automation. A quick and easy solution is to have multiple files, each containing a different automation YAML. I have a YAML file for my door automation, and another for my reminders.

Backup Your Home Assistant Config to Git

I run my Home Assistant of a raspberry pi using Docker. I found this to be a great way to run multiple different containers as well as Home Assistant. If you are like me, and like to tinker with the YAML files, you can very quickly end up overwriting working config with something that’s not working at all. I’ve learned my lesson by not having a backup of the files.

Starting Docker Containers After a Host Restart

I’ve recently started learning Docker, and how to run Docker on a Raspberry PI 3. I soon realized that whenever the host shuts down, or restarts the Docker containers will not restart automatically. I know you can set the container to auto start but if you are a Noob like me, you can use the following to get the containers back up and running. docker ps -a The command docker ps -a will list all the containers event the once that are not running.

Compress files and folders using sevenzipsharp and 7-Zip in C-Sharp

Compressing files using 7-Zip and seven zip sharp (http://sevenzipsharp.codeplex.com/) is really easy. To get started you would need the 7-Zip DLL http://www.7-zip.org/download.html namespace Cupofdev { using System; using System.IO; using SevenZip; class Cupofdev { static void Main(string[] args) { // Set source and target folders string targetFolder = @"E:\CodeDumps"; string sourceCodeFolder = @"C:\Dev\Clients\cupofdev"; if (System.IO.Directory.Exists(targetFolder)) { // Specify where 7z.dll DLL is located SevenZipCompressor.SetLibraryPath(@"C:\Program Files\7 - Zip\7z.dll"); SevenZipCompressor sevenZipCompressor = new SevenZipCompressor(); sevenZipCompressor.