I threw away my hard drive and switched switched to running a Debian-based custom live OS as my daily driver about a year ago. I thought I'd share with my favorite podcast's community the two bash script that enables it all. One script, zero.live, configures the live-build server and the other, zero.run, customizes the environment on boot. I'd be happy to help anyone on here who wants give it a try.
zero.run
zero.live
#Build out the live build tool and edit its configuration.
apt install -y live-build
mkdir liveos && cd liveos
lb config
cp /usr/share/doc/live-build/examples/auto/* auto/
nano auto/config
#Change buster to bullseye and i386 to amd64 if you'd like. This setup builds an around 500mb ISO which handles compatibility with everything. The server version operates on about 54mb of RAM and the Debian 9 Openbox version runs with a full GUI on around 115mb of RAM.
#!/bin/sh
set -e
lb config noauto \
-d buster \
--mode debian \
--architectures i386 \
--linux-flavours 686-pae \
--debian-installer false \
--archive-areas "main contrib non-free" \
--apt-indices false \
--memtest none \
--bootappend-live "quiet hostname=trashos boot=live" \
"${@}"
lb config -d buster --apt-indices false --apt-recommends false --debootstrap-options "--variant=minbase" --firmware-chroot false --memtest none --bootappend-live "quiet boot=live hostname=trashos"
lb clean
echo "live-tools user-setup sudo eject" > config/package-lists/recommends.list.chroot
#Setup the included packages (further down) and setup some arbitrary directory to include anything you'd like.
nano config/package-lists/my.list.chroot
mkdir -p config/includes.chroot/home/user/Backup
cd /root/liveos/config/includes.chroot/home/user/Backup
#Insert your run file and hook it into openbox.
nano run.sh && chmod 755 run.sh && cd ~/liveos/
mkdir -p config/includes.chroot/lib/live/config
nano config/includes.chroot/lib/live/config/2000-custom-run
#!/bin/sh
sed -i '131s/4/1/g' /etc/xdg/openbox/rc.xml
echo "sudo ~/Backup/./run.sh" >> /etc/xdg/openbox/autostart
chmod 755 config/includes.chroot/lib/live/config/2000-custom-run
#Setup the simplest bootloader, remove the default, and add your own splash.png
mkdir -p config/bootloaders/isolinux && cp -Rv /usr/share/live/build/bootloaders/isolinux/* config/bootloaders/isolinux
nano config/bootloaders/isolinux/isolinux.cfg
rm config/bootloaders/isolinux/splash.svg
lb clean
lb build 2>&1 | tee build.log
echo "Finished..."
ls -lth
mv -v live-image-i386.hybrid.iso TrashOS.iso
#Create the above script, run it with screen and watch it with htop. Pull it off of AWS with sftp, and burn it to a usb drive.
nano build.sh && chmod 755 build.sh
screen -dmS iso ./build.sh && c && htop -C
sftp -i /home/user/Backup/VPNkey.pem admin@[BUILD SERVER IP]:/home/admin/liveos/TrashOS.iso
clear && dd if=TrashOS.iso of=/dev/[sdX] bs=1M status=progress && sync && echo 'Finished...'
#You can look for other packages with apt-cache search and mix and match however you like.
chromium
xorg
openbox
xfce4-terminal
mousepad
pcmanfm
net-tools
network-manager
network-manager-gnome
pciutils
wireshark
wget
nano
tcpdump
conky
feh
tcpdump
screen
htop
iotop
nmap
ncat
whois
openvpn
ssh
ufw
wipe
gnome-screenshot
curl
easy-rsa
bro-aux
git
lsof
dnsutils
software-properties-common
apt-transport-https
httptunnel
unzip
unrar
p7zip-full
vlc
usbutils
vokoscreen
lynx
pavucontrol
pulseaudio
gparted
zero.run
#!/bin/bash
cp -fv /home/user/Backup/background.png /etc/xdg/openbox/
cp -fv /home/user/Backup/conky.conf /etc/conky/
ln -sf /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
sed -i 's/Clearlooks/Onyx/g' /etc/xdg/openbox/rc.xml
sed -i '86s/9/14/g' /etc/xdg/openbox/rc.xml
sed -i '95s/9/14/g' /etc/xdg/openbox/rc.xml
sed -i '23s/6d95de/0000ff/g' /usr/share/themes/Onyx/openbox-3/themerc
sed -i '24s/2b829d/0000ff/g' /usr/share/themes/Onyx/openbox-3/themerc
sed -i '25s/f8f8f8/ffffff/g' /usr/share/themes/Onyx/openbox-3/themerc
sed -i '42s/mediumblue/blue/g' /etc/conky/conky.conf
rm -f /etc/motd
cat > /etc/motd << EOF
TrashOS
EOF
xsetroot -solid black
xset s off -dpms
setxkbmap -option caps:none
xhost +si:localuser:root
feh --bg-center /etc/xdg/openbox/background.png
conky -b &
cat >> /root/.bashrc << "EOA"
source /home/user/.bashrc
EOA
cat >> /home/user/.bashrc << "EOA"
# ~/.bashrc: executed by bash(1) for non-login shells.
[ -z "$PS1" ] && return
HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
shopt -s histappend
shopt -s checkwinsize
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
red='\[\e[0;31m\]'
RED='\[\e[1;31m\]'
blue='\[\e[0;34m\]'
BLUE='\[\e[1;34m\]'
cyan='\[\e[0;36m\]'
CYAN='\[\e[1;36m\]'
green='\[\e[0;32m\]'
GREEN='\[\e[1;32m\]'
yellow='\[\e[0;33m\]'
YELLOW='\[\e[1;33m\]'
PURPLE='\[\e[1;35m\]'
purple='\[\e[0;35m\]'
nc='\[\e[0m\]'
if [ "$UID" = 0 ]; then
PS1="$nc\u$nc@$nc\H$nc:$nc\w$nc\\n$nc#$nc "
else
PS1="$blue\u$nc@$nc\H$nc:$blue\w$nc\\n$blue\$$nc "
fi
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
fi
alias aliases='sudo nano /home/user/.bashrc && source /home/user/.bashrc'
alias c='clear'
alias x='exit'
alias pubip='wget -qO- checkip.dyn.com | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"'
alias menu='sudo nano /etc/xdg/openbox/menu.xml && openbox --reconfigure'
alias pmon='watch -d -n4 sudo lsof -i -o'
alias dmon='sudo iotop -a'
alias fmon='watch -d -n4 "ls -lth /tmp"'
alias crypt='test -f /usr/bin/veracrypt && /usr/bin/veracrypt || ~/Backup/./veracrypt-x86'
alias nyt='wget https://www.nytimes.com -O i.htm && lynx i.htm && sudo rm -f i.htm'
alias sound='pulseaudio --start && sleep 2s && pavucontrol'
alias pdf='chromium --headless --disable-gpu --print-to-pdf=/home/user/Downloads/grc.pdf https://www.grc.com/securitynow.htm && chromium file:///home/user/Downloads/grc.pdf'
EOA
mv -v /etc/xdg/openbox/menu.xml /etc/xdg/openbox/menu.xml.bak
cat > /etc/xdg/openbox/menu.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="root-menu" label="Openbox 3">
<separator label="TrashOS" />
<item label="Terminal">
<action name="Execute">
<command>xfce4-terminal --geometry=99x40 --hide-scrollbar --hide-menubar --title=t0s</command>
</action>
</item>
<item label="Chromium">
<action name="Execute">
<command>chromium</command>
</action>
</item>
<item label="Files">
<action name="Execute">
<command>pcmanfm</command>
</action>
</item>
<item label="Text">
<action name="Execute">
<command>mousepad</command>
</action>
</item>
<menu id="menu" label="Tools">
<item label="Networks">
<action name="Execute">
<command>nm-connection-editor</command>
</action>
</item>
<item label="ScreenSh">
<action name="Execute">
<command>gnome-screenshot -i</command>
</action>
</item>
<item label="ScreenRc">
<action name="Execute">
<command>vokoscreen</command>
</action>
</item>
<item label="Wireshark">
<action name="Execute">
<command>sudo wireshark</command>
</action>
</item>
</menu>
<item label="Shutdown">
<action name="Execute">
<command>sudo shutdown -P --no-wall now</command>
</action>
</item>
</menu>
</openbox_menu>
EOF
sed -i '317s/scrot/gnome-screenshot \-i/g' /etc/xdg/openbox/rc.xml
sed -i '319i\
<keybind key="W-t">\
<action name="Execute"><command>xfce4-terminal --geometry=99x40 --hide-scrollbar --hide-menubar --title=TrashOS</command></action>\
</keybind>\
<keybind key="W-f">\
<action name="Execute"><command>pcmanfm</command></action>\
</keybind>\
<keybind key="W-w">\
<action name="Execute"><command>mousepad</command></action>\
</keybind>\
<keybind key="W-s">\
<action name="Execute"><command>gnome-screenshot -i</command></action>\
</keybind>\
<keybind key="W-r">\
<action name="Execute"><command>vokoscreen</command></action>\
</keybind>\
' /etc/xdg/openbox/rc.xml
openbox --reconfigure
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "Port 44444" >> /etc/ssh/sshd_config
sed -i '56s/no/yes/g' /etc/ssh/sshd_config
systemctl stop ssh
killall pulseaudio
ufw enable
ufw logging medium
exit 0