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 | |
set -e | |
SSH=/usr/bin/ssh | |
PSQL=/usr/bin/psql | |
PGBASEBACKUP=/usr/bin/pg_basebackup | |
REPLICATION_USER=replication | |
if [ -z "$MASTER_HOST" ]; 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/bash | |
set -e | |
SSH=/usr/bin/ssh | |
PGCTL=/usr/bin/pg_ctl | |
PCP_ATTACH_NODE=/usr/sbin/pcp_attach_node | |
DEVNULL=/dev/null | |
if [ -z "$PCP_HOST" ]; 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
/* | |
This widget shows Recent Posts on your Tumblr blog. | |
Its dependency is jQuery. | |
Usage: | |
1) Add html: | |
<div id="recent-posts"></div> | |
2) Add code into the <head>: |
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 | |
if [ -z "$HOSTNAME" ]; then | |
echo 'input $HOSTNAME' | |
read HOSTNAME | |
fi | |
if [ -z "$ROOT_PASSWORD" ]; then | |
echo 'input $ROOT_PASSWORD' | |
read ROOT_PASSWORD |
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 | |
# The following arguments are passed to the script: | |
# | |
# <master-name> <role> <state> <from-ip> <from-port> <to-ip> <to-port> | |
MASTER_IP=$6 | |
VIP=172.17.0.101 | |
NETMASK=16 | |
IF=eth0 | |
MY_IP=$(ip addr show dev $IF | grep "global $IF" | head -1 | sed -e "s/^.*inet \(.*\)\/$NETMASK .*$/\1/") |
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 | |
# Get current swap usage for all running processes | |
# Erik Ljungstrom 27/05/2011 | |
# Updated: 2013-11-13 Yuichiro Saito | |
SUM=0 | |
OVERALL=0 | |
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do | |
PID=`echo $DIR | cut -d / -f 3` | |
PROGNAME=`ps -p $PID -o comm --no-headers` | |
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $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
openssl s_client -cipher EXPORT -connect domain.com:443 < /dev/null 2>/dev/null | grep SSL-Session | wc -l |
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/env perl | |
# Used to generate PEM encoded files from Mozilla certdata.txt. | |
# Run as ./make-cert.pl > certificate.crt | |
# | |
# Parts of this script courtesy of RedHat (mkcabundle.pl) | |
# | |
# This script modified for use with single file data (tempfile.cer) extracted | |
# from certdata.txt, taken from the latest version in the Mozilla NSS source. | |
# mozilla/security/nss/lib/ckfw/builtins/certdata.txt |
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 | |
EXIT_CODE=0 | |
STATUS_FILE=/tmp/drbd.status | |
STATUS=$(sed -e 's/.* state:\(.*\)$/\1/' $STATUS_FILE) | |
if [ "${STATUS}" != "MASTER" ]; then | |
echo "current status is ${STATUS}. skip" | |
exit |
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/env bash | |
# setting clamav-milter config file | |
# VirusAction /path/to/virus-alert.sh | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin | |
SERVER=$HOSTNAME | |
VIRUS_ADMIN=${VIRUS_ADMIN:=virus-admin@$HOSTNAME} | |
VIRUS_ALERT=${VIRUS_ALERT:=postmaster@$HOSTNAME} | |
SUBJECT="[virus-alert] $SERVER: an infected e-mail has been detected." |