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 | |
| # Create a socks5 proxy server to use ssh-tunnels | |
| ACTION="@$1" | |
| HOST=sshproxyhost # edit /etc/hosts | |
| LISTEN=127.0.0.1:8600 | |
| LOGDIR=/var/log/ssh-proxy/`date +%Y` | |
| LOGFILE=$LOGDIR/`date +%Y%m%d`.log |
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 | |
| # Remount vmware shared folders to clear the file cache | |
| echo -n 'Unmounting HGFS shares:' | |
| umount /mnt/hgfs | |
| echo -e " \033[32;49;2m[YES]\033[39;49;0m" | |
| echo -n 'Mounting HGFS shares:' | |
| mount -t vmhgfs .host:/ /mnt/hgfs |
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 | |
| # 数据库自动备份 | |
| root_dir=$(cd "$(dirname "$0")"; cd ..; pwd) | |
| timestamp=$(date +"%Y%m%d_%H%M") | |
| backup_dir=$root_dir/data/dbbackup | |
| # 需要备份的库 | |
| databases=(db1, db2) |
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 | |
| ### 数据库同步到本地 ### | |
| all_databases=(db1 db2) | |
| ssh='ssh root@remote-db-host' | |
| mysqldump='/usr/local/mysql/bin/mysqldump -uroot -proot --single-transaction' | |
| mysql='/usr/local/mysql/bin/mysql -uroot -proot' | |
| create='CREATE DATABASE IF NOT EXISTS' |
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 | |
| ACTION="@$1" | |
| if [ $ACTION = "@start" ] ; then | |
| echo "Starting Jekyll Service..." | |
| jekyll serve -w -B | |
| PID=`ps -ef | grep "jekyll" | grep -v grep | awk '{print $2}'` | |
| if [ $PID ] ; then | |
| echo -e "Jekyll service startup succeed! \033[32;49;2m[YES]\033[39;49;0m" |
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
| function FindProxyForURL(url, host) { | |
| var PROXY = "SOCKS5 10.1.2.79:8600; DIRECT;"; | |
| var DIRECT = "DIRECT"; | |
| var list = [ | |
| '*t.co*', | |
| '*twitter.com*', | |
| '*twimg.com*', | |
| '*tinypic.com*', | |
| '*twitpic.com*', |
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
| <?php | |
| use | |
| Phalcon\Mvc\Model, | |
| Phalcon\Mvc\Model\Message, | |
| Phalcon\Db\RawValue; | |
| /** | |
| * 基础 Model 实现 | |
| * |
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
| <?php | |
| /** | |
| * 密码 HASH 处理 | |
| */ | |
| class 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/bash | |
| ### Automatic fixed php coding style ### | |
| bin=/usr/local/bin/php-cs-fixer | |
| # install php-cs-fixer | |
| if [ ! -f $bin ]; then | |
| echo "Preparing to install php-cs-fixer ..." | |
| wget http://cs.sensiolabs.org/get/php-cs-fixer.phar -O $bin |
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 | |
| ################################################ | |
| # | |
| # phpDocumentor install: | |
| # | |
| # pear channel-discover pear.phpdoc.org | |
| # pear install phpdoc/phpDocumentor | |
| # | |
| ################################################ |
OlderNewer