Notes

Hello, cyberpals. I make Pushover and old Macintosh stuff and sometimes OpenBSD stuff for you and me.

Follow me in the Fediverse: @jcs@jcs.org
824 notes 47 following 97 followers
joshua stein @jcs@jcs.org - November 3, 2023 14:53:05

If you charge your laptop's battery to 100% all the time, eventually the battery life decreases and it will only ever be able to charge to like 90%.

So the solution is to have the laptop limit its charging to 90% to preserve the battery's life, but then any time you need to use the laptop away from your desk it only ever has 90% battery. How is this better?

We're told to do this with our EV but we usually know in advance if we're going on a long trip so we can change the limit and charge to 100% temporarily.

joshua stein @jcs@jcs.org - September 23, 2023 12:46:50

My wacky goal was to try to do this transparently on the wire, with the BlueSCSI intercepting TCP packets of plaintext to remote IPs on port 443, then do TLS and send out encrypted traffic, read the reply, decrypt it, and send back plaintext on the wire to the Mac. This way applications on the Mac wouldn't need to know anything about TLS, they could just connect to things on port 443 and get plaintext.

But this was too difficult to do because the plain/cipher packets wouldn't match up one-to-one, so I'd have to answer the Mac's TCP connection and buffer data, then create my own outbound TCP connection to the server with hand-crafted TCP packets built using the Mac's IP (since the Pico doesn't have its own stack/IP), and shuffle data between both TCP conections. That meant adding a TCP state machine, trying to find/maintain the current time (needed for x509 validation), etc.