Adding latest changes

This commit is contained in:
Gerardo J. Puerta 2022-09-13 07:11:59 -05:00
parent b7fd37ba13
commit a15b47444a
5 changed files with 62 additions and 3 deletions

View File

@ -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}"

View File

@ -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"

View File

@ -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
}

View File

@ -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 \

View File

@ -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