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
#setup my_project via venv | |
proj_path="/usr/local/scripts/my_project/" | |
venv_path="${proj_path}/venv" | |
if [[ ! -d ${venv_path} ]] ;then | |
echo "Installing virtualenv ..." | |
virtualenv ${venv_path} | |
source ${venv_path}/bin/activate | |
pip install -r ${proj_path}/dependencies.txt | |
# Following 2 lines only needed if exporting libs | |
#cd ${proj_path} |
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 | |
lockfile=/var/lock/$(basename $0) | |
#Redirects output of file descriptor 5 to lockfile while this script runs | |
exec 5>"${lockfile}" | |
# flock file descriptor 5, otherwise fail | |
if ! flock -n 5 ; then | |
echo "Exiting: Another instance of $0 is already running"; | |
exit 1 |
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 | |
echo "DNS Checker v1.0 David Mcanulty 2017" | |
echo -e "\t- # repeatably tests dns and records success/failures\n" | |
success=0 | |
failure=0 | |
dnshost=$1 | |
datestamp=$(date) | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) |
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
frontend stats | |
bind :8080 | |
use_backend be_stats unless { path /favicon.ico } | |
errorfile 503 /etc/haproxy/errors/haproxy-favicon.ico | |
backend be_stats | |
stats enable | |
stats uri / |
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
# Fix ssh sockets so they always work in Tmux/Screen, even after you re-connect dmcanulty 2021 | |
# | |
# After putting this file at ~/.ssh/rc add the following to your ~/.bash_aliases | |
# alias ssh="SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock; ssh" | |
# alias git="SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock; git" | |
# If the symlink does not point at a valid socket, and the env variable is a valid socket, make a symlink | |
if [ ! -S ~/.ssh/ssh_auth_sock ] && [ -S "$SSH_AUTH_SOCK" ]; then | |
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock | |
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
# Make things colorful | |
set -g default-terminal "screen-256color" | |
setw -g window-status-current-format '#[fg=white]#I:#{?window_zoomed_flag,#[fg=colour201]#W,#W}' | |
# Window title for Putty,xterm,etc | |
set -g set-titles on | |
set -g allow-rename on | |
# ctrl-b / sets window name to hostname -s | |
bind-key / send-keys "printf \"\\033k$(hostname -s)\\033\ \"" \; send-keys "Enter" |
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 | |
# | |
# This script grabs the Name, Ip and environment tags from aws. | |
# It then grabs a cesi conf header file and appends (using heredocs). | |
config="/opt/cesi/defaults/cesi.conf.toml" | |
tmpconf="/tmp/cesi.conf.toml" | |
# Create the header in our new copy of conf file | |
cp -f "${config}.head" ${tmpconf} |
OlderNewer