I Am Justyn

I fix things

Jul 14, 2019 - 8 minute read - Windows

Using a Yubikey for GPG in WSL (Windows Subsystem for Linux) on Windows 10

Previously, I wrote about using bash (WSL) on Windows 10. I’ve changed some of my setup since then, but still use something similar for when I’m developing on a Windows machine. Until recently, I have been disappointed with the lack of gpg support in wsl. GnuPG itself works fine, but you can not use a hardware smartcard device like a Yubikey. To get around this, I installed Keybase on my WSL instance, and set up a key just for wsl.

Jan 14, 2018 - 2 minute read - Finances

Automatically Sort and Align Ledger Transactions in VIM

One of my goals for 2018 is to track all of my finances using plaintextaccounting. For now, I am using ledger-cli and vim. I won’t go into detail on how to use ledger or plaintextaccount in this post, but wanted to share a quick tip. Ledger files can quickly grow in size, and if you have multiple accounts you may not enter transactions in the correct order. By default, Ledger processes transactions in the order it sees them - not by the date of the transaction.

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 - 4 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.