Skip to content

Instantly share code, notes, and snippets.

View dz-s's full-sized avatar

dz_s dz-s

  • Allegro
  • Poland
  • 02:37 (UTC -12:00)
View GitHub Profile
@dz-s
dz-s / README.md
Created June 12, 2018 13:39 — forked from magnetikonline/README.md
NSSM - the Non-Sucking Service Manager cheatsheet.
@dz-s
dz-s / site.conf
Created May 29, 2018 11:15 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@dz-s
dz-s / parse-es6-template.js
Last active May 23, 2018 11:52 — forked from smeijer/parse-es6-template.js
ES6 template string parser
function get(path, obj, fb = `$\{${path}}`) {
return path.split('.').reduce((res, key) => res[key] || fb, obj);
}
function parse(template, map, fallback) {
return template.replace(/\$\{.+?}/g, (match) => {
console.log('match', match);
const path = match.substr(2, match.length - 3).trim(); const replBy = get(path, map, fallback);
return isFinite(replBy) ? replBy : '\"'+replBy+'\"';
});
@dz-s
dz-s / torrc-defaults
Created April 19, 2018 23:15
Prevent Tor from connecting to Five-Eyes countries
# Add this in the Tor config file
# Exclude Nodes of all of these countries
# Five Eyes: U.S., Australia, Canada, New Zealand, U.K. (also added France because it's becoming worst than the Five Eyes)
ExcludeNodes {fr}
ExcludeExitNodes {us},{au},{ca},{nz},{gb},{fr}