I Am Justyn

I fix things

Nov 3, 2017 - 4 minute read - Home Automation

How to restart Home Assistant docker container automatically on failure

Intro Quoting from the website: “Home Assistant is an open-source home automation platform running on Python 3. Track and control all devices at home and automate control.” I’ve been using Home Assistant for a while now, and it quickly grew on me as my favorite home automation system. Before Home Assistant, I was using my own home-grown solution, and before that I was using OpenHab. OpenHab was great, but the configuration and scripting had a steep learning curve.

Sep 24, 2017 - 3 minute read - Windows

Using Bash (Windows Subsystem for Linux) on Windows 10

I recently reinstalled my main desktop computer, and decided to finally give “Bash on Windows 10”, or the “Windows Subsystem for Linux”, a real try. I’m hoping it will get rid of my need for Putty/WinSCP as well as allow me to do more development work locally on my Windows machine instead of through ssh (not that there is anything wrong with using vim over ssh.) Installation Installation was very simple.

Mar 5, 2017 - 2 minute read - Scripts

Monitoring PiHole with Telegraf and Influxdb

I recently installed Pi-hole on a spare Raspberry Pi 3. Pi-hole essentially blocks most advertisements from devices on a network, by running dnsmasq with a custom set of hosts to block.

Before Pi-hole, I was using dnsmasq with a hosts list generated by a bash script combining a few other hosts files from the internet. My solution worked, but I didn’t put much effort into it, and it wasn’t the easiest thing to maintain.

Pi-hole definitely has more polish to it, and includes a nice web interface for monitoring, logging, and some configuration. One of the first things I noticed was that the dashboard displays a few stats on the front page. Obviously that meant I needed to export the same stats to InfluxDB to graph in Grafana later. This is my quick solution for doing exactly that.

Jan 19, 2013 - 2 minute read - Plesk Linux

Rebuild missing SSL certificates from Plesk database

I’ve had to deal with errors similar to this occasionally on Plesk servers: root@cent:# apachectl -t Syntax error on line 55 of /var/www/vhosts/domain.com/conf/13449678050.31729500_httpd_ip_default.include: SSLCertificateFile: file '/usr/local/psa/var/certificates/cert-sFD3Ys' does not exist or is empty Probably the #1 reason I see this is when we’re doing migrations from one Plesk machine to another. Restoring Plesk-created backups can also cause it sometimes. Regardless of the reason, if the certificates exist in the psa database – they can be re-created easily through ssh.

Aug 8, 2011 - 5 minute read - Linux

Automated off-site Linux Backups using Duply and Duplicity

Off-site backups are important, and even though I know this, I rarely implement them in my own servers. Lately, I’ve been setting up rsnapshot to do hourly and daily backups locally(to the same server), and I only do manual backups to remote servers occasionally. I decided to install duply on all of my servers/virtual machines(that I care about) and have them back up to a single backup server. This backup server will also do daily encrypted backups to Amazon S3, effectively giving me 3 redundant layers of backups.

May 8, 2011 - 4 minute read - Linux

Xen file-based vs LVM-based disk images (benchmarks)

I’ve been messing around a lot with Xen lately and have seen several different articles and forum posts debating the advantages over using file-based disk images, like /mnt/xen/VM01-disk.img, versus giving the VM direct access to a LVM partition. So, I ran a few simple tests on my own to determine what would be best for my machine.

Dom-0 is using four 1.5tb 7200rpm seagate drives in a software Raid-10, /dev/md2. Both Dom0 and DomU have 1gb of ram and are using ext3. Xen is using mainly default settings with the default scheduler.