Skip to content

Instantly share code, notes, and snippets.

View TimothyGillespie's full-sized avatar

Timothy Gillespie TimothyGillespie

View GitHub Profile
@TimothyGillespie
TimothyGillespie / logSpeed.sh
Last active February 28, 2022 01:04
Automatically log your internet speed (raw output and extracted values to a csv). See details in the comments.
#!/bin/bash
date >> /home/pi/speedtest/speedtest.log
note=`/usr/bin/speedtest -p no`
echo "$note" >> /home/pi/speedtest/speedtest.log
DATE=$(date)
SERVER=$( echo "$note" | grep "Server:" | sed 's/^.*Server://' | xargs )
ISP=$( echo "$note" | grep "ISP:" | sed 's/^.*ISP: //' | xargs )
LATENCY=$( echo "$note" | grep "Latency:" |sed 's/^.*Latency: //' | xargs )
DOWNLOAD=$( echo "$note" | grep "Download:" | sed 's/^.*Download: //' | xargs )
@TimothyGillespie
TimothyGillespie / TimothyGillespie.asc
Created January 2, 2022 03:57
Public Key timothy@gillespie.eu
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGEYctsBEAC3sAbhm3BSKnbhOKIV15VVhY60jWZ+6ohlJ116S3lFy0kK1q90
iVuBSh35JlLPmRB9uaCqQQN/rbCAQqiL907fzIW0/u6HVEnif9j2QcqKrEvJAUOT
VlTv0S1w7S/1YUP/09oCpkiifvZdu8cUox0uDLQ8rgIdHm9jokabO8IdgHdp9VHL
Fusg0fXedj3Zt4cGf4hByPtdp2qN0wwdhv6wW18tCHvtWUOfeLwojMHwkbaP5OMN
9JguywtnavbUnTG4qW1q7vZxdiyJkZmzTiBw3rrJKpIGWcpyb+XmkaoQ8HG9nKQV
0BpcQN6aWk37Cj/pWLJwrMGQHaIt1ISJoXlT1AU40H1t+nQeJw9Z8heENiwPzfAT
07+539IyppF88NSdnHGPveHHJmhVpmzadquZwnkawLdusv+Bno/grmKvvA93X+Aj
UvSat5FH3ewjxIC/kWhpu6/6xWT4c8RKN5TC1984a/cFcGmuCLU0JnrD8IxBpQ8S
@TimothyGillespie
TimothyGillespie / blinkWords.py
Created December 5, 2021 16:05
To run this save all three scripts in the same folder and run `python3 blinkWords.py someword`. You of course need python 3 and a Raspberry Pi. Configure the GPIO pin in morseToBlink.py on line 6 as you need.
from morseToBlink import blinkMorsecode
from wordsToMorsecode import textToMorsecode
import sys
blinkMorsecode(textToMorsecode(sys.argv[1]))
@TimothyGillespie
TimothyGillespie / commit-msg
Last active December 4, 2022 15:51
Git Hook: Prepend Ticket Id From Branch Name. If other ticket IDs are prepended keep all of them.
#!/bin/bash
# Change this; if the ticket prefix and id is separated by a dash you will need to include it here
TICKET_PREFIX='TICKET-'
# Get Git branch; use grep with extended regex to capture the tickets
TICKET_IDS_BRANCH=$(git rev-parse --abbrev-ref HEAD | grep -oE "${TICKET_PREFIX}[0-9]+")
COMMIT_MESSAGE=$(cat $1)
@TimothyGillespie
TimothyGillespie / changeAuthorAndCommiterInfo.bash
Last active January 5, 2022 01:48
Change commiter email and name caught by email
# Attribution:
# https://stackoverflow.com/a/34851024
#As you mentioned in your question (the link to the answer you found), this is the script indeed.
#Note:
#filter-branch is doing a rebase (will rewrite the history of the branch) which means that everyone who had a copy of the branch will have to delete and checkout it again.