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“.

:: Ununifi’d

i have a server in my garage. It’s not a super beefy machine, but i use it as a NAS, postgres/http server and a few other things. i’ve had it for a while and while i wouldn’t say it’s a key element of my home network, it’s damn handy to keep around. Still, it’s not quite worth fishing a 30m of cat6 line through a 60 year old house, so i use wifi to connect to it.

the unifi access pointBecause i tend to be a fairly cheap bastard, i’ll get a sub $100 access point in whatever the fastest flavor of 802.11 happens to be at the time. The problem with doing that is sometimes, say, when you’re on vacation in LA for a week, the crappy access point dies on you and your wife can’t peek at the out the front window while she’s away. So after coming home and turning the access point on and off again, i decided i’d fix the problem for realz and get an Unifi AP AC Lite. Several colleagues have Unifi setups for their homes and swear that they’re the bees knees. (i’ll get into that a bit more later.)

Yeah, i’m not so sure about that anymore.

Now, let me make a brief aside to discuss my home network.

i consider the modem provided to me to be hostile. It’s from AT&T, so that’s probably all you need to know. Since it runs a network on 192.168.1.0/24, i keep my protected network on 192.168.2.0/24 behind a second router. Further more, i keep two “private” wifi nets and one “guest” net that gets no access to the private network. i also run a Pi-Hole as my local network DNS. ABSOLUTELY NONE OF THAT SHOULD MATTER TO ANY GOOD ACCESS POINT

Normally, when i get a new access point, i simply plug it into the protected net’s hub, open up the admin access HTTP page, do a bit of local configuration for the device, and we’re good to go, super easy-peasy.

This is not the case with Unifi.

Unifi first wants… no, let me clarify… demands you download their java based controller app. This sets up a local connection running on port “8443” (Oh, hey, that’s the HTTPS port! Better hope you don’t run a secure server on whatever machine you’re running this app on because otherwise you’re going to be very sad.). Of course, the Controller app doesn’t provide any config options to change the port or really do anything other than open a browser to connect, which i guess is fine.

Ok, so let me connect up the access point. i grab a few extra cat5 cables (because none were in the box), and pass the connection through the PoE connector running on a 12″ power cord. i was told that as a device comes online it would appear in the Controller listing. This, appears not to be true.

i unplug, and replug, checking connections. Nope.
i open my protected router’s config panel and see the new Unifi device’s IP4 address. Still nothing in the controller.
i ping the access point, Nothing in the controller.
i port scan the access point, oh, port 22 is open. Google says the user and password is “ubnt” (yay! Security!) and yep, that works just fine. Still nothing in the controller app, though.
i use the “device discovery” tool, which eventually finds the device and lets me locate it. Absolutely zilch in the controller app.

Out of pure curiosity and a bit of needling from a colleague, i connect my computer directly to the AP. Hey! There it is! Only i can’t adopt it because who the hell knows why?

Ok, this is just stupid. Screw you, “controller” app that’s probably doing some UDP polling crap to be clever, let me just ssh back onto the device and… oh, swell. It’s running some weird deviant of Unix. No /etc/network, no /etc/wpa_supplicant,…

There is a /var/log/message that i can cat, and see that it’s constantly trying to connect to “http://unifi:8080/inform”. Well, that’s less than helpful, since i don’t have a “unifi” on my net. Let me force it to connect to my host box that’s running the Connector app… Yay! It connected! and failed to adopt and is back looking for “http://unifi:8080/inform”…

Yeah, ok, i’m done.

i have no doubt that these are amazing in enterprise configurations. i’m sure that if you buy enough Unifi gear, that things “just work” kind of like how you need to buy all of Apple’s stuff for all of Apple’s stuff to work together magically. (i consider this “tech tautology”.) i’m also reminded of one colleague noting that he was able to “adopt” unifi gear that was being installed into neighbor’s houses, so guessing that things work REALLY WELL if you’re doing your initial setup in a Faraday cage, or with no questionable parties sitting within 230 feet of you.

But for me? yeah, no. This thing’s going back.

As for my crappy current access point that drops on occasion? i can solve that for about $25.

:: Best of Twitter

Recently, i grabbed my twitter data, mostly because i could. Reading through it, i kinda remembered how ephemeral it all is. So, again because i can, allow me to indulge myself with what i think are the best tweets i came up with (there aren’t many).

:: Dear Graduates of the School I Will Never Give a Commencement Speech to

You, full of youth and vigor, with stars in your eyes and a cause in your hearts, are ready to change the world. i wish you the absolute best, and in many respects, you will absolutely change the world.

Just realize, that about half of you are assholes.

i’m not saying you are, since i don’t know you well enough to make that determination. Nor am i declaring any group of you are assholes, much for the same reason. Hell, every one of you in this auditorium/stadium/state could not be an asshole, nor ever be. That still means half of your peers are, because there’s a lot of you and y’all are everywhere.

i know this because i was horrified to discover that half of my generation were assholes. Same with every generation back to the time when two fish fought to get out of a pile of muck. For some generations, more than half were assholes, for others, less than half, but rest assured, the number is about half.

What’s worse is that the asshole half are fairly well organized. Because they’re organized, they’re influential. Because they’re influential, they tend to get their way. Once they get their way, they do everything they possibly can to keep it that way. Why do they do this? Because they’re assholes.

Fret not, they consider you assholes because you don’t doggedly share their beliefs without question. You ask too many questions they don’t want answers to. Even worse, you support those other groups. How the hell could you possibly do that, you asshole?

i’m telling this to you now so that later, when you realize that all the things you though would happen don’t, or that there was no way could happen do, you’ll understand. Stupid wars will be fought, and gleefully supported by assholes. Assholes will prevent us from intervening in horrible injustices. Assholes will vote in other assholes and those assholes will push for policies that clearly favor assholes.

All this will leave you wondering where the hell all these assholes came from. Truth be told, they were always here. Some are born assholes, some trained to be assholes, some even make the choice to be an asshole and work at it at every opportunity.

You are going to be surrounded by assholes. You’re going to be saddened by them, infuriated by them, and you’re going to want to get revenge against assholes.

Yeah, don’t do that last thing.

Instead, understand that some people are just assholes. There may be a good reason, and you should at least make an attempt to understand what that reason can be, but ultimately, the reason they’re an asshole is because they’re an asshole, and that’s probably not going to change.

Instead, focus on the fact that assholes survive because you’re not doing stuff against them. Have plans. Sometimes, defeating assholes means doing things that you may not like, or make you think you’re an asshole. Sometimes, you might even have to be an asshole to someone in order to not be an asshole to a larger group, or to stop them from being an asshole. Work together with others who oppose the assholes. Assholes hate that and will fight you about it. That’s ok, you should expect them to be assholes about it.

It’s also important to understand why you’re being an asshole to someone (since, after all, half of you are assholes). There’s nothing special that makes an asshole an asshole. Anyone can be an asshole, just like how anyone can not be an asshole. What makes an asshole an asshole is when they’re an asshole. When they’re being selfish, close-minded, greedy, dismissive, demanding, those are all pretty clear markings of an asshole. Heck, we’ve had at least a dozen religions that point that out. (The assholes tend to ignore those parts, though.)

i wish i could give you better advice. i wish i could tell you how to solve the fact that half of you are assholes. i can’t. Perhaps one of you can. Instead, i’ll leave you with a few rules i’ve found for myself.

Take care of others.
Listen more than talk.
Reflect on where you are and how you got there and why someone else isn’t.
Realize that most folks aren’t really comfortable where they are.
Help when you can.
Don’t look back with regret. At the time it was the best decision you could make. Instead learn from it for the next time.
If you have power, use it for others more than yourself.
Realize, even those with power, fame and glory, could still use an extra napkin or help finding the bathroom.
Leave it slightly better than you found it.
Realize you’re not always right and that even someone you might look down on has something to teach.
Everyone has a hard job, and no one is solely defined by what they get paid to do.
Nobody has all the knowledge or answers.
Be respectful and kind.
Pick up your trash and hold the door open.
A few have it better, many have it worse. Just like we can use some help, so can others.
Don’t be afraid to ask for help, directions, or just to say “hello”.
Your brain regularly lies to you, and your head is full of assholes.
Other cultures aren’t better or worse, they just have different ideas, and only about half of them are assholes.

But most importantly, try not to be an asshole.

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.