export DOCKER_HOST=tcp://localhost:4243
This file contains 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
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
CustomError.prototype = Object.create(Error.prototype); |
This file contains 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
* filter and count IPs | |
```shell | |
grep -F 'SLEEP%285%29' /var/log/nginx/www.letsface.cn/access_www.letsface.cn.log | grep -F '26/May/' | awk '{print $1}' | sort | uniq -c | sort -nr | |
``` |
This file contains 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
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
set vpn to the service "VPN name" | |
if vpn is not null then | |
if current configuration of vpn is not connected then | |
connect vpn | |
end if | |
end if | |
end tell |
This file contains 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
# include a variable for the upgrade header | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen 80; | |
server_name example.com; |
This file contains 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
rsync ./ ec2:~/wechat-demo --exclude '.git*' --compress --links --copy-unsafe-links --perms --recursive --times --delete --delete-excluded --progress |
This file contains 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
sudo apt-get install libcap2-bin | |
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node | |
# https://www.digitalocean.com/community/articles/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps |
This file contains 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
/* https://github.com/yields/case/blob/master/dist/Case.js */ | |
(function () { | |
var Case = {}; | |
if (typeof define === 'function' && define.amd) { | |
define(function(){ return Case; }); | |
} else if (typeof module !== 'undefined' && module.exports) { | |
module.exports = Case; | |
} else { | |
this.Case = Case; | |
} |
C-x h (M-x mark-whole-buffer)
C-M-\ (M-x indent-region)
NewerOlder