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
[program:consul] | |
command=/usr/local/bin/consul agent -config-dir=/etc/consul.d/client | |
stopsignal=INT | |
user=consul | |
stdout_logfile=/var/log/consul.log | |
stdout_logfile_maxbytes=50MB | |
stdout_logfile_backups=10 | |
autostart=true | |
autorestart=true |
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/sh | |
# | |
# /etc/rc.d/init.d/supervisord | |
# | |
# Supervisor is a client/server system that | |
# allows its users to monitor and control a | |
# number of processes on UNIX-like operating | |
# systems. | |
# | |
# chkconfig: - 64 36 |
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
[unix_http_server] | |
file=/var/tmp/supervisor.sock ; (the path to the socket file) | |
[supervisord] | |
minfds = 1024 | |
minprocs = 200 | |
loglevel = info | |
logfile = /var/log/supervisord.log | |
logfile_maxbytes = 50MB | |
nodaemon = 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
+----------------------------------------+-----------------------------------------------------------------------+ | |
| variable_name | variable_value | | |
+----------------------------------------+-----------------------------------------------------------------------+ | |
| admin-stats_credentials | stats:stats | | |
| admin-telnet_admin_ifaces | (null) | | |
| admin-telnet_stats_ifaces | (null) | | |
| admin-refresh_interval | 2000 | | |
| admin-read_only | false | | |
| admin-version | 1.2.2 |
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
from __future__ import absolute_import | |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from itertools import repeat | |
from math import fmod | |
import quantumrandom | |
try: | |
range = xrange | |
except NameError: |
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 | |
# | |
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" | |
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT | |
sudo service iptables save | |
sudo sed -i 's/.*net.ipv4.ip_forward = 0*/net.ipv4.ip_forward = 1/' /etc/sysctl.conf | |
sudo sysctl -e -p /etc/sysctl.conf | |
sudo service iptables restart |
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 | |
# Mount and format the disks | |
sudo mkdir -p /data | |
sudo yum install xfsprogs -y | |
sudo /usr/share/google/safe_format_and_mount -m "mkfs.xfs -isize=512" /dev/sdb /data | |
sudo echo "Mount persists" | |
sudo sh -c "echo \"/dev/sdb /data xfs noatime,data=writeback,errors=remount-ro 0 1\" >> /etc/fstab" | |
sudo echo "fstab 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
#!/bin/bash | |
BackupDir=logbackup | |
HomeDir=/archive/$HOSTNAME | |
# Set $BackupYear equal to 4 characters of $f starting with the first character, the YYYY | |
BackupYear=$(date +"%Y") | |
# Set $BackupMonth equal to 2 characters of $f starting with the fifth character, the MM | |
BackupMonth=$(date +"%m") | |
# Test to see if the main backup directory exists if not then create it | |
if [ ! -d $HomeDir/$BackupDir ]; then |
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/sh | |
# | |
function compile_bin { ./configure --prefix=/usr; make && make install; wait 3; } | |
function download_untar { wget -O - "http://downloads.sourceforge.net/fuse/fuse-2.9.3.tar.gz" | tar -xzvf - ; wget -O - "https://github.com/s3fs-fuse/s3fs-fuse/archive/v1.78.tar.gz" | tar -xzvf - ; } | |
echo "Build the S3 fuse with native binaries" | |
download_untar | |
# | |
cd fuse-2.9.3 | |
compile_bin | |
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/ |
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
#!/usr/bin/python | |
import subprocess, sys, shlex | |
def main(argv): | |
args = shlex.split(argv) | |
op = subprocess.Popen(args,stdout=subprocess.PIPE) | |
result, err = op.communicate() | |
op.wait() | |
tw = op.returncode | |
# Use the result , error and return code here for extra processing |