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
#!/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 |
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
## 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 | |
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
# 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 |
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
#!/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" |
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
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 |
NewerOlder