Skip to content

Instantly share code, notes, and snippets.

@mallendeo
Last active November 14, 2023 18:48
Show Gist options
  • Save mallendeo/7964bb3a7f27ab4b344bebb5ad27f8fa to your computer and use it in GitHub Desktop.
Save mallendeo/7964bb3a7f27ab4b344bebb5ad27f8fa to your computer and use it in GitHub Desktop.
Debian server init
source $HOME/.antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
antigen bundle git
antigen bundle bash
antigen bundle command-not-found
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
antigen theme romkatv/powerlevel10k
antigen apply

On proxmox:

qm set [vmid] -serial0 socket

On the VM:

# Docker & docker-compose
apt install ca-certificates curl gnupg lsb-release python-is-python3 python3-pip
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update && apt install docker-ce docker-ce-cli containerd.io
pip install docker-compose

apt install git curl jq sudo magic-wormhole

mkdir ~/.ssh

wormhole ssh invite # wormhole ssh accept ...

usermod -aG docker $USER
usermod -aG sudo $USER

touch .hushlogin

curl -L git.io/antigen > .antigen.zsh

chsh -s $(which zsh)

## Edit `.p10k` POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS to change the host and user position (context # user@hostname)

## Create sudo user without password
export NEW_USER=someuser
adduser $NEW_USER
usermod -aG sudo $NEW_USER
rsync --archive --chown=$NEW_USER:$NEW_USER ~/.ssh /home/$NEW_USER
echo "$NEW_USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$NEW_USER

# Enable serial console
echo 'GRUB_CMDLINE_LINUX="quiet console=tty0 console=ttyS0,115200"' >> /etc/default/grub
update-grub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment