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 python3 | |
# vim:fileencoding=utf-8 | |
""" [NAME] script or package easy description | |
[DESCRIPTION] script or package description | |
""" | |
from datetime import datetime | |
from argparse import ArgumentParser, FileType | |
import pprint |
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 python3 | |
# vim:fileencoding=utf-8 | |
""" [NAME] script or package easy description | |
[DESCRIPTION] script or package description | |
""" | |
from datetime import datetime | |
from argparse import ArgumentParser | |
import pprint |
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 | |
# cron setting example | |
# 5 3 * * * ionice -c2 -n7 nice -n19 /usr/local/sbin/dar-differential-backup.sh >/dev/null 2>&1 | |
# or | |
# ALLNICE="ionice -c2 -n7 nice -n19" | |
# BACKUP_SCRIPT="/usr/local/sbin/dar-differential-backup.sh" | |
# 5 3 * * 0 $ALLNICE $BACKUP_SCRIPT -f >/dev/null 2>&1 | |
# 5 3 * * 1,2,3,4,5,6 $ALLNICE $BACKUP_SCRIPT -d >/dev/null 2>&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
#!/bin/bash | |
set -e | |
TARGET_DIR=/path/to/target | |
BACKUP_DIR=/path/to/backup | |
RSYNC=/usr/bin/rsync | |
RSYNC_ARGS="-avS --stats --human-readable --delete $CMD_ARGS" | |
ROTATE=3 |
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 | |
#--- memo -- | |
# 参考:https://sites.google.com/site/glusterfstech/install | |
#--- vm.swappiness [デフォルト:60] | |
# 0にすると物理メモリを使いきるまでswapしなくなる。 | |
#--- vm.dirty_background_ratio [デフォルト:10] | |
#メモリに対してdirtyデータが指定の%になるとバックグラウンドでpdflushが動作 |
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 | |
set -e | |
_plain() { | |
local user=$1 | |
local pass=$2 | |
echo -ne "$user\0$user\0$pass" | openssl enc -base64 | tr -d '\n'; echo |
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 | |
MASK=32 | |
SEP='|' | |
IPV4=ipv4 | |
SCRIPT=$(basename $0) | |
DELEGATED_APNIC_LATEST=http://ftp.apnic.net/stats/apnic/delegated-apnic-latest | |
if [ $# -lt 1 ]; then | |
echo "Usage: $SCRIPT CC [DELEGATED_APNIC_LATEST]" |
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 | |
set -e | |
SSH=/usr/bin/ssh | |
PGCTL=/usr/bin/pg_ctl | |
failed_node=$1 | |
new_master=$2 | |
cluster_path=$3 |
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 | |
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 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 |