Category Archives: Tech

Webdev Tip: ALWAYS Put the Record ID *in* the Edit Form

I started out this morning happy with my web host. They’d sent me an alert about disk usage that allowed me to catch an error that would have filled up all the available space on my VPS and taken down this site and several others, and I was able to fix it before that happened. That changed as I discovered what had actually set it up, as revealed by another, more pressing issue.

Background

A few months ago, my VPS did lock up, because I’d set up backups on a new site and forgot to add a cleanup script. Tech support brought the server back online, I cleared out the backups, and I copied the script over from this site.

But this site’s cleanup script stopped running, and it reached 90% usage. The script was there, but the cron job was somehow pointing to the other script. I figured I must have messed it up at the time, made sure it was correct now, and moved on.

Discovery

Later this afternoon, though, I discovered that a test blog I set up last week was pointing to the wrong site. That seemed really weird. I looked in the control panel and it was very neatly pointing to the other site’s folder. How does that happen?

Then I remembered: A few days ago, I’d reconfigured several sites to upgrade them to PHP 7.2. I’d opened them in multiple tabs to I could get them all at once. And I had this sinking feeling.

Sure enough: DreamHost’s control panel doesn’t put the form state in the page. As far as I can tell, the ID of the record you’re editing is stored in the session somewhere, which is fine if you only ever have one page open at a time, but if you open two pages, it gets confused.

That’s what probably happened a few days ago: I opened two forms, saved them both, and the settings for one site got written to the other. And it’s probably what happened a few months back with the cron jobs: I opened one to edit, the other for reference, and it overwrote the wrong one.

As near as I can tell it’s just the one site that got messed up, which is a relief. Even better that it’s the test site and not, say, this one. But I’m still waiting for the fixed config change to take effect.

Lesson

Always, always put the record ID for an edit form in the form. People will open multiple records in different tabs or windows, to compare them or just to speed up their workflow.

If you store it in session, or in a cookie, or anywhere else, you run a good chance of saving the data into the wrong record.

Delicious Irony

While looking up importers that I could use to move various third-party archives into something self-hosted, I found an add-on to pull Facebook posts into Keyring Social Importers, an extensible WordPress plugin. At the top of the list of built-in services: Delicious.

“Hey, I used to have a ton of stuff on Del.icio.us! I don’t know what percent of the links still work, but I should at least export it!”

delicious.com is gone, but I remembered they moved back to del.icio.us at some point, so I went there, and found…

The delicious site is temporarily offline while we move servers. We'll be back!  Your bookmarks are safe and sound. The site should be available again on Monday, July 24.

Yeah, so I guess that’s not gonna happen. It turns out I exported my bookmarks in 2016 (into one big HTML file), which is probably as current as it needs to be.

The maintenance page mentioned Pinboard, so I looked up some articles. Apparently Pinboard bought Delicious in June 2017 and put it into read-only mode. I know I was able to look up bookmarks on Del.icio.us as recently as January, so it’s at least this July they’re talking about, but I’m guessing the server migration probably failed and it never came back.

The Fanfic Connection

In an interesting twist, I discovered that there’s a fanfic-related history in the past rivalry between Del.icio.us and Pinboard.

TL;DR: Delicious was once extensively used to categorize fic on LiveJournal, but an overhaul left it unsuitable. (Among other things, “/” became an unsearchable character, making it impossible to search for pairings.) There was a mass exodus of fanfic writers and readers, many of whom ended up at Pinboard…and Pinboard’s owner put in extra effort to address their needs.

Forgotten Smart Watch

Two years ago I bought a Pebble smart watch. For the first week or two I wore it constantly, to get the sleep tracking data. That was cool, but not cool enough to keep it up, and it was uncomfortable to sleep with, so I started taking it off at night.

I kept putting it on every morning for maybe eight months, using it for step and heart rate tracking, alerts, music control, and of course time. Plus the kid loved using the app to change the appearance of the watch face. People had come up with some really whimsical designs!

The watch kept working after the company went under. Fitbit bought what was left and agreed to keep the cloud services up for a year or so, and they updated the firmware and phone app to reduce the watch’s dependency on those services when they finally shut them down.

After a while, though, I got out of the habit of putting the watch on in the morning. I misplaced the Pebble, found it again, wore it for a few days, and forgot it again. Repeat.

What Do I Miss?

I do miss having the time available at a glance, but I can dig out a plain watch for that. The calendar reminders were helpful too. But I don’t miss having other alerts on my wrist, even after paring them down to the essentials, and the fitness tracking was really only a curiosity for me. Then outside of its core functionality, it was too clunky to use for, say, to-do lists or games.

Only a narrow range of the watch’s capabilities really appealed to me, and it turns out they weren’t enough to keep me using it.

Repurposed

Every once in a while, the kiddo would ask about the Pebble. I finally found it again and charged it, and decided to pair it with an old phone and give it to him instead of wearing it myself. He’s been wearing it 24/7 for a week now.

It’s basically a watch and fitness tracker only right now. Fitbit shut down the Pebble services over the summer, and I haven’t been able to get it working with Rebble (the volunteer group that’s put together a replacement server), so the marketplace with apps and watch faces aren’t available. And I only put limited apps on that phone, so there’s not much in the way of alerts. But he likes the step/heartrate tracking, and having a buzzing alarm that he can set.

Though he’s somehow learned to sleep through the tactile version of “Reveille” already! 🤦‍♂️

How I Use(d) Google+

With yesterday’s news that Google+ is shutting down next August, I found myself looking again at my exported archive from the network. This time I was less interested in the format (which has changed since January – you can export as JSON instead of HTML if you choose, and it includes media now), and more interested in what I had posted there over the years.

Early on I used Google+ a lot like Twitter: short statuses and link sharing, most of them short enough they could have been cross-posts.

After that early period I still mostly posted short items, but not as short. More like Facebook, really. I checked a few and found some tailored cross-posts, where I’d cram something into 140 characters for Twitter, then restore the missing words and abbreviations for Google+.

I tried using it as a blog. I did a few longer text posts and some photos, and a handful of galleries: A partial solar eclipse, Endeavour’s stop on the way to the museum. I contributed to a shared photo gallery from SDCC, and I’d share the occasional post from someone I followed.

Somewhere in there I’d figured out what felt like Google+ instead of what felt like Twitter or Facebook.

But most of my friends went back to Facebook, and the few people and sites I was still following on Google+ were also available elsewhere. So I stopped visiting, and I stopped posting.

From around 2015 on, it’s mostly auto-posts from my blog and the occasional picture that Google Photos’ auto-stylize feature actually made look interesting.

Ironically, I got my first +1 in ages on yesterday’s here’s-where-you-can-find-me post!

Cross-Posting and the Fediverse

Over the last few months I’ve been cross-posting a lot less between Mastodon and Twitter.

When I first started on Mastodon last fall, I’d sometimes post to both networks. I’d reformat things slightly if I needed to fit a pair of 280-character tweets and a single 500-character toot. (I’ve long thought that if something takes more than two posts to say on a platform, that’s not the right platform for it.) I’d often linkblog to Twitter, Mastodon and Facebook all at once.

But as I’ve shifted more toward Mastodon being my main social network, and Twitter being where I go in a private window to see what people are saying about politics, retweet a few items, and then leave, I’ve been posting completely different things to each site. These days, cross-posts between the two are almost non-existent.

So What am I Still Cross-Posting?

  • Photos across Instagram, Pixelfed and Mastodon, depending on the type of photo.
  • Occasional photos or text posts to my blog, if I decide they’re significant enough to keep findable or if they fit with a recurring topic.

Plus I’m automatically pushing links to Twitter (and sometimes Tumblr) from:

  • Flickr albums.
  • Blog posts.
  • Instagram photos.
  • Randomly-chosen “flashbacks” from my blog a couple of times a week.

I realized: When I’m not using it actively, Twitter has basically become a dumping ground for me to link to what I do elsewhere on the net.

I don’t think that would fly in the Fediverse. At least not on Mastodon. Maybe if the auto-posts were all unlisted, or on a secondary account.

ActivityPub: Boosting Instead

As the Fediverse grows to encompass more types of networks, we’ll be able to boost instead of cross-posting. Right now I can post this article on a Plume instance and boost it to Mastodon, bringing it into the world of short status updates. In the very near future, I’ll be able to do the same with a photo on Pixelfed. (I sort of can now, but replies and follows don’t work yet.)

Both networks can interact directly with the original post. It’s not an isolated duplicate. And while it’ll display as a link on Mastodon, the network will funnel actions back to Plume. Someone who sees it on Mastodon can reply there, and the conversation will appear both on their Mastodon timeline and the comment thread on the originalpost. And I think that’s awesome.

Originally posted on Fediverse.Blog., and cross-posted the old-fashioned way. You can follow my main Mastodon account,@KelsonV@Wandering.Shop.