Skip to content

Instantly share code, notes, and snippets.

View windhooked's full-sized avatar

H windhooked

View GitHub Profile
@windhooked
windhooked / golang-tls.md
Created August 12, 2019 07:48 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@windhooked
windhooked / traefik-auth.conf
Created August 20, 2019 14:43 — forked from acundari/traefik-auth.conf
Traefik fail2ban
# /etc/fail2ban/filter.d/traefik-auth.conf
[Definition]
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$
@windhooked
windhooked / nginx.conf
Created August 25, 2019 06:43 — forked from atomaths/nginx.conf
This is a FastCGI example server in Go.
## FastCGI
server {
location ~ /app.* {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
}
## Reverse Proxy (이 방식으로 하면 http.ListenAndServe로 해야함)
server {
@windhooked
windhooked / serve.go
Created August 26, 2019 08:18 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="YOUR-ACCESSKEY"
S3SECRET="YOUR-SECRETKEY"
function putS3
{
path=$1
file=$2
aws_path=$3
@windhooked
windhooked / README.md
Created January 27, 2020 12:49 — forked from owulveryck/README.md
Simple linear regression with plot in go with gonum

Very simple linear regression

curl -s //www.lauradhamilton.com/data_files/cricket_chirps_versus_temperature.txt | go run main.go > output.svg
2018/06/13 19:57:59 3.3057614388773593*x+24.966014428303183
@windhooked
windhooked / counter.v
Created April 22, 2020 13:30 — forked from wnew/counter.v
Parametrised Verilog Counter
//============================================================================//
// //
// Parameterize Counter //
// //
// Module name: counter //
// Desc: parameterized counter, counts up/down in any increment //
// Date: Oct 2011 //
// Developer: Rurik Primiani & Wesley New //
// Licence: GNU General Public License ver 3 //
// Notes: //
@windhooked
windhooked / counter.v
Created April 23, 2020 18:19 — forked from mcgodfrey/counter.v
Up-down counter (8-bit) in verilog for servo control example
/*
8 bit up-down counter.
Based on code from Mojo tutorial
https://embeddedmicro.com/tutorials/mojo/pulse-width-modulation
/\ /\
/ \ / \
/ \/ \
The CRT_LEN determines the period of the resulting counter
*/
module counter #(parameter CTR_LEN = 27) (
@windhooked
windhooked / ep2c5-ss-howto
Created April 24, 2020 13:12 — forked from makestuff/ep2c5-ss-howto
Build FPGALink and VHDL examples for the EP2C5+Minimus in sync-serial configuration
$ # Make sure you have udev rules for 1d50:602b and 03eb:2ffa, using a group you're a member of (I use "users"):
$ groups
users ...
$ cat /etc/udev/rules.d/10-local.rules
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="602b", GROUP="users", MODE="0660"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ffa", GROUP="users", MODE="0660"
$
# You'll need some stuff before we begin:
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml