Skip to content

Instantly share code, notes, and snippets.

View dz-s's full-sized avatar

dz_s dz-s

  • Allegro
  • Poland
  • 05:35 (UTC -12:00)
View GitHub Profile
@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}
@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 / 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
import { isEqual } from 'lodash'
import { inject } from 'mobx-react'
import { Component } from 'react'
import { jss } from 'react-jss'
import { compose, createEagerElement, getDisplayName } from 'recompose'
const InstanceSheetInjector = BaseComponent => class extends Component {
static displayName = 'applyTheme-instanceSheet';
instanceSheet;
@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 / гайд.md
Created June 14, 2018 18:07 — forked from anonymous/гайд.md
Музыкальная теория и импровизация

Гайд для ньюфагов

  • наворачивай https://www.coursera.org/learn/edinburgh-music-theory
  • прорешивай Berklee - Music Theory 1 и 2 (рабочая тетрадь с аудио, ссылка на торрент ниже)
  • параллельно дрочи https://www.musictheory.net/exercises (этот же сайт можешь использовать в качестве справочника) и functional ear trainer (на андроиде)
  • не забывай, что тебе нужно петь\мычать все то, что ты слушаешь\угадываешь\пишешь
  • не забывай, что тебе нужно играть на инструменте все, что ты пишешь (обязательно) и читаешь (необязательно)
  • не забывай, что тебе нужно ТВОРЧЕСКИ КОМБИНИРОВАТЬ все изучаемые концепции. Научился петь первые три ноты мажорной гаммы? Придумай из них мелодию, пой их с разными ритмами, накладывай на них разные слова, постарайся вспомнить знакомые тебе песенки с такими же отрезками мелодии. Научился строить мажорное трезвучие? Играй его во всех 12 тональностях, пробуй комбинировать разные трезвучия, ищи последовательности, которые для тебя интересно звучат, переставляй ноты местами, ар
@dz-s
dz-s / openssl-commands.md
Last active August 20, 2018 12:18
Common OpenSSL Commands with Keys and Certificates

Getting key from .pfx file

openssl pkcs12 -in ~/../dir/filename.pfx -nocerts -out ~/../dir/key-filename.key

Getting crt from .pfx

openssl pkcs12 -in ~/../dir/filename.pfx -clcerts -nokeys -out ~/../dir/cert-filename.crt

Removing passphrase from key file

openssl rsa -in ~/../dir/key-filename.key -out ~/../dir/key-filename-stripped.key

@dz-s
dz-s / diff.mdown
Created September 3, 2018 10:49 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.

@dz-s
dz-s / Rustup
Last active December 25, 2018 21:22
Rustup issue solution
https://github.com/rust-lang/rustup.rs/issues/953#issuecomment-318650338
@dz-s
dz-s / cmd-list.md
Last active March 11, 2019 23:40
Useful Unix commands

du -h your_directory - the size of your target directory and subdirectories as well.