Proofing as a Service?

Here’s a real thing I’d enjoying doing for money: Proofreading & ”proofcoding” JS framework tutorials. Maybe even on a subscription basis; every 3 months I’ll rework your tutorial from scratch and see what breaks.

Bonus: An excuse to learn All The Things.

CV: 10 yrs executive & legislative lawyering (reading/writing/editing/critical analysis/critical communication), 3 years self-taught JS via dozens of half-broken tutorials trailed by years’ worth of comments.

(This post brought to you by a graphQL & Authentication tutorial that I don’t want to name-and-shame.)

Plex on Pop_OS with external USB files

[UPDATE, LATER: This all fell apart. I need a dedicated linux box, not a triple-boot Mac from 8 years ago.]

It’s about file permissions, yeah, but the thing that eluded me for a few hours until I hit on this post, was that it’s also about mount points and security rules.

You gotta get the UUID of your ”plex files” partition(s) and edit /etc/fstab to have your system mount it/them somewhere other than the default.

I think the example the Plex employee uses in his walkthrough is unfortunate because on my Pop_OS drive /media is already used by the system. I created a new folder at the root level called /plexmedia, chmodded it to 755, and listed it as the mount point for a partition on my external USB drive. When the system rebooted, suddenly the Plex server could see all my subfolders. Hooray.

NOTE: Before figuring this out, I had already tried the following; now I don’t know if they were unnecessary fiddling or if they were also a needed part of the solution:

(1) The drive and media files were originally part of a Mac setup. The drive was formatted HFS+, journalled. I took the drive back to a Mac and turned off journalling using diskutil.

(2) Once I’d done (1) I could mount the drive in Linux in a write-able fashion, and chowned the entire thing to user plex and group root. (As a read-only volume they had been showing up as ”503: root” where 503 is the ID of my everyday Mac user. I read some tricky posts about creating a Linux user with a matching ID and ”stealing” those ”orphan” files, but I’m glad I didn’t go down that route because the security/default-mount thing would still have been in the way… [I do think this mattered, because once I discovered the Plex post linked above, I didn’t need to do the 755/644 stuff; it just worked.]

Mastodon, et al, via Nextcloud

Reading my ‘random stuff’ newsfeed and someone mentioned being able to use Mastodon because of their Nextcloud account. I didn’t understand that until digging into the NC “app store.”

Oh, hey.

So I installed the alpha and we’re giving it a try. Apparently I’m

(This feels like it is sure to die on the vine but oh well. Was only an investment of a few minutes.)

Share with me via Nextcloud

CSS layout and React.Fragment

Still banging on this dumb dashboard project. I wrapped a bunch of rectangles with a parent grid-container, but I was getting one rectangle too many. Oh hey, the box that should have a YouTube embed and a list of links underneath… uh.. doesn’t. The “playlist” is showing up as its own rectangle – a sibling div to the YT player. They’re imported from a single component though!

(Opens that component file.)

Ooh, right. Instead of wrapping the player and the playlist in an otherwise-meaningless div, I wrapped them with React’s Fragment thing-o. The fragment ‘disappears’ in the layout so the two divs inside it get treated as siblings by the grid.

Obvious, now, but a funny little thing I hadn’t noticed before.

Apache rewrite

more Apache stuff… need a /callback route in a node-based PWA (edit: SPA, maybe. Is it still a “single-page app” if you need a second route for auth?) to “pass through” the Apache server; rewrite rule took me a while to figure out, and it still requires the trailing slash, which is fragile. Not sure this is best, but it works.

<Directory /var/www/dashboard/build >
    Options Indexes FollowSymLinks MultiViews
    AllowOverride none
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} callback(.+)
    RewriteRule ^ $1 [L]

And after making my edit above, re: SPAs, it occurs to me I could’ve maybe routed it without a truly separate /callback path… it could just provide a querystring at the end of the bare domain… hm.

Icecast on linode

tl;dr …I’m going to regret not taking notes.

I can’t justify the cost of Rogue Amoeba’s audio tools, but I wanted to get back into streaming music to myself over the web — when I was a Windows user, Shoutcast was a fun thing to install. In the morning I’d set musicMonkey (or whatever) playing mp3s into Shoutcast, which would then serve it up online. Poke a hole in my home cable-modem and I could listen at my desk @ work.

Dumb, totally superseded by the iPod, but still fun.

When I switched to Macs, it wasn’t as easy, but R.A.’s Nicecast could do the trick — it just needed to be rebooted every hour (they’re willing to let you use their apps for free, without feature-locks, but all their apps have time-limits or other clever tricks to encourage you to buy in. I would, if money were no object!) iTunes into Nicecast, same hole poked in the home modem/router combo… done. (At one point I had a USB TV-tuner thingie running on the network, and I vaguely recall going for a long walk one Saturday and using my Blackberry Curve to listen to the audio of CBS college football, being piped from USB dingus to Nicecast to Blackberry. I don’t remember how I overcame the restart thing. Maybe I got T to do it?)

Aaaaaanyway there are open source solutions and they are finicky of course, but I got them working today. I put an app called butt (“broadcast using this tool”) on the iMac and started Tunes. Butt couldn’t see the audio outputs on my new Macbook (a known problem); fortunately the iMac had an old R.A. freebie called Soundflower already installed, and butt could see Soundflower. (Title.)

so that’s music into a broadcaster. where to broadcast to? I started by breaking out an old Raspberry Pi. I knew Icecast was the open source version of Shoutcast, so I checked the repos and pulled down Icecast. Figured out where the config was and got it started. After some minor network hiccups, the whole thing was working. Fun.

But I didn’t want to have it running locally; poking a firewall hole in the Eero network dealies is do-able, but c’mon. That can’t be safe. I want to have an Icecast instance in the klôüd… So I got into my Linode box and yum install icecasted. “This will be easy.”

This was not easy.

I spent too much time messing with Apache, trying to get it to bind to a port that was the same port Icecast wanted to operate on. This was dumb. At the end of the day, I

  • got the music server on one port and told both semanage and firewalld to make way for that port (necessary, because the simple broadcasting software on the iMac (butt) couldn’t deal with server-redirect responses Apache was giving it when I tried it the other way — butt needed an IP address and a port, not a human-readable URL)
  • wrote an Apache config file to make a VirtualHost for one port over, and wrote a couple of ProxyPass lines to go from the one port to the other. (IOW, you go to a human URL, the DNS server turns that into numbers, and the Apache config redirects the numbers from port N to port N+1, where Icecast is running on port N+1 and if you figure out the IP address of my domain you can go to port N+1 like a nerd, or port N like a gentleman)
  • listened to my ‘fours and fives’ playlist over the internet for a while.

There was also a whole roundabout getting the domain sorted, but that was just general dummyosity, nothing worth writing down. (You might’ve moved your site’s nameservers to Netlify even though you bought the domain at Hover. I feel like I’ve even noted that here, before.)

N.B.: This solution still stinks, even though it works, because (a) I have to redirect the audio of my iMac to Soundflower, which means remembering to turn off Apple notifications so that messages and calendar and reminder dings don’t play, and (b) the ‘Now Playing’ metadata doesn’t get routed to butt this way. Soundflower just flows raw audio in; no artist/album/etc. A paid solution would just pop all of that out of iTunes or Spotify and feed it to the cloud server along with the audio.

Anyway is sometimes live. I’m not expecting traffic.

CSS grid-gap “trick”

was futzing with a container div full of grid-template-areas. I wanted to get the child divs off the far edges in an amount equal to the “grid-gap” properties I’d set. You can do that with padding on the container but out of curiosity I tried this and it worked just as well:

  grid-template-columns: 0px 300px 1fr 300px 0px;

Grid-gap doesn’t “do” the outer edges, just inners, but a column of no-width will still generate the gaps. Shmeazy.

(Quick search of Stack Overflow suggests this is sometimes answered with “add padding on container” but that sometimes makes other messes. I also see people using grid without area-names, and this would only work in that case if you added useless html to account for the 0-width content. Not an issue with my named areas.)

Login problems with Office 365 on Mac OS X

Don’t know if anyone will ever find this but I’m compelled to document it, since it cost me a solid half-hour+.

From the Template screen when you first open Word or Excel (or other?), if you click Sign In and the dialog box opens and there’s a different email pre-populated (because your spouse also uses it, or whatever)… and you use the same email provider (because you both use gmail or or whatever)… WIPE OUT THE WHOLE FORM and type in your email address.

I, being, was replacing ONLY the 999 in the pre-populated email address, and couldn’t log in.

Web searches gave only the obvious advice (restart, reinstall, burn your house down and walk into the ocean). So I reinstalled 9 gigs of Office 365… and it kept happening. (Deleting and reinstalling didn’t wipe out whatever little .plist or whatever had memorized the part).

Brain flash: Do I delete the whole email address in the window? Is it that dumb? I mean… that’s the kind of mistake I’d make, in a React setState screwup.

Blammo, it worked.