Oops! Something went sideways.

Looks like the styling got goofed up. Sorry about that, unless it's what you wanted. If this isn't what you were looking for, try force refreshing your page. You can do that by pressing Shift + F5, or holding Shift and clicking on the "reload" icon. (It's the weird circle arrow thing "⟳" just above this page, usually next to where it says https://blog.unitedheroes.net...)

isn't quite ashamed enough to present

jr conlin's ink stained banana

:: Web Pushless

Hi!

i’m one of the nice people that brought you WebPush. That lovely tech that is probably one of the most user hated things to roll out. i work on the back-end bits. i still hold that in spite of idiot web marketing folk who don’t want us to have nice things, web push is still really useful, but that’s not important right now.

What i want to talk about today is something i’ve been asked a good deal lately:

“How do i provide push notifications on mobile devices if i can’t use device native Push?”

Ok, that probably sounds like a really weird question, but let me explain a few things.

How Push works:

i’m not going to go into super detail here, but suffice to say that Web Push provides a way for servers you’re not connected to currently to send you messages that you’ve agreed to having delivered. It’s super easy for you to send messages to servers since they don’t move around and change their IP address every 15 minutes. Your phone may well do that. So what we do internally is have your phone connect to one of a bunch of servers we run, then it sits around waiting for you to send a message. For things like laptops or desktops which have big batteries or are always plugged in, that’s a great solution. For phones, however things are a bit different.

How Push works on Mobile Devices:


i do believe that Donald does not approve of your battery usage.

Your phone doesn’t want to be on. It wants to power down as much as possible so that your battery doesn’t die after an hour or so. It has LOTS of VERY AGGRESSIVE power management things it does in order to facilitate that. It will also flag any app that consumes “too much” battery and point at it like Donald Sutherland in Invasion of the Body Snatchers. Naturally, since having a reliable connection from your devices maker’s servers to your device is actually really useful, they’re very forgiving about any that they might set up. In fairness, they have a lot of neat tricks they can pull at very low levels to keep your CPU asleep and the battery usage minimal that they’re absolutely not going to let your J. Random Application take advantage of.

So instead they offer a way for you to piggyback on top of their protocols. That’s what Firefox on Android (and to some extent Firefox on iOS and Amazon FireTV) does. The data we send over these bridges is still encrypted because the decryption key is in the User Agent (the actual “Firefox” application).

The problem is, running machines that your device connect to for long periods is kind of expensive. As in people in the Accounts Payable department screaming “WHY DOES THIS BILL HAVE SO MANY ZEROES!?” sort of expensive. There are things you can do to control costs, but frankly, when you’re talking about hundreds of millions of phones calling in, you’re talking about having at least a few good boxes just to handle the loads. It’s kinda depressing how much doing nothing costs, particularly in setting up a secure link that does nothing, but that’s our problem more than yours. (Although, next time you want to buy something, if you were to search for it in the AwesomeBar, click on one of the ads and buy it from there, that’d be swell!)

That’s one of the reasons that Google put their messaging system under Google Play. It’s an app that only gets installed on authorized Google Android devices, and (surprise) it costs money to do that. You can absolutely grab a copy of the Android Open Source, customize it to fit your phone’s hardware platform and get rolling. You might even be able to sideload some versions of Google Play onto those devices, but Android is the most used phone platforms on the planet and even Google has pipers to pay.

So, how do you do Push if Push isn’t there?

Thus we come to the (potentially) million dollar question.

So, if you’ve got an off-brand Android phone, it’s probably using the Open Source release of Android, which does not have Google Play. Honestly, it probably doesn’t have a lot of services. So what options are there?

  1. Polling: This is probably the easiest. When your app is active (or if you set up a timer) you could have it poll a well known server address and check to see if there are any messages. You want to be careful with this, to avoid “thundering herds” where all the devices suddenly check at once and swamp your servers. You can randomize things a bit, but i’ve also seen some devices that “helpfully” round sleep timers to a nearest interval (e.g. you thought you said sleep for 5 minutes? Oh, well, we slept for 15 since that means less CPU.) Some experimentation and monitoring your servers may be required.

    Pro: here is that it’s fairly straightforward and simple to do.
    Con: it’s not exactly “timely”. Good for “Remember John’s Birthday tomorrow” less for “your tea kettle is boiling”.

  2. Active Reception: This one is a bit trickier. Basically, when your app is active, it connects to your servers using WebSocket, HTTP/2 or whatever protocol and actively pulls and listens for messages. This can provide much faster message deliveries while the user is present and attentive.

    Pro: Quick message delivery with feedback.
    Con: Could be complex and doesn’t work when the device is sleeping.

  3. Combo: This one combines the two above steps. You have a small stub program that checks a URL to see if there are any messages pending, and if so, spins up your app to do a full connection. The connection processes everything, then lets the device go back to sleep.

    Pro: Almost exactly like Push, sort of.
    Con: Complex, and probably buggy. Dances the line between “efficient” and “here come the howler monkeys”

Sadly, i believe that any of these would probably constitute a “savvy business opportunity” for some startup, and while i’ve not looks, i would not be surprised in the least if there was a company out there that was offering a service like one of these. i don’t think it would be free though, mostly because of the costs associated with it.

:: Chaos and Kindness

There are two completely different events that have happened in the last week that i need to think about. i tend to find that i think most when i am on a keyboard, so yay you ineffable void and ad bot now reading this, you get more words!

1) Mozilla’s Layoffs.
social media love
The company i work for announced layoffs for about 70 out of 1000 employees. The folks were chosen by project and role, that part is normal. What’s not normal was something i don’t think i’ve ever seen another company do. The employees were not treated like modern lepers and tossed out the door.

Instead, they were told that they were going to be laid off, but still had access to most of the things they needed. This included company mail, internal Slack channels, resources, etc. Folks inside the company rallied to support them. Spreadsheets were created that had employee info and prospective or recommended hires from folks networks. Social Media networks hosted “#MozillaLifeboat” to help get folks on their feet fast, and many very positive words were said in praise of those who were let go.

The folks who we let go were treated like humans. There was an all hands meeting held a couple of days after the layoffs occurred. The folks laid off were encouraged to attend, ask really hard questions, and were given good answers.

Ask yourself, “Would your company have done that? Could they have done that?”

Granted, mozilla works pretty hard on not hiring sociopaths and jerks, so it’s just not really the culture to be terrible to each other. Still, i’ve been through five rounds of layoffs, and had never seen that level of trust.

As remarkably smooth that incredibly disruptive and painful experience was, it did absolutely drive home a point i’ve been thinking for years: You need to be most loyal to the friends and colleagues you meet in your career than to anywhere you happen to work. Any employer that demands faithfulness solely to them is a huge risk to your professional and personal life. Your friends are who will help you, your employer is not. If you work for somewhere you can’t get that, it’s a HUGE red flag. The money might be good, but the risk is tremendous. i can say with first hand knowledge that getting paid well at a place that doesn’t respect you as a person eats at you in subtle ways.

A side product is that you remember that you’re dealing with people, and as such, folks are making it up as they go. Folks want you to believe that there’s a plan and direction, but quite often, there’s not. More often than not, there’s just a rough guess and a general feeling dressed up in powerpoint slides and bold rhetoric. Again, unless you’ve got sociopaths at the helm, layoffs hurt the folks making the decisions about who stays and who goes. Even if they are sociopaths, the company is giving up the money invested in the person and whatever income that person could have brought in.

(Oh, and if you’re ever working somewhere and see absolutely no sign of remorse or regret when an executive talks about layoffs, leave. i’m talking about actual regret, not “Sorry to see those folks go :sad face emoji: it’s terrible. Anyway, who else here is excited to see the Project Foo we’re launching!? [loud, upbeat techno music]”. Yeah, after that, spend the rest of the day polishing up the resume and sending notes to your network about potential leads.)

2) Actix drama

i’ll preface to say that i don’t know all the details about the drama around actix-web. As i understand, there were some concerns around coding practices, a single maintainer, and some folks who may have been jerks. Coding practice discussions are part of any open source projects, single maintainers are concerning for anything other than a small package that’s just starting, and half of the world are jerks.

What happened was that the project maintainer pulled the library code off of github and announced he was done with open source. Honestly, that’s good, because i believe he didn’t know what open source really was.

Let me diverge a bit here.

Open source is about trust.

When you decide to use a package, you are extending trust that:

  • The program/library/package works.
  • It will continue to do so.

Bug fixes, improvements, documentation, etc are also part of that, but kinda fit into the list above. Open source can sometimes be called “Free as in puppy” in that you might be getting into a lot more than you expected.

It’s very rare that the trust is broken. There are ways for a package maintainer to step away from a given package. They could ask a larger group to take over. They could pass it on to someone else. They could “archive” the package and let someone else fork it into a new version. Almost never does anyone just yank their code down in the same way that you almost never see an argument end with someone throwing a temper tantrum. It’s sad because while the author may have been a talented engineer, i can no longer trust anything that they produce.

Would things have been different if folks were not jerks? Probably. Likewise, i think folks were presuming a level of emotional maturity that may not have been present. i don’t fault the author for his actions, even though i’m deeply impacted by them. i’ll survive, reassess and move on. i’m saddened by them, but i look forward to the growth that i hope he gets to experience.

So, how do these things both relate?

In essence, it’s about people. It’s about remembering that at the end of the day, we’re all real, breathing, mentally weird beings and not just clever bags of thinking meat. Sure, there are some openly hostile folk out there, and there are trolls, dirtbags, grifters, and fools, but those tend to be the painful exceptions, rather than the rules.

As Michelle McNamara often said, “It’s chaos, be kind“.

:: A Few Thoughts about the Star Wars

Ok, let me get a few things out there.

1) i have not seen the final Star Wars movie yet. From the sounds of things, i’m tempted not to, but i’ll probably watch it on some streaming service eventually.

2) i find the various uber nerdy videos talking about the details of Star Wars hilarious, whether they intend it or not. Star Wars is about as far from hard science fiction as the Lord of the Rings. And i’m about to go off on one aspect of it just like those uber nerds.

3) i’ve been watching Star Wars since i sat in on the first one in a mostly empty theater on release day, when Han shot first and you could see the matts on the TIE fighter flybys.

Ok, so Star Wars is pretty much about one family. One really screwed up family, but one family, the Skywalkers. Since The Force is a thing in this universe, and has been for quite some time, it’s reasonably safe to presume that there was at least one other family out there. Otherwise with the various alternate species that are also Jedi or Sith, someone back when got James T. Kirk freaky.

As i understand the last movie’s major plot point (oh, yeah, spoilers, i guess) one of the main characters turns out to be from one of those companion families of Force folk.

We learn in the early movies that being able to lift spaceships out of swamps or become a walking bug zapper is a hereditary trait. It’s a biological component called midiclorians or something. That’s kind of the equivalent of living in a world where folks with red hair can fly (not dye jobs either, gotta be born a proper ginger).

That’s awesome and all, except that during that same time, a couple of the big time Forcey folk decided that all the lesser Forcey folk should instead focus on Forcing daisies up out of the ground. The whole “Special Order 66” or 69, or 72 with chicken, or whatever. So, we’re talking a pretty successful level of genocide against a bunch of Force users/sensitives/etc. Pretty darn horrific, if you ask me, but hey, they’re space Nazis, so genocide is kind of their thing.

What’s more, with the death of all the other Jedi/Sith over the arc of eight movies, essentially you’ve just reduced the pool of high power folk chock full of midiwhatevers to a breeding pool of two.

Now, just think about what that means if you actually pay attention to things like biology. There are not a whole lot of populations that survive from just two individuals. Hell, a species is considered “endangered” at below a population of one thousand.

So, what does this mean for the future?

Get ready for a few generations of Space Wizard Inbreds. Yep, Bill-Bob-Skywalker using the force to play banjo on some porch on Degobah thinking that sarlac’s sure got a pretty mouth. And yeah, you thought Luke and Leia kissing was creepy, just wait ’til you start thinking about how the Jedi/Sith repopulate.

Oh, yeah, and don’t forget that they can wield superhuman powers.

Thank God they’re in a galaxy far, far away. i don’t want them doing donuts in a rebuilt X Wing (with mud flaps) while orbiting Uranus.

:: Raspberry Pi, PCA9685, and YOU!

i made a creepy eyeball pumpkin over the weekend. There are lots of how-tos for these sorts of things, so i’m not going to do that. Instead i’m going to offer some lessons-learned.




First, off, i’m a software guy. This is the first time i ever played around with servo motors.

So, let’s start off at the top, shall we?

Aside from the raspberry pi, you’ll need

  • A fake pumpkin big enough to get your hands into (yes, both hands)
  • A box cutter with a fresh blade, because otherwise it’s not going to cut right.
  • A PCA9685 servo controller board. Get the one from Adafruit. Yes, you’ll have to do soldering to add the pins. If you get one that’s already soldered, you’ll still need the Adafruit libraries and documentation, because they’re better than the ones that come with the pre-built boards.
  • 4 strand of Female to Female jumper wires. Really, you should have a bunch of these lying around if you’re going to do stuff with a Pi other than run Pi-Hole or HomeAssistant on it.
  • A hot glue gun and a surprising number of glue sticks
  • 2 bags of 10 full globe plastic eyeballs. Yes, the half eyeballs look better, but they stop looking better once they turn any angle. Yes, it’s more eyeballs than you need. You’re going to screw up a few.
  • About 10 inches of PVC pipe. You will need to bring a sample eyeball with you to make sure it fits inside the pipe.
  • A three AAA battery holder plus connector wire (optional, but since there’s, like, one electronics shop left in the San Jose area that even comes close to having it, it’s a good a reason as any to go to Excess Solutions, which has become the last one standing from Weirdstuff and HSC)
  • Nylon zip ties. (unless you’re planning on hot-gluing the motors to the pipe because you never want to use those motors for anything else ever again.)
  • A roll of 20 gauge bailing wire you bought back in the 80’s and forgot you had until now, but thank you past you for not pitching that.
  • A 1.25″ SpeedBor drill bit you got to add a drain to a sink years ago and also forgot you had but thankfully didn’t pitch or sell.
  • A dremel with one of those drum sander bits.
  • a breathing mask because it turns out that dremel’d off foam gets friggin’ EVERYWHERE.
  • Two cans of compressed air.
  • A shop vac with a reasonably clean filter.
  • A chop saw, rotary sander, laser level and drill press. Ok, like me, you probably don’t have that, and unlike some of the other crap on this list, you’re not going to get those either. So, instead build a bunch of crappy rigs to try and keep a hacksaw straight while wondering if you ever had a proper PVC pipe cutter (you don’t). You’ll also need whatever sandpaper you can find to take all the plastic burrs off the bad saw job you did.

Now for the lessons learned:

  • This is going to take all day. Plan accordingly.
  • Wiring up the PCA board involves you understanding the semi-arcane labeling systems that exist for electronics. Basically, for the Raspberry Pi:
    PCA Pi GPIO post Notes
    GND 6 Ground (also pins 6,9,14,20,25,30,34, or 39
    OE Output Enable (NOT USED)
    SCL 5 (Serial Clock Line)
    SDA 3 (Serial Data Line. No idea why “A” either other than easier to read as tiny print.)
    VCC 1 IC Power (3v also pin 17)
    V+ 2 Servo Power (5v also pin 4)
  • Wire up the boards and add the motors (remember, for the motors, darkest wire is “Ground”) with power off.
  • Once things are wired up, boot up the Pi.
  • Make sure the Pi has the I2C kernel mod loaded (use sudo rpi-config to turn it on).
  • You also want to apt install i2c-tools as well so you can verify that the PCA board is recognized:
    # i2cdetect -y 1
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: 70 -- -- -- -- -- -- --
    

    No values at 0x40 & 0x70? It’s not there.

  • Drilling holes on the directly opposite side of a ball is not easy. You can build a jig to hold things. i wound up taping a bit of PVC pipe to an old phone book, finding the center, and using a bit of wire as a post to hold it in place. i still screwed up, and that’s why you buy two bags of eyeballs.
  • You will try to be all sorts of clever in how you want to rig up the eyes. Don’t be. Simplicity works better than imagined artistry. (Plus fishing line will NOT cooperate with you trying to emulate eye muscles no matter what elder gods you may invoke.)
  • Make sure every single time you’re about to do something irreversible, that you’re working on the correct side. You can hide some sins, but not all of them.
  • Make the eyeball mounts first. These will take most of the day and be really annoying. Remember to cut more than you think you’ll need because you’re going to screw some of them up.
  • Depending on how bug-eyed you want your eyeballs, you can drill the swivel point deeper or shallower into the lengths of PVC. Mine are around 7.5mm in. Remember what i said about irreversible? Mark which side of the tube is the front. Future you will thank you.
  • Drill all the holes before you start gluing things in place. Each hole will need 45 – 70mm clearance (depending on where the motor is attached). Use a sample eyeball mount to figure out placements. If you’re feeling super clever, you can push a length of wire from the inside out to not where to drill the hole.
  • Did i mention that pumpkin foam gets everywhere? Oh, just wait.
  • Since the shell will be thick (anywhere from 10 to 40mm), you’ll need to dremel out a bunch of it. This will terrify you because it’s a whirring destruction machine and you know your hand is going to slip and destroy everything. Fortunately, this will distract you from the ungodly amount of dust being generated.
  • It’ll be only afterwards as you survey the foamy carnage that you’ll think about setting up the shopvac to suck up the dust being generated.
  • Oh, yeah, and the face mask would have been good too.
  • Place the eyes into the holes and secure them in place with hot glue. Bonus, you want to hold the eye in place with one hand while applying the glue otherwise the damn thing will slip off, or the glue will leak and stick to everything. Check each before everything sets.
  • ProGuy who did it once tip: compressed air will help set the glue quicker that just ambient temperature will.
  • Once all the eyes are in place, try to secure the internal cabling. Don’t try to use blue tape to hold things in place in there because holy hell there’s still ground up foam? You can use bits of blue tape to hold strands of wire together.
  • Plug the eyes back in, pray to whatever gods you have, and power up to check what’s working and what’s not.
  • Tweak the range of movement, because it’s not going to be from 0 to 180. i use 20-160. You’ll know when you no longer have eyeballs that sound like angry bees when they’re resting.

There, that’s it! Wasn’t that easy and fun?

Of course it wasn’t.

Still, if you want to add a light, i found an old LED bike light works pretty well and might even be a bit overpowering.

:: In Praise of Robber Barons

John D. Rockefeller became the nations first billionare (back when the cost of living was around $.25 a day and the average wage was around $430 a year) He was the richest American ever, and widely considered to have been the richest person on the planet. His company, Standard Oil, was considered the most ruthless and cruel monopoly and is the textbook example of Monopoly used still today.

Andrew Carnegie pretty much was American steel at a time when everything was made from steel. Steam engines, the rails they ran on, the beams used to construct modern buildings, cars, ships, you name it, all steel, and pretty much from his foundries. He killed over 2,000 people because his get away flooded a town, and he is responsible for the Homestead Strike which is one of the bloodiest anti-union attacks. Fair wages and decent working conditions? Bah, peasants.

William Randolph Hearst build a publishing empire from salacious articles and, frankly, out right lies. Heck, to boost sales of a flagging paper, he even convinced the country to go to war. (You, know, just in case you think that conservative nut jobs riling up the masses is a new thing.)

Why do i note these folk? Well, recently i’ve been thinking about our current crop of robber barons. It started when i was listening to a podcast talking about the Vision Fund which gives questionable startups like WeWork ungodly gobs of cash.

The point really got driven home when i saw this tweet showing how taxes for the top 400 have dropped over the years.

So, what are the ultra wealthy folks like Bezos, Jobs, Zuckerberg and the rest doing with their cash? They’re “reinvesting it” using investment funds like the Vision Fund above. They’re burning it in rocket fuel.

Know that they’re not doing with that huge pile of cash? Building universities, or public squares, or even over-opulent tourist attractions lording over large swaths of green space. Basically, the old robber barons at least had some level of civic mindedness (or at least sense of legacy) to realize that at least trying to buy some positive legacy might be a good idea.

At least that’s one thing i can look forward to. The new crop will be forgotten quickly.

They’re the kings that Ozymandias was trying to impress.

The ones you have no memory of.

Because, you know, fuck them.

Blogs of note
personal Christopher Conlin USMC Henriette's Herbal Blog Where have all the good blogs gone?
geek ultramookie

Powered by WordPress
Hosted on Dreamhost.