Various snippets of Linux commands & scripts I use enough to justify existing on my $PATH

git_fp Link to heading

git fetch & pull

#!/usr/bin/env bash
git fetch
git pull
echo "Fetched n pulled any new content."

git_send Link to heading

git add, commit and push in one

#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
    echo 'Expected commit message'
    exit 1
fi
git add .
git commit -m "$1"
git push

gitr Link to heading

Recursive git clone

alias gitr="git clone --recursive"

git_authors Link to heading

Get the names and emails of all git commiters

alias git_authors="git -C . shortlog -ens"

decrypt_gpg Link to heading

Decrypt all gpg files in current dir

#!/usr/bin/python3
import os
from pathlib import Path


for path in Path(".").rglob("*.gpg"):
    file_name = path.name
    output_name = file_name.removesuffix(".gpg")
    os.system(f"gpg --output \"{output_name}\" --decrypt \"{file_name}\"")

print("Decrypted all found files.")

fish Link to heading

alias fish=asciiquarium

Export and import terminal stuff Link to heading

source system:

dconf dump /org/gnome/terminal/legacy/profiles:/ > gnome-terminal-profiles.dconf

destination system (after transferring the gnome-terminal-profiles.dconf file):

dconf load /org/gnome/terminal/legacy/profiles:/ < gnome-terminal-profiles.dconf

From this.

The relevant dconf file exists under this domain also.

File sizes Link to heading

df -H

sudo du -h --max-depth=1