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
{ | |
"server": "[email protected]", | |
"server_dir": "/srv/qr.xxx.com", | |
"repo": "[email protected]:fanweixiao/xxxx.git", | |
"branch": "release", | |
"history_releases_count": 3, | |
"shared_dirs": [ | |
"node_modules", | |
"public/bower_components" | |
], |
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 | |
pacman -S nginx | |
export JAIL=/srv/http | |
# Create Necessary Devices | |
mkdir $JAIL/dev | |
mknod -m 0666 $JAIL/dev/null c 1 3 | |
mknod -m 0666 $JAIL/dev/random c 1 8 | |
mknod -m 0444 $JAIL/dev/urandom c 1 9 |
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
require 'oauth2' | |
require 'json' | |
OAuth2::Response.register_parser(:text, 'text/plain') do |body| | |
parsed_body = JSON.parse(body) | |
parsed_body | |
end | |
client = OAuth2::Client.new(YOU_KEY, YOU_SECRET, :site => "https://api.weibo.com", :authorize_url => "/oauth2/authorize", :token_url => "/oauth2/access_token") | |
puts client.auth_code.authorize_url(:redirect_uri => YOUR_CALLBACK_URL) | |
token = client.auth_code.get_token('authorization_code_value', :redirect_uri => YOUR_CALLBACK_URL) |
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
- wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz | |
- ./configure --prefix=/usr/local | |
- Download ruby source | |
- ./configure --prefix=/usr/local --disable-install-doc --with-opt-dir=/usr/local/lib/ | |
- sudo apt-get install zlib1g-dev libssl-dev | |
RUBY_SOURCE_DIR/ext/openssl | |
ruby extconf.rb | |
make | |
make install |
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 fs = require('fs'), | |
util = require('util'), | |
Stream = require('stream').Stream; | |
/** | |
* Create a bandwidth limited stream | |
* | |
* This is a read+writeable stream that can limit how fast it | |
* is written onto by emitting pause and resume events to | |
* maintain a specified bandwidth limit, that limit can |
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
sudo add-apt-repository ppa:w-vollprecht/ppa | |
sudo apt-get update | |
sudo apt-get install uberwriter | |
UberWriter 非常简单易用,主要功能如下: | |
具备预览功能( Ctrl+P) ,全屏功能及专注书写模式 | |
提供 斜体 、粗体、项目列表等快捷键。 | |
支持导出到 PDF (需安装 texlive)、Html 、OTD 、LaTex 、ePub 等多种文档格式。 |
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
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
#define UserDefaults [NSUserDefaults standardUserDefaults] | |
#define NotificationCenter [NSNotificationCenter defaultCenter] | |
#define SharedApplication [UIApplication sharedApplication] | |
#define Bundle [NSBundle mainBundle] | |
#define MainScreen [UIScreen mainScreen] | |
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES | |
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO | |
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x | |
#define NavBar self.navigationController.navigationBar |
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
【z】 to toggle color. | |
【x】 to toggle coloring of sort column. | |
【s 9 9 Enter ↵】 to set update frequency to every 99 seconds. | |
【Space】 to force a update. | |
【>】 to change the sort column to the right of current sort column. | |
【<】 to change the sort column to the left. | |
【R】to toggel reverse sort order. | |
【O k Enter ↵】 to order by CPU usage. (also 【P】) | |
【O n Enter ↵】 to order by memory usage. (also 【M】) |
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
gem install pg -- --with-pg-lib=/usr/pgsql-9.1/lib --with-pg-config=/usr/pgsql-9.1/bin/pg_config | |
========== | |
$ export PATH=/usr/pgsql-9.1/bin:$PATH | |
$ uname -a | |
$ export ARCHFLAGS=' -arch x86_64' | |
$ bundle install | |
========== |