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 / nfs-tunnel.md
Created October 26, 2017 11:44 — forked from proudlygeek/nfs-tunnel.md
Mount NFS Folder via SSH Tunnel

1. Install NFS on Server

Install the required packages (Ubuntu 12.04):

apt-get install nfs-kernel-server portmap

2. Share NFS Folder

Open the exports file:

vim /etc/exports

Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load
@thuvh
thuvh / kubernetes_commands.md
Created May 23, 2019 14:04 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@thuvh
thuvh / hive_druid_integration.md
Last active July 4, 2019 10:45 — forked from rajkrrsingh/hive_druid_integration.md
hive druid integration : quick test to create druid table from hive table
generate data for hive table
echo "generating sample data for hive table"
echo {-1..-181451}hours | xargs -n1 date +"%Y-%m-%d %H:%M:%S" -d >> /tmp/dates.data
echo {-1..-18145}minutes | xargs -n1 date +"%Y-%m-%d %H:%M:%S" -d >> /tmp/dates.data
echo {-1..-1825}days | xargs -n1 date +"%Y-%m-%d %H:%M:%S" -d >> /tmp/dates.data
cat /tmp/dates.data | while read LINE ; do echo $LINE,"user"$((1 + RANDOM % 10000)),$((1 + RANDOM % 1000)) >> /tmp/hive_user_table.data; done

create hive table

@thuvh
thuvh / SSL-certs-OSX.md
Created August 10, 2019 09:59 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@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
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 / 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 / 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 "[email protected]"
@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.