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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. |
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
当我们设计对外Api接口的时候,要考虑接口的安全性,防止被拦截或者被重放攻击等,所以接口的对外设计要有一套验证机制。 | |
接口的设计主要双方就是接口提供方以及接口使用方,所考虑的方案就是双向加密认证,双方使用一个统一的Token,然后用Token加上固定的混淆规则 | |
然后双方都使用同样的规则来产生一个认证sign来验证。 | |
<!-- Api验证函数 --> | |
<?php | |
class ApiCheck | |
{ | |
const MAX_TIME_DIFF = 600; |
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 | |
########################################################################### | |
# 配置项 | |
# include lib | |
# 获取当前deploy脚本的路径 | |
this_file=`pwd`"/"$0 | |
# 通过dirname获取当前部署脚本所在的目录 -- deploy目录 | |
this_dir=`dirname $this_file` |
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 | |
########################################################################### | |
# 配置项 | |
# 项目名称 | |
prj_name="xxxxx" | |
# 线上集群列表 |
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 | |
### mysql begin ### | |
/usr/local/mysql/bin/mysqld_safe --user=mysql & | |
### mysql end ### | |
### nginx begin ### | |
/usr/local/nginx/sbin/nginx | |
### nginx end ### |
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 | |
class IdGen {/*{{{*/ | |
private $executor = null; | |
public function __construct($executor) {/*{{{*/ | |
$this->executor = $executor; | |
}/*}}}*/ | |
public function genId($key) {/*{{{*/ |
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 | |
build_dir=$HOME/tmp/build | |
pkg_root=/data/pkgs/source | |
pkg_dst_root=/usr/local | |
if [ -d $build_dir ] | |
then | |
rm -rf $build_dir | |
fi |
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
var zlib = require('zlib'); | |
var crypto = require('crypto'); | |
var shasum = crypto.createHash('sha1'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var content = 'what is up, doc?'; | |
var header = 'blob ' + content.length + '\0'; | |
var store = header + content; |
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
; Summary: Proxy Switchy! Exported Rule List | |
; Date: Sunday, May 15, 2011 | |
; Website: http://bit.ly/proxyswitchy | |
#BEGIN | |
[wildcard] | |
*://192.168.1.* | |
*://www.amazon.com/* | |
*://www.bbc.co.uk/* |
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
(function($){ | |
$.widget("ui.mywidget", { | |
options: { | |
autoOpen: true | |
}, | |
_create: function(){ | |
// by default, consider this thing closed. |
NewerOlder