Advice for Junior DevOps

Hey blog, long time no see. I’ve been incredibly busy these last couple months. Apologies to you for not updating your content as often as I’d like to. I intend to post this in HackerNews, so if you’re coming from there, hello πŸ‘‹ ! Recently, someone approached to me in Reddit asking me if I had any general advice for an β€œfirst time | entry-level | junior DevOps Engineer” While I disagree on that request because I believe that: ...

April 25, 2023 Β· 3 min Β· oschvr

Bash Prank

I remember of coming up with a random joke prank, so when I stumbled upon this comment in the /r/bash subreddit, I absolutely had to try it. I modified it slightly and used a one-liner jokes list I found in Github too. It works in macOS monterey 12.2.1 Here’s what it does: Sets the volume at maximum Creates a temp dir in ~ ($HOME) Downloads a list of jokes from Github Select one randomly and say it out loud using the computer speakers Remove the list of jokes #! /bin/bash # β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–„β–€β–€β–€β–€β–€β–€β–€β–€β–„β–„β–„β–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘ # β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–‘β–€β–€β–„β–‘β–‘β–‘β–‘ # β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–’β–’β–’β–’β–’β–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–’β–’β–’β–‘β–‘β–ˆβ–‘β–‘β–‘ # β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–„β–ˆβ–ˆβ–€β–„β–„β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘ # β–‘β–„β–€β–’β–„β–„β–„β–’β–‘β–ˆβ–€β–€β–€β–€β–„β–„β–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–„β–„β–ˆβ–‘β–‘β–‘β–‘β–ˆβ–‘ # β–ˆβ–‘β–’β–ˆβ–’β–„β–‘β–€β–„β–„β–„β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–’β–’β–’β–’β–’β–‘β–ˆ # β–ˆβ–‘β–’β–ˆβ–‘β–ˆβ–€β–„β–„β–‘β–‘β–‘β–‘β–‘β–ˆβ–€β–‘β–‘β–‘β–‘β–€β–„β–‘β–‘β–„β–€β–€β–€β–„β–’β–ˆ # β–‘β–ˆβ–‘β–€β–„β–‘β–ˆβ–„β–‘β–ˆβ–€β–„β–„β–‘β–€β–‘β–€β–€β–‘β–„β–„β–€β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–ˆβ–‘ # β–‘β–‘β–ˆβ–‘β–‘β–‘β–€β–„β–€β–ˆβ–„β–„β–‘β–ˆβ–€β–€β–€β–„β–„β–„β–„β–€β–€β–ˆβ–€β–ˆβ–ˆβ–‘β–ˆβ–‘β–‘ # β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–€β–ˆβ–„β–„β–„β–ˆβ–„β–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–ˆβ–‘β–‘β–‘ # β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–€β–€β–„β–‘β–ˆβ–‘β–‘β–‘β–ˆβ–‘β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–ˆβ–‘β–‘ # β–‘β–‘β–‘β–‘β–‘β–€β–„β–‘β–‘β–‘β–‘β–‘β–€β–€β–„β–„β–„β–ˆβ–„β–ˆβ–„β–ˆβ–„β–ˆβ–„β–€β–‘β–‘β–ˆβ–‘β–‘ # β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–„β–„β–‘β–’β–’β–’β–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–’β–‘β–‘β–‘β–ˆβ–‘ # β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–€β–„β–„β–‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–‘β–‘β–‘β–ˆβ–‘ # β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–„β–„β–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘ # Get current volume cur_vol=$(osascript -e 'output volume of (get volume settings)') # To restore vol to current level restore_vol=$(echo ${cur_vol}/14 | bc) # Get bool if muted mute_state=$(osascript -e 'output muted of (get volume settings)') # If system doesn't have gshuf, not gonna work if [ ! -f $(which gshuf) ] ; then exit ; exit fi # Set vol to max osascript -e "set Volume 10" # Create temp dir if [ -d ~/temp ] ; then tempe=1 else tempe=0 mkdir ~/temp fi # Create list of annoying things to say curl -s https://raw.githubusercontent.com/jpf/dial-a-joke/master/jokes/www.textfiles.com/humor/JOKES/onelinrs.txt > ~/temp/jokes # Use gshuf to generate radom permutations # Use -n1 to get a phrase from list # Pipe it to say to transform text to speech (macOS) # Select a random voice that supports en_ (english) gshuf -n1 ~/temp/jokes | say --voice $(say --voice '?' | grep en_ | gshuf -n1 | awk '{ print $1 }') # Restore volume osascript -e "set Volume ${restore_vol}" if [[ ${mute_state} == "true" ]] ; then osascript -e 'set volume output muted true' fi # Cleanup if [[ ${tempe} = 0 ]] ; then \rm -Rf ~/temp else \rm -f ~/temp/jokes fi Put it somewhere hidden like /usr/local/tmp and change the mod to executable ...

April 25, 2023 Β· 2 min Β· oschvr

IPv6 support

Quick update after what I believe was my most popular post ever. I received an suggestion over an email message to enable IPv6 in this blog. Thing that I been meaning to do for a while now as I’ve been wanting to show my support to the cause So what did I do? Given that I’m hosting the whole thing in AWS (Cloudfront, S3, Route53), it really was trivial to do. Enable IPv6 in my Cloudfront distribution Set up AAAA record to the Cloudfront distribution Update all my images to use dualstack endpoints. So here it is. If you do: ...

January 19, 2023 Β· 1 min Β· oschvr

Things I want as SRE/DevOps from Devs

It has been a while since I’ve been working as SRE/Platform/Cloud Engineer, and lately and I realize I’ve been repeating some questions to developers that I rarely get an answer for straight away. These are not meant to make anyone’s life harder, au contraire, the whole pourpose of having a solid answer to this list of questions, is to make everyone less worried about the probabilty of some high stakes, overnight failure or a data handling missuse that could potentially cause big losses, and of course a lot of unnecessary stress. ...

December 15, 2022 Β· 3 min Β· oschvr

HumanOps Mantra

I just found this precious little jewel on the internet. The HumanOps-mantra I’m re-posting here as I strongly believe in every single point made in it. HumanOps Mantra Humans build and fix systems. Humans get tired and stressed, they feel happy and sad. Systems don’t have feelings yet. They only have SLAs. Humans need to switch off and on again. The wellbeing of human operators impacts the reliability of systems. Alert Fatigue == Human Fatigue Automate as much as possible, escalate to a human as a last resort. Document everything. Train everyone. Save time. Kill the shame game. Human issues are system issues. Human health impacts business health. Humans > systems

November 30, 2022 Β· 1 min Β· oschvr