Last active
December 5, 2021 20:27
-
-
Save veggiemonk/005d5c1e0093529f2b734d361543c2e9 to your computer and use it in GitHub Desktop.
zshrc linux
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
export PATH=$HOME/bin:/usr/local/bin:$PATH | |
export ZSH="~/.oh-my-zsh" | |
ZSH_THEME="robbyrussell" | |
DISABLE_UPDATE_PROMPT="true" | |
# Uncomment the following line if pasting URLs and other text is messed up. | |
DISABLE_MAGIC_FUNCTIONS="true" | |
# Uncomment the following line to enable command auto-correction. | |
ENABLE_CORRECTION="true" | |
# Uncomment the following line to display red dots whilst waiting for completion. | |
COMPLETION_WAITING_DOTS="true" | |
# Uncomment the following line if you want to disable marking untracked files | |
# under VCS as dirty. This makes repository status check for large repositories | |
# much, much faster. | |
# DISABLE_UNTRACKED_FILES_DIRTY="true" | |
HIST_STAMPS="yyyy-mm-dd" | |
HIST_IGNORE_DUPS=true | |
HIST_IGNORE_SPACE=true | |
## PLUGINS CONFIG | |
# | |
plugins=( | |
docker | |
docker-compose | |
git | |
zsh-autosuggestions | |
zsh-completions | |
fast-syntax-highlighting | |
) | |
source $ZSH/oh-my-zsh.sh | |
[ ! -d $ZSH_CUSTOM/plugins/zsh-autosuggestions ] && \ | |
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions | |
[ ! -d $ZSH_CUSTOM/plugins/zsh-completions ] && \ | |
git clone https://github.com/zsh-users/zsh-completions $ZSH_CUSTOM/plugins/zsh-completions | |
[ ! -d $ZSH_CUSTOM/plugins/fast-syntax-highlighting ] && \ | |
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git $ZSH_CUSTOM/plugins/fast-syntax-highlighting | |
[ ! -d ~/bin ] && mkdir ~/bin | |
[ ! -d ~/code ] && mkdir ~/code | |
export LANG=en_US.UTF-8 | |
export MANPATH="/usr/local/man:$MANPATH" | |
# Compilation flags | |
export ARCHFLAGS="-arch x86_64" | |
alias ez="vim ~/.zshrc && source ~/.zshrc" | |
alias es="vim ~/.ssh/config" | |
alias eg="vim ~/.gitconfig" | |
alias c="clear" | |
alias repo="cd ~/code" | |
alias path='echo -e ${PATH//:/\\n}' | |
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | |
#command -v fzf >/dev/null 2>&1 || { brew install } | |
command -v kubectl >/dev/null 2>&1 || { brew install kubernetes-cli } | |
[ ! -f ~/.kubectl_comp ] && kubectl completion zsh > ~/.kubectl_comp | |
alias k=kubectl | |
complete -F __start_kubectl k |
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
#!/usr/bin/env bash | |
sudo apt update | |
sudo apt-get install fail2ban git curl wget build-essential gcc zsh | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" |
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
adduser $USERNAME | |
usermod -aG sudo $USERNAME | |
su - $USERNAME | |
ufw allow $PORT | |
mkdir .ssh | |
touch .ssh/authorized_keys | |
# Paste public here | |
## TODO automate changes | |
/etc/ssh/sshd_config | |
# PubkeyAuthentication yes | |
# Port $PORT | |
# PermitRootLogin no | |
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
## TODO: test if user has root access | |
snap install microk8s --classic | |
apt-get update | |
apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
cat << EOF > /etc/docker/daemon.json | |
{ | |
"insecure-registries" : ["localhost:32000"] | |
} | |
EOF | |
# sudo nvim /etc/docker/daemon.json | |
systemctl restart docker | |
iptables -P FORWARD ACCEPT; | |
apt-get install iptables-persistent; | |
ufw allow in on cni0 && ufw allow out on cni0 | |
microk8s enable helm3 storage registry dns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment