Skip to content

Instantly share code, notes, and snippets.

View the-moog's full-sized avatar
💭
Not looking for a new job

Jay the-moog

💭
Not looking for a new job
  • Qualcomm/QTI, UK, Cambridge
  • Cambridge, UK
  • 06:18 (UTC +01:00)
View GitHub Profile
@the-moog
the-moog / rainbow.sh
Last active June 9, 2023 13:21
Bash shell scipt that prints lots of colous on an ANSI terminal
#!/bin/bash
# rainbow
# A bash script that prints a nice set of colours on an ANSI terminal
# Written as a platform to test capability and conformance, but it's also pretty!!
# Written in celebration of Pride Month 2023 and support of LGBTQ+
# J. Morgan (@the-moog on github)
#
# License: MIT: Free to the community not commercial gain and no warranties applied.
@the-moog
the-moog / README.md
Created September 13, 2023 13:02
shebang: '/usr/bin/env /path/interpreter' or '/usr/bin/env interpreter'??

Running

Notice that #2 in the 2nd example is the only one that works

1: Without user PATH

./envtest1;./envtest2;./envtest3

diff <(cat env_envtest1) <(cat env_envtest2)
@the-moog
the-moog / .bash_aliases
Last active February 9, 2024 18:43
Got fed up trying to work out which .ssh key maps to which host hence: alias (or function) lskeys
alias lskeys='for kf in ~/.ssh/*.priv; do read -rst 2 size fingerprint userid txt <<<$(ssh-keygen -l -f ${kf});\
printf "KEYFILE: %-50s - BITS: %-6d FP: %s, USER: '%s', INFO: '%s'\n" "$(basename ${kf})" "${size}" "${fingerprint}" "${userid}" "${txt}"; done'
@the-moog
the-moog / remote-sftp.shsrc
Created November 7, 2024 04:49
Running remote sftp commands from a script
# use the source, Luke
# > source remote-sftp.shsrc
action="df -h\nexit\n"
for d in / /vol /vol/homes /vol/Public; do
echo "${d}:"
echo -e "${action}" | sftp "user@fs1:${d}"
echo "${d}/:"