Skip to content

Instantly share code, notes, and snippets.

@dafydd
dafydd / stt
Created August 30, 2025 15:54
short machine status
#!/usr/bin/env bash
#ssum: machine status report
UNAME=`uname`
if [ 'Linux' == "$UNAME" ]
then
MACHINE=`hostname`
OSVERSION=`cat /etc/issue`
IP=`hostname --all-ip-addresses`
fi
@dafydd
dafydd / gitcon
Last active August 30, 2025 15:49
find out if our git repos are behind and likely merge statuses
#!/usr/bin/env python3
"""
Scan repos for "behind upstream" status (i.e. you need to catch up).
Optionally hints whether a merge would likely be clean (no working tree changes).
Usage:
./gitcon # scans ~/code
./gitcon /path/to/src # scan a different base directory
"""
@dafydd
dafydd / rscan
Last active August 30, 2025 16:03
find out what's not checked in and what's not pushed
#!/usr/bin/env python3
import os
import subprocess
def find_git_repos_with_unpushed_commits(base_dir):
messages = []
for root, dirs, files in os.walk(base_dir):
if '.git' in dirs:
repo_dir = root
try:
@dafydd
dafydd / .aliases
Last active August 30, 2025 16:46
shortcuts
#frequent
alias c="clear;pwd;echo;ls;echo;"
alias e="exit"
alias m="more"
alias o="open.sh"
alias sc="sc2"
alias cd-="cd .."
alias u="cd .."
alias u2="cd ../.."
alias u3="cd ../../.."