Skip to content

Instantly share code, notes, and snippets.

View MadFaill's full-sized avatar

Nikolay MadFaill

View GitHub Profile
@MadFaill
MadFaill / site.conf
Created December 11, 2018 10:46 — 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
@MadFaill
MadFaill / install-pycripto.sh
Created January 31, 2017 05:15
Установка m2crypto & pycrypto на mac
# Mac-OS setup crypto package
env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto pycrypto
@MadFaill
MadFaill / proxy.go
Created January 24, 2017 19:01 — forked from ericflo/proxy.go
Golang TCP Proxy
package proxy
import (
"io"
"net"
"sync"
log "github.com/Sirupsen/logrus"
)
@MadFaill
MadFaill / proxy.go
Created January 24, 2017 07:03 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@MadFaill
MadFaill / orhttp_example.go
Created January 23, 2017 04:06 — forked from Yawning/orhttp_example.go
How to dispatch HTTP requests via Tor in Go.
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
@MadFaill
MadFaill / enc_dec.go
Created January 22, 2017 08:33 — forked from myouju/enc_dec.go
encryption - ruby, python and golang with AES-256-CFB and
package main
import (
"fmt"
"io"
"encoding/base64"
"crypto/rand"
"crypto/cipher"
"crypto/aes"
"crypto/md5"
@MadFaill
MadFaill / supervisor.conf
Created May 20, 2016 17:22 — forked from tsabat/supervisor.conf
Sample supervisor config file
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@MadFaill
MadFaill / Gogs-Docker.adoc
Created April 20, 2016 06:55 — forked from mgreau/Gogs-Docker.adoc
Gogs Docker Env (docker-compose)

Replace 192.168.99.100 by your DOCKER_HOST IP

# Configure the server
curl 'http://192.168.99.100:3000/install' \
  -H 'Origin: null' -H 'Accept-Encoding: gzip, deflate' \
  -H 'Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4' \
  -H 'Upgrade-Insecure-Requests: 1' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36' \
@MadFaill
MadFaill / chat.go
Created April 18, 2016 15:30
simple golang chat server
package main
import (
"bufio"
"net"
)
type Client struct {
incoming chan string
outgoing chan string
@MadFaill
MadFaill / echo.go
Created January 22, 2016 17:50 — forked from paulsmith/echo.go
A simple echo server testing a few interesting Go language features, goroutines and channels.
// $ 6g echo.go && 6l -o echo echo.6
// $ ./echo
//
// ~ in another terminal ~
//
// $ nc localhost 3540
package main
import (