把一个git仓库的origin搬到另一台服务器上
-
在旧服务器上删除这个仓库
rm -r /home/$USER/repo/$REPO
-
在新服务器上创建一个同名的仓库
cd /home/$USER/repo git init --bare $REPO
Erlang references are unique indentifiers. They are commonly used to | |
identify timers, rpc calls, etc. | |
make_ref() -> ref() | |
Returns an almost unique reference. | |
The returned reference will re-occur after approximately 2^82 calls; |
import pdb | |
import cgi | |
import dis | |
import time | |
import struct | |
import marshal | |
def dump_code_object(code, ident=0): | |
print '%s<code_object>' % (' '*ident,) | |
ident += 2 |
/* tcp_keepalive.c | |
* | |
* References: | |
* http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html | |
* http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
把一个git仓库的origin搬到另一台服务器上
在旧服务器上删除这个仓库
rm -r /home/$USER/repo/$REPO
在新服务器上创建一个同名的仓库
cd /home/$USER/repo git init --bare $REPO
#!/bin/bash | |
set -e | |
PREFIX="$HOME/local/ruby/1.9.3" | |
RUBY_DIST_URL="ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz" | |
RUBY_DIST_PKG=`basename $RUBY_DIST_URL` | |
RUBY_DIST_DIR=`basename $RUBY_DIST_PKG .tar.gz` |
#!/bin/bash | |
script_dir() | |
{ | |
local SCRIPT_PATH=${BASH_SOURCE[0]} | |
while [ -L "${SCRIPT_PATH}" ]; do | |
SCRIPT_PATH=`readlink "$SCRIPT_PATH"` | |
done | |
local SCRIPT_DIR=`dirname "${SCRIPT_PATH}"` |
def parse_config_stream(str_or_file): | |
_myglobals, mylocals = {}, {} | |
exec str_or_file in _myglobals, mylocals | |
return mylocals | |
def parse_config_file(filename): | |
_myglobals, mylocals = {}, {} | |
with open(filename) as f: | |
exec f in _myglobals, mylocals |
$ gem sources | |
*** CURRENT SOURCES *** | |
http://rubygems.org/ | |
http://gems.github.com/ | |
$ gem sources --remove http://rubygems.org/ | |
http://rubygems.org/ removed from sources | |
$ gem sources --add http://ruby.taobao.org/ |
# ejabberdctl | |
Usage: ejabberdctl [--node nodename] [--auth user host password] command [options] | |
Available commands in this ejabberd node: | |
backup file | |
connected_users | |
connected_users_number | |
delete_expired_messages | |
delete_old_messages days | |
dump file |
#!/bin/sh | |
# Unset GIT_DIR or you will get a `fatal: Not a git repository: '.'` error. | |
# Refer to: http://stackoverflow.com/questions/10507942/git-checkout-in-post-receive-hook-not-a-git-repository | |
unset GIT_DIR | |
cd /home/www/mysite || exit | |
git pull | |
nanoc compile |