Skip to content

Instantly share code, notes, and snippets.

@quangthe
quangthe / SSL-nginx-Docker.md
Created April 2, 2022 10:11 — forked from dahlsailrunner/SSL-nginx-Docker.md
SSL with Docker images using nginx as reverse proxy

Docker with SSL and an nginx reverse proxy

Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.

Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the Windows Terminal).

1. Create a conf file with information about the cert you'll be creating

It should look something like the content below; call it my-site.conf or something like that.

@quangthe
quangthe / server.conf
Last active April 3, 2022 14:32 — forked from timcheadle/server.conf
SSL nginx config example
server {
listen 80;
server_name www.example.com example.com;
# Redirect all traffic to SSL
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl default_server;
@quangthe
quangthe / Jenkinsfile
Last active April 3, 2022 14:40 — forked from bcomnes/Jenkinsfile
Jenkinsfile stuff, Jenkins 101
/*
Git env vars you might need in jenkins
Jenkins ENV Reference:
env.GIT_COMMIT: the commit sha of the current build
env.BRANCH_NAME: the branch name OR tag name of the current build, when it exists
env.GIT_BRANCH: same as BRANCH_NAME
env.TAG_NAME: the tag name of the current build, when it exists
*/
// stash and unstash
@quangthe
quangthe / rsa_util.go
Created December 2, 2021 10:53 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@quangthe
quangthe / jaas.config
Created November 25, 2021 11:21 — forked from serpensalbus/jaas.config
JAAS config Magnolia example configuration file
/**
* options for JCRAuthenticationModule module:
* realm: to restrict the login to a certain realm
* use_realm_callback: to allow the GUI to pass the realm to login into
* skip_on_previous_success: if true the login is scipped if a former module proceeded a successfull login
*
* example:
* info.magnolia.jaas.sp.jcr.JCRAuthenticationModule requisite realm=public;
* info.magnolia.jaas.sp.jcr.JCRAuthenticationModule requisite realm=admin skip_on_previous_success=true;
*/
@quangthe
quangthe / SSL-certs-OSX.md
Created February 4, 2021 05:55 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@quangthe
quangthe / add-app-metadata-to-jwt.js
Created March 27, 2019 08:27 — forked from philipisapain/add-app-metadata-to-jwt.js
Auth0 Rule for adding app_metadata to JWT
function (user, context, callback) {
var namespace = 'https://tojs.io/';
context.accessToken[namespace + 'user_authorization'] = {
groups: user.app_metadata.groups,
roles: user.app_metadata.roles,
permissions: user.app_metadata.permissions
};
return callback(null, user, context);
}
You can ssh into the VM by finding the IP (from kubectl config view) and using username "docker" password "tcuser":
ssh [email protected]
@quangthe
quangthe / introrx.md
Created April 16, 2018 02:45 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing