Submind YouTube summaries
Thumbnail for Give ‘Em Shell: Joyful Automation For The Busy Programmer

Give ‘Em Shell: Joyful Automation For The Busy Programmer

Watch on YouTube

Video summary

Gina Verstro begins her presentation by sharing her personal journey from aspiring English professor to DevOps engineer, a transition sparked by discovering the joy of automation scripts left behind by a former colleague. She explains that while many assume automation is driven solely by laziness, she views it as a powerful tool for managing brain space and solving complex problems efficiently. For her, writing scripts feels like magic, allowing her to focus on what truly matters rather than getting bogged down in tedious tasks. This philosophy led her to create practical tools that turn boring or overwhelming responsibilities into opportunities for play and creativity, effectively transforming daily challenges into enjoyable experiences. The first script she introduces is the "Daily Digest," designed to help non-morning people like herself start their day with clarity and focus without feeling overwhelmed. The script automatically gathers essential information such as meeting schedules, priority emails, active Jira tickets, and medium-level security alerts from DataDog, ensuring users stay informed without diving into every single detail immediately. It also checks the status of various database clusters and curates a selection of uplifting news articles based on specific keywords like "joyful" and "uplifting," avoiding negative search results that could ruin the mood. To end the routine on a positive note, the script includes a gratitude section that reminds users to appreciate simple things, ranging from their health to the existence of coffee. To address the common issue of context switching caused by hunger during deep work sessions, Gina presents a second script that acts as an intelligent meal assistant. This tool uses Google Sheets to track meals based on ingredients, preparation time, and nutritional needs like energy levels or temperature preference, while also cross-referencing grocery lists to ensure only feasible recipes are suggested. If the user is feeling particularly lazy, the script can integrate with Google Places to find nearby restaurants offering delivery within a specific radius that matches their dietary preferences and current operating hours. The program includes a helpful decision flow that guides users through questions about their energy needs and location, ultimately suggesting a perfect meal or directing them to a suitable restaurant if they lack the time to cook. In conclusion, Gina emphasizes that automation scripts are accessible to everyone, whether you have a partner reminding you to eat or are working alone in a quiet office. She demonstrates how these tools can be scheduled via cron jobs to pop up reminders at specific times, ensuring that even solitary programmers never forget to take care of their basic needs. Her talk serves as an inspiring example of how Bash automation can bring joy and efficiency to the lives of busy developers, turning mundane tasks into a form of wizardry at the keyboard. She invites the audience to explore her GitHub repository for the source code and encourages them to build their own scripts that solve unique problems in their daily workflows.
Read the full video transcript
Um, so yes, this is a talk on Bash automation. And so if this isn't what you thought it was going to be and anyone's looking to beat a hasty retreat right now, I invite you to stay anyway because we're going to have some fun. My name is Gina Verstro and I am the girl with the shell script tattoo. Uh, this is just a little pseudo code for remove all negativity. By way of a proper introduction though, I want to share with you my origin story, if you will. I am a career transitioner. For most of my life, I thought that I wanted to be an English professor and then I realized academia is not for me. So, I bounced around to some different things and eventually made my way to Learn Academy, which is a web development boot camp that was in person in San Diego. And I actually got that tattoo as a graduation gift to myself. My first job in tech was a tech support engineer at Sohi and I started in November of 2019. Fun fact, my interview took place on Halloween and I of course wanted to present professionally but still be ready to add a dash of whimsy in case they were to ask about my Halloween plans. So I wore a plain black shirt and a cardigan. And then at the end of the interview when they asked what I was going to be for Halloween, I just pushed up my sleeve, held my arm in front of me, and said, "I'm a terminal window." And they hired me anyway. At that time, we were a scrappy startup. And those of us who were new to the industry and our field had regular one-on- ones with our amazing CTO, Alo Sarv, and he would do little kind of career coaching sessions with us and ask us things like, do we like frontend or backend more? Or what tools and technologies are we really excited about? What do we want to learn? And round about the third or fourth time that we had our one-on-one, I realized I probably needed a better answer than everything, all of it. Because while then and now I want to learn absolutely everything there is to know, I can't learn it all at the same time. So I thought it would probably behoove me to have a focus, at least to start. So I went down the internet rabbit hole trying to figure out what it is that I might like to focus on in the beginning. And that led me to this. You don't have to squint and try to read all of that. I will summarize. There was a build engineer who left his company and they discovered all of these scripts on his laptop. Things like if he's logged in to the server beyond a certain time of night, then it will choose a list it will choose from a list of excuses and text his wife that he's working late. [laughter] or if he gets an email from a certain client with the words like sorry or mistake, it will automatically roll back that database to the last backup and send an email with like that's okay man, just be careful next time. So, I took this to my next one-on-one and when Alo asked what I want to be when I grow up, I said this guy. I want to be him. And Al said, you have a bright future in DevOps. So that is why I stand before you today a DevOps engineer at SOI. I want to talk next about why we write automation scripts because I think a lot of people including those of us who do it jump first to laziness, right? Work smarter not harder. But there are some other reasons that we should also appreciate such as brain space. We have certain limitations as human beings learning everything all at the same time. We may want to do it but there are only so many hours in the day. So when we write automation it gives us the freedom to then focus on all of the other many things that we want to learn all the other tools that we want to play around with. Another reason to quote the incredible Alosarv. We came into this space because we love solving complex problems. And I just think that it is so special that we get to do something that we love so much. That's genuinely fun. Some of us are out there getting paid for it. And that is super special. I never want to take it for granted that we have this superpower. It's something that honestly I feel like it's maybe the closest I'll ever get to magic. pressing a button and just seeing all this output suddenly light up my terminal. We're all just wizards at a keyboard. And that's fun. It's also a life hack because if you love writing automation scripts, then suddenly anytime you get a task that's tedious or boring or that you just don't really want to do for whatever reason becomes an opportunity to play, to do something that you actually enjoy. I'll give you an example of this. It was Thanksgiving and we had a lot of new retail customers. So that's their biggest shopping weekend of the year. And so our boss didn't want to just rely on our monitoring and observation that weekend. He wanted actual human eyeballs on our database cluster resource usage metrics every six hours. And before you grown, he's in the room. So everybody just be cool. It was absolutely the right call and I I definitely appreciate that. But nonetheless, I didn't think it would be the ideal use of holiday time to have to click through all of those different databases in performance insights and go hunting at different tables, different graphs, etc. So, I wrote a script and it was a lot of fun and it would output the different metrics, both the average and the maximum or minimum depending on what you're concerned about over the last 6 hours and one hour. And that way I had this sort of 30,000 foot view and I could see trends and spikes and then if any one cluster looked sort of out of whack, I could go and focus on that one in particular. that became part of a larger script that I'm going to share with you today. So, the first script that I want to share with all of you is called Daily Digest. And there's some problems that it's addressing. Number one, I'm not a morning person. Takes me a little while to get going, even with a lot of caffeine. And I have colleagues in many different time zones. So, some of them are starting at like 3:00 or 4 in the morning my time. By the time I log on at 7:30 a.m., I need to be ready to hit the ground running. And I also need to be able to orient myself in my day, know what's going on in different places without feeling overwhelmed. So my solution was to build a script that would give me that highle overview of my day and also help me get into the right headsp space. So I'll share that with you now. And this is the code. Might be a little hard to see due to the lighting, but I'll walk you through how it works. The production version, of course, will have credentials in there, but this is the presentation safe version. No free credentials for you. Okay. Get G Suite is going to pull in my meeting schedule for the day along with the emails that I actually have to care about. So, it's looking specifically for emails from either of my bosses or with certain subject line. Get tickets is going to be my Jira tickets that are in progress. So, I know right away what I'm diving into in the morning. Next is data dog signals. So, this is getting specifically the medium level security signals and that is because any critical or high alerts is going to hit my phone. alarms are blaring. I already know about those. But when it comes to security, we don't have a lot of those, thank goodness. But I maybe because I'm still new to infosc, but I sort of view security signals like parents view young children playing in another room. If it's loud, if you're hearing them screaming and laughing and running around, it's all good. But as soon as it gets quiet, you're about to have a mural on your wall you did not commission. So that is why I like to still have the medium level signals coming to me just so that I have my finger on the pulse no matter what. Then of course we have those database statuses just so I can be aware of what all of our different databases are doing resource-wise. And then we have good news. And if you can believe it, this is the piece of the script that gave me the most trouble because finding pieces of good news is a little bit challenging these days. So I found that when I just entered search terms like good or happy, I was getting this is not good and I used to be happy and then that's a bummer. That's not what we want to start our day with. So instead, I found that joyful and uplifting were better search terms. And I chose uh science, technology, and sports as my topics to focus on. I felt like that was kind of safer territory. Uh just a few things to think about if you're planning on hunting for good news in your day as well. And finally, gratitude. Very simple. It just pulls from a predefined list of strings something to be grateful for each day. Big things like my health or little things like the existence of coffee. Maybe that's a big thing. Um, but that is what that script does. And I have a pre-recorded demo that I'm going to run now. Hopefully So it starts with meetings then gets into emails. Lots of SSL certificate updates tickets. Here are our data dog signals. The database data takes a little bit of time to pull, but I just want to assure everyone that none of those security signals were anything dangerous. The first one was me. The second one was our IT team and the third one is our director of engineering. So all good there. We do have more database clusters than this but for the purpose of this just in case anyone thought I was being really lazy and pathetic over Thanksgiving. [snorts] Finally, our good news articles pop up with just headline and little intro. And there you have it. Okay, this next script that I'm going to share with you addresses the problem of context switching. when you're in the weeds, you're trying to solve a really hard problem, you're trying to read through a lot of code that's pretty obscure, and then your stomach does that really loud growl and you realize that you need the fuel or you're never going to get through this. But at the same time, now suddenly your brain has to switch from what you're focused on to what you want to eat. How long is it going to take to make that thing? How difficult is it? Do I even have the ingredients? So this script basically just outsources all of the thinking, all of the mental energy. So again, I'll just walk through the code and then I will attempt a live demo, but I also have a recording in case things go south. Okay, once again, no credentials for you, but in production, you'll want those. starts by choosing an appropriate category of meal for the time of day. And oh, I should point out there's a little bit of setup needed with this one. So, this is what the setup looks like. Essentially, just Google Sheets with the name of the meal, the ingredients, and then tags as far as whether it's quick, gives you energy, and if it's hot or cold, uh, and light or filling. And those are just sort of the things that when I'm trying to decide that I land on. But of course you could do things like sweet or salty or spicy or things like that. And there's also a groceries section. And the script assumes that if it's on your grocery list, you're out of it and therefore can't make the meal. So that's kind of a limitation. Of course, you know, maybe people want to put something on their grocery list before they're all the way out of it. or yeah, you could still make a salad without tomatoes, but for the purposes of this script, that's what it's doing. And based on the time of day, it's pulling the appropriate meal, breakfast, lunch, dinner, and um of course, these times can be adjusted as well. If you want to take this and make this your own, maybe you hate breakfast in every breakfast foods, then it can be lunch all day. That is up to you. First, it's going to pull in the sheet for the meal category as well as your groceries. And then it's going to filter for only available meals. Then we have a find delivery option. So if you're feeling lazy and you just want delivery instead, it's going to help you out with that. And then you also have this decision flow because if you don't enter an argument, it will walk you through choosing what you want to eat from the meals that you have available to you. And finally, usage. This is something that one of my mentors, Brian, taught me to always do just in case you forget or if someone else is running the script for the first time, so they don't have to look through the code, they can just use the usage argument and it will tell them the different arguments that are available to enter. So, let's attempt demo and I'm going to see what happens if I make this bigger. Okay. >> Okay. Okay. So, I've entered it with no input. So, it's asking, do I need energy? Let's say, yeah, I want something energetic. Do you prefer something hot or cold? Let's say I'm feeling something cold and just light. All right. So, it's telling me like pre-made salad. Perfect. Now, if I just want something quick, I can say something I can have right now. Okay. Or if I want to say if I'm feeling lazy. So you'll see here it says this script is using my IP address to determine my geographical location. However, because I'm on the VPN, it's putting me in LA when we're actually in Pasadena. So, we can say no, that's actually not correct. And tell it that we're in Pasadena. And there are a lot of options here. So, sorry. If you scroll up to the top, it'll tell you if you don't have time to decide on a restaurant, then this is the one that you should order from. If you do have the brain space for more options, it gives you more options and you can choose what you want to eat. Um, and it's pulling specifically, um, essentially the search that it's doing is using Google Places to find restaurants within a certain geographic radius that do delivery for the type of food, breakfast, lunch, dinner, etc., and that are open at the time that you're running the script according to the information of course on Google Places. Oh, not share. There we go. Okay, so that is my presentation. If you want to find me, I do have some characteristics that make me pretty easy to locate while still here at this conference. And if you want to look me up later with questions, comments, concerns, feedback, then uh you can find me on LinkedIn or on Instagram. Thank you very much for coming to my first conference talk ever. [applause] [applause] >> I'll take questions, but please be nice. >> So yeah, raise your hand. really high up if you have a question so I can run over to you with the microphone. >> Sorry, >> that was fantastic. I really liked it. >> Um, are these scripts available on GitHub or anything like that? >> Yes, they are on my GitHub which uh I have it listed on my LinkedIn but it's also GitHub. My username is bashkit case like basket case >> which is great by the way. I love it. Basket case. Great. Thank you. Thank you very much. >> Thank you. >> I have a question. >> Okay. Uh, so I have an issue with remembering to eat when I'm programming. So, how did you go about this? Like that script was awesome. How did you go about like like what gave you the idea to let's automate this? Um, you know, it would be anytime that I'd be working on something and really just trying to intensely focus. Uh, my husband, who also works from home, um, I really, really appreciate this, but he'll come in and say, "Hey, you haven't eaten. It's getting really late. Can I make you something?" And then I'd have to go, "Oh my god, okay, what can he make me that's not annoying to make? What do we have? Let me think." Uh, and then I just realized, you know, it would be a lot quicker if I could just hit a button and have it tell me. and then say this thing. Um, and you could also if you forget um and don't have a partner at home or someone who will come remind you, you could probably run it on a cron job so it'll pop up for you and say, "Hey, knock knock. Eat something." >> All right. So, even the lonely programmers can do this. >> Absolutely. >> You hear that everyone? We can do this. [laughter] >> Any other questions? >> All right, one more round of applause. >> Thank you. [applause]