Skip to content

Instantly share code, notes, and snippets.

View caocuong2404's full-sized avatar
🌍
Have a nice day

Nguyen Cao Cuong - Peter James caocuong2404

🌍
Have a nice day
View GitHub Profile
@caocuong2404
caocuong2404 / nerd_fonts.md
Created June 5, 2023 03:36 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
@caocuong2404
caocuong2404 / Dockerfile
Created May 22, 2023 04:30 — forked from rosskevin/Dockerfile
nginx envsubst escape $
FROM nginx:alpine
# https://thepracticalsysadmin.com/templated-nginx-configuration-with-bash-and-docker/
ENV LISTEN_PORT=80 \
NGINX_ENV=production \
SERVER_NAME=_ \
RESOLVER=8.8.8.8 \
UPSTREAM_API=api:3000 \
UPSTREAM_API_PROTO=http \
WORKDIR=/www \
@caocuong2404
caocuong2404 / webcryptoapi.html
Created May 12, 2023 07:29 — forked from deiu/webcryptoapi.html
Web Crypto API example: RSA keygen & export & import & sign & verify & encrypt & decrypt
<!-- MIT License -->
<html>
<head>
<script>
function generateKey(alg, scope) {
return new Promise(function(resolve) {
var genkey = crypto.subtle.generateKey(alg, true, scope)
genkey.then(function (pair) {
resolve(pair)
})
@caocuong2404
caocuong2404 / hosts.ps1
Created April 27, 2023 03:29 — forked from markembling/hosts.ps1
Powershell script for adding/removing/viewing entries to the hosts file.
#
# Powershell script for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
$file = "C:\Windows\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {