Skip to content

Instantly share code, notes, and snippets.

View James-Firth's full-sized avatar
🐙

James Firth James-Firth

🐙
View GitHub Profile
@James-Firth
James-Firth / morse-code.json
Created October 15, 2015 22:00 — forked from mohayonao/morse-code.json
Morse code and reverse lookup
{
"0": "-----",
"1": ".----",
"2": "..---",
"3": "...--",
"4": "....-",
"5": ".....",
"6": "-....",
"7": "--...",
"8": "---..",
@James-Firth
James-Firth / Am_I_Root.sh
Last active August 29, 2015 14:27 — forked from PerpetualBeta/gist:6653157
Bash script header to elevate a script that needs to run as "root" if it is run without sudo. Background here: http://darkblue.sdf.org/weblog/post/got-root
# /bin/sh
if [[ $EUID -ne 0 ]]; then
echo 'This script must be run as "root".'
echo 'Enter password to elevate privileges:'
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
SELF=`basename $0`
sudo $SCRIPTPATH'/'$SELF
exit 1
fi
@James-Firth
James-Firth / hardlink_checker
Last active January 3, 2016 01:29 — forked from hollobon/gist:7579947
Forked from https://gist.github.com/hollobon/7579947/ This script recursively checks a directory's files for hardlinks. If there's no other links to a file the name is printed. TODO: Add flags to only print filenames above or below a link count threshold. Add a flag to be recursive.