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
#! /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
/etc/update-motd.d/95-aws-tags | |
#!/bin/bash | |
# Print some info from the aws tags | |
# Color codes from http://stackoverflow.com/questions/4332478/read-the-current-text-color-in-a-xterm/4332530#4332530 | |
black=$(tput setaf 0) | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) |
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 | |
PATH="/bin:/usr/bin" | |
ipcs | |
read -p "press enter to kill all the ipc process owned by ${USER}" | |
IPCS_S=$(ipcs -s | egrep "0x[0-9a-f]+ [0-9]+" | grep ${USER} | cut -f2 -d" ") | |
IPCS_M=$(ipcs -m | egrep "0x[0-9a-f]+ [0-9]+" | grep ${USER} | cut -f2 -d" ") | |
IPCS_Q=$(ipcs -q | egrep "0x[0-9a-f]+ [0-9]+" | grep ${USER} | cut -f2 -d" ") |
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
#!/bin/bash | |
# Tweak hard drive performance stuff | |
for drive in sda sdb sdc sdd; do | |
if [[ -e /dev/${drive} ]] ;then | |
#increase readahead buffer on sata devices | |
/sbin/blockdev --setra 2048 /dev/${drive} | |
echo 1024 > /sys/block/${drive}/queue/read_ahead_kb | |
if smartctl -a /dev/${drive} |grep SSD;then | |
#SSDs do not have latency issues like traditional hdd so we tweak | |
echo "/dev/${drive} is a SSD, tweaking proc entries" |
NewerOlder