Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Tue, 25 Jun 2019

Unison works between Ubuntu and NearlyFreeSpeech.net's FreeBSD, so blog migration is a go

As long as I've been using Unison, I've been running version 2.40 because that's the newest package I can get for CentOS 6, which is the Linux system that my current shared host runs.

The first thing you learn about using Unison to synchronize files on a server and a number of desktops, is that Unison likes to see the same version on both sides of the "transaction." If you have different versions of Unison, or even the same version compiled with a different version of Ocaml, it's probably not going to work.

I haven't even figured out how to sync from Windows to Linux with the same Unison version on both sides. It probably has something to do with Unix file permissions vs. Windows file permissions.

But from Linux to Linux, you need the same Unison, compiled with the same Ocaml, on both sides. Even in Fedora 30, the project doesn't package "newer" than Unison 2.40, so that's what I run locally.

See if you can wrap your head around this: Forward-thinking Fedora packages Unison 2.40, but Debian and Ubuntu have been packaging 2.48. And the current "stable" version of Unison is 2.51, which seemingly nobody packages anywhere.

But NearlyFreeSpeech.net offers Unison 2.51, which the admins likely built from ports for their FreeBSD infrastructure. Even OpenBSD offers Unison 2.51, and you can get it with a binary package.

Let me tl;dr this: I downloaded the source for Unison 2.51, untarred it in my Windows 10 WSL (which is running Ubuntu 16.04), used apt to install Ocaml, untarred the Unison sources and used make UISTYLE=text to compile it. Then I had to make a .prf configuration file for the new site (building off my old .prf) and play around until I got it right. It worked, and now that I can successfully use Unison to sync between the Ubuntu 16.04 WSL in Windows and NFSN's FreeBSD system, I am free to move my Ode sites over there.

Why do I use Unison? Ode's has an extension that allows the server to put its own timestamps on post files after they are uploaded, so if I only pushed one way, say using rsync, the local files wouldn't have the timestamps that are on the server versions. Unison checks in both directions for file changes and reconciles them. Git is another way to do this, and it's something I might explore in the future, though I'm more interested in syncing the two filesystems than I am in version control, and that's why I decided to use Unison in the first place.

I'm thinking of giving up on /blog: I originally set up this blog with a /blog subdirectory because I couldn't figure out how to make the /cgi-bin/ode.cgi part of the URL "disappear" via Apache's .htaccess any other way. Since then, I have figured out how to do that, and I might either dedicate http://stevenrosenberg.net to this blog, or more likely put it on a subdomain like blog.stevenrosenberg.net. That MIGHT mean breaking the Disqus comments, but I could probably save them. Even so, I've been thinking about giving up on outside-hosted comments and instead creating links to Reddit to allow for discussion of entries on this blog.

Changing the URL could break all the old links. I could set up redirects in the Apache configuration, or I could just let it go. Or I might keep the old URL along with /blog.