Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #390: Coding in a Castle

Return to episode page view on github
Recorded on Tuesday, Jul 2, 2024.

00:00 Hello and welcome to Python bites where we deliver Python news and headlines directly to your earbuds. This is episode

00:06 390 recorded July 2nd 2024 I'm Michael Kennedy and I'm Brian Okken. This episode is brought to you by Scout APM

00:16 Thank you so much to them for supporting the show. We really appreciate them

00:19 and if you want to attend live get your comments in the episode then Check out by the by side of him slash live usually Tuesday at 10 a.m. Pacific Time like we're recording right now, Brian

00:33 Yeah, and please visit by them by side of them right on the home page. Click on newsletter

00:38 Subscribe to our newsletter We've got lots of interesting information that we share with you and we're gonna be doing some kind of giveaway that we have yet to

00:46 Determine and soon when we reach maybe a major milestone there, so that'll be awesome

00:52 Yeah, and yeah with that right now kick us off. Well, you guys are us. Let's talk about strings for a minute. So

00:59 this one is from an article written by Veronica Olson and It's an article called joining strings in Python

01:08 uh-huh moment and I actually just really enjoyed this story because it's a it it tricked me up and and

01:16 she says I've been writing Python code for 17 years and And it's then I learned something new recently from a mastodon conversation. So so what is the new thing?

01:27 So the idea is is around joining strings So let's say you're you've got your like and we do we do this. I do this all the time

01:35 so you've got some input from a file and and her example is got some input from a file and you're going through and just

01:43 Just using it using the read generator thing So if equals open and you get like this thing that you can read with so she's using

01:50 X for X or I usually put line line for line in F And then also doing like some some logic on it within a generator, which is kind of cool

02:01 and once I learned this I use it all the time, so Go through as a general using the file as a generator to pull out lines and then only collect the lines that you care about

02:11 And then joining it in at the end and so like this discussion really is when you've got a whole bunch of line strings that you want to concatenate together with like new lines or something is

02:21 You just create create a list of them and then join it But if you're using a generator, you can just you can use a generator and pass that to join also

02:30 So the the little trick here is whether you whether or not you should use a list comprehension

02:36 so these these two methods is you're joining a Generator out of the file or you use a list comprehension within it

02:45 And the only difference is these little little brackets in there to create a generator or to create a list comprehension

02:53 So I would think I would my first reaction is that it really probably doesn't matter

02:59 But the list comprehension might be maybe I have no idea which one's slower or faster

03:04 But the odd thing is if it's a huge text file Brian if it's a huge text file, it could be a memory if you had a gig of text, right?

03:14 Yeah, then you potentially would be loading more than that in memory with the brackets, but not with the parentheses, right?

03:20 That's what I thought right? So So she's got she used a sample file like like the King James Version of the Bible or something

03:29 Yeah, which is?

03:32 800,000 words long and a ballpark of 3,000 pages anyway 200 million words, okay

03:42 so did did a little timing here as to whether or not you want to use a generator or list comprehension for this and

03:50 Looking at the memory output so that the memory itself is as expected generator uses less memory

03:57 The list comprehension gradually grows and you're using more memory Okay, so far it seems like it's doing what we think it might be doing

04:06 But but the weird bit is when we go down and actually time this stuff Is that the the generator version without and and if you compare the times for the generator and the list comprehension

04:19 The generator one is slower by like 16% weird why?

04:25 So that is weird, especially since the list has to like you allocate the list you fill the list you reallocate the list

04:32 You copied over it like growing the list over and over and over is although as a list comprehension, maybe it doesn't I don't know

04:40 So anyway, that's great. And then more adding more Mystery to the to the mystery is that instead of if you instead of join if you use all

04:49 As the thing that you're using across the entire list or generator It's behaving as expected. The generator is faster than the the comprehension. So what's going on?

05:01 So they the discussion went online and Trey hunter said You should know something about join join is weird in that the CPython

05:11 implementation of join has is a to pass because generators can you can't there they get exhausted and you can't use them again, so

05:20 it has some little tricks that it uses to do a to pass over the generator and

05:25 So therefore it is it is the same the Joe join is the same as take creating a list

05:33 And we know that comprehensions are a little bit better than actually just creating a list

05:37 So that little bit better is the reason why?

05:40 This the the comprehension version is faster. Well, wait, I have no idea why I

05:46 Should have read more closely But there's something about this that makes it faster in when you're using joins to go ahead and use a comprehension faster

05:55 interesting weird and It's only in CPython. Apparently, that's not true for Pi Pi and

06:04 Yeah, apparently you can I don't know how they're doing it without it but I pie and some others

06:11 implementations of Python do not use this but Interesting. Yeah, I don't see that. Yeah, I don't see it tested here. But the web assembly one would be quite interesting

06:21 Yeah for pyrodied and pie strip a pie script and those kinds of things. Yeah

06:28 Okay, so interesting inside baseball around I guess around if you want to do memory whether you care about speed or memory efficiency

06:35 And also it's weird that you got to choose though. It is weird that you have to choose

06:41 But also just in case you haven't seen this this is the state basically the standard format for

06:47 if you want to iterate through strings and combine them all into one is to

06:51 either throw them in a list or throw them in a comprehension or throw them in generator and use join to

06:56 Combine them with a new line if you haven't seen that before that's a good thing to stick in your tool belt

07:00 Yeah, and our Windows friends can put backslash our backslash in join for their Windows line ending. I'm on Windows

07:07 I don't do that. But okay, I know It should still work All right. Awesome. Well, what do you have for us next?

07:15 Well, I'm afraid I have some hard truths for you Brian Just like you've learned it's a hard truth that generator doesn't always give you the advantages

07:22 You thought these are hard truth ten hard truths to swallow that people won't tell you about your brand new software engineering job

07:30 so this focused at students who just recently graduated or who are getting into software development and that might sound like a

07:37 Somewhat niche crowd but if you look at the PSF jetbrain survey, it's like the biggest group of people are like

07:44 Well, you've been coding for three years or less, which is crazy. All right. Anyway, let's go through the ten

07:50 This is by menswear Dura Vec It's pretty good a pretty good article here and basically says I was talking with a bunch of students and they were all psyched about

07:58 Like startup culture pizza parties and stuff. Yeah. Well, yes, but the thing you're gonna do most the time

08:04 Right in code. So here are the the ten first college will not prepare you for the job

08:09 So imagine your instructor spins a you you go to college to learn how to swim your instructor spends a lot of a ton of

08:16 time teaching you about the moves Reciting the moves ask you questions about the moves after five years you get a piece of paper that proves your swimming skills

08:24 And you got to go in the pool and you just flail around right a little bit like that

08:28 Also, a lot of the curriculums are pretty far behind I remember when I was in college I said, can I please take C++ is in the 90s?

08:37 They're like no you have to take Fortran. It's the most important language you'll ever learn

08:42 I'm like, okay, and then I well, let me try some CS classes like well, you got to do list

08:46 But like really can I please take some something like more modern like no, right?

08:51 So you should have a lot of those. Yeah, I'm still not embracing the list

08:55 I like parentheses, but not that much. Okay Anyway, so it's like a lot of these folks who are professors have are not not been professional software developers in the engineering sense

09:05 And so like the skills that they teach you are valuable, but it's not the same right as like working day-to-day

09:11 This one I think is probably people probably don't realize that much as you rarely get a work on greenfield projects

09:18 Yeah, you get brownfield projects that is you get some project. That is not a three-week project

09:24 but it's something that's been around since 2003 and You're dropped in to work on some features and every time you poke it

09:31 It's like a rickety house of cards. You got to be super careful. All right, and how is that? Oh, yeah with your understanding

09:37 Yeah, definitely true that's one of the reasons why I encourage people to do opens phone contribute to open source projects even in large ones because

09:46 There's you have to get used to huge code bases You have to get used to getting thrown in the deep end and fix a bug and you don't even know what the code does

09:54 Yeah, this is yeah central speaking which is a fantastic picture for this

09:59 So let me try to zoom that out for a second so we can see here Brian So check this check this link out folks

10:06 It's like this crazy Ruben cold Bergen thing There's a button to start the app and it's got all these weird wires and there's like an elephant that's

10:14 Suspended and the wire cuts elephant loose which it drops off of rock and there's a security layer

10:19 There's the core logic since 2003 There's all these like third party bits that are largely controlled by aliens

10:28 And then there's a cloud and below the cloud you can see just the base of the building

10:32 There's two new engineers with a little button that's supposed to like kick this thing off or something says how hard can it be?

10:38 Come on. Yeah Yeah, amazing. So check that out. All right Nobody gives a blankety blank about your clean code

10:47 You may focus on a lot but really your job is to deliver features You're expected to write clean code

10:53 But you're not gonna get like promotions and stuff from the business people because you write clean code

10:58 It's because you deliver value right part of that value is clean code. That's true, but you've got to maintain it, too

11:04 So you should be happy. Yes, you've got to live with it. Yeah, so here's what here was my experience

11:08 Not how do you lie?

11:10 But how do you phrase things like estimates and stuff so that you're in a position?

11:15 So you don't have to write terrible code constantly, right?

11:18 so for example with testing or a Little bit of refactoring. It's just like I would just work that into my estimates. How long is it gonna take?

11:25 It's gonna take a week Well probably takes three and a half days, but then if you were to bust it out, right?

11:30 But if you're gonna put in the tests and do it, right, it'll take a week

11:33 So I want to take it takes a week, you know that that kind of thing. Sometimes you'll work with incompetent people

11:38 Oh boy. Oh boy. Oh boy Yes, and sometimes that person will your boss and so that's even even tougher. I'll tell you a story Brian

11:46 You know I used to do in person training classes and there was there is a person who was in this class as part of a team

11:53 software development team from a like a law a medium-sized company one of these like, you know, 50 million yearly revenue type companies or something and

12:02 During that class we were doing like exercises. I'd do a presentation for an hour

12:07 They'd spend maybe half an hour working on something and running around it goes

12:10 So there's this part where you need a variable that has a string value. This person has been working for at least six months

12:17 I think a lot longer as a professional software developer in this language and I say you got to create a variable there

12:23 And you need to assign a string to it that says, you know, XYZ the value the string is XYZ

12:30 So they just write variable name equals XYZ with spaces and all sorts of stuff

12:34 Like no, you can't just type it into the editor. You have to put quotes around it

12:38 What do you mean you have to put quotes around this?

12:41 How have you been a professional software developer at a proper company for over six months to a year and not know that?

12:50 Sentences with spaces to have quotes around them to put them into code as a piece of text. Like could you imagine?

12:55 That person is like review in your coach like oh my goodness, dude. Yeah, no, I

13:01 That was that was a rough one Anyway, sometimes maybe not to that extreme

13:06 But you will probably end up working with ineffective people or people that don't care about your process or people don't care about your clean

13:11 Code or whatever right all that stuff's there get used to being number five get used to being in meetings for hours

13:17 This is important part of software development job Most meetings are not productive because you're being forced to be there by a person whose only job is to have meetings

13:27 That's their job. That's their work, right? Which is However, other meetings with your team members and stuff planning out. Oh, and I went out is pretty good

13:37 Yeah, if you're the one responsible for the meeting be okay with cutting it short

13:40 Getting everybody together and leaving in 10 minutes is fine. Remember that. Yep. Okay 100% Okay

13:47 On I feel like you should have done this this art. No, I'll be the heckler in the background. It's fine

13:52 It's good. They will ask you for estimates a lot of times, right? I told you about this one. I mentioned this is fun. So

13:58 Here's a great cartoon for this one - this is also good. Like basically the joke segment says would you rather?

14:05 For better estimates we switched from measuring story points to a different style

14:12 We now ask how many duck-sized horses are you willing to fight rather than implement this task?

14:18 In that awesome. Yeah Yeah And it sounds silly but I kind of think of it is it's actually kind of practical

14:27 Yeah, it's using your like your desire to avoid negative stimuli more than your ability to predict something

14:34 Love it. Yeah, that was only a two duck side to duck size horse battle All right bugs will be arching me for life because they come from different places could be your own code

14:45 But it could be third-party libraries. It could be hardware failure Electricity all sorts of things uncertainty be will be your toxic friend

14:53 So could be implementing something you never worked on could be getting transferred to a new project with new technologies

15:00 It could be a move to a new company could be a bug report The day you need to finish the work and break the deadline job security evolution technology all these things are totally resonate

15:10 Number nine, it will be almost impossible to disconnect from your job So yeah, that's rough, but it's true because you're you're thinking about it, right?

15:19 Yeah however This one comes a lot of these come with actually good advice on what to do to combat it or to

15:24 Counteract it or to deal with it. Oh, that's good Cuz I like one of the best things I ever did was not I don't have the ability to get email on my phone

15:32 Now my work email. Oh, that's nice And I because I was checking it all the time even on when I was off work and that was bad

15:39 So yeah, it's bad last one number ten You will profit more from your soft skills than your coding skills. Not that your coding skills are important

15:49 But yeah, definitely soft skills are tough and they're also required So things like teamwork learning mindset my management emotional intelligence and empathy approachability

16:00 Persistence confidence all these things amongst a whole zillion others Anyway, if you're new, I think this is a pretty good article

16:07 I didn't go through all the little details, but yeah, he's at least ten concepts. I don't know. What do you think right?

16:12 can we I think they the tech the soft skills probably out of in at the top the

16:18 Being able to communicate well and stay positive and don't be a jerk is huge

16:24 To the ability to not be in a jerk under pressure. That was a struggle for me

16:29 Also embracing deadline like that people are gonna ask you how long it's gonna take you have to you just have to learn how to

16:36 Do that estimating is part of the job. It sucks. It's wrong But you get better at it and you're also okay about telling it. I mean it can be ballparks

16:46 It's gonna be is gonna be two days or is it gonna be two months?

16:49 pick People just need to know so yeah. Yeah, absolutely. It's good All right, before we move on to the next one

16:56 Let's talk about a sponsor that I'm very excited about. Let me tell you real quick about

17:01 Scout APM. They're big supporters of Python bites. So we appreciate that very much

17:06 So if you are tired of spending hours trying to find the root cause of issues impacting your performance

17:12 Then you owe it to yourself to check out Scout APM They're a leading Python application performance monitoring tool APM that helps you identify and solve performance

17:22 abnormalities faster and easier Scout APM ties bottlenecks such as memory leaks slow database queries background jobs and the dreaded n+1

17:31 Queries that you can end up if you do lazy loading in your or am then you say oh no, why is it so slow?

17:38 Why are you doing 200 database queries for what should be one so you can find out things like that

17:41 And it links it back directly to source code so you can spend less time in the debugger and

17:46 Healing logs and just finding the problems and moving on and you'll love it because it's built for developers by developers

17:52 It makes it easy to get set up. Seriously. You can do it in less than four minutes

17:56 So that's awesome. And the best part is the pricing is Straightforward you only pay for the data that used with no hidden overage fees or per seat pricing

18:05 And I just learned this Brian. They also have they provide the pro version for free to all open source projects

18:13 So if you're an open source maintainer and you want to have Scout APM for that project just shoot him a message

18:19 There's something on their pricing page about that so you can start your free trial and get instant insights today

18:24 Is it by them by side of him slash Scout the link is in your podcast player show notes as well

18:29 And please use that link Don't just search for them because otherwise they don't think you came from us and then they'd stop supporting the show

18:36 So, please use our link by them by side of him slash Scout check them out. It really supports the show. Cool

18:42 Yes, thank you. Indeed already, right?

18:44 Well, we've checked we talked in the past about Python coming to Excel and but I haven't tried it

18:50 so, um I was kind of curious about this person that wrote up an article called my thoughts on Python in Excel and

18:57 This isn't just a rando person. Apparently. This is let's see See, or maybe I don't know

19:05 They wrote a book on Python and Excel or reported. Yeah, are they creative Excel wings? Maybe? Yeah sure

19:13 Oh, yeah as a creator of Excel wings the author of the O'Reilly book Python for Excel. I was obviously curious to try it

19:19 so anyway, uh Yeah, okay. Anyway, so somebody tried it out. Great. And this is from the Excel wings blog

19:28 So yeah, it's probably somebody that's worthwhile looking at this and tried actually really wanted it to work

19:35 So what what are their takeaways and I'm just kind of loving this We'll just run through them. he wanted it to be an alternative to VBA VBA

19:45 But mostly got an alternative to the Excel formula language Okay, so I thought it was going to be a VBA replacement as well. Apparently not

19:53 The integrate integrating the Jupyter notebook cells inside Excel grid was a mistake

19:58 So not sure what they did there, but apparently they didn't like that. So

20:05 Python in Excel is not suitable for Python beginners nor for interactive data analysis. That's kind of that's a bummer

20:13 So there's that one person like Yeah Right now there are too many restrictions. You can't use your own packages. You can't connect to the web APIs

20:23 So what are the current you could use cases?

20:26 probably computationally intensive things like Monte Carlo some simulations AI stuff via the included packages like scikit-learn and LK or

20:35 nltk stats model and balance learn That actually that makes sense. And so there's a that's a good use case

20:45 I guess for being able to use a I scikit-learn stuff in in Excel nice being able to use matplotlib and seaborn for

20:53 Visualizations, that's pretty cool because these are great packages a time series analysis

20:59 And but that's really about it said done not sure about data cleaning or data analysis since you're mostly certain

21:06 Almost certainly need power query. I don't know what this is must be a Excel thing. It's like a bi

21:11 Microsoft Office Tableau type of thing I believe okay so What's the conclusion here before we dive into details?

21:22 I want to clarify that this is my personal opinion and not meant to be a rant or critique, but I'm amused by it

21:27 I've been in contact with the Excel team a few times and they're super friendly. Okay, so he's he wants the whole thing to succeed

21:35 So we'll just that's good. So these are just interesting takeaways one of the things and then goes through a bunch of the

21:42 little bits And in more detail the part that wasn't in the the summary Which I find is interesting is Python is not really in Excel. It's in the cloud, which I'm surprised by

21:56 Says as you've probably heard but I hadn't that the Python that you're running runs in an Azure container instance not inside Excel

22:04 That's just kind of weird. I think did you know this?

22:07 Yeah, I did and it's interesting that it means that you can't configure the environment

22:12 You can't control which Python is running You can't install third-party packages that are not pre-approved like you saw that there was a list of a couple of ML ones

22:22 If you don't like those then you don't use it Well, can you do it when your laptops disconnected like when you're on an airplane or something? No, I don't think so. Okay. I

22:31 You just like quick to me I was hoping for like some kind of VBA like true automation

22:38 Yeah sort of beyond the cell this cell that cell but kind of what you do with notebooks and then sometimes you bring in

22:45 Like Excel writer or something to like actually save the stuff out or something, right?

22:50 Like a little way to orchestrate bigger. Okay, but yeah, so it's not also yeah, so it's it's just different

22:56 It's just like stuff within a cell. Well multiple cells, but yes, okay Well, it's not really what I was hoping for for Python and Excel. So anyway, it's also not quite in there, right?

23:07 Say that again. It's not quite in it. As I said, it's in the cloud. Yeah

23:11 Yeah, it is weird. That's got to be online only. Yeah, that's kind of a deal-breaker for me

23:17 But maybe I shouldn't be care that much but anyway, yeah but one of the comments around that was that

23:23 that it's not really a problem for a lot of people because a lot of people are using that are using Excel or already

23:29 Sharing their data through one drive and SharePoint and I yeah, I don't know if that's maybe that's a majority of corporations

23:36 But there's a lot of corporations like the one I'm in where we cannot do that because we don't want our stuff to go out

23:42 Anywhere, so anyway, yep Just an interesting takeaway of I guess if you've if you've been hoping and thinking this might be a good article to peruse

23:51 Just to make sure that it's really your use case before you jump in. Yeah, good point Christopher out there says

23:57 It's nice that it doesn't require Python to be installed locally I'm like power bi because I wouldn't be able to have my IT department install it. So that's an interesting bonus there

24:08 Hmm, Navarro says you got you got a got a fight for your right to sudo Yeah, can't you I mean Python now can't you install it on Windows machines? I think you can install it in like personal mode

24:22 That's just in your home directory or something. I don't yeah, I don't think you need like

24:27 Administrator privileges anymore. Yeah, that's true without the it's actually true with the

24:32 Python in the Windows Store and Windows 10 and 11. Yeah. Yeah, okay Henry Schreiner on the audience a Henry says this feels like the perfect use case for WASM sad

24:42 It wasn't the default totally agree some pyro died here would have been awesome. Yeah

24:46 All right. I'm not as awesome. Next thing. I'm about to tell you though, Brian. Okay, what's what's the next thing this?

24:53 Special live event course that I'm running. All right, cool so this is happening in in October and

25:02 I'm doing a code in a castle event in Tuscany Wow So this is a six day luxurious

25:13 core course in a lecture luxurious Tuscan Villa and Every morning we're gonna wake up and we're gonna spend four hours working on Python and then the rest of the day is

25:25 Excursions and winery tours and other stuff around the Italian countryside. This looks like fun. Sounds awesome

25:33 Huh? Yeah, so the course is gonna be super fun The course is I called it Python zero to hero, but you don't have to actually be zero

25:40 Just you got it just like there's probably some areas of this it would be you haven't any experience with so basically it takes you

25:47 from I'm Maybe learning Python. Maybe I know Python but then talks about a sink and await MongoDB

25:55 talks about We cover a FastAPI using HTMX We'll be back to that in just a second and building out awesome web apps and web APIs and then performance testing this and then

26:06 deploying it Linux we got time maybe using doctor as well. So yeah, that's what the plan is and it's gonna be awesome

26:16 So if you were interested in being part of this click the link and your player show notes and a so show notes there and

26:24 Yeah, you have a Python. I think I'll have a talk Python link so talk Python dot FM slash castle is the link and

26:30 Everyone when they come they get a room in the villa and the room has up to two beds

26:35 So if you wanted to bring your wife or a good friend, there's actually a separate

26:40 Set of events for the people who are not in the course, but who are attending the event as like a companion or something

26:46 So there's like morning excursions as well Yeah I was reading up on that and it sounds really pretty like some some good quotes from people from last year enjoying the the

26:56 The plus ones Having fun in the mornings. So yeah, awesome. Maybe I'll just say the morning track. No, just kidding

27:05 So I forgot to mention this is an extra extra extra. So this is number one of the extra. Okay more

27:10 Okay more so first one code in a castle learn Python FastAPI Deployment load testing all that stuff. Hopefully you can be there number two. I

27:18 Had this awesome use case for HTMX that is so incredibly clean that I just want to give people a feel for it

27:27 so Brian if you go to Top Python click on the courses putting your course here. Okay

27:34 You see it has a price as $59 But if you're European it would have a price in euros if you were in India

27:42 You would have a price and some else So in order to pull that all that information in this was usually fast

27:49 But periodically would have to hit our credit card processor for places that are less common

27:55 I tried to pre-compute all this but it's like combinatorially out of control

27:59 So if you're like from a certain part of Greece where there's a certain tax

28:03 That's different than another part of you know, like all of that factors into what shows up on this page

28:07 So I just showed him without prices and like well What if I could reload like show the page and then recompute the page with prices?

28:15 And if it takes 10 seconds for 50 API calls to the credit card processor, so be it and maybe you'll see it

28:21 Maybe you won't but if it's already seen that it's saved to the database. We'll just show it to you basically

28:27 Well, really really quick So watch it so watch this if I refresh it you can see that

28:31 It flickers for a second and then the prices come back Cool All of that is in in HTMX and if you look at the implementation of it

28:39 Three lines for that entire client-side implementation of show the page without prices

28:44 Instantly start a computation to figure them all out get the answer and then rebuild the page out of that

28:50 Just div HX get some URL HX trigger to load render partial This is the implementation that both shows it on the first load without prices and then refreshes it and loads it with prices

29:01 Those three lines and one of them is a slash div. Well, that's pretty cool. Is that insane? Yeah, so

29:06 Yeah, HTMX for the win. Just wanna nice use encourage more people to use that

29:11 It lets you do more Python and less JavaScript, right? Cuz most said implementations on the server, which is where it's all Python

29:18 Yeah, and one of those one of those three lines is just the closing of the div

29:22 So it's really like two lines of code. It's really like two lines. It's incredible. Yeah

29:26 All right another one so that I've been recently using and some people will be like Michael

29:31 Where have you been all this time? Why have you not done this?

29:33 All I'll put this out to you as I my test candidate Did you know that if you're if you find yourself sitting down to the terminal?

29:41 SSH into a server running the command and then leaving often even if that has like text output and all sorts of responses

29:48 Colored text output like rich or whatever. Yeah, you can just run that on your machine using SSH to execute a command remotely

29:55 This is news to you. No, but so you you say SSH for people who don't know you say SSH

30:01 User at host and then in print and quotes some command so like if you want to say tail your log and see what's happening on your server instead of

30:10 Logging into the server over SSH and tailing it you could just create an alias that says SSH

30:15 User at host do the tail log thing and you just type it locally and just boom you're telling log

30:20 Beautiful or whatever you want to do if you want to run multiple commands just separate them by semicolons

30:25 Get a little alias for that bad boy and off you go. Yeah nice. So anyway, that's one of my extras

30:30 I use it for So the reboot is built in but we we have an extra command that we do for restarting

30:36 They we have an application that we often have to restart. So Doing a single command SSH and run the restart to restart all the software do that a lot. Yep

30:46 All right. I told you it's extra extra extra. There's still more extras. Okay. Okay

30:50 We got time. All right. Yeah, these are short. So polyfill.io is a CDN I believe for a JavaScript polyfill is if a browser doesn't support a feature

31:03 But you can implement it in JavaScript on top of the features that are there

31:07 That's a because include a script that's a polyfill like add features to an old one. Okay, you know brother

31:12 Okay so apparently according to bleeping computer this thing has been impacted by a supply chain attack where

31:20 Chinese company acquired the domain and then the script was modified to redirect users to malicious and scam sites

31:27 Oh and everyone who had that in their web app 100,000 different websites the CDN got a new version of the the script for you

31:35 Geez, which means it's time for required reading from Wesley Aptaker castles reasons to avoid CDNs and JavaScript. I'll do the way I lighted one here

31:46 Look systemic risk says one of the CDNs out there supports 12.5% of all websites if that goes down there's having 12.5% of the Internet vanish is silly

31:58 We've swung too far towards away from resiliency Society privacy obviously because they can track everyone who makes a request that and coordinate that across

32:08 Browsers and sites they see speed but I if using a CP to it doesn't that matter that much you could use your own CDN

32:15 Security this points out that modern browsers have Sub-resource integrity basically put a hash on to it

32:23 And if you're using a CDN put the hash in there that way if something like this happens

32:27 It won't load the page like the browsers like no it doesn't match. I'm not running this. Hmm. Just good

32:32 Unfortunately, this doesn't work for libraries that are split into multiple pieces

32:35 You know where one thing requires another type of deal as part of it So what to do instead just download it is what they say

32:43 Although what we do Brian over at Python bites is we just download it But then we serve that content back over our own CDN at bunny.net

32:52 Well, it's not ours, but when we use a bunny.net, which still gives it all the global reach

32:56 But we control whether or not it changes other people. She's awesome okay, and just to keep beating the drum and

33:03 major ad networks are basically malware delivering funnels and Don't feel bad about ad blockers Mac users served info stealer malware through Google Ads. So why not? Who wouldn't want that? Oh geez, so

33:16 That's an article on ours technically you can check out but that's my extra extra extra extra extra here all about it

33:23 Okay, nice. You got extras I do but I've got a link that I can't show Okay, so I want you to go to the like either in the notes or the private chat and click on that link

33:35 I will talk about it. It's called I will effing pile drive you if you mentioned AI again, so it's just a

33:42 It's a funny reaction to all this ChatGPT stuff and AI and everything and it's interesting

33:49 It's the interesting position. So this is somebody that was studying data science there and I think they're in college and

33:56 And they're doing grads. I think grad school stuff now doing a master's thesis

34:01 but he's Kind of sick of a lot of the hype around AI so there's just an interesting take on it and it's it's so funny

34:09 like If you'd like to have an alternative if you're tired of all the hype around AI and you'd like to you know

34:18 Read some somebody else's perspective. Click the link in the show notes and it'll be interesting read for you

34:25 The reason why I'm not showing it is because I want to keep this child friendly and safe for the spot for the live feed

34:32 So, thanks, right. Well, check it out. That's my that's my only extra alright, well

34:39 Lance Closed to sell the joke, huh? All right. Yeah, let's do that. By the way. I I have this AI fatigue as well

34:46 It's like ChatGPT is cool Lama three is cool, but like not everything needs to have AI in it and certainly a lot of times

34:55 Software use has just like easiest all persistent bugs because the whole team is like on an AI mission

35:01 You're like, I don't want any of this junk. Could you just make it when I click this that it works?

35:05 Yeah, you know, all right off the joke over on reddit we have Something called the HTML hacker. We just talked about like the malware, right? So

35:16 This is a sort of two sides of the picture. Both people don't see either side really so woman

35:23 She says my boyfriend is a programmer. He'll hack is don't mess with me. My boyfriend is a programmer

35:28 He'll hack your world into oblivion. Meanwhile the boyfriend on his computer Google how to declare variables in HTML

35:34 Yeah, yeah Both things gonna be true at the same time He also could be a hacker and still not know to declare variables at HTML you never know

35:45 I don't know how to declare variables an issue. Can you declare variables an issue? No, no, okay, but you can in like

35:52 Modern CSS and you know, well, okay So what are the things I think is funny about this because sometimes in the movies you'll see somebody like

36:00 pouring through lines of code and then you you look at it and it's it's just like the view source of

36:07 Some web page or something. It's like that's not like you're not hacking anything then guys looking at the guys

36:13 I found the source to this web page I'm going in Yeah, well now I've got the JavaScript next oh my gosh, I can't believe they just published this and don't hide it

36:27 Yeah, so anyway, that's funny. Yeah. Anyway, all right. That's it. Thanks a lot for great episode

36:35 Yeah, Vaughn, as always.

36:36 Catch you later.

Back to show page