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 | |
HOST=$(hostname | awk -F'.' '{print $1}') | |
IDC=$(hostname | awk -F'.' '{print $3}') | |
SYSTEM_LOAD=$(awk '{print $1}' /proc/loadavg) | |
SYSTEM_MEMORY=$(free -m | grep 'buffers/cache' | awk '{print $NF}') | |
NGINX_CONNECTIONS=$(curl -s http://127.0.0.1/server-status | head -n 1 | awk '{print $NF}') | |
REDIS_CONNECTIONS=$(/usr/local/redis/bin/redis-cli info | grep connected_clients | awk -F: '{print $NF}' | sed 's/.$//') |
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
/* new */ | |
tr.odd.status-1, table.list tbody tr.odd.status-1:hover { color: #900; } | |
tr.odd.status-1 { background: #ffc4c4; } | |
tr.even.status-1, table.list tbody tr.even.status-1:hover { color: #900; } | |
tr.even.status-1 { background: #ffd4d4; } | |
tr.status-1 a, tr.status-1:hover a { color: #900; } | |
tr.odd.status-1 td, tr.even.status-1 td { border-color: #ffb4b4; } | |
/* assigned / in progress */ | |
tr.odd.status-2, table.list tbody tr.odd.status-2:hover { color: #990; } |
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 | |
# | |
#---------------------FastDFS monitor------------------------ | |
#------------------------------------------------------------ | |
# This scripts use to monitor the fastdfs's status. with standard output. | |
# you can run it in this way to let it loop 3 times with 5 seconds break: | |
# ./fdfs_monitor.sh 5 3 | |
# | |
# or just run it to loop for 10 years with 3 seconds break. | |
# ./fdfs_monitor.sh |
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 | |
while true; | |
do | |
if test -n "`file /tmp/Flash*|grep \"Macromedia Flash Video\\|MPEG v4\"`";then | |
gnome-screensaver-command -p | |
fi | |
sleep 30 | |
done |
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
<?php | |
/** | |
* input: | |
* $arr = array( | |
* 'a' => array( | |
* 'b' => array( | |
* 'c' => 'bar' | |
* ), | |
* 'x' => 'i', | |
* ) |
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
- *.log | |
- *.swp |
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 | |
# | |
# Script to prepare and restore full and incremental backups created with innobackupex-runner. | |
# | |
# This script is provided as-is; no liability can be accepted for use. | |
# | |
INNOBACKUPEX=innobackupex-1.5.1 | |
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX | |
TMPFILE="/tmp/innobackupex-restore.$$.tmp" |
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 | |
# backup MySQL databases | |
# author: [email protected] | |
# backup directory | |
backup_parent_dir="/opt/backups/mysql" | |
mysql_dir=/usr/local/mysql | |
# MySQL settings | |
mysql_host=$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
<?php | |
/** | |
* CVE-2013-4547 | |
* http://mailman.nginx.org/pipermail/nginx-announce/2013/000125.html | |
* author [email protected] | |
*/ | |
$host = 'x.com'; | |
$fp = fsockopen($host, 80, $errno, $errstr); |
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
<html> | |
<head> | |
<script type="text/javascript" src="../js/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('button').click(function() { | |
var options = $('select.whatever option'); | |
var arr = options.map(function(_, o) { |
OlderNewer