Created
May 31, 2025 22:41
-
-
Save darinkishore/ddea360c695f01a3281c34c88868be6a to your computer and use it in GitHub Desktop.
Simple GPU Dev Setup - Just Essentials: developer user, Node.js via mise, Python with uv, Claude Code CLI, VSCode SSH compatibility
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
#!/bin/bash | |
# Simple GPU Dev Setup - Just the essentials, no BS | |
# Core: developer user, Node.js, Python/uv, Claude Code, VSCode SSH support | |
set -e | |
echo "π Simple Dev Setup - Essentials Only" | |
echo "====================================" | |
# Must be root | |
if [ "$EUID" -ne 0 ]; then | |
echo "Run as root: sudo bash $0" | |
exit 1 | |
fi | |
# No prompts | |
export DEBIAN_FRONTEND=noninteractive | |
export TZ=UTC | |
# Fix timezone first | |
ln -fs /usr/share/zoneinfo/UTC /etc/localtime | |
echo "UTC" > /etc/timezone | |
# Update apt | |
echo "π¦ Installing essentials..." | |
apt-get update || { | |
# Fix mirrors if needed | |
echo "deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" > /etc/apt/sources.list | |
echo "deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list | |
echo "deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" >> /etc/apt/sources.list | |
apt-get update | |
} | |
# Install only what we need | |
apt-get install -y \ | |
sudo \ | |
curl \ | |
wget \ | |
git \ | |
build-essential \ | |
python3 \ | |
python3-pip \ | |
ca-certificates | |
# Create developer user | |
echo "π€ Creating developer user..." | |
if ! id -u developer >/dev/null 2>&1; then | |
useradd -m -s /bin/bash developer | |
echo "developer ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
fi | |
# Fix workspace permissions NOW | |
if [ -d "/workspace" ]; then | |
chown -R developer:developer /workspace | |
echo "β Fixed /workspace" | |
fi | |
# Setup as developer | |
cat << 'DEVSETUP' > /tmp/setup.sh | |
#!/bin/bash | |
cd ~ | |
# Setup paths for everything (bash, VSCode, etc) | |
cat > ~/.profile << 'EOF' | |
export PATH="$HOME/.local/bin:$PATH" | |
[ -d "$HOME/.local/share/mise/shims" ] && export PATH="$HOME/.local/share/mise/shims:$PATH" | |
[ -f "$HOME/.local/bin/mise" ] && eval "$($HOME/.local/bin/mise activate bash)" | |
EOF | |
cat >> ~/.bashrc << 'EOF' | |
export PATH="$HOME/.local/bin:$PATH" | |
[ -d "$HOME/.local/share/mise/shims" ] && export PATH="$HOME/.local/share/mise/shims:$PATH" | |
[ -f "$HOME/.local/bin/mise" ] && eval "$($HOME/.local/bin/mise activate bash)" | |
EOF | |
# Create directories | |
mkdir -p ~/.local/bin | |
export PATH="$HOME/.local/bin:$PATH" | |
# Install mise (for Node.js) | |
echo "π¦ Installing mise..." | |
curl -fsSL https://mise.run | sh | |
# Install Node.js | |
echo "π¦ Installing Node.js..." | |
~/.local/bin/mise use -g node@22 | |
~/.local/bin/mise install | |
# Install uv (for Python) | |
echo "π¦ Installing uv..." | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
# Wait for mise to settle | |
sleep 2 | |
# Install Claude Code | |
echo "π¦ Installing Claude Code..." | |
export PATH="$HOME/.local/share/mise/shims:$PATH" | |
npm install -g @anthropic-ai/claude-code | |
# Create symlinks for VSCode | |
ln -sf ~/.local/share/mise/shims/node ~/.local/bin/node 2>/dev/null || true | |
ln -sf ~/.local/share/mise/shims/npm ~/.local/bin/npm 2>/dev/null || true | |
ln -sf ~/.local/share/mise/shims/npx ~/.local/bin/npx 2>/dev/null || true | |
# Basic git config | |
git config --global init.defaultBranch main | |
echo "" | |
echo "β Setup complete!" | |
echo "" | |
echo "Installed:" | |
echo " β’ Node.js $(~/.local/share/mise/shims/node --version 2>/dev/null || echo 'check path')" | |
echo " β’ npm $(~/.local/share/mise/shims/npm --version 2>/dev/null || echo 'check path')" | |
echo " β’ Python $(python3 --version)" | |
echo " β’ uv (Python package manager)" | |
echo " β’ Claude Code CLI" | |
echo "" | |
echo "Quick test:" | |
echo " claude --version" | |
echo " uv pip install numpy" | |
DEVSETUP | |
chmod +x /tmp/setup.sh | |
su - developer -c "bash /tmp/setup.sh" | |
rm -f /tmp/setup.sh | |
echo "" | |
echo "β ALL DONE!" | |
echo "" | |
echo "To start working:" | |
echo " su - developer" | |
echo "" | |
echo "VSCode SSH should work automatically." | |
echo "If not, reconnect after killing the VSCode server." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment