Late Night Linux – Episode 255

Hello and welcome to episode 255 of late-night Linux reported on the 6th of November, 2023. I'm Tro, and with me, I fade in. Good evening. Graham. Hello. And Will. 1, 1, 1, 1, 1, 1, 1, 1. Oh well done. Well done. SF. SF. Whatever. Anyway, let's get straight on with our discoveries. Will, yours is amazing. It turns out that a lot of think pads or most think pads have a 1 by 1 pixel display on them. You're just so in the club now that you want to have it as little. Yeah. Yeah, I just saw this on MasterDone from Leonard Pottering talking about how you can control with the latest kernels anyway. How you can control the red dot on the outside of the lid on your think pad. And you can make it certain brightness. And you can make it turn on and off, you know, breathing it out. And well, that's all you can do with it, but great fun. And to know that I can do this on my think pad is quite good. Has you made a system de-unit out of it yet? I would imagine so. Well, I was thinking you've got to be able to use Pulse Audio or Pipeware or something to like pipe it into it to flash along with music. That's got to be doable. Just reading the comments on the rest of the thread and people have tried to flash it on and off very fast and apparently it just stays on. So there's quite a lot of lag, it seems, between when you tell it to turn on and when you tell it to turn off and it's probably not good enough to have a disco. No, well, I did try it with my X270 and I tried to do it fairly quickly and yet it did just seem to stay on. I wonder if that's a security feature because isn't there kind of a vulnerability in the variants of lights and LEDs when people are doing certain things on the computers? Hmm, maybe. I would think it's probably less a security feature and more the cheapest LED that I know I've identified. Well, that is just one of those cold, just nerdy things that only a Linux user would discover and care about and I love it. We've also discovered Octopus Energy Home Assistant add-on. Now, this one is slightly more useful and well, it's quite niche still, I admit, but it is more useful. If you are with Octopus Energy, it implies that you're on one of their smart tariffs. They offer a number of different tariffs that have different pricing structures depending on what you need it for. So if you've got an electric car, for example, and you need to charge at a much lower rate for six or seven hours a day, they have a tariff just for you where you get cheap rate overnight and during the day it's more expensive. They also have one called Agile, which is the wholesale rate plus their markup of whatever it is, 10, 15% or whatever. And that varies every 30 minutes throughout the day. And so if you're clever and you have a battery and solar panels and whatnot, then you can configure your battery to charge on the very cheap rate and then you can avoid the very expensive rate. Normally, the most expensive rate in a day is between about 4 pm and about 7 pm, which is when people are cooking dinner and using a lot more electricity. So if you have a battery and you're able to charge it up on a cheaper rate, then you can avoid that very expensive rate and you can save probably a couple of quid a day, I would say, which over the course of a year is quite a considerable saving. This is essentially storage heaters for the 21st century, isn't it? Exactly what it is, load shifting, they call it, and that's exactly what it is. And so I spent an awful lot of time writing a Python script to download the prices from their API, calculate when the cheapest four hour slot was and then tell my battery to charge at those times. Well, it turns out that bottle cap Dave on GitHub has done this in home assistant and he's done it in a much better way than I ever could. It downloads the prices, you can configure it to calculate rolling averages over any period of time you like. So if your car takes four hours to charge, you can find the cheapest four hour rate. If your car takes eight hours to charge, you can find the cheapest eight hour rate and you can configure it to use individual 30 minute slots in a non contiguous block. So you can charge half an hour here, half an hour and hour and a half later, half an hour, a 30 minutes later than that still. And sometimes on our trial, when there's a lot of wind, for example, the price goes negative. And so you are paid for any electricity you use. And this package allows you to find those negative times and take actions when the price goes negative. So using home assistant, you can call pretty much any script that you've written in home assistant, turn on fan heaters, set an alarm to go off to tell you to turn the tumble dryer on or whatever. And so yeah, bottle cap Dave has put all of this together in a nice, easy to use add on, which if I'd have bothered to look for it would have saved me quite a number of days of software development. You're not worried that one day your house is just going to turn against you and kill you or lock you in or something. No, I'll be all right. I'll be all right. I know where the big switch is. I suppose the good thing is that all of this is open source, whereas if you'd built it all using proprietary bullshit, then there might be a danger that had killed you, whereas at least time assistant, everything's all open source. So yeah, someone would have caught it by now. Yeah. And I think it offers a lot of real value like there is a lot of money to be saved by shifting your energy usage to these very, very cheap times. And the reason that that electricity is cheap is because it is green, because the wind is blowing extra hard and there's more electricity in the grid than really it needs. So using that electricity up is your civic duty as a green person to save the planet. And you get paid for it and this makes it easy. So I think everybody should get on board with it. It's well smart, but I just wish we could teleport this entire segment 30 years in the past, where a land called bottle cap Dave allows you to install into your house, a script which allows your octopus energy company to charge your electric car, cool, totally normal things. Yeah, I think it sounds absolutely amazing. I love the idea that there's such a nerdy aspect of all of this alongside the fact that you're using green electricity and producing your own. It's just another reason to try and get a solar set up for me, I think. Yeah, I'm tempted to get a lot of panels and batteries and just live half of the grid like you do. And also you feel typically so powerless with energy companies, you know, the amount of money they take out of your account every month, the amount they have at the buffer, the kind of lack of transparency over their tariffs or when you've come to the end of a tariff. I mean, it's great to be able to control something to such a fine degree, I suppose, props to octopus. I do worry a little bit that while at the moment, octopus is still working off startup capital, you know, it's VC funded, I think. At some point, they're going to change their their mind and somebody in the finance department is going to go hang about you're telling me we're giving our customers money for electricity we could be selling to them. Let's not do that anymore. And then the party will be over. But until that day, make the most of it. Fail him. Rough now has a formatter. Yes. So it's talked about rough before. It's a pip and soluble way to check the syntax of your code, the lint essentially, but they have now added more to it. This is the astral. The company that's running it. They've now added a formatter to it, which is something like 98% compatible with black, which is a really famous Python formatter. And this is essentially a way of if you write shape format code like I do, you can just tell it to go and reformat it properly and then change the syntax structure of things. So you are say wrapping things in brackets and then putting one on each line. I have to answer you to make a big line and split them with the escape backslash. And it does a proper version of that. And it is exceptionally fast, pretty much about well. It runs it in 0.1 of a second versus 3.2 seconds for a 250,000 line of code piece of code base. And a couple other ones run it in the 19, 17 second sort of region. So exceptionally fast. So again, they've done really well. They've built the more tools for Python and I am all for that. Those benchmarks are quite amazing. But AutoPEP 8, 19.56 seconds, rough, 0.1 seconds. Amazing. Absolutely amazing. I mean, my code is so shite, but it makes it look nicer at least anyway. Graham, ZSH profiling, I guess quite a few of us use ZSH instead of bash for our terminals. Especially Mac users, eh? Don't you mean ZFS? What are you talking about? Yeah, it's the only Z thing we care about. Well, yeah, I mean, it's, I think it is default on Mac OS, but I've used it everywhere for a long time and copy my profile and settings from my Comfort Git repo. It lets you do lots of things. It's more convenient for path names and navigating. And also it's got a really good kind of plugin system. There's a theming. There's lots of theming engines, but I use O, my ZSH, which is a very popular option that comes with its own sort of themes to create like power line effects. Anyway, the end result of me doing all this for so long is that my ZSH was running very, very poorly whenever I opened up a terminal. It would take a couple of seconds, maybe not that long, but it took a, there was a noticeable delay, which is very annoying when you just want to fire up something in typos or whatever it is that you have to be doing. So this discovery is that ZSH has a built-in ZProf profiler that you can put in the equivalent of ZSH bash RC, which is ZSH RC. All you have to do is in this Comfort file, you put, I can't remember the name of the command now, but it's easy to find. You put the certain command at the beginning of the Comfort file and then you put the same command at the end of the profile so that when you next run ZSH, it creates a kind of a log, a ZProf log of all of the things that are run from your configuration and the time it takes for them to run. And then you can take a look at this and see what's taking all the time. And it was incredibly revealing what mine was doing. In fact, it was a huge cache of dot ZSH underscore session profiles that have been cached that I was get cloning across all of the places that I got this configured and moving back. It was like, I don't know how big it was, it was megabytes and megabytes and this was being passed every time I loaded up a new session. So it now loads instantly. I do quite like Omar ZSH as a kind of novelty shell, there's so many ways of configuring it and so many sort of standard or downloadable themes that you can get for it. It's a nice tool to have, but I did find it would get slow the longer I fiddled with it and you're never quite sure which bit of the change it was that broke it. I did not know that this profiling existed that would have been a real life saver. I'm going to pull back the curtain a little bit. Have you noticed that Graham keeps saying ZSH, that's because he tried it a couple of times quickly, ZSH and fucked it up and I've had to edit them out. You know, it's a great name for something when you have to say ZSH, I'm actually all for using Z, I think Z's the answer is ZSH. Not kicking off the podcast, but I thought fish was like the hot shit these days with Linux users. No. Bash, who installs a new shell, what type of weirdos area? Well, yeah, certainly not me because surely it's just one extra step to set up any machine if you're using a different shell. I get that there's advantages to using fish and ZSH and various other shells, but like any machine apart from a Mac, any Linux machine that you sit down in front of is going to be running bash. So yeah, I'm in with you, failure man, just have the old school shit shell because it's default. You don't have to call it shizz, Jesus, it's not that bad. Well, it also means you don't have to learn anything new, which is handy as well. Yes, I'm off with that. Do you use a funny shell, Will, or do you just stick with Bash? No, I just use Bash. I did use ZSH on the Mac, but now I'm back on Linux, I just use Bash and it's fine, thank you very much. Yeah, you're just some sort of fancy man, Graham. I think maybe it's because it's got a terrible memory, it's great for like navigating your history and not having time to see D and what's wrong with control, ah, come on. Yeah, I mean, I know there's fuzzy search for Bash as well, but it's so nicely integrated into a ZSH. The Git management was very good. It would tell you what branch you're in and you know, whether you had committed changes and all that. I'm sure you can do that in Bash, I just can't be asked. Yeah, there's power line for Bash, which is what I used to use, which is a Python thing. It just strikes me as a very sort of arch Linux user thing to do changing your shell. And that's right. He does run aerosolics. You're right. I'd forgotten that. He didn't even say. I know. I've not mentioned it for a while. I think you got away with it. Okay, this episode is sponsored by people who support us with PayPal and Patreon. Go to latenightlinux.com slash support for details of how you can support us too. For $10 a month on Patreon, you can get access to an RSS feed that contains all the late nightlinux family shows without adverts like this. There's also an option to get just this show ad free for $5 a month. Some episodes are even released today or so early for Patreon supporters. So if you like what we do and can afford it, it'd be great if you could support us at latenightlinux.com slash support. Fail in PyTelegrambot API. Yeah, so I have kind of two things that I've got. I've got PyTelegrambot because I want to have a out of band or out of email way to and learn on something because a learning on email is fine until email is fucked and then, you know, let's face it, email is fucked. So I use this for quite a few things. There's a cool, you tell me, I heard Martin actually talk about it. On Linux matters only the last episode where he was talking about net data and how good it is. I've used that for quite a while. It's like running your own sort of both monitoring and graphing solution on the same host, but you can also set it up to notify you via various channels and one of them is actually telegram. And I use that for some stuff, but I also use command-lined alerts for various things and it's quite handy to set up a telegram group and then use this script, which is all Python based and essentially you can set up a, you go to the botfather, you get yourself a bot handle and then you assign it to a group and then you've got notifications coming in from boxes that you can ignore in your telegram chat because there's too many of them and you just realize that it was a few that I left all along anyway and it's all broken. But it is very handy and I use one for a, I've got my, obviously my pie that listens for airplanes flying by, I watch for certain aircraft, I've even found a DB that a electronics from fully enough updates and is used by a lot of people to determine whether aircraft are military or not and I use that to then notify me if there's any military aircraft flying by because they might be interesting and it telegrams me all the time, it's really amazing. Yeah, sounds great. Yeah, and it's a wonder I have migraines every time I wake up for the last eight days. And you've got a related one which I refused to call notify, I read it as nifty.sh. Yeah, so telegrams good, but it could go away, it could run out of money, it could be blocked or whatever and yes, I also don't know what it's nty.sh, so whatever you want to call that. We're calling it nifty, that's the official name for it on our show, even though they say it's notify. I, so well, you can get that on Google Play, App Store and Eftroids. It allows you to, without paying, set up a sort of a channel name, you have to kind of set one unique so you don't have a collision. I believe there's a pro version where you can pay for it to, so you can actually sort of reserve one, but it's a way to send notifications to this sort of channel that you're all listening on. Now, I haven't tried it myself. I have taught about using it before, but I sort of fell back to telegram by the fact that lots of people that I work with all use telegram anyway, so still quite handy to use that. But if people are looking for a way to get sort of non email based alert coming through, it's got ways for you to get on your mobile phones. It's quite interesting, and I believe you can run it yourself, so you could have your own version of this. That's a gateway that you can then listen in on. Well, I've got a discovery that Ryan sent in. It's a book that he's written called Beyond Out. And he basically said, you lot are a bunch of godless heathens. Maybe you'll enjoy this book, and it's all about how secularism is on the rise and don't be fooled by the various evidence to the country, or supposed evidence to the country. It sounds like quite an academic study of secularism. And it doesn't seem like everyone will be interested, but maybe one or two people will. So I thought I'd give it a quick mention. So I'll put link in the show notes, but it's called Beyond Out anyway. Quick update on my running Ubuntu, a Sahi on my Mac experience, and how I don't know if it was recent bugs that the Sahi folks found with macOS, or not, but anyway, I tried to do updates on the Mac on the macOS side of things, and it just fucking wouldn't work. It just kept saying, unable to personalize the update, and I was like, what? Looked it up. Okay, try booting in like some sort of safe mode equivalent. No, still wouldn't do it. It sort of start downloading and then go, nah, sorry. And then try this, try that. And in the end, I had to do a DFU restore, which someone in the telegram said, does that stand for done fucked up? And yeah, I think it does. And something direct firmware updates, some of that anyway. And even that failed at first. And then I had to like do an update of the Apple Configurator, and I thought I'd brick the Mac at some point. I thought Jesus Christ, I paid a lot of money for this thing, and it's still worth a few hundred quid, and I might have fucking bricked it, and I was thinking, maybe I can buy an M21 to replace it. But no, in the end, I got it working again. And so the Ubuntu situation lasted about a week and a half before I had to totally wipe it off again. So that's a bit shit, really, and I blame Apple for it, and not at all the SRH folks, who actually are doing a good job of finding bugs that I don't, I don't know if it's what I am too thick to work out, whether it's related to it or not. Maybe it is, maybe it isn't, maybe just Macs are shit. Was that an Apple security book that got pushed out, and then it just wouldn't install because it didn't like the look of it, or? Well, I don't know why it wouldn't do it, but yeah, the reason that I was keen to install it was because there's this recent speculative execution vulnerability with the ARM Macs. So, yeah, I was very keen to get it installed, but no, it just fucking wouldn't. So, I don't know, I really have not got to the bottom of what caused it because it doesn't seem related to the other bugs that were found recently, but just nothing I tried would work, except for just completely new-compaving the whole thing. Thankfully, I did have a time machine back up, so I got it all back and running within a few minutes. Well, actually more like about an hour, but yeah, weird. So now I'm a bit scared, really, to run a saw here again, but it's not my main machine, so it'll be fine. I'll just do that again when I get bored. Let's do some feedback then. Christian writes, hi Joe, congratulations on your X270. Nice to hear you finally joined the ThinkPad Cult. It's a lovely device, so I'm sure you'll love a lot of fun with it. Excited to see whether you'll get additional ThinkPad's later. Usually, it won't stop with the first device, and I admit I have been looking at other ones. I haven't bought any yet, but I'm looking. Let's just say that. I want a T-series one now. But anyway, I'm going to, maybe for Christmas, we'll say. Anyway, it continues. I'm also a ThinkPad enthusiast and a heavy collector, and then he sends a link to his list of ThinkPad's, and yeah, he's not wrong. He is a heavy collector. Right now, I'm about to start a virtual museum and a dedicated podcast about ThinkPad history. So whenever you have any questions I want to dig deeper, let me know. Happy to help. So yeah, definitely let us know when you get your virtual museum and podcast started. We'll give it a shout out on the show. But just looking through his list of ThinkPad's, it is quite impressive. Yes, impressive. That's a word for it. It makes your collection look shit-well. I think somebody needs to send help immediately. I'm only joking. Yeah, I think he might become the leader of this cult potentially. And it's quite the range as well from some quite modern ones to some like proper ancient ones, running XP and way older than that as well. Windows 98, he's got a ThinkPad 240, for example, which has got 128 megabytes of RAM and a six gigabyte IDE hard drive. And Windows 98 second edition. And he's also got a wish list as well, which is brilliant. It just, it doesn't stop, does it? I think I need to just get rid of this ThinkPad of mine and not join this cult. It seems dangerous to me. Fail him. How about you read this next one? Yes, I see why you might have got me to try and tell you forza, tell you every day, who knows? Who knows? They write in and say, in episode 250, you mentioned that the pixelate will get updates for next seven years, and that that would be unparalleled in the Android world. I just wanted to mention that Fairphone has that kind of support commitment. Five years for the Fairphone 4 and eight years for the new Fairphone 5 with a track record. Fairphone 2 got seven years of updates. Yeah, which I think was a bit of an oversight really. When we talked about this, Fairphone is very much the outlier and they go through, I mean, they just jump through hoops, man, to get this support for so long and to make it all work. And so I think it was definitely remiss of us to not mention them. So yes, thank you for pointing that out. And it's interesting that I saw an article on notebook check. It looks like the pixel eight offloads AI to the cloud, which is exactly what Gary had said in that episode where we talked about it. He suggested that that's probably how they will end up supporting them for so long. So yeah, I think he was right there. I was looking at a Fairphone last week when I thought my phone had died horribly because I couldn't delete a chain of SMS messages. I couldn't send and receive them either because everything just looked like it was stuck in concrete. So I just ended up clearing a cache and deleting all the onboard stuff and then it all funnily enough came back and then it worked again. So crisis of error, I don't have to look for a new phone for a while, yay. Yeah, but the Fairphone you pay for it, don't you pay premium is expensive. But fair play to them. They are a small-ish company offering something that is otherwise unprecedented. And I suppose that the in our defense is unprecedented for a big company like Google to do something like this. And not a sort of specialist like Fairphone, but yes, we should have definitely mentioned them. Michael says, how are Linux market share numbers compiled mostly from the user agent string? I only run Linux and mostly Firefox and my user agent strings shows windows. Is this common? Our Linux desktop installation is being undercounted due to this misreporting. To be fair, no one else in my circle uses the Linux desktop and I'm not suggesting a massive reporting miss. The bottom line is that there is no true way to know what market share various operating systems and desktops and everything has. There's loads of different ways to count here and none of them are truly scientific. I think it's all made up. Well, it's not all made up, is it? It's people having their best guess. It's people using things like user agent strings and getting logs and everything, but it's an impossible problem, I think. Maybe if you have a destroyer and it's big, you can then say X number of hosts went to hit the server every error for updates, but are they all gone through proxy? I don't know. I'll say you had some sort of packaging format that checked in every six hours for updates. Maybe that'll give you accurate stats. What would you call that? I don't know. Pop? It'd need to be something quite snappy. Crackle. Yeah. But yeah, the bottom line is Michael, fucking nobody knows. Don't trust anyone who tells you any sort of stats. You know, you've got the steam surveys and there's lots of data points, but no one is going to give you a truly accurate representation of desktop market share. Right, well, we better get out of here then. We'll be back in a couple of weeks, when it might be some news, it might be some random bollocks, who knows. But until then, I've been John. I've been Salem. I've been Green. And I've been Will. See you later.