Skip to content

Instantly share code, notes, and snippets.

@esurdam
esurdam / nginx_njs.md
Last active August 19, 2018 18:38
njs for nginx configuration

NJS/nginScript

Configure nginx with HTTP JavaScript module using the --add-module option:

./configure --add-module=<path-to-njs>/nginx

Alternatively, you can build a dynamic version of the njs module

./configure --add-dynamic-module=<path-to-njs>/nginx
@esurdam
esurdam / sign_html_gpg.md
Last active July 14, 2016 07:28
Sign .html files with gpg - detached signature

HTML Signing

Inspiration

Automate Signing with a MakeFile

Create a MakeFile in the root of your git project.

This MakeFile will recursively look through all dirs for any .html file, starting at the root. It will then sign the file and create a detached signature contained in a .html.asc file.

@esurdam
esurdam / meta-tags.md
Last active July 14, 2016 04:19 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@esurdam
esurdam / ecdsa_openssl.md
Last active December 21, 2023 09:12
Generate ECDSA certs

ECDSA Certs with LetsEncrypt

More on ECDSA

Info on bit length and complexity

From it you may gather that using 256 bit ECDSA key should be enough for next 10-20 years.

To view your available curves

@esurdam
esurdam / kodi_plugins.md
Last active July 13, 2016 09:44
Kodi Plugin Setup

Install Kodi then...

# Navigate to System > File Manager
# Add http://fusion.tvaddons.ag
# Name it 'Fusion;

# Go to System > Add-Ons > Install From Zip
# Select 'Fusion'
# Install the Add-On-Manager
@esurdam
esurdam / web_server_setup.md
Last active December 2, 2021 02:42
Knowledge base for secure server setup.
@esurdam
esurdam / pem_to_hkpk.md
Created July 12, 2016 07:31
Generate HKPK from pem encoded certs (letsencrypt, digicert, etc)

HPKP from .pem (letsecnrypt)

Generate from your letsencrypt certs.

HKPK (RFC7469) is a standard that tells browser to cache a certain TLS certificate’s signature, and validate that future visits use that certificate. Please read Extended Info as losing your pins may result in migraines (if you use your leaf) You can check or generate your hashes with this tool

letsencrypt renews your certificates every few months, so if you pin against your cert.pem and it changes (or you lose it), the browser will still expect to see the old one.

@esurdam
esurdam / install_nginx_alpn.md
Last active December 2, 2021 02:42
Install nginx with alpn support

Install nginx 1.11 with ALPN

Test your web server for HTTP/2 and ALPN support KeyCDN

Test SSL strength of your setup SSL LABS

install openssl with ALPN support

@esurdam
esurdam / ghost.md
Last active September 26, 2016 15:37
Install Ghost on CentOS/Amazon Linux AMI

Install Ghost on CentOS/Amazon Linux AMI

Thanks to: https://www.rosehosting.com/blog/install-ghost-with-nginx-on-centos-7/

Ghost is a free and open source blogging platform written in JavaScript and built on Node.js, designed to simplify the process of online publishing for individual bloggers as well as online publications.

Prep System

As always, make sure your server is fully up-to-date. Also install unzip and a text editor of your choice. We will use nano:

@esurdam
esurdam / proxy_elb_ssl.md
Last active July 10, 2016 10:54
Setting up ELB for multi SSL

ELB Proxy SSL to instance

Thanks to http://garthkerr.com/multiple-ssl-domains-on-elb-with-nginx/

If you are also (likely) handling standard requests over port 80, you do not need to enable Proxy Protocol for non-secure traffic. The HTTP traffic can remain unaffected while adding HTTPS to an existing ELB.

Create ELB and policy

First, we need an ELB instance.