-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e70742
commit 3893978
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,11 @@ export -f pytags | |
alias jstags='ctags -R --exclude=.git --exclude=log *' | ||
|
||
alias mhome='mosh -a [email protected] --ssh="ssh -p 2222"' | ||
function loadnvm { | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | ||
} | ||
export -f loadnvm | ||
|
||
# Copies 2 factor auth code to clipboard from yubikey. | ||
# Requires this: https://developers.yubico.com/yubikey-manager/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CUTOFF="2017-08-25T16:13:42Z" | ||
|
||
for job in $( kubectl get jobs -o name ); do | ||
if [[ "$( kubectl get "${job}" -o jsonpath="{.status.conditions[0]['status','type']}" )" != "True Complete" ]]; then | ||
continue | ||
fi | ||
|
||
completionTime="$( kubectl get ${job} -o jsonpath='{.status.completionTime}' )" | ||
if [[ "$completionTime" < "$CUTOFF" ]]; then | ||
kubectl delete "${job}" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
host="$@" | ||
echo $host | ||
if [ -z "$host" ]; then | ||
echo "Supply a hostname" | ||
exit 1 | ||
fi | ||
|
||
# remove any existing agent socket (in theory `StreamLocalBindUnlink yes` does this, | ||
# but in practice, not so much - https://bugzilla.mindrot.org/show_bug.cgi?id=2601) | ||
ssh $host rm -f ~/.gnupg/S.gpg-agent | ||
ssh -t -R ~/.gnupg/S.gpg-agent:.gnupg/S.gpg-agent-extra $host \ | ||
sh -c 'echo; echo "Perform remote GPG operations and hit enter"; \ | ||
read; \ | ||
rm -f ~/.gnupg/S.gpg-agent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters