I regularly pull photos off of my iPhone and store them in my Synology for safe keeping (I also protect against the nuclear option by backing up my Synology to AWS Glacier).
This has worked well for me (except I’m still looking for something to help with organization—drop me a line if you have recommendations) but tonight I came across a new problem.
I wanted to put a Live Photo back on my phone after having archived it. I found the original photo, but when you pull them off, Live Photos become two separate files.
Synology DiskStation Manager (DSM) allows you to back up a machine running Apple OS X via Time Machine to a Synology NAS device. This lets you back up many computers running OS X to a single NAS.
OS X support for NAS devices has improved in recent years. Time Machine attempts to mount the NAS volume, mount the sparsebundle file, then backup into the sparsebundle.
The problem
It seemed to work for a few months after I set it up, but in the last half of 2016 I started seeing corrupted backup messages from OS X:
The last time I used Evernote on my Mac was Evernote 4.3.1 (circa 2012 I believe). I had accumulated over 5000 notes. In an act of supreme cleverness, instead of actually archiving those notes in the Evernote enex
format, I just backed up my entire home directory, knowing that all my notes were safely stored somewhere in the ~/Library
hierarchy.
When I finally got enough gumption on my new laptop to install Evernote, I found that the latest version could not read the native 4.3.1 format from the ~/Library
hierarchy. Doom.
For several weeks I’ve had a 69 GB chunk of disk missing. No scanner could detect where it had gone (DaisyDisk, WhatSize, Finder, “About This Mac → Storage”, Disk Utility (also in Recovery mode), command-line utilities df
and du
): they all indicated that there was only 18G left and none of them could tell me where the missing 69G was.
I have an encrypted boot volume and thought that perhaps something had been corrupted, but I wasn’t sure. I haven’t ever seen anything like this before. I remembered fsck
from my happy FreeBSD days, so I thought I would single-user boot and run an fsck_hfs
to see what might come up, but first I needed to figure out which disk was the right one to scan; Disk Utility helped with that: select the primary volume (mine is the default “Macintosh HD”) and notice the “Device” in the bottom left corner: disk1
Apple removed the OpenSSL header files in “El Capitan”, making it hard to build OpenSSL-dependent libraries without modifying your system a little bit.
Fortunately we have Homebrew; if you don’t have it yet, go ahead and install it now. I’ll wait here.
Ready? Now, repeat after me:
$ brew doctor (now fix anything that it tells you to fix)
$ brew update
$ brew upgrade
We’re just warming up with all that; it’s good to stay current with things like OpenSSL, which tends to go stale fast. Now let’s install it:
SSH tunnels can provide secure connections through insecure or untrusted networks and may also be used to securely route through firewalls.
About This Guide
This guide began as a personal document to help me learn and remember how SSH tunnels work and has been several years incubating. If you find errors or think of additional examples that you believe would be helpful, I’d be delighted to know about them.
Terminology
Throughout this guide we use “SSH” to refer to the SSH protocol or the world of SSH things and use ssh
to refer to the ssh(1)
program itself. “We use ssh
and sshd
to make SSH connections.” The examples in this tutorial are based on OpenSSH 0.9.8 and later.
scroll mode
tmux
has a scroll mode where you can use page up/page down and arrows to scroll the buffer back. To enter scroll mode, C-b <page up>
. To get out of scroll mode, <Esc>
. Also C-b [
turns on scroll mode.
sharing
Poor man’s screen sharing:
$ tmux -S /tmp/tmux-shared new-session -s session-name
(detach)
$ chmod 777 /tmp/tmux-shared
(attach)
Person 2 attaches:
$ tmux -S /tmp/tmux-shared attach-session -s session-name
I don’t mess with procmail
much anymore, but maybe these will be useful to someone.
Split a mailbox into separate files for each message:
$ formail -s sh -c 'cat - > foo.$FILENO' < klez.file
Resend a mailbox (foo) through a set of filters (rc.test
):
$ formail -s procmail ./rc.test < foo
Move the last 10 messages from folder foo
and put them in folder bar
:
$ MSGS=`egrep '^From ' foo | wc -l`
$ formail +`expr $MSGS - 10` -s < foo > bar
Check which recipes triggered most often (based on a verbose log format):