Skip to content

Instantly share code, notes, and snippets.

View maitrungduc1410's full-sized avatar
πŸ’ͺ
Keep chasing your dreams!

Duc Trung Mai maitrungduc1410

πŸ’ͺ
Keep chasing your dreams!
View GitHub Profile
@maitrungduc1410
maitrungduc1410 / blog.md
Created December 2, 2024 14:28
[ARCHIVE] Dockerize α»©ng dα»₯ng chat realtime vα»›i Laravel, Nginx, VueJS, Laravel Echo, Redis, SocketIO

CαΊ­p nhαΊ­t gαΊ§n nhαΊ₯t: 10/11/2024

Xin chΓ o cΓ‘c bαΊ‘n Δ‘Γ£ quay trở lαΊ‘i vα»›i series Học Docker vΓ  CICD cα»§a mΓ¬nh.

ChΓΊc mọi người mα»™t mΓΉa giΓ‘ng sinh an lΓ nh αΊ₯m Γ‘p 😍😍

MαΊ₯y ngΓ y vα»«a rα»“i tinh thαΊ§n viαΊΏt blog Δ‘ang lΓͺn cao thΓ¬ Δ‘Γ΄i mαΊ―t mΓ¬nh lαΊ‘i Δ‘Γ¬nh cΓ΄ng sau 1 khoαΊ£ng thời gian ngα»“i mΓ‘y tΓ­nh quΓ‘ nhiều, hΓ΄m nay "cα»­a sα»• tΓ’m hα»“n" cΓ³ vαΊ» tα»‘t trở lαΊ‘i thΓ¬ mΓ¬nh lαΊ‘i chαΊ§m chαΊ­m viαΊΏt blog tiαΊΏp cho mọi người ;)

DΓΉ lΓ m gΓ¬ cΕ©ng phαΊ£i nhα»› giα»― sα»©c khoαΊ» nhΓ© mọi người, TαΊΏt nhαΊ₯t Δ‘αΊΏn nΖ‘i rα»“i phαΊ£i cΓ³ sα»©c khoαΊ» để cΓ²n Δ‘i lΓ m lαΊ₯y tiền Δ‘Ζ°a về biαΊΏu thαΊ§y bu 🀣🀣

Ở bΓ i trΖ°α»›c mΓ¬nh Δ‘Γ£ hΖ°α»›ng dαΊ«n cΓ‘c bαΊ‘n cΓ‘c Dockerize α»©ng dα»₯ng NodeJS vα»›i mysql, redis,... cΓΉng vα»›i Δ‘Γ³ lΓ  cΓ‘c setup cho mΓ΄i trường dev vΓ  production.

@maitrungduc1410
maitrungduc1410 / Dockerfile
Created October 22, 2023 03:38
Docker Centos Nginx JWT
FROM quay.io/sclorg/nginx-120-c8s as base
FROM base as builder
USER root
ARG JWT_MODULE_PATH=/usr/local/lib/ngx-http-auth-jwt-module
ARG LIBJWT_VERSION=1.13.1
ARG NGINX_VERSION=1.20.0
@maitrungduc1410
maitrungduc1410 / middleware.ts
Created July 8, 2023 03:40
Sync session between Next Auth and Keycloak
import { withAuth } from "next-auth/middleware";
export default withAuth(
{
pages: {
signIn: "/auth/signin",
},
callbacks: {
authorized: async ({ token }) => {
if (!(token as any)?.id_token) return false;
@maitrungduc1410
maitrungduc1410 / _silent-check-sso.html
Created January 4, 2023 04:13
Openedx Keycloak federated login (SSO)
<html>
<body>
<script>
parent.postMessage(location.href, location.origin)
</script>
</body>
</html>
@maitrungduc1410
maitrungduc1410 / _silent-check-sso.html
Last active January 4, 2023 04:18
Openedx Keycloak Federated Logout (Single sign out)
<html>
<body>
<script>
parent.postMessage(location.href, location.origin)
</script>
</body>
</html>
@maitrungduc1410
maitrungduc1410 / index.js
Last active December 27, 2022 03:25
Import users from OpenEdx to Keycloak with NodeJS
import KcAdminClient from "@keycloak/keycloak-admin-client";
const kcAdminClient = new KcAdminClient({
baseUrl: "http://localhost:8080",
realmName: "myrealm",
});
const credentials = {
grantType: "password",
username: "superuser",
@maitrungduc1410
maitrungduc1410 / angular.json
Last active September 25, 2022 03:15
Angular (NGX) Intro.js
{
"projects": {
"ngx-introjs": {
"architect": {
"build": {
"options": {
"styles": [
"node_modules/intro.js/introjs.css"
],
"scripts": [
@maitrungduc1410
maitrungduc1410 / client_3.py
Created December 9, 2020 02:26
Demo streaming audio data to Api-gateway
import argparse
from ws4py.client.threadedclient import WebSocketClient
import time
import threading
import sys
import urllib.parse
import queue
import json
import time
import os
@maitrungduc1410
maitrungduc1410 / package.json
Last active March 2, 2023 23:23
Update Npm and SonarQube on Git commit (using Husky)
{
"name": "demo-project",
"version": "0.0.3",
"husky": {
"hooks": {
"pre-commit": "npm --no-git-tag-version version patch && sh updateSonarProps.sh && git add ."
}
}
}
@maitrungduc1410
maitrungduc1410 / docker-compose.yml
Created November 4, 2020 03:00
Docker PHP Nginx without mouting source code to Nginx
version: '3.4'
services:
app:
image: php:7.2-fpm-alpine
restart: unless-stopped
volumes:
- ./:/var/www/html
- ./www.conf:/usr/local/etc/php-fpm.d/www.conf
webserver: