Idempotent bootstrap script for an Ubuntu 24.04 LTS development VM
optimised for Claude Code agent sessions.
Run it once to install everything. Run it again to update. Safe, transparent, and documented at every step.
Idempotent bootstrap script for an Ubuntu 24.04 LTS development VM
optimised for Claude Code agent sessions.
Run it once to install everything. Run it again to update. Safe, transparent, and documented at every step.
| # Beware! This file is rewritten by htop when settings are changed in the interface. | |
| # The parser is also very primitive, and not human-friendly. | |
| # requires libsensors | |
| htop_version=3.2.2 | |
| config_reader_min_version=3 | |
| fields=0 48 17 18 38 39 40 2 46 47 49 1 | |
| hide_kernel_threads=1 | |
| hide_userland_threads=0 | |
| hide_running_in_container=1 | |
| shadow_other_users=0 |
| Server | Total time (s) | Transactions (total) | TPS | Queries (total) | QPS | Read (total) | Write (total) | Other (total) | Latency avg (ms) | Latency 95th percentile (ms) |
|---|---|---|---|---|---|---|---|---|---|---|
| Server AX102 (btrfs: compression=zstd:3) | 60.00 | 147,450 | 2,457.32 | 2,949,000 | 49,146.33 | 2,064,300 | 589,800 | 294,900 | 3.25 | 4.91 |
| Cloud Server CAX31 | 60.01 | 100,983 | 1,682.83 | 2,023,574 | 33,721.77 | 1,417,164 | 404,201 | 202,209 | 4.75 | 7.98 |
Notes:
| // unattended_upgrades_setup.go | |
| package main | |
| import ( | |
| "bufio" | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "log" |
| #!/bin/bash | |
| # setup_unattended_upgrades.sh | |
| # This script configures Debian's Unattended Upgrades to: | |
| # 1. Automatically update all packages. | |
| # 2. Automatically restart services after upgrades. | |
| # 3. Automatically respond "no" to configuration file replacement prompts. | |
| # 4. Limit system reboots to once every two weeks if strictly required. | |
| set -e # Exit immediately if a command exits with a non-zero status. |
| d-i debian-installer/locale string en_US.UTF-8 | |
| d-i debian-installer/language string en | |
| d-i debian-installer/country string ES | |
| d-i keyboard-configuration/xkb-keymap select us | |
| d-i netcfg/choose_interface select auto | |
| d-i hw-detect/load_firmware boolean true | |
| d-i mirror/protocol string http |
If you can connect using psql, then you can use this command:
postgres=# SHOW data_directory;
data_directory
-----------------------
/opt/postgres/data/
| directory | description |
| BEGIN TRANSACTION; | |
| ALTER SCHEMA public RENAME TO public_original; | |
| ALTER SCHEMA my_db RENAME TO public; | |
| DROP SCHEMA public_original CASCADE; | |
| COMMIT; |
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| ) | |
| func helloWorld(w http.ResponseWriter, r *http.Request) { | |
| // this is what you want | |
| if r.URL.Path != "/" { |