diff --git a/bash/bashrc b/bash/bashrc index 33e2238..4c18b49 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -146,7 +146,18 @@ if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null then echo -e "${green} * ${nc} WSL env detected ..." export DISPLAY=:0.0 + for i in $(pstree -np -s $$ | grep -o -E '[0-9]+') + do + if [[ -e "/run/WSL/${i}_interop" ]] + then + export WSL_INTEROP=/run/WSL/${i}_interop + fi + done + export BROWSER=wslview alias adb="/mnt/c/Android/android-sdk/platform-tools/adb.exe" + alias fastboot="/mnt/c/Android/android-sdk/platform-tools/fastboot.exe" + alias code="/mnt/c/Program\ Files/Microsoft\ VS\ Code/Code.exe" + fi echo -e "Ready${green}!${nc}" diff --git a/bash/functions/enoclink/functions.sh b/bash/functions/enoclink/functions.sh new file mode 100644 index 0000000..fc53925 --- /dev/null +++ b/bash/functions/enoclink/functions.sh @@ -0,0 +1,6 @@ +alias kubeazdev="kubectl config use-context moon-dev-enoc-link-k8s" +alias kubeazstaging="kubectl config use-context moon-staging-enoc-link-k8s" +alias kubeazprod="kubectl config use-context moon-prod-enoc-link-k8s" +alias updateazdev="az aks get-credentials --name moon-dev-enoc-link-k8s --resource-group moon-dev-enoc-link-rg" +alias updateazprod="az aks get-credentials --name moon-prod-enoc-link-k8s --resource-gro up moon-prod-enoc-link-rg" +alias updateazstaging="az aks get-credentials --name moon-staging-enoc-link-k8s --resour ce-group moon-staging-enoc-link-rg" diff --git a/bash/functions/gerardo/functions.sh b/bash/functions/gerardo/functions.sh new file mode 100644 index 0000000..e6a953d --- /dev/null +++ b/bash/functions/gerardo/functions.sh @@ -0,0 +1,15 @@ +function check_cert { + curl --insecure -v https://$1 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }' +} + +function cert_fingerprint { + openssl s_client -connect $1 |& openssl x509 -fingerprint -noout | awk -F '=' '{print $2}' | sed -e 's/://g' | tr [:upper:] [:lower:] +} + +function vman { + vim <(man $1); +} + +function cpu { + ps -Ao user,comm,pid,pcpu,pmem,rss --sort=-pcpu | head -n 6 +} diff --git a/bash/functions/rcp/functions.sh b/bash/functions/rcp/functions.sh index 85dc9d1..3d1a7c8 100644 --- a/bash/functions/rcp/functions.sh +++ b/bash/functions/rcp/functions.sh @@ -1,6 +1,6 @@ # Use common parameters for ssh into servers -function sph { +function sph { sshpass -p spr1ngw4t3r ssh \ -o ChallengeResponseAuthentication=no \ -o HostbasedAuthentication=no \ diff --git a/install.sh b/install.sh index d6ca3e8..aa14b22 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,11 @@ #!/bin/bash -packages="sshpass tmux python3-pip cargo vim-nox build-essential python3-dev \ - gcc-9 g++-9 python2 python2-dev guestfish libncurses-dev" +packages="sshpass tmux python3-pip cargo vim-nox build-essential \ + python3-dev gcc-9 g++-9 python2 python2-dev guestfish \ + libncurses-dev python3.10-venv sqlite3 build-essential \ + mono-complete libboost-dev, libfreeimage-dev bison flex \ + ca-certificates curl apt-transport-https lsb-release gnupg\ + qemu-system-arm" pip="awscli cmake" @@ -27,6 +31,20 @@ install_packages() { echo "Updating alternatives ..." sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 + curl -sL https://packages.microsoft.com/keys/microsoft.asc | \ + gpg --dearmor | \ + sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null + AZ_REPO=$(lsb_release -cs) + echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \ + sudo tee /etc/apt/sources.list.d/azure-cli.list + sudo apt update + sudo apt install azure-cli + sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg + echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list + sudo apt-get update + sudo apt-get install -y kubectl + sudo apt-get upgrade + sudo apt-get autoremove fi } @@ -36,21 +54,27 @@ install_pip() { echo "Pip 3 detected, installing packages ..." pip install --user -U $pip fi +} +setup_inputrc() { if [[ -f ~/.dotfiles/inputrc ]] then echo "Installing inputrc ..." rm -rf ~/.inputrc ln -sf ~/.dotfiles/inputrc ~/.inputrc fi +} +setup_bash() { if [[ -f ~/.dotfiles/bash/bashrc ]] then echo "Dotfiles bashrc found, linking it ..." rm -rf ~/.bashrc ln -sf ~/.dotfiles/bash/bashrc ~/.bashrc fi +} +setup_tmux() { if [[ -f ~/.dotfiles/tmux/tmux.conf ]] then echo "Dotfiles tmux.conf found, linking it ..." @@ -152,6 +176,9 @@ then else install_packages install_pip + setup_inputrc + setup_bash + setup_tmux install_starship setup_starship setup_ssh