Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →
We'll go over how to determine this and cover a use case of when you might want to create a script that handles both.
This can be handy to delete temp files that your script creates or to always write a log file out if the script works or fails.
You may want to do this before recording videos, giving presentations at work, demoing something for clients or live streaming.
The script handles calling another script with an optional position argument and 0 or more command line flags.
This can help detect how long a server has been up or when you may have powered it off. We'll track reboots too.
This can save you from writing a file to a temporary directory and then moving it after using mkdir.
We'll go over examples with echo, how to use it for creating files and making multiple curl requests. It's a flexible feature!
Here's a few ways to output multiples files so you can skim which file has which content.
Aliases and shell functions serve a similar purpose, but they don't need to be kept in the same file.
Sometimes you want to experiment and revert the changes you've made to their last known good state or dispose of files.
We'll go over using short flags, long flags, flags with and without values and required positional arguments.
There's a couple of ways to split strings into an array with a 1 character or multi-character delimiter.
Provide a file along with a start / end time and ffmpeg will do the rest. We'll also make a tiny wrapper script to make it easier to use.
Here's how you can fix HTML templates not being updated in development after upgrading to Django 4.1+.
It's worth documenting and running through the process before disaster strikes while the stakes are low.
This is useful if you have a handful of repos using a different SSH key than your usual default key.
Occasionally I want to POST human formatted JSON with curl, here's how to do that without using shell hacks or temp files.
No longer get tricked by fake PNG files that have checker box patterns as their background when searching for a transparent image.
Starting with Bash 4+ you can assign arrays with keys and values. Here's how to declare, update and loop over them.
Most shell scripts I create start the same, this saves a bit of time from having to create, chmod the file and set a few options.
Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per month (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.