Skip to content

Instantly share code, notes, and snippets.

@sounishnath003
Last active January 3, 2026 09:56
Show Gist options
  • Select an option

  • Save sounishnath003/5644a3aff4060bc6cda9353dccbcce0b to your computer and use it in GitHub Desktop.

Select an option

Save sounishnath003/5644a3aff4060bc6cda9353dccbcce0b to your computer and use it in GitHub Desktop.
To setup sounish dev setup
#!/usr/bin/env bash
set -e
echo "πŸš€ Starting Dev Environment Setup..."
# ----------------------------
# Detect OS
# ----------------------------
OS=""
if [[ "$OSTYPE" == "darwin"* ]]; then
OS="macos"
elif [[ -f /etc/debian_version ]]; then
OS="linux"
else
echo "❌ Unsupported OS"
exit 1
fi
echo "πŸ–₯️ Detected OS: $OS"
# ----------------------------
# Helpers
# ----------------------------
command_exists() {
command -v "$1" >/dev/null 2>&1
}
append_if_missing() {
local line="$1"
local file="$2"
grep -qxF "$line" "$file" 2>/dev/null || echo "$line" >> "$file"
}
ZSHRC="$HOME/.zshrc"
# ----------------------------
# Package Managers
# ----------------------------
if [[ "$OS" == "macos" ]]; then
if ! command_exists brew; then
echo "🍺 Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
PM_INSTALL="brew install"
elif [[ "$OS" == "linux" ]]; then
sudo apt update
PM_INSTALL="sudo apt install -y"
fi
# ----------------------------
# Git
# ----------------------------
if ! command_exists git; then
echo "πŸ“¦ Installing Git..."
$PM_INSTALL git
else
echo "βœ… Git already installed"
fi
# ----------------------------
# Python
# ----------------------------
if ! command_exists python3; then
echo "πŸ“¦ Installing Python..."
$PM_INSTALL python3 python3-pip
else
echo "βœ… Python already installed"
fi
# ----------------------------
# Go
# ----------------------------
if ! command_exists go; then
echo "πŸ“¦ Installing Go..."
if [[ "$OS" == "macos" ]]; then
$PM_INSTALL go
else
$PM_INSTALL golang
fi
else
echo "βœ… Go already installed"
fi
append_if_missing 'export GOPATH=$HOME/go' "$ZSHRC"
append_if_missing 'export PATH=$PATH:$GOPATH/bin' "$ZSHRC"
# ----------------------------
# Java (OpenJDK)
# ----------------------------
if ! command_exists java; then
echo "πŸ“¦ Installing OpenJDK..."
if [[ "$OS" == "macos" ]]; then
$PM_INSTALL openjdk
append_if_missing 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' "$ZSHRC"
else
$PM_INSTALL openjdk-17-jdk
fi
else
echo "βœ… Java already installed"
fi
# ----------------------------
# Node.js + npm (LTS)
# ----------------------------
if ! command_exists node; then
echo "πŸ“¦ Installing Node.js (LTS)..."
if [[ "$OS" == "macos" ]]; then
$PM_INSTALL node
else
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
fi
else
echo "βœ… Node.js already installed"
fi
# ----------------------------
# Docker
# ----------------------------
if ! command_exists docker; then
echo "πŸ“¦ Installing Docker..."
if [[ "$OS" == "macos" ]]; then
$PM_INSTALL --cask docker
else
sudo apt install -y docker.io
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker "$USER"
echo "⚠️ Log out & log back in for Docker group changes"
fi
else
echo "βœ… Docker already installed"
fi
# ----------------------------
# Minikube
# ----------------------------
if ! command_exists minikube; then
echo "πŸ“¦ Installing Minikube..."
if [[ "$OS" == "macos" ]]; then
$PM_INSTALL minikube
else
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
rm minikube-linux-amd64
fi
else
echo "βœ… Minikube already installed"
fi
# ----------------------------
# Verification
# ----------------------------
echo ""
echo "πŸ” Installed Versions:"
python3 --version || true
go version || true
java -version || true
node --version || true
npm --version || true
docker --version || true
minikube version || true
git --version || true
echo ""
echo "πŸŽ‰ Dev environment setup complete!"
echo "πŸ‘‰ Restart your terminal or run: source ~/.zshrc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment