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 | |
# | |
# unicorn_redmine Startup script for unicorn for redmine | |
# | |
# chkconfig: - 86 14 | |
# processname: unicorn_rails | |
# pidfile: /opt/redmine/tmp/pids/unicorn.pid | |
# description: Rails application server for Redmine | |
# | |
### BEGIN INIT INFO |
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
read USER_NAME | |
useradd ${USER_NAME} | |
mkdir -m 700 /home/${USER_NAME}/.ssh | |
cat << _EOF_ > /home/${USER_NAME}/.ssh/authorized_keys | |
chmod 400 /home/${USER_NAME}/.ssh/authorized_keys | |
chown ${USER_NAME}:${USER_NAME} -R /home/${USER_NAME}/.ssh |
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
yum -y install python-setuptools | |
easy_install fabric |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# sample src | |
# | |
# D-U-DENY-1,match,source-address,any | |
# D-U-DENY-1,match,destination-address,192.0.2.163/32 | |
# D-U-DENY-1,match,destination-address,198.51.100.202/32 | |
# D-U-DENY-1,match,application,any | |
# D-U-DENY-1,then,deny, |
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 | |
IFS=' | |
' | |
i=1 | |
for l in `grep -n '<hudson.triggers.SCMTrigger>' /disk1/jenkins/jobs/*/config.xml` | |
#for l in `head -1 /tmp/src` | |
do | |
n=`echo $l | cut -d':' -f2` |
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
UserParameter=postgres.pg_stat_database[*],$PGSQL_HOME/bin/psql -h localhost -p 5432 -U zabbix-mon YOUR_DB -At -c "SELECT SUM($1) FROM pg_stat_database;" | |
UserParameter=postgres.pg_locks[*],$PGSQL_HOME/bin/psql -h localhost -p 5432 -U zabbix-mon YOUR_DB -At -c "SELECT COUNT(*) FROM pg_locks WHERE mode='$1';" | |
UserParameter=postgres.pg_stat_activity.waiting,$PGSQL_HOME/bin/psql -h localhost -p 5432 -U zabbix-mon YOUR_DB -At -c "SELECT COUNT(*) FROM public.pg_stat_activity_as_admin WHERE waiting = false;" | |
UserParameter=postgres.version,$PGSQL_HOME/bin/psql --version | head -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
var page = require('webpage').create(); | |
var server = require('webserver').create(); | |
var system = require('system'); | |
var host, port; | |
if (system.args.length !== 2) { | |
console.log('Usage: server.js <some port>'); | |
phantom.exit(1); | |
} else { | |
port = system.args[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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# gunzip -c proxy_access_8844_log-20130720.gz | python ~/ResponseTimeParser.py >> /tmp/proxy_access_8844_log | |
import sys | |
import math | |
class ResponseResult(object): | |
count = 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
CREATE TABLE addresses ( | |
id INTEGER NOT NULL, | |
email VARCHAR NOT NULL, | |
owner_id INTEGER, | |
PRIMARY KEY (id) | |
); | |
CREATE TABLE users ( | |
id INTEGER NOT NULL, | |
name VARCHAR NOT NULL, | |
PRIMARY KEY (id) |
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 | |
# | |
# gunicorn_sr Startup script for gunicorn for sr | |
# | |
# chkconfig: - 86 14 | |
# processname: gunicorn | |
# pidfile: | |
# description: Python application server | |
# | |
### BEGIN INIT INFO |
OlderNewer