Skip to content

Instantly share code, notes, and snippets.

@moscowchill
Created September 12, 2025 20:50
Show Gist options
  • Select an option

  • Save moscowchill/c80205433009701e57a6ab8b3b5d0bf9 to your computer and use it in GitHub Desktop.

Select an option

Save moscowchill/c80205433009701e57a6ab8b3b5d0bf9 to your computer and use it in GitHub Desktop.
cloud init
#cloud-config
# Update package cache
package_update: true
package_upgrade: true
# Install base packages
packages:
- curl
- wget
- git
- build-essential
- python3
- python3-pip
- python3-venv
- nodejs
- npm
- zsh
- fonts-powerline
- autojump
# Create user with sudo access (optional - remove if not needed)
users:
- name: admin
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa AAAAB3... # Add your public key here
shell: /bin/bash
# Write setup script for user-specific installations
write_files:
- path: /tmp/user_setup.sh
permissions: '0755'
content: |
#!/bin/bash
# Run as the user, not root
USER_HOME="/home/admin" # Change to your username if different
# Install pipx
pip3 install --user pipx
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $USER_HOME/.bashrc
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Source NVM and install latest Node.js
export NVM_DIR="$USER_HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install node
# Install PM2 globally
npm install -g pm2
# Install Claude Code
npm install -g @anthropic-ai/claude-code
# Install Nim Lang
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
echo 'export PATH="$HOME/.nimble/bin:$PATH"' >> $USER_HOME/.bashrc
# System-wide commands that run as root
runcmd:
# Run telemetry disable script
- curl -sSL https://gist.githubusercontent.com/moscowchill/47cfbb871705ceb32a095565948afd85/raw/4354a9f9ecd8b933db49e29c7a4fc412c9c8ddf7/telemetry_off.sh | bash
# Run shell setup script as user (not root)
- sudo -u admin bash -c "curl -sSL https://gist.githubusercontent.com/moscowchill/4fbdb5aa9ca164e4d3bc0b5bd1648f70/raw/6be124ba9d9230d779693ba8d8b8812dafcb3964/shellfix.sh | bash"
# Run user setup script as user
- sudo -u admin bash /tmp/user_setup.sh
# Clean up
- rm -f /tmp/user_setup.sh
# Update locate database
- updatedb
# Set timezone (optional)
timezone: UTC
# Reboot after setup (optional)
power_state:
mode: reboot
timeout: 300
condition: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment