Skip to content

Instantly share code, notes, and snippets.

@thomanhphuc
thomanhphuc / gist:fcedf4112e2bd9fa9f4aeb9499ed204a
Created February 17, 2025 08:31
OpenVPN Community for Amazon Linux 2 + 2FA with Google Authenticator
git clone https://github.com/danilvalov/openvpn_amazon_linux_2fa.git
cd openvpn_amazon_linux_2fa
chmod +x install-openvpn.sh manage-openvpn.sh
./install-openvpn.sh
Open /etc/openvpn/easy-rsa/easyrsa file, find the function called gen_req(), and change a parameter called opts= to opts="-passout stdin"
Edit /etc/openvpn/server.conf
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
@thomanhphuc
thomanhphuc / gist:688d72d9be6d36b7f100b82d9419260b
Last active October 15, 2024 06:24
in‌stall cuda 12.2 ubuntu 20.04
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get remove --purge '^libnvidia-.*'
sudo apt-get remove --purge '^cuda-.*'
sudo apt-get install linux-headers-$(uname -r)
lsof /dev/nvidia*
kill -9 PID
wget https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run
sudo sh cuda_12.2.0_535.54.03_linux.run
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
@thomanhphuc
thomanhphuc / AzureRegionData.md
Created September 17, 2024 03:45 — forked from ausfestivus/AzureRegionData.md
A list of the Azure regions

List of Azure Regions

A list of all the region names and locations for Azure

Creating the list

You can recreate the list anytime using this command:

az account list-locations -o table
Additional IPv4 IP
reboot sever
ip addr add xxx.xx.xxx.xx/32 dev eth0
cp ~/.kube/config ~/.kube/config.bak
KUBECONFIG=~/.kube/config.1:~/.kube/config.2 kubectl config view --flatten > ~/.kube/config_tmp
mv ~/.kube/config_tmp ~/.kube/config
@thomanhphuc
thomanhphuc / gist:cbf907e5e99f074eaaee15727556ff2d
Created December 27, 2023 07:50
minio kube proxy login error
https://github.com/minio/console/issues/2539#issuecomment-1619211962
@thomanhphuc
thomanhphuc / gist:b39eeebf915c6490401abf90a3ff2799
Created August 30, 2023 08:33
Remove Namespace stuck in terminating state after delete
kubectl get namespace keda -o json >tmp.json
edit tmp.json
"spec": {
"finalizers": [
]
},
kubectl proxy
curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/keda/finalize
kubectl delete apiservice v1beta1.external.metrics.k8s.io
#EXTM3U url-tvg="http://stream.cvmtv.site:5000/epg.xml,http://trada.info/epg.xml,http://stream.cvmtv.site:9981/xmltv/channels"
#EXTINF:-1 group-title="VIỆT NAM" tvg-id="quochoi" tvg-logo="https://quochoitv.vn/themes/quochoitv/images/logo-qhtv-new.png",Quốc Hội TV
http://stream.cvmtv.site/qhtv?token=live
@thomanhphuc
thomanhphuc / gist:7261d2ba4adc773b0cfb099c4b796eb2
Last active August 9, 2023 08:29
Vim copy/paste messing up indentaton

~/.vimrc

" Code from:
" http://stackoverflow.com/questions/5585129/pasting-code-into-terminal-window-into-vim-on-mac-os-x
" then https://coderwall.com/p/if9mda
" and then https://github.com/aaronjensen/vimfiles/blob/59a7019b1f2d08c70c28a41ef4e2612470ea0549/plugin/terminaltweaks.vim
" to fix the escape time problem with insert mode.
"
" Docs on bracketed paste mode: