I hereby claim:
- I am alloydwhitlock on github.
- I am alloydwhitlock (https://keybase.io/alloydwhitlock) on keybase.
- I have a public key whose fingerprint is 2260 8CFD 4C57 12F7 8EED 7514 AD0C DE08 F3C9 54FA
To claim this, I am signing this object:
## Load curl_json plugin | |
LoadPlugin curl_json | |
<Plugin curl_json> | |
<URL "http://localhost:28017/serverStatus?text=1"> | |
Instance "mongodb" | |
## Specify JSON array keys to collect information | |
#!/bin/bash | |
# | |
#Name: Fail Detection | |
#Function: If the previously executed command fails the script will exit. | |
function failDetect () { | |
if [ $? -eq 0 ]; then | |
echo -e "Something went horribly wrong... exiting script." | |
exit 2 | |
fi |
-- These are two separate Applescripts that can be executed within an automator workflow. Create a new workflow, create two “run applescript” actions, and paste them. This script will copy the RSA token, set your PIN, and paste it. If you don’t want the pin copied, remove the two lines with “pin” in the second applescript. There are instructions online about setting workflows as services which can be called via key commands. | |
-- You can set the “terminalapp” to whichever app you use (I use iTerm) and the “pin” to your PIN. | |
on run {input, parameters} | |
set terminalapp to "iTerm" | |
set pin to "6666" | |
on run {input, parameters} | |
tell application "System Events" | |
set frontApp to first application process whose frontmost is true | |
set frontAppName to name of frontApp | |
end tell | |
tell application "SecurID" | |
activate |
#!/bin/bash | |
# Name: sudoaudit | |
# Author: Adam Whitlock | |
# Version: 0.1 | |
# Purpose: Send e-mail when sudo is invoked by a user | |
# | |
# Note: Please setup the following parameters in /etc/sudoers: | |
# mailto: "[email protected]” | |
# mail_always: on |
#!/usr/bin/env bash | |
# Name: date_offset.sh | |
# Description Subtract offset days from current epoch date | |
# | |
# Last Update: 11/04/2014 | |
# How many days back | |
day_offset="49" |
# Add this line to a user's ~/.bashrc to automatically attach a tmux session upon login. | |
# Credit goes to William Shallum for writing this gist (http://william.shallum.net/random-notes/automatically-start-tmux-on-ssh-login) | |
if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ] | |
then | |
STARTED_TMUX=1; export STARTED_TMUX | |
sleep 1 | |
( (tmux has-session -t remote && tmux attach-session -t remote) || (tmux new-session -s remote) ) && exit 0 | |
echo "tmux failed to start" | |
fi |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# | |
# Clear SSH control master sockets if using Cisco AnyConnect on Mac OS X | |
$(command -v ifconfig) | $(command -v grep) 'tun3' > /dev/null 2>&1 | |
[[ $? -eq 0 ]] && rm -f ~/.ssh/master-alloydwhitlock@* && echo "Cleared SSH control masters from prior connections..." |
alias bastionssh='ssh -X -K -D 9999 targethost.example.com -t tmux attach -t session_name' |