This file contains hidden or 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 is a little script that will install the required puppet modules. | |
# It was written to help setup vagrant. It is called as a provision script. | |
# | |
# # This installs the modules | |
# config.vm.provision :shell do |shell| | |
# shell.path = "./puppet/install_puppet_modules.sh" | |
# end | |
# |
This file contains hidden or 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 | |
generic_handler () { | |
kill -s $1 $PID | |
while kill -0 $PID &>/dev/null | |
do | |
wait $PID | |
done | |
} |
This file contains hidden or 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
# Enable ssh tunneling on remote server | |
GatewayPorts yes | |
ClientAliveInterval 30 | |
ClientAliveCountMax 99999 | |
# Example tunnel from local server | |
# $ ssh -R8081:127.0.0.1:8080 [email protected] | |
# $ curl example.com:8081 |
This file contains hidden or 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
# Clones a repository from our github | |
# Info: https://github.com/puppetlabs/puppetlabs-vcsrepo/blob/master/README.GIT.markdown | |
class web::repo ($revision, $latest=false) { | |
# Git is used to install our repositories | |
ensure_resource('package', 'git', {'ensure' => 'present'}) | |
class { 'ssh::client': | |
storeconfigs_enabled => false, |
This file contains hidden or 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
exec { 'pull-changes': | |
# This unless command makes it so this exec only runs when the branch is behind the head | |
unless => [ | |
"/bin/bash -c 'cd /var/www/django/django \ | |
&& CURRBRANCH=$(/usr/bin/git rev-parse --abbrev-ref HEAD)\ | |
&& /usr/bin/git fetch origin \$CURRBRANCH \ | |
&& /usr/bin/git rev-list HEAD...origin/\$CURRBRANCH --count'\ | |
| /bin/grep '0'" | |
], |
This file contains hidden or 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 | |
# A simple nagios check for Redis set length | |
# | |
# It doesn't require any redis libraries and uses the raw api | |
# | |
# @author Richard Caceres ([email protected]) | |
# @license MIT | |
# @example check_redis_llen -c 50 -w 10 -k celery -h localhost -p 6379 | |
# Parse -c -w args |
This file contains hidden or 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
# A simple configuration file for monitoring the local host | |
# This can serve as an example for configuring other servers; | |
# Custom services specific to this host are added here, but services | |
# defined in nagios2-common_services.cfg may also apply. | |
# | |
define host{ | |
use generic-host ; Name of host template to use | |
host_name localhost | |
alias localhost |
This file contains hidden or 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
# Install NTP for clock syncing | |
apt-get install -y ntp | |
/etc/init.d/ntp start | |
# Install Puppet from official packages | |
cd | |
mkdir source | |
cd source | |
sudo wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb | |
sudo dpkg -i puppetlabs-release-precise.deb |
This file contains hidden or 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
# Run with "foreman start" | |
gulp: gulp | |
server: sh -c 'cd public && python -m SimpleHTTPServer 9876' |
This file contains hidden or 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
""" | |
A pretty nice time parsing regex. | |
@author Richard Caceres, @rchrd2 | |
""" | |
import re | |
# The history for this regex is stored in my gist | |
# https://gist.github.com/rchrd2/9773922 | |
time_range_regex = re.compile(r''' |