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 | |
# brew install oath-toolkit | |
# | |
# ~/.otpkeys: | |
# name1=secret | |
# name2=secret | |
scriptname=`basename $0` | |
if [ -z $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/sh | |
### BEGIN INIT INFO | |
# Provides: rsyncd | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: fast remote file copy program daemon |
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
worker_processes 1; | |
daemon on; | |
master_process on; | |
error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log debug; | |
#pid logs/nginx.pid; |
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
import cStringIO | |
import PIL.Image | |
from ssim import compute_ssim | |
def get_ssim_at_quality(photo, quality): | |
"""Return the ssim for this JPEG image saved at the specified quality""" | |
ssim_photo = cStringIO.StringIO() | |
# optimize is omitted here as it doesn't affect | |
# quality but requires additional memory and cpu |
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 | |
#requires: socat | |
#author: fangpsh | |
#关于采集的Haproxy指标和报警阈值设置请参考:https://github.com/iask/haproxymon | |
set -eu | |
STATS_SOCKET="/var/lib/haproxy/stats" | |
HOST=`cat /etc/hostname` | |
DATE=`date +%s` | |
tmp_info="/tmp/haproxy_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
#!/bin/sh | |
# command | bash time-stramp.sh | |
if [ $# -gt 0 ];then | |
exec 0<$1; | |
fi | |
while read line | |
do | |
echo `date "+%Y-%m-%d %H:%M:%S"` $line; | |
done<&0; |
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 | |
# Cronic v2 - cron job report wrapper | |
# Copyright 2007 Chuck Houpt. No rights reserved, whatsoever. | |
# Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/ | |
set -eu | |
OUT=/tmp/cronic.out.$$ | |
ERR=/tmp/cronic.err.$$ | |
TRACE=/tmp/cronic.trace.$$ |
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
# zypper bash completion script | |
# | |
# A hackweek gift from Marek Stopka <[email protected]> | |
# Major rewrite by Josef Reidinger <[email protected]> | |
# 2009/02/19 Allow empty spaces in repos names, Werner Fink <[email protected]> | |
# 2014/12/15 Complete package names for install/remove/update/info/download , Fang Peishi <[email protected]> | |
_strip() | |
{ | |
local s c o |
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 | |
if [ $# -eq 1 ] | |
NM=`uname -a && date` | |
NAME=`echo $NM | md5sum | cut -f1 -d" "` | |
then | |
ppa_name=`echo "$1" | cut -d":" -f2 -s` | |
if [ -z "$ppa_name" ] | |
then | |
echo "PPA name not found" | |
echo "Utility to add PPA repositories in your debian machine" |