Building a ZFS Array with VMware Raw Device Mapping

Software: ESXi 6.5, Ubuntu 17.04, ZFS On Linux (ZOL) I recently came by a couple of 3 TB WD Blues and naturally decided it was time to build a storage array. Given the minuscule size of my mini-ITX not-quite-a-server I didn’t have space for a hardware RAID controller so instead I elected to go with a software-based approach I’ve always been interested in: ZFS. If you don’t know about ZFS, as usual the Arch Wiki has a good, practical introduction. [Read More]

Automating Let's Encrypt Renewal

Well, setup a cron job using the Let’s Encrypt certbot utility. I created a file on my CentOS 7 box in /etc/cron.d/ containing: 16 3,15 * * * root /usr/bin/certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx" This will run a renewal check every day at 3AM and 3PM using the standalone method described in the certbot docs. This does mean nginx stops briefly twice a day, but that’s fine on my personal server! [Read More]

The Samba Junk Box

Hardware: Raspberry Pi 2 OS: Arch Linux ARM Sometimes you just need a quick file server to move some data around. On a private network an unauthenticated Samba share on a Raspberry Pi works great, but do this only at home! Here’s what I did to get mine set up. Samba My trusty Raspberry Pi 2 had been shelved for a few months; naturally, I started with a full system update. [Read More]

Update all pip packages

Pip still doesn’t have a built in ‘update all’ option, so here’s a quick way to do that via the shell: pip list --outdated | grep -o '^\S*' | xargs pip install --upgrade I love it when a grep | xargs pipeline comes together. [Read More]

Exclusions with rsync

Whenever you move folders between different OSes you’ll likely find various OS-specific files coming along for the ride (e.g., .DS_Store from OS X or Thumbs.db from Windows). It’s not hard to remove these recursively from an existing directory using find: $ find . -type f \( -name '.DS_Store' -o -name 'Thumbs.db' \) -delete It’d be better to just never copy those files in the first place, wouldn’t it? If you’re using rsync, you can specify exclusions like so: [Read More]

Enable SELinux on Vultr CentOS 7

Some VPS providers (like mine, Vultr) disable SELinux in their OS installers to simplify deployments for their customers. If you’d like to enable SELinux, though, it’s pretty simple – here’s how to get the standard targeted policy running on Vultr’s CentOS 7 base install: Install the selinux-policy-targeted package. The dependencies for this package will pull in everything else you need and will install an /etc/selinux/config file that enables SELinux. [Read More]