Skip to content

Instantly share code, notes, and snippets.

View tuanle96's full-sized avatar
♥️
Focusing

Lê Anh Tuấn tuanle96

♥️
Focusing
View GitHub Profile
@tuanle96
tuanle96 / Dockerfile
Created March 27, 2025 15:12
Odoo 18 Dockerfile
FROM debian:bookworm-slim
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
# Không sử dụng ARG cho dữ liệu nhạy cảm (sẽ sử dụng biến môi trường khi build nếu cần)
ARG GIT_ORG=earnbaseio
ARG GIT_REPO=odoo
ARG GIT_REGISTRY=github.com
ARG TARGETARCH=
@tuanle96
tuanle96 / squid.conf
Created December 2, 2023 04:08
Squid Configuration with basic auth
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
acl localnet src fc00::/7 # RFC 4193 local private network range
@tuanle96
tuanle96 / main.py
Created February 7, 2023 02:26 — forked from theangryangel/main.py
Odoo 12 Prometheus instrumentation
##############################################################################
#
# Author: Miku Laitinen / Avoin.Systems
# Copyright 2019 Avoin.Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#

PostgreSQL High Availibility on Kubernetes

  • Installation
  • Create PostgreSQL Cluster
  • Connect to a PostgreSQL Cluster
    • psql
    • pgAdmin
  • Updating PostgreSQL Cluster
  • High Availability

Create cluster

gcloud container clusters create "gke-px" \
--zone "asia-southeast1-a" \
--cluster-version "1.20.8-gke.900" \
--machine-type "n1-standard-4" \
--image-type "UBUNTU" \
--disk-type "pd-ssd" \
--disk-size "100" \
@tuanle96
tuanle96 / odoo_k3s.yaml
Last active November 11, 2022 16:28
Setup Odoo with K3s
apiVersion: v1
kind: Namespace
metadata:
name: odoo-16
labels:
cattle.io/creator: "norman"
@tuanle96
tuanle96 / vietnam_exchange_rates_vietcombank.py
Last active October 26, 2022 04:45
Vietnam Exchange Rates from Vietcombank
import datetime
import requests
from bs4 import BeautifulSoup
def get_exchange_rates_vcb(exchange_date=None, currencies=["USD"]):
headers = {
'authority': 'portal.vietcombank.com.vn',
'accept': '*/*',
@tuanle96
tuanle96 / flutter_publish_release.yml
Created May 27, 2022 10:10 — forked from andrea689/flutter_publish_release.yml
Example of CI/CD for Flutter
name: Flutter publish release
on:
push:
tags:
- android-v[0-9]+.[0-9]+.[0-9]+
- ios-v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+
jobs:
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 20.04 LTS (could be used for other version too)
# Author: Henry Robert Muwanika
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 20.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# crontab -e
@tuanle96
tuanle96 / jwtRS256.sh
Created November 18, 2021 08:59 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub