Skip to content

Instantly share code, notes, and snippets.

View dumrauf's full-sized avatar

Dominic Dumrauf dumrauf

View GitHub Profile
@dumrauf
dumrauf / get_ghost_drafts.sh
Created December 16, 2019 20:03
Get all draft post URLs from a given Ghost installation and output them to a given file; see https://www.how-hard-can-it.be/getting-all-draft-posts-ghost-blog/ for details
#!/bin/bash
# This Bash script gets all draft post URLs from a given Ghost installation and
# outputs them to a given file; see <https://www.how-hard-can-it.be/getting-all-draft-posts-ghost-blog/>
# for details
# Stop on all errors
set -e
@dumrauf
dumrauf / basic_directories_diff.sh
Created December 20, 2019 18:10
Find out if two directories contain the same files or where they differ; see https://www.how-hard-can-it.be/basic-directories-diff/ for details
#!/bin/bash
# Input parameter validation
if [ "$#" -lt 2 ]; then
script_name=$(basename "$0")
echo "Usage: ${script_name} <directory-one> <directory-two>"
echo "Example: ${script_name} one/ two/"
exit -1
fi
@dumrauf
dumrauf / rename_google_camera_app_portraits.sh
Created September 23, 2020 21:08
Batch rename Google Camera App portraits for organisation in a single directory; see https://www.how-hard-can-it.be/batch-rename-google-camera-portraits/ for details
#!/bin/bash
# Stop on all errros
set -e
# Enable extended globbing
shopt -s extglob
for dir in IMG_*/
do
@dumrauf
dumrauf / curl-memory-only-cookie.sh
Last active November 17, 2022 05:38
Persisting cookies in memory only between curl requests; see https://www.how-hard-can-it.be/curl-cookie-memory-only-not-disk/ for details