This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable vim automatic visual mode on mouse select | |
source /usr/share/vim/vim82/defaults.vim | |
# set compatible | |
set mouse-=a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo add-apt-repository ppa:bamboo-engine/ibus-bamboo | |
sudo apt-get update | |
# Install all necessary tools with the following command | |
sudo apt install vim htop terminator meld glogg curl git totem keepass2 \ | |
kazam ksnip maven remmina libreoffice network-manager-l2tp-gnome \ | |
ibus-bamboo gnome-calendar gnome-weather gnome-clocks \ | |
qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager -y; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check ufw status | |
sudo ufw status | |
# Enable ufw | |
sudo ufw enable | |
# Check ufw status again | |
sudo ufw status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kubectl Autocomplete | |
source <(kubectl completion bash) | |
alias k=kubectl | |
complete -F __start_kubectl k | |
alias kns='kubectl config set-context --current --namespace' | |
alias kurrent='kubectl config view --minify -o "jsonpath={..namespace}" | xargs -I %s echo "Current Namespace: %s"' | |
alias kcurrent=kurrent | |
alias nodetop='k get nodes | grep Ready | cut -d" " -f1 | xargs kubectl describe node | grep -E "Name: |cpu |memory "' | |
alias ktop=nodetop | |
export KUBECONFIG=$HOME/.kube/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
python3 -m venv <your-python-project> | |
# if Debian/Ubuntu, then: | |
# sudo apt install python3.10-venv | |
# python3.10 -m venv <your-python-project> | |
# To access your project | |
source /path-to-your-python-project/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Size of partition for ubuntu | |
<Size> <mount point> <type> | |
50.000m / ext4 | |
100m efi | |
Remain /home ext4 | |
4096m /Swap swap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Step 1 | |
#Generate server keystore and client keystore | |
keytool -keystore kafka.server.keystore.jks -alias localhost -validity 365 -genkey | |
keytool -keystore kafka.client.keystore.jks -alias localhost -validity 365 -genkey | |
#Step 2 | |
#Create CA | |
openssl req -new -x509 -keyout ca-key -out ca-cert -days 365 | |
#Add generated CA to the trust store | |
keytool -keystore kafka.server.truststore.jks -alias CARoot -import -file ca-cert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set location of docker-compose binary - shouldn't need to modify this | |
DESTINATION=/usr/local/bin/docker-compose | |
# Get latest docker-compose version | |
# VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) | |
VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f4) | |
# Output some info on what this is going to do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MAINTAINER: NGUYEN HONG THAI | |
if [ $# -eq 2 ]; then | |
old_data=$(realpath $1) | |
new_data=$(realpath $2) | |
else | |
read -p "old_data: " old_data | |
old_data=$(realpath $old_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.ssh/config | |
Host * | |
ControlMaster auto | |
ControlPath ~/.ssh/sockets/%r@%h-%p | |
ControlPersist 600 | |
# https://puppet.com/blog/speed-up-ssh-by-reusing-connections/ |