Setup scripts

These scripts are designed to configure new bare-metal OS installations or virtual machines for development and/or productivity use. The Linux scripts are split into logic for headless systems and desktop environments, whereas the Windows script can be used to configure either, and will automatically install additional GUI tools in the case of the latter.

Ubuntu Server Setup: configures a headless Ubuntu 22.04 installation for use as a development environment.
View the list of components installed by this script

Software:

Python Packages:

Ruby Gems:

  • bundler dependency manager
  • pleaserun startup script and service definition generator
# Download the script to a temporary file, since it can't simply be piped without a filename
SCRIPT='/tmp/ubuntu-server.sh'
wget 'https://scripts.adamrehn.com/setup/ubuntu-server.sh' -O "$SCRIPT" && bash "$SCRIPT" && rm "$SCRIPT"
Ubuntu Desktop Setup: configures a desktop Ubuntu 22.04 installation for development and productivity use.
View the list of components installed by this script

Extends another script:

  • Includes everything from the Ubuntu Server Setup script

Software:

# Download the script to a temporary file, since it can't simply be piped without a filename
SCRIPT='/tmp/ubuntu-desktop.sh'
wget 'https://scripts.adamrehn.com/setup/ubuntu-desktop.sh' -O "$SCRIPT" && bash "$SCRIPT" && rm "$SCRIPT"
Adam's Daily Driver Setup: everything from the Ubuntu Desktop Setup script, with additional customisations.
View the list of components installed by this script

Extends another script:

  • Includes everything from the Ubuntu Desktop Setup script

Software:

GNOME Shell Extensions:

GTK Themes:

  • Fluent with orange accent colours and minor CSS modifications

System Customisations:

  • Adds Firefox, GNOME Terminal, Visual Studio Code and diagrams.net to the GNOME Shell favourites list
  • Configures custom CSS for Firefox to ensure it looks correct when using the Fluent GTK application theme
  • Configures GNOME notifications to appear at the bottom-right of the screen (via the Just Perfect shell extension)
  • Removes the Ubuntu Software Store and Help shortcuts from the GNOME Shell favourites list
  • Removes “window is ready” notifications and immediately shifts focus to highlighted windows (via the Just Perfect shell extension)
  • Sets the GNOME Shell theme to Yaru Dark, the GTK application theme to Fluent, and the cursor theme to DMZ White
# Download the script to a temporary file, since it can't simply be piped without a filename
SCRIPT='/tmp/ubuntu-desktop-adam.sh'
wget 'https://scripts.adamrehn.com/setup/ubuntu-desktop-adam.sh' -O "$SCRIPT" && bash "$SCRIPT" && rm "$SCRIPT"
Windows Setup: configures a Windows 10 or Windows Server installation for use as a development environment.
# Be sure to run this from a PowerShell prompt with administrative priveleges
Set-ExecutionPolicy Bypass -Scope Process -Force;

# Download the script to a temporary file so that it can be invoked with parameters
(New-Object System.Net.WebClient).DownloadFile('https://scripts.adamrehn.com/setup/windows.ps1', "$env:TEMP\windows.ps1")
cd $env:TEMP; .\windows.ps1 [PARAMETERS]

# Parameter details:
# 
# Accepts one or more positional arguments that specify the loadouts to install, or "all" to install all loadouts.
# Supported loadouts are as follows:
# 
# - base (the default if no loadouts are specified)
# - c++
# - go
# - perforce

Disk image management scripts

These scripts perform common disk image manipulation tasks, with a focus on development and system administration uses.

Windows Insider VHDX Boot: converts a Windows Insider ISO image into a VHDX image and configures a boot entry for Native Boot.
# Be sure to run this from a PowerShell prompt with administrative priveleges

# Download the latest version of `Convert-WindowsImage.psm1` from the Microsoft virtualisation tools repository
Set-ExecutionPolicy Bypass -Scope Process -Force;
iex ((New-Object System.Net.WebClient).DownloadString(`
	'https://raw.githubusercontent.com/MicrosoftDocs/Virtualization-Documentation/' + `
	'master/hyperv-tools/Convert-WindowsImage/Convert-WindowsImage.psm1'`
))

# Replace these values with the appropriate Windows Insider build number and ISO image file path
$previewBuild = '20150'
$insiderISO = "${env:HOMEDRIVE}${env:HOMEPATH}\Desktop\Windows10_InsiderPreview_Client_x64_en-us_${previewBuild}.iso"
$insiderVHDX = $insiderISO.Replace('.iso', '.vhdx')

# Create a VHDX image and populate it with the contents of the Windows Insider ISO image
Convert-WindowsImage `
	-SourcePath  $insiderISO `
	-VHDPath     $insiderVHDX `
	-VhdType     'Fixed' `
	-SizeBytes   80GB `
	-DiskLayout  'UEFI' `
	-Edition     'Windows 10 Pro' `
	-BCDinVHD    'NativeBoot' `
	-RemoteDesktopEnable

# Mount the created VHDX image and retrieve the drive letter of the mounted partition
$mounted = (Mount-VHD -Path $insiderVHDX -PassThru | Get-Disk | Get-Partition | Get-Volume).DriveLetter

# Create a boot entry for the VHDX image (this will automatically be set to the default boot entry)
bcdboot "${mounted}:\Windows"

# Set a human-readable description for the boot entry
bcdedit /set '{default}' DESCRIPTION "Windows Insider Build ${previewBuild}"

# Unmount the VHDX image
Dismount-VHD -Path $insiderVHDX

# Verify that the boot entry was configured correctly
bcdedit /enum