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}'`
    if [[ $1 = *@* ]]; then
    dst=`df -l "$dst" | tail -1 |awk '{print $1}'`
  [ -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}"



Apply ZFS driver settings without reboot

Apply your modprobe.d values without rebooting:

egrep -v '^#|^\s*$' zfs.conf \
| while read L; do
   P=(${N/=/ })
   echo "${P[1]}" > /sys/module/zfs/parameters/${P[0]}

#zfs #linux #bash

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
          dhcp4: no
          dhcp6: no
          dhcp4: no
          dhcp6: no
          dhcp4: no
          dhcp6: no
          dhcp4: no
          dhcp6: no
          dhcp4: no
          dhcp6: no
          dhcp4: yes
          dhcp6: no
             - eth0
             -  to:
                on-link: true
          dhcp4: no
          dhcp6: no
          addresses: []
             - eth1
          dhcp4: no
          dhcp6: no
          addresses: []
             - eth2
          dhcp4: no
          dhcp6: no
          addresses: []
             - eth3
          dhcp4: no
          dhcp6: no
          addresses: []
             - 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.

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.


Soldered new cabling


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

Robocopy Notes

Install cmder: It’s the nicest shell I’ve seen for windows. Run your console as Administrator. Otherwise you can’t use the /B backup switch. Also rember you need to do a net use command as administrator.

Before you robocopy stuff, setup a dedicated drive letter. The drive letter is only available to the logged in session. So if you have drive p: for Bob, and then you boost your console to Administrator–no more drive p: ! So dont use the users drive mappings: create admin drive mappings.

net use p: \\nas02\backup\ "secret" /user:bob /persistent:yes

Remember to type the password with “double quotes” and not ‘single quotes’. If you type single quotes you may as well be typing capital Xes: they become part of your password.

The net use command to see if you already have a drive share. Close any File Explorer windows open to that server becuase that’s equivalent of have a net use $d /user:anonymous open at the same time, and windows wont cooperate. Mount the directory

There are a lot of switches. We’ll assume a C:\Users directory.

C:\Users\bob> mkdir c:\temp
C:\Users\bob> cd C:\Users
C:\Users> robocopy bob P:\bu-bob\ /mir /ZB /FFT /XA:SH /W:5 /R:2 /dcopy:T ^
 /XJ /XD "Temp*" "cache2" "temporary internet files" "*cache*" /NFL

First try the command without the /LOG switch. The command goes faster with the LOG turned on, do that later. /XF is a pattern to exclude files. Example log option: /LOG:C:\temp\bu.txt. The /NFL will show directories. not files.

The /MT flag is useful, but it prohibits logging, not available on Vista. The /XJ flag should be default, but sadly–no. Juntion points create these really frustrating backup path loops. Use /XJ!