1h active keys by location:
sum(max(increase(shadowsocks_data_bytes{access_key!=""} [1h])) by (access_key, location) > bool 0) by (location)
1h usage by location:
sum(increase(shadowsocks_data_bytes{dir=~"c<p|p>t"} [1h])) by (location)
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json
file in /etc/docker
:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
Tested on a standard $5/mo DigitalOcean VPS running Ubuntu 16.04.
# in /etc/sysctl.conf | |
# net.ipv4.ip_forward=1 | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT | |
iptables -A FORWARD -j REJECT | |
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE |
package main | |
import ( | |
"fmt" | |
"github.com/Shopify/sarama" | |
"os" | |
"os/signal" | |
"strings" | |
) |
package main | |
import ( | |
"fmt" | |
"log" | |
"strconv" | |
"github.com/miekg/dns" | |
) |
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
collection = db.getCollection('foo') | |
result = collection.aggregate( | |
[ | |
{"$group": { "_id": { fa: "$fa", fb: "$fb" } } } | |
] | |
); | |
printjson(result); |