Skip to content

Instantly share code, notes, and snippets.

@quangthe
quangthe / eks-dev-group.yaml
Last active July 22, 2022 07:28
AWS EKS aws-auth dev group
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: dev-role
namespace: dev
rules:
- apiGroups:
- ""
resources:
- nodes
@quangthe
quangthe / eks-dev-readonly.yaml
Created May 11, 2022 03:09
AWS EKS auth: dev readonly
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: dev-readonly-role
namespace: dev
rules:
- apiGroups:
- ""
resources:
- nodes
@quangthe
quangthe / eks-demo-readonly.yaml
Created May 11, 2022 02:41
AWS EKS auth readonly group
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: eks-demo-readonly-clusterrole
rules:
- apiGroups:
- ""
resources:
- nodes
- namespaces
@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 / minikube-docker.md
Last active August 21, 2023 07:23
Docker with Minikube (Replace Docker Desktop)

Installation

brew install minikube

# install docker cli only
brew install docker

brew install docker-compose
@quangthe
quangthe / lima.md
Last active April 7, 2022 03:35
Lima: Docker Desktop replacement

Install lima

brew install lima

2022-02-07: nerdctl is not supported for MacOS. Cannot install via brew install nerdctl

With Docker

Set alias in .bashrc or .zshrc

alias docker="lima nerdctl"

@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"
)