Last active
June 10, 2025 13:22
-
-
Save HeshamMeneisi/fcab19cbeb0a1b5c524fd67a7da2b079 to your computer and use it in GitHub Desktop.
Shell Quick Setup
This file contains hidden or 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
# path: ~/.shell_aliases | |
# variables | |
export WINDOWS_USER=$(cmd.exe /c "echo %USERPROFILE%" | tr -d '\r' | awk -F'\\\\' '{print $NF}') | |
export WINDOWS_HOME="/mnt/c/Users/$WINDOWS_USER" | |
export SHELL_NAME=$(basename "$SHELL") | |
export SHELL_CONFIG=$(realpath ~/.${SHELL_NAME}rc) | |
export REPOS=$(realpath ~/repositories) | |
# terminal | |
alias srs='SHELL_PERFORMANCE_MODE=0 exec $SHELL' | |
alias srsp='SHELL_PERFORMANCE_MODE=1 exec $SHELL' | |
alias edit='code' | |
alias aconfig='edit ~/.shell_aliases' | |
alias sconfig='edit $SHELL_CONFIG' | |
# git | |
alias gcl='gcl_func' | |
alias gs='git status' | |
alias ghb='gh browse' | |
alias ghp='gh pr view --web' | |
# kubernetes | |
alias k='kubectl' | |
alias kn='kubens' | |
alias kx='kubectx' | |
# terraform | |
alias tf='terraform' | |
alias tfa='terraform apply' | |
alias tfp='terraform plan' | |
alias tff='terraform fmt' | |
alias tfi='terraform init' | |
alias tfo='terraform output' | |
alias tfs='terraform show' | |
alias tfw='terraform workspace' | |
alias tfwc='terraform workspace select' | |
# functions | |
# windows | |
function wopen() { | |
linux_path="$1" | |
explorer.exe $(wslpath -w "$linux_path") | |
} | |
# git | |
function gcl_func() { | |
repo_id="$1" | |
target_path="$REPOS/$repo_id" | |
mkdir -p "$target_path" | |
shift | |
git clone "$@" "https://github.com/$repo_id.git" "$target_path" | |
} |
This file contains hidden or 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
# apt packages | |
sudo apt update | |
sudo apt install make zoxide xdg-open wslu -y | |
# snap packages | |
sudo snap install gh | |
# install snap --classic packages | |
snap_classic_packages=("terraform" "helm" "kubectl" "kubectx") | |
for pkg in "${snap_classic_packages[@]}"; do echo "Installing $pkg with --classic..."; sudo snap install $pkg --classic; done | |
# download & source aliases | |
SHEL_ALIASES_URL="https://gist.githubusercontent.com/HeshamMeneisi/fcab19cbeb0a1b5c524fd67a7da2b079/raw/9dfdad03a30e93c88938ef9a02244553ba94d244/.shell_aliases" | |
curl -L $SHEL_ALIASES_URL -o ~/.shell_aliases | |
source ~/.shell_aliases | |
# install oh-my-shell | |
$SHELL -c "$(curl -fsSL https://raw.githubusercontent.com/ohmy${SHELL_NAME}/oh-my-${SHELL_NAME}/master/tools/install.sh)" | |
curl -sSfL | |
# configure aliases and j in shell config | |
echo ' | |
source ~/.shell_aliases | |
eval "$(zoxide init --cmd=j $SHELL_NAME)" | |
' >> "$SHELL_CONFIG" | |
source "$SHELL_CONFIG" | |
# ble.sh (autosuggestions) | |
gcl akinomyoga/ble.sh --recursive | |
cd $REPOS/akinomyoga/ble.sh | |
make install | |
echo " | |
if [[ SHELL_PERFORMANCE_MODE -ne 1 ]]; then | |
source ~/.local/share/blesh/ble.sh | |
fi | |
" >> "$SHELL_CONFIG" | |
srs |
This file contains hidden or 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
# VSCode | |
# install: https://code.visualstudio.com/ | |
# install: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack | |
# WSL | |
wsl --list --online | |
wsl --install Ubuntu | |
wsl | |
# install aliases and useful tools | |
curl -s https://gist.githubusercontent.com/HeshamMeneisi/fcab19cbeb0a1b5c524fd67a7da2b079/raw/auto_install_linux.sh | $SHELL_NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment