start new:
tmux
start new with session name:
tmux new -s myname
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
e.g. for user stefan, starting two different applications, located under /apps/APPLICATION/prod/current.
This script is very useful, because it is run at startup of server, so no 503 anymore.
Put this script under /etc/init.d/ and make it executable chmod +x /etc/init.d/rails_apps
| ___ | |
| ,'._,`. | |
| (-.___.-) | |
| (-.___.-) | |
| `-.___.-' | |
| (( @ @| . __ | |
| \ ` | ,\ |`. @| | | _.-._ | |
| __`.`=-=mm===mm:: | | |`. | | | ,'=` '=`. | |
| ( `-'|:/ /:/ `/ @| | | |, @| @| /---)W(---\ | |
| \ \ / / / / @| | ' (----| |----) ,~ |
| # Author: Dongsheng Cai | |
| # | |
| # Gist: https://gist.github.com/dcai/3824286 | |
| # | |
| # c-d to close shell | |
| # <prefix> s to switch to another session | |
| # <prefix> f to find a window | |
| # <prefix> o to switch to another panel | |
| # <prefix> ! to close other panes except current one | |
| # <prefix> x Kill the current pane |
| #!/bin/bash | |
| # https://gist.github.com/dcai/3847582/ | |
| [[ -r /etc/bash_completion ]] && source /etc/bash_completion | |
| # TERM COLOR | |
| export WHITE="\033[1;37m" | |
| export YELLOW="\033[1;33m" | |
| export GREEN="\033[1;32m" |
| require "bundler/capistrano" | |
| set :application, "awesome" | |
| set :user, "vagrant" | |
| set :deploy_to, "/home/#{user}/apps/#{application}" | |
| set :deploy_via, :remote_cache | |
| set :use_sudo, false | |
| set :scm, "git" | |
| set :repository, "git@github.com:7hunderbird/#{application}.git" |
Other people's code is awful, and your own code from months previous counts as someone else's. With this and the festive spirit in mind, I dug up a canvas snow demo I made two years ago to see how bad my code really was.
Turns out the performance landscape has changed quite a bit, but after applying a couple of workarounds, best practices, and memory management, I got the demo running smoother than it ever did.
Ugh, I can't believe I just wrote "performance landscape". Anyway...
| Shadowsocks 启动脚本 | |
| # insserv -v -d /etc/init.d/shadowsocks | |
| ===================== | |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: shadowsocks | |
| # Required-Start: $local_fs $remote_fs $network $syslog | |
| # Required-Stop: $local_fs $remote_fs $network $syslog |