Skip to content

Instantly share code, notes, and snippets.

View rmoreira's full-sized avatar

Rafael Moreira rmoreira

View GitHub Profile
@rmoreira
rmoreira / golang-tls.md
Created January 20, 2021 02: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)
@rmoreira
rmoreira / gist:805119271891e0e78de111262112f381
Created February 10, 2020 22:59 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@rmoreira
rmoreira / gist:342be9be316312e7d5c67c7c20acd09a
Created February 10, 2020 22:59 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@rmoreira
rmoreira / requirements.txt
Created July 31, 2019 03:04 — forked from jarpy/requirements.txt
Serverless Elasticsearch Curator for AWS Lambda
certifi==2016.8.8
elasticsearch-curator==4.0.6
PyYAML==3.11
@rmoreira
rmoreira / KUBERNETES.md
Created September 9, 2017 02:29 — forked from renoirb/KUBERNETES.md
Setup Pine64 5 node cluster from longsleep Ubuntu 16.04 base image
@rmoreira
rmoreira / LetsEncrypt_HTTPS_plex.MD
Created June 27, 2017 19:43 — forked from churro-s/LetsEncrypt_HTTPS_plex.MD
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@rmoreira
rmoreira / nginx.conf
Created May 1, 2017 20:09 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@rmoreira
rmoreira / how-to-fix-on-mac.sh
Created March 7, 2017 06:17 — forked from Gedrovits/how-to-fix-on-mac.sh
How to fix 'dyld: lazy symbol binding failed: Symbol not found: _yajl_set_static_value'
# Copy the gem location to clipboard
bundle show yajl-ruby | pbcopy
# Example: /Users/gedrovits/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/yajl-ruby-0.8.2
cd <cmd + v>
cd ext/yajl
# Now we need to replace 'inline void' to 'static void'. This will also create backup of old files.
sed -i '.bak' 's/inline void/static void/g' yajl_ext.h yajl_ext.c
# Now we must rebuild changed extension
make clean all
# After this you should not have any problems with yajl-ruby
@rmoreira
rmoreira / h2_puma.rb
Created February 27, 2017 22:14 — forked from tenderlove/h2_puma.rb
Demo HTTP/2 server with Puma
require 'socket'
require 'openssl'
require 'puma/server'
require 'ds9'
class Server < DS9::Server
def initialize socket, app
@app = app
@read_streams = {}
@write_streams = {}
BITS 32
org 0x05000000
db 0x7F, "ELF"
dd 1
dd 0
dd $$
dw 2
dw 3
dd 0x0500001B