Skip to content

Instantly share code, notes, and snippets.

@willjasen
Last active October 11, 2024 19:26
Show Gist options
  • Save willjasen/1bb3e406f66452ba71e2a86960ae2311 to your computer and use it in GitHub Desktop.
Save willjasen/1bb3e406f66452ba71e2a86960ae2311 to your computer and use it in GitHub Desktop.
set up an image of ubuntu 24.04 for me
#!/bin/sh
###
### Image script version -- v1.1
###
### HISTORY
# - v1.0 -- base install of Ubuntu with / as btrfs and no swap partition, no commands or scripts have been applied
# - v1.1 -- installed needed apps and updates; make GRUB boot screen only 3 seconds
###
# Update the operating system
apt update; DEBIAN_FRONTEND=noninteractive apt upgrade -y;
# Install common tools
apt install curl git wget net-tools screen jq locate nano -y;
# Install management tools
apt install ssh openssl qemu-guest-agent cryptsetup gparted htop nmon iotop -y; ## iostat not installing
# Install network diagnostics tools
apt install iputils-ping traceroute dnsutils -y;
# Install Tailscale (but don't activate)
curl -fsSL https://tailscale.com/install.sh | sh;
# Ensure QEMU guest agent is started and enabled
systemctl start qemu-guest-agent;
systemctl enable qemu-guest-agent;
# Clean up no longer needed dependencies
apt autoremove -y;
# Make the GRUB boot screen only show up for 3 seconds
sed -i '/^GRUB_RECORDFAIL_TIMEOUT=/ s/.*/GRUB_RECORDFAIL_TIMEOUT=3/; t; $ a GRUB_RECORDFAIL_TIMEOUT=3' /etc/default/grub;
update-grub;
# End of the script
echo "The script is finished."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment