This file contains hidden or 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 | |
# Thanks goes to @pete-otaqui for the initial gist: | |
# https://gist.github.com/pete-otaqui/4188238 | |
# | |
# Original version modified by Marek Suscak | |
# | |
# works with a file called VERSION in the current directory, | |
# the contents of which should be a semantic version number | |
# such as "1.2.3" or even "1.2.3-beta+001.ab" |
This file contains hidden or 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
[Unit] | |
Description=Shadowsocks Server | |
After=network.target | |
[Service] | |
ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss-config.json | |
Restart=on-abort | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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/zsh | |
for url in `curl --silent https://api.github.com/repos/$1/releases/latest | awk '/browser_download_url/ { print $2 }' | sed 's/"//g'` | |
do | |
echo $url | |
curl -LOk $url | |
done |
This file contains hidden or 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
#!/usr/bin/env bash | |
ProjectName="sundries" # 项目名称 | |
Port=3030 # 服务监听端口 , 通过设置 NODE_PORT 环境变量实现 | |
CleanNodeModules=true # 是否每次都清除 node_modules | |
NodeVersion=8.1.2 # node 版本, 需确保 nvm 有该版本 | |
Restart=true # 是否每次都重启服务 | |
if [[ -e $1 ]]; then |
This file contains hidden or 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
// returns things in array 'a' that are not in array 'b' | |
// > ['a','b','c','1', '2', '3'].complement(['b', 'c', 'd', 'e']); | |
// ['a', '1', '2', '3'] | |
function complement(a, b){ | |
(b)||(b=a, a=this); | |
return (Array.isArray(a) && Array.isArray(b)) | |
? a.filter(function(x){return b.indexOf(x)===-1;}) | |
: undefined; | |
} | |
Array.prototype.complement=complement; |