ZFS Snapshot alias

Add this to your .bash_aliases for fun and profit:

function Snapshot () {
  local dst=""
  local atnam=""
  if [ -z "$1" ]; then
    dst=`df -l . | tail -1 |awk '{print $1}'`
  else
    if [[ $1 = *@* ]]; then
      atnam="${1##*@}"
      dst="${1%%@*}"
    fi
    dst=`df -l "$dst" | tail -1 |awk '{print $1}'`
  fi
  [ -z "$dst" ] && echo "wants file system name to snapshot" && return 1
  local NOW=`date +%Y%m%d-%H%M%S`
  [[ $dst = /* ]] && dst="${dst#/}"
  [[ $dst = */ ]] && dst="${dst%/}"
  [[ x$atnam = x ]] && atnam=$NOW
  sudo zfs snapshot "${dst}@${atnam}"
}

 

Ubuntu 18.04 Netplan!

This was unexpected, but I think I’m coping well. These are my notes on configuring netplan networking on my Ubuntu 18.04 server.

  1. systemctl disable NetworkManager.service NetworkManager-wait-online.service
  2. systemctl mask NetworkManager-wait-online.service
  3. systemctl daemon-reload
  4. apt install bridge-utils -y
  5. edit /etc/udev/rules.d/70-net.rules
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="c8:70:00:9f:d7:72", NAME="eth0"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="00:e2:ed:17:09:60", NAME="eth1"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="00:e2:ed:17:09:61", NAME="eth2"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="00:e2:ed:17:09:62", NAME="eth3"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="00:e2:ed:17:09:63", NAME="eth4"
  6. edit /etc/netplan/01-netcfg.yaml
      version: 2
      renderer: networkd
      ethernets:
        eth0:
          dhcp4: no
          dhcp6: no
        eth1:
          dhcp4: no
          dhcp6: no
        eth2:
          dhcp4: no
          dhcp6: no
        eth3:
          dhcp4: no
          dhcp6: no
        eth4:
          dhcp4: no
          dhcp6: no
      bridges:
        br0:
          dhcp4: yes
          dhcp6: no
          interfaces:
             - eth0
          routes:
             -  to: 192.168.100.0/24
                via: 192.168.45.3
                on-link: true
        br1:
          dhcp4: no
          dhcp6: no
          addresses: [10.45.0.1/24]
          interfaces:
             - eth1
        br2:
          dhcp4: no
          dhcp6: no
          addresses: [10.45.1.1/24]
          interfaces:
             - eth2
        br3:
          dhcp4: no
          dhcp6: no
          addresses: [10.45.2.1/24]
          interfaces:
             - eth3
        br4:
          dhcp4: no
          dhcp6: no
          addresses: [10.45.3.1/24]
          interfaces:
             - eth4
    
  7. sudo netplan generate
  8. sudo netplan apply
  9. reboot

Without my eth1-eth4 devices plugged into a switch, rebooting takes forever.

ZFS Rebuild Script

I’ve rebuilt my zfs modules often enough that I’ve written a script to do a clean build that should avoid old kernel modules and old libraries.

#!/bin/bash
sudo find /lib/modules -depth -type d -iname "spl" -exec rm -rf {} \;
sudo find /lib/modules -depth -type d -iname "zfs" -exec rm -rf {} \;
sudo find /usr/local/src/ -type d -a \( \
   -iname "spl-*" \
   -o -iname "zfs-*" \
   \) -exec rm -rf {} \;

sudo find /usr/local/lib/ -type f -a \( \
   -iname "libzfs*" \
   -o -iname "libzpool*" \
   -o -iname "libnvpair*" \
   \) -exec rm -f {} \;

cd spl
git reset --hard HEAD
git checkout master
git pull
git tag | tail -1 | xargs git checkout
./autogen.sh && ./configure && make -j13 && sudo make install
cd ../zfs
git reset --hard HEAD
git checkout master
git pull
git tag | tail -1 | xargs git checkout
./autogen.sh && ./configure && make -j13 && sudo make install

sudo update-initramfs -u
sudo update-grub2

Pulling 200 Feet of Cable

We wrapped five 200 foot segments of the direct burial line back onto the original spool so we could tape them all together. The paint cans are ballast to keep the spool from sliding around.

Our first pull attempt was thwarted by friction. We yanked it back and greased the nose of the cable and it went through well.

The cables then had to be completely un-spooled again, the opposite end taped, and then pushed through three more short conduit runs. It comes out of the wall in the sound room of the sanctuary.

Made it Fit

This is a Digium card, clearly intended for a 1U or ATX case. One of my goals is to reduce the number of high speed fans in the lab, so I repurposed my Lanner chassis. Using a typical twist drill bit is a poor choice for the job of an end mill, but it came out ok when I put a rotary steel brush to the aluminum plate.

20180216_152343-asterisk1

Soldered new cabling

20180216_152355-asterisk2

Heat shrinked cable ends fit nicely

Thoughts on Media Hosting

If the recordings are licensed in the public domain, out of copyright, or creative commons, archive.org provides free audio hosting. http://archive.org/about/faqs.php#224

All of the services listed are not a substitute for an offline cold backup, just a reminder. Site content on Amazon or YouTube can disappear because of copyright dispute claims or policy conflicts like Terms of Service violation or other arbitrary policy changes.

Commercial podcast hosting appears to be tiered by upload amount per month; this is a comparison: https://www.thepodcasthost.com/websites-hosting/best-podcast-hosting/

The advantages of some podcast hosting services is that they might have automatically generated RSS feed services, and might provide integration with other podcast syndicators such as rdio.com or stitcher.com. No particular service is better than others at iTunes integration because iirc, iTunes plays by its own rules.

Moving podcast hosting often involves altering podcast feeds which can alter the subscribers content (like flood it with hundreds of ‘unread/new’ items), or make it appear to have stopped updating altogether. It definitely takes some homework to prepare for a move.

Hosting videos can also be done on vimeo.com or anything that hosts files. Video hosting services typically differentiate themselves by their online players (mobile friendly vs High Definition).

Live streaming services are available from both YouTube, vimeo.com, or other services like ScaleEngine.com or Twich. Converting a live stream to a hosted video takes forethought to record the video, sometimes on a separate device.

lsblk trick

Here’s a fun trick to list the serial numbers and sizes of your hard drives:

 $ lsblk --nodeps -o name,serial,size
NAME SERIAL             SIZE
sda  50026B77640B3E09 223.6G
sdb  50026B77640B4B39 223.6G
sdc  YGGU3EZD           1.8T
sdd  W1E15D5G           1.8T
sde  W1E16ACY           1.8T
sdf  W1E16BJB           1.8T
sdg  W1E5W99Y           1.8T
sdh  YFGR1V3A           1.8T