apt-get install git
adduser --shell /usr/bin/git-shell git
#!/bin/bash | |
# N and BYTES may be followed by the following multiplicative suffixes: | |
# c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024 | |
help(){ | |
echo "useage: `basename $0` -o full_path -b block_size(default 1K) -c block_count(default 2M)" | |
} | |
while getopts 'o:b:c:' OPT; do | |
case $OPT in |
通常情况下,我们调出 PopClip 工具条需要用鼠标选中一段文字,但这在编辑文字时会显得有些不便,那么如何直接用键盘调出 PopClip 呢?Mac 自带的小机器人 Automator,可以实现很多 Mac 自动化的流程。打开 Automator,新建一个「Service」(即「服务」),利用 AppleScript 写一段代码。这里要注意的是,上方的「服务」我们要选择「没有输出」。
复制下面代码替换:
on run {input, parameters}
tell application "PopClip" to appear
#!/bin/sh | |
start(){ | |
ssserver -c /etc/shadowsocks.json -d start | |
} | |
stop(){ | |
ssserver -c /etc/shadowsocks.json -d stop | |
} | |
case "$1" in | |
start) |
# Ubuntu upstart file at /etc/init/yourservice.conf | |
pre-start script | |
mkdir -p /var/log/yourcompany/ | |
end script | |
respawn | |
respawn limit 15 5 | |
start on runlevel [2345] |
The plan is to create a pair of executables (ngrok
and ngrokd
) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok
to connect to this ngrokd
, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com
, you'll need a record for that and for *.domain.com
.
In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version.