Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominic Dumrauf dumrauf

View GitHub Profile
@dumrauf
dumrauf / rename_google_camera_app_portraits.sh
Created Sep 23, 2020
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
View rename_google_camera_app_portraits.sh
#!/bin/bash
# Stop on all errros
set -e
# Enable extended globbing
shopt -s extglob
for dir in IMG_*/
do
@dumrauf
dumrauf / basic_directories_diff.sh
Created Dec 20, 2019
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
View basic_directories_diff.sh
#!/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 / get_ghost_drafts.sh
Created Dec 16, 2019
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
View get_ghost_drafts.sh
#!/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 / curl-memory-only-cookie.sh
Last active Nov 28, 2019
Persisting cookies in memory only between curl requests; see https://www.how-hard-can-it.be/curl-cookie-memory-only-not-disk/ for details
View curl-memory-only-cookie.sh
You can’t perform that action at this time.