Passing a private key as an environment variable (1 mins read).
How to convert a PEM-encoded private key in a form to be stored in an environment variable.
Passing a private key as an environment variable (1 mins read).
How to convert a PEM-encoded private key in a form to be stored in an environment variable.
Small tip: a delightful bash alias that helped me today alias '$'='' lets you copy tutorials that include '$' verbatim.swyx 🌴 (@swyx)Mon, 07 Feb 2022 16:19 GMT
A tool for glamorous shell scripts 🎀. Contribute to charmbracelet/gum development by creating an account on GitHub.
When should I use env
to start a command with environment variables? (2 mins read).
When you should use the env
command to specify environment variables when executing a command on the command-line (TL;DR: always).
Recommended read: PIPEFAIL: How a missing shell option slowed Cloudflare down https://blog.cloudflare.com/pipefail-how-a-missing-shell-option-slowed-cloudflare-down/
Recommended read: That simple script is still someone's bad day https://rachelbythebay.com/w/2022/04/05/pipe/
I've recently been doing similar with some of my utilities, albeit with an informal comparison between Ruby and Go versions, but would agree that for large, production critical scrips, this is a great way to do it
Recommended read: Rewriting Bash scripts in Go using black box testing https://stackoverflow.blog/2022/03/09/rewriting-bash-scripts-in-go-using-black-box-testing/
Shell scripts have been around for 50 years.
Ian Miell (@ianmiell)Sat, 20 Nov 2021 07:33 GMT
Recommended read: shell - What is the difference between the Bash operators [[ vs [ vs ( vs ((? - Unix & Linux Stack Exchange https://unix.stackexchange.com/questions/306111/what-is-the-difference-between-the-bash-operators-vs-vs-vs
The hardest problem in computer science is escaping a quotation mark in a bash string.
Lorin Hochstein (@norootcause)Mon, 17 May 2021 15:32 +0000
Getting your .zshrc Just Right® has a very pronounced IKEA effect. It's a huge investment, but it feels so darn great 😆
Guillermo Rauch (@rauchg)Sun, 27 Dec 2020 18:49 GMT
One of the fights I keep losing at ${DAYJOB} is “don’t use short flags in shell scripts if you have long flags available; make things easier for the people who come after you” And like... I do not understand why this is controversial or why people resist it so strongly.Ryan McKern 🇵🇷 (@the_mckern)Fri, 18 Dec 2020 00:55 GMT
Recommended read: Escaping strings in Bash using !:q | Simon Willison’s TILs https://til.simonwillison.net/til/til/bash_escaping-a-string.md
TIL that you can use the "DEBUG" trap to step through a bash script line by line
🔎Julia Evans🔍 (@b0rk)Sat, 03 Oct 2020 15:24 +0000
I very much recommend learning how to use a more well-structured scripting language than Bash, as languages such as Ruby have a great standard library, a huge ecosystem of other libraries, and are commonly installed across machines - this is a great look at partially replacing shell scripts with Ruby
Recommended read: Enhanced Shell Scripting with Ruby https://www.devdungeon.com/content/enhanced-shell-scripting-ruby
Recommended read: Take care editing bash scripts https://thomask.sdf.org/blog/2019/11/09/take-care-editing-bash-scripts.html
I used to write a lot of shell scripts before realising that what I was trying to do was treat shell scripting as a "full" scripting language (I won't define here what I mean by "full").
Its not - reach for a higher level scripting language like Ruby or Python when things are getting more complicated, and allow shell scripts to glue things together, or be for quick tasks maybe a few lines long.
When you do write them, this advice is great but it's definitely worth gaining understanding of when you should and shouldn't use them.
Recommended read: Anybody can write good bash (with a little effort) https://blog.yossarian.net/2020/01/23/Anybody-can-write-good-bash-with-a-little-effort
Parsing a Unix Epoch With Bash/Ruby on the Command-Line (1 mins read).
How to convert a Unix Epoch to a human-readable date format.
Recommended read: Using Bash to automate Rubocop fixes https://krmannix.com/2019/12/12/using-bash-to-automate-rubocop-fixes/
Recommended read: Beware of shell globs https://soptik.tech/articles/beware-of-shell-globs.html
Recommended read: Things You Didn't Know About GNU Readline https://twobithistory.org/2019/08/22/readline.html
Recommended read: Stupid UNIX Tricks https://sneak.berlin/20191011/stupid-unix-tricks/
This is a great article about how to be safer when writing shell scripts. I am a huge proponent of not using them where possible, and instead moving them to another scripting language (Ruby, Python, Node) which you can test, and use a shared standard library.
Recommended read: Use the Unofficial Bash Strict Mode (Unless You Looove Debugging) http://redsymbol.net/articles/unofficial-bash-strict-mode/
Adding Newlines to all Files in Git (3 mins read).
Adding newlines at the end of all Git-tracked files.
A sneaky and interesting way to trick someone into running a fork bomb, even if they know it may be one!
Recommended read: Tricking the tricksters with a next level fork bomb - Vidar Holen https://www.vidarholen.net/contents/blog/?p=766
In every programming language, there is a linting tool that can help pick up on some common style issues. ShellCheck isn't one of those - it's so much more!
I've been using it for many years now, and since it came into my life it's honestly changed the way I use shell scripts. There have been so many pitfalls that I've avoided falling into since learning about them (and adding ShellCheck to my Vim linting setup.
This is a great read from Vidar, the ShellCheck author, about a case where it could've caught issues that caused the deletion of a production database!
Recommended read: https://www.vidarholen.net/contents/blog/?p=746 https://www.vidarholen.net/contents/blog/?p=746
Automating Promotion of Jekyll Posts from Draft to Post (2 mins read).
The handy script I've created to automate publishing a draft in Jekyll, with handy Zsh + Bash autocomplete.
My editorial workflow for blog posts (8 mins read).
Taking you through the journey I go on when writing blog posts, from ideation to publishing the post.
Viewing Git history of a file in git log
while ignoring file renames (5 mins read).
How to track changes to files in Git without pesky file renames getting in the way, using git log --follow
.
SSLError
When Running Berkshelf Behind a Proxy (2 mins read).
Getting around the pesky OpenSSL::SSL::SSLError SSLv2/v3 read server hello A
error when running Berkshelf behind a proxy.
Viewing your diff while writing your commits with git commit --verbose (3 mins read).
Making it easier to write commit messages by having the diff in your editor.
Extracting SSL/TLS Certificate Chains Using OpenSSL (1 mins read).
A quick one-liner to get you the full certificate chain in .pem
format.
You're currently viewing page 1 of 1, of 32 posts.