Skip to content

Instantly share code, notes, and snippets.

View thuvh's full-sized avatar
😀
hello world

Hoai-Thu Vuong thuvh

😀
hello world
View GitHub Profile
@thuvh
thuvh / redis_proxy_connection.py
Created March 13, 2024 02:45 — forked from Hanny2010/redis_proxy_connection.py
Connect to Redis server over Squid Proxy
import socket
from redis.client import Redis
from redis.connection import Connection, ConnectionPool
from redis._compat import iteritems
class ProxyConnection(Connection):
def __init__(self, host='localhost', port=6379, db=0, password=None,
socket_timeout=None, socket_connect_timeout=None,
socket_keepalive=False, socket_keepalive_options=None,
@thuvh
thuvh / authy-fetch-extract-snap.md
Created May 4, 2023 10:17 — forked from ruario/authy-fetch-extract-snap.md
How to download and install Twilio Authy on a desktop Linux system without snap support
  • Make an install directory somewhere convenient and switch to it
mkdir -p ~/.local/share/authy
cd ~/.local/share/authy
  • Fetch the current Authy snap
@thuvh
thuvh / ca.py
Created March 16, 2023 05:48 — forked from major/ca.py
Making a certificate authority (CA) with python cryptography
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
import datetime
import uuid
one_day = datetime.timedelta(1, 0, 0)
private_key = rsa.generate_private_key(
public_exponent=65537,
@thuvh
thuvh / smart-caps-lock.md
Created August 29, 2022 07:38 — forked from tanyuan/smart-caps-lock.md
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@thuvh
thuvh / README.md
Last active March 29, 2024 07:09
ubuntu common packages

Ubuntu Common Packages

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install -y  git build-essential \
    tmux htop nload \
    sysstat iotop dstat \
    tcptraceroute net-tools wget \
 curl dnstop bash-completion \
@thuvh
thuvh / generate-ed25519-ssh-key.sh
Last active January 4, 2022 08:22 — forked from risan/generate-ed25519-ssh-key.sh
Generate SSH key with Ed25519 key type
ssh-keygen -a 101 -t ed25519 -f ~/.ssh/id_ed25519 -C "john@example.com"
@thuvh
thuvh / letsencrypt_2020.md
Created April 16, 2021 03:50 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@thuvh
thuvh / postman.desktop
Created April 9, 2021 07:36 — forked from hauthorn/postman.desktop
Postman desktop entry
[Desktop Entry]
Categories=Development;
Comment=Supercharge your API workflow
Exec="/home/hauthorn/Programs/Postman/Postman"
Icon=/home/hauthorn/Programs/Postman/app/resources/app/assets/icon.png
Name=Postman
Terminal=false
Type=Application
Version=1.0
@thuvh
thuvh / telegramdesktop.desktop
Created April 9, 2021 02:55 — forked from bobby1030/telegramdesktop.desktop
Telegram Desktop Entry
[Desktop Entry]
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
TryExec=/opt/Telegram/Telegram
Exec=/opt/Telegram/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
thuvh ALL=(ALL) NOPASSWD: ALL