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 | |
# GITLAB | |
# Maintainer: @randx | |
# App Version: 6.0 | |
### BEGIN INIT INFO | |
# Provides: gitlab | |
# Required-Start: $local_fs $remote_fs $network $syslog redis-server | |
# Required-Stop: $local_fs $remote_fs $network $syslog |
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 | |
declare -a files | |
IFS=$'\n' | |
# Check for puppet lint | |
if requires=$(which puppet puppet-lint git 2>&1) ;then | |
: #We have puppet-lint and git, good | |
else | |
echo -e "Error, missing required item(s) from path.\n Requires: git puppet-lint\n\nFound:\n${requires}" | |
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 | |
# | |
# Rsyncr (Rsync Retry) 2016 David Mcanulty | |
# Runs rsync, retrying on errors up to a maximum number of tries with incremental backoff (delay) | |
# Based on idea from https://gist.github.com/iangreenleaf/279849 by iangreenleaf 2011 | |
# Set your max rsync retries here | |
max_retries=50 | |
# Trap interrupts (ctrl-c) and exit instead of continuing the loop |
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
# This restarts the agent every 30 days, to make sure its not hung | |
# And also checks that the lockfile isn't more then 1 hour old | |
check process puppet with pidfile /var/run/puppet/agent.pid | |
group system | |
start program = "/usr/sbin/service puppet start" | |
stop program = "/usr/sbin/service puppet stop" | |
if 5 restarts within 5 cycles then timeout | |
if uptime > 30 days then restart |
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 | |
# Auto start xen instance confs based on images present | |
cd /home/dave/xen/images/ | |
for xenimage in *.img ;do | |
xm create ${xenimage%%\.*} | |
sleep 30 | |
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
#!/bin/bash | |
# Check for user input | |
process=$@ | |
if [[ -z "${process}" ]] ;then | |
echo "This program requires a process name." | |
echo "The (oldest) given process name will be killed" | |
echo "if it has been running for > 24 hours" | |
exit 1 | |
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
#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 | |
# sgrab - David Mcanulty 2013 | |
# | |
# Inspried by gist: https://gist.github.com/Saicheg/4231551 | |
# Automatically grabs a screenshot of a the currently active | |
# window after a short delay (default is 2 seconds), and | |
# then copies it to /Dropbox/Public/share/Screenshots/hostname/ | |
# and saves a tiny url encoded path to your system's clipboard | |
# | |
# You can use any scrot switch to override the defaults, like --select |
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 / |
OlderNewer