< ^ txt
Thu Aug 24 08:07:08 EDT 2017
Slept from eleven to six without waking.
High of sixty-nine and partly sunny today.
Work:
- Yell at Bullseye about BV outage
Done.
- Prepare for property copies
Done.
- 3 PM call with Rachel at HZ
Done.
Half-hour walk at lunch.
Nice and cool.
Saw a turkey vulture and a flying blackish grasshopper.
Home:
- Pay utility bill
Done.
- Play with encrypted disks (LUKS)
Done.
- Rejigger sorting on Go static site generator
Done.
https://golang.org/pkg/sort/#Slice
package main
import (
"fmt"
"sort"
)
type cloud struct {
adj string
color string
rain int
}
func main() {
fmt.Println("Hello, clouds.")
c := []cloud{
{"fluffy", "white", 2},
{"heavy", "black", 9},
{"whispy", "white", 1},
{"radioactive", "green", 4},
}
sort.Slice(c, func(i, j int) bool { return c[i].adj < c[j].adj })
fmt.Println("By adj:", c)
sort.Slice(c, func(i, j int) bool { return c[i].rain < c[j].rain })
fmt.Println("By rain:", c)
}
This shell script and a couple of USB drives walked off site look to be my CrashPlan replacement:
#!/bin/sh
set -euf
# Supply the device name of an external USB drive as the sole argument:
# $ sudo ~/bin/backup-offsite /dev/sdc
d="$1"
mnt=/media/usb
h=/home/paulgorman
cryptsetup open "$d" backup --key-file /root/luks-keyfile-for-usb-backups
mkdir -p "$mnt"
mount /dev/mapper/backup "$mnt"
mkdir -p "$mnt"/Trash
rsync -aqh --delete --backup --backup-dir="$mnt"/Trash \
--exclude "$h"/.cache \
--exclude "$h"/Downloads \
--exclude "$h"/tmp \
"$h" \
/data \
/etc \
/root \
/var/spool/anacron \
/var/spool/cron \
"$mnt"
umount "$mnt"
cryptsetup close backup
cryptsetup luksHeaderBackup --header-backup-file /root/luks-header-backup /dev/sdc
Lunch: coffee, peanut butter and jelly
Dinner: steak and mushroom sub, fries
< ^ txt