My brother insists that I write a blog post about this, even though it’s really just basic Unix stuff and not anything the least bit esoteric, or even related to Syncthing really.

I didn’t want to sync my entire music library to my phone, because it’s huge, and about half of it is just stuff that was either of merely passing interest, or really no interest at all. So, I decided to create a folder I called “Core music,” that would contain the other half of my music library—all the stuff I might actually want to listen to. However, I didn’t want to make copies of 7 GB of music files, because that would be crazy.

My first thought was just to create a folder with symbolic links to the music I wanted to sync to my server (and thence to my phone). But that didn’t work at all. (That is, Syncthing just syncs the symbolic links, and since the music wasn’t on my server, on the server they didn’t point to anything.)

My second thought was to make hard links, but even though I’m a Unix nerd from way back, I initially started by trying to make hard links to the folders that had the music I cared about, because it has been years since I did this sort of thing. Of course that didn’t work at all. (You can’t hard link to a directory, for reasons.)

Finally, I created this little function:

function linkmusic { pax -rwl '$1' ~/Music/Core\ music; }

Then I could invoke it by cding into my iTunes Music folder (where the directories actually are) and then invoking the function for each folder I wanted in my “Core music” folder. (My natural inclination is to go to the folder where I want the music to end up, but then the pax command didn’t do what I wanted, because it wanted to copy the whole directory structure, but I just wanted to copy the directory structure starting at iTunes Music, so that’s where I wanted to be when I invoked my function.)

So, let’s hope that Steven is happy now that I’ve documented this.

A year and a half ago, my brother gave me a Raspberry Pi 3 as a birthday present, suggesting that I should use it to run my own server.

I used to run my own server. A friend who liked to build such things had built it. It had two ethernet ports, one connected to my cable modem and the other connected to my WiFi router, and it was running OpenBSD (then the most secure OS easily available) and was configured to serve as a firewall.

I used it as a server in other ways. I put an extra disk drive (40 GB!) in it where I could store files that I might want to access from elsewhere. (In particular, when I went to Clarion I copied my latest draft of my current story there each evening, in case of catastrophic computer failure.)

It didn’t require much upkeep, but it required more than none—which turned out to be more than I wanted to devote to it. At some point a serious security flaw was discovered in the OpenBSD release I was running. By then most desktop machines had built-in firewalls as did most routers, and I had Time Machine as a backup solution. It seemed safe to give up my server, and easier than updating it.

In the years since then, the use of cloud services has become ubiquitous, to the point that practically everything I do ends up in the cloud—my photos go to both Flickr and Google. I also use Dropbox (where I have Scrivener stash a backup copy of everything I’m writing) and I stash some amount of my music at both Google and at Amazon.

That’s all great—those services are well backed-up, and the servers are very likely running the latest security patches—but I really like the idea of having my own data on my own machines. But I want that without giving up the advantages of having my data in the cloud. Hence wanting to have my own server.

All that as prequel to my brother coming to visit this past week, and helping me get my Raspberry Pi server up and running.

Once the basic install of Raspbian was up and running, I went ahead and ordered a bit of hardware for it. I got a short ethernet cable to connect it to my router, so that it doesn’t have to do WiFi for basic connectivity (although WiFi and Bluetooth are built in). I also got a slightly more powerful USB power supply for it, mainly because I also got a portable USB hard drive that takes its power from the USB port, meaning that the power needs to be available to the Raspberry Pi. Finally, I got a case for it, so that I don’t just have a naked circuit board sitting on my dresser.

This time the hard drive is 1 TB rather than 40 GB.

For cloud functionality I’m following my brother’s example and running syncthing, which has the advantage of being able to handle being behind a NAT and not having a port exposed to the outside world. I’m running it on my Android phone as well and sharing my photos with a third place: my server. The server then shares them with my desktop machine, so they’re available to use. (That’s how I got the photo above: Taken with the phone and then transferred to the desktop within about a minute.)

I’m still sorting out my sharing strategy. I don’t want to share my whole Music folder with my phone, because it would use all the space there. (I’ll probably end up making a folder with an “essential subset” of my music to share with the phone.) I don’t think I want to share my whole Documents folder on my desktop machine, but I’m not sure yet. For the time being I’m sharing a folder I call “Active writing” with the files I’m currently working on, on the desktop, the server, and my laptop. That way they’ll be available wherever I want to work on them.

Other things are tougher. I’d like to have my own calendar server, but that doesn’t seem easy. I should go back to my post on the google-free option and see what else I was thinking about that I might now be able to implement.

For now, though, I’m pretty happy.

My previous server was rack mount width and maybe four or five inches tall, about the size of a stereo component. This one is maybe 3 inches by 5 inches, rather smaller than the hard drive it’s sitting on.