I hereby claim:
- I am sancoder-q on github.
- I am jianmingqu (https://keybase.io/jianmingqu) on keybase.
- I have a public key ASCe98CA7WNuozg3o52bz01sT-GxaTchPqCRIDZGNjqingo
To claim this, I am signing this object:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /Library/PrivilegedHelperTools/com.docker.vmnetd | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /Library/PrivilegedHelperTools/com.docker.vmnetd |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /Library/PrivilegedHelperTools/com.docker.vmnetd | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /Library/PrivilegedHelperTools/com.docker.vmnetd |
# install GnuPG | |
brew install gpg | |
# generate gpg key pair | |
gpg --gen-key | |
# list keys | |
gpg --list-keys | |
# export public key |
git_auth_token='' | |
git_domain='' | |
org_name='' | |
# Clone all | |
curl "https://api.${git_domain}/${org_name}/<>/repos" -H "Authorization: token ${git_auth_token}" |\ | |
jq -r .[].subscription_url |\ | |
xargs -n1 -Ix git clone x | |
# Watch all |
I hereby claim:
To claim this, I am signing this object:
(add-hook 'web-mode-hook | |
(lambda () | |
;; short circuit js mode and just do everything in jsx-mode | |
(if (equal web-mode-content-type "javascript") | |
(web-mode-set-content-type "jsx") | |
(message "now set to: %s" web-mode-content-type)))) |
nvram set enable_jffs2=1 | |
nvram set jffs2_scripts=1 | |
nvram commit | |
reboot |
Synology NAS - How to make a program run at startup | |
The other day I created a little node.js project to keep track of some finances. Synology has a node.js package but that just installs the tools - it has no 'container' or any other support to drop files and have it run automagically. Maybe one day. | |
In the meantime, you can start your project when you SSH into the NAS. My project has a 'www' script which bootstraps my project, so to start I simply type 'node bin/www' from the project directory. But, it only runs while I'm logged in, and if I log out for any reason, the process dies. That's hardly useful when I'm away from home, or on a different PC. So I decided to have a look at starting my project as a Linux service. | |
After doing a lot of research into how Synology does services, and a few failed attempts at init scripts, I found that Synology DSM (since version 5 perhaps) bundles Upstart, which is a neat little tool to deal with services on Linux. It's most prevalent on Debian and derivatives (notably Ub |
#清空所有链 | |
iptables --flush | |
iptables --delete-chain | |
iptables --table mangle --flush | |
iptables --table mangle --delete-chain | |
#设定默认规则 | |
iptables --policy INPUT DROP | |
iptables --policy OUTPUT ACCEPT | |
iptables --policy FORWARD DROP | |
#允许SSH |
# 新建一个无密码,无法登陆,没home的系统用户,就叫shadowsocks | |
adduser --system --disabled-password --disabled-login --no-create-home shadowsocks | |
# 修改 /etc/default/shadowsocks-libev | |
USER=shadowsocks | |
GROUP=nogroup | |
# 使用setcap,允许非root用户无法监听低位端口 | |
apt-get install libcap2-bin | |
setcap 'cap_net_bind_service=+ep' /usr/bin/ss-server |