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
#write each second ten times | |
sar -A -o /tmp/sar-snapshot-$(date +%Y-%m-%d%H-%M-%S) 1 10 | |
# read | |
sar -f /tmp/sarsnapshot-2012-04-0911-21-55 | |
sar -f /tmp/sarsnapshot-2012-04-0911-21-55 -b | |
# etc.. |
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
set daemon 120 | |
set logfile syslog facility log_daemon | |
check process es with pidfile /home/es/elasticsearch-0.17.10/var/run.pid | |
start program = "/home/es/elasticsearch-0.17.10/bin/elasticsearch -p /home/es/elasticsearch-0.17.10/var/run.pid" | |
stop program = "kill $(cat /home/es/elasticsearch-0.17.10/var/run.pid)" | |
# humm.. need to improve this... | |
if cpu > 80% for 20 cycles 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 | |
case $1 in | |
start) | |
echo $$ > /var/run/bucky.pid; | |
exec 2>&1 /usr/local/bin/bucky --disable-collectd --statsd-ip=192.168.0.1 /etc/bucky.py | logger -t bucky | |
;; | |
stop) | |
kill `cat /var/run/bucky.pid` ;; | |
*) | |
echo "usage: bucky {start|stop}" ;; |
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
<VirtualHost *:80> | |
ServerName es.yourhost.com | |
<Proxy balancer://main> | |
BalancerMember http://127.0.0.1:9200 max=1 retry=5 | |
<Limit GET > | |
order deny,allow | |
deny from all | |
allow from 127.0.0.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
socat -d -d tcp-l:1234,reuseaddr,fork file:/dev/ttyUSB0,nonblock,raw,echo=0,waitlock=/var/run/tty,min=0,b38400 |
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
knife ec2 server create -I ami-359ea941 -f t1.micro -x ubuntu --region 'eu-west-1' -Z 'eu-west-1a' |
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
sed -i "209 d" .ssh/known_hosts |
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
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140) |
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/sh | |
### BEGIN INIT INFO | |
# Provides: logstash-shipper | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start daemon at boot time | |
# Description: Enable service provided by daemon. |