OK this is a bit of a hack. But lets say you want to be editing files in a directory. Each time you write one, you want it synced into some container. This is obviously for development purposes. Well I present the below hacklet. It uses the inotifycall of Linux, watching the current directory. Each time a file is written, in my example, it calls docker cp. Feel free to make that kubectl cp or another action.

Warranty void where prohibited.

inotifywait -m $PWD -e modify | while read path action file
do 
  echo sync $file
  docker cp $file CONTAINER:PATH/
done

 

Recently I was looking to add OAuth2 login to my wordpress system.

Side note: when you see an icon 'sign-in with Google/Github/...' on a site, please use that, rather than creating a new account. The protocol is called 'OAuth2'. Its not (usually) giving that new site permission to read your gmail, rather its allowing you to federate and use less logins.

Back to the story. I was looking to add OAuth2 to my wordpress. I wanted to handle a few different logins (Google, Github, Linkedin being the minimum). This is not overly complex, I was not expecting trouble. A couple of hours later of looking at a bewildering array of plugins, all of which had 2 or more of these properties:

  • Some freemium approach where the part you wanted is not available, the yearly cost is high, and its not obvious they will stay in business
  • There is a SaaS component you are delegating to that now owns your site
  • Has not been updated in 4 years

Sigh. So I picked one (miniOrange). It worked, I was ready to hit the buy now on $400/yr, when suddenly, the removed it from the wordpress marketplace. No reason given. This one used a SaaS component so I was instantly broken.

Enraged, I wrote the attached, on Github. Its certainly not great. Its not even good. But it works, I've made it free (as in speech, also as in beer). It uses only your site, no 3rd party site is involved in the OAuth2 dance with your credentials. And, more importantly, I can now improve it. And so can you, pull requests welcome.

 

I wrote just a couple of days ago about the excitement of removing the snow tires. The strategy and gamble of "will it snow again". I present to you might front yard this am. Very snowy 🙂

Its going to be a slippery ride in to work without my studded tires.

Murphy, you great trickster you!

Every year in mid march people start to get antsy. There's still some snow, but its nearing spring, maybe I should swap my snow tires out.

For those unfortunate enough to live where they don't understand the concept of snow tires, its simple. When the ground is cold, rubber is harder, and gets less traction. So tires are made with a super-soft compound and marketed as 'snow', 'ice', 'snow and ice' etc. But the upshot is they are softer at lower temperatures, thus getting better traction.

However, these super-soft gumball tires also don't have a long life. So you want to coax another year out of them by removing them as soon as feasible, and take the chance on 'one last big snowfall'.

Yesterday I swapped the snow tires off the bike. You may recall they were metal-spiked as well as being soft-compound and very wide. I gotta say, they were fantastic, I'm not sure I would be alive today if it were not for those tires. But, progress, its spring, its time to remove.

Its very weird driving now with nearly 1" less width and a whole lot less noise. Its not that the summer tires are quiet per se, but compared to the metal spiked monsters they are silent!

How about you, done the great swap yet?

Many years ago there was a great short story "the midas plague". You can actually read it online at that link.

In a nutshell, advances in productivity and energy and automation meant that more and more things were getting created, and people had less and less hours to work. The economy started to struggle. So the poorer people were forced to work harder to consume. If you were rich you could have a small amount of things, if you were poor you needed a lot. People had to keep feeding the machine as it went into production/consumerism overdrive. Its a classic 50's sci-fi, totally worth the time to read.

It strikes me that today we are heading down the same path. Not just on the physical production side (GM makes more cars than ever, but employs way less people), but also on the information side.

How many of you have seen or read some content that seemed suspiciously machine-generated click-baitey? Those youtube videos that are a script read by a machine? A breathless title ending in a question mark leads to an article that is a bit... um... lacking.

That is all machine-generated content, designed to vacuum up advertising dollars.

But wait, machines are also now indexing and learning. The Google engine is crawling all of this, as are untold millions of other bots and things.

So we literally have machines creating, and consuming content. Soon only the poor people will read Facebook threads, if you are wealthy enough you can turn the internet off for a bit.