sudo fdisk -lUbuntu:
sudo dd if=ubuntu-server.iso of=/dev/sda bs=8M conv=fdatasync status=progressFedora:
sudo unxz --keep Fedora-Server-38-1.6.aarch64.raw.xz
sudo dd if=Fedora-Server-38-1.6.aarch64.raw of=/dev/sda bs=8M conv=fdatasync status=progresssudo timedatectl set-timezone America/Denversystemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.targetsudo adduser username
sudo usermod -aG sudo username
sudo vi /etc/hostnamesudo lvdisplay
sudo lvm lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv/etc/netplan/00-installer-config.yaml
network:
ethernets:
eno1:
dhcp4: true
dhcp6: true
optional: true
enp6s0:
dhcp4: true
dhcp6: true
optional: true
version: 2/etc/netplan/50-cloud-init.yaml
wifis:
wlan0:
dhcp4: true
dhcp6: true
optional: true
access-points:
"***":
password: "***"sudo swapon -s
sudo swapoff -a
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabcurl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
tar -xf vscode_cli.tar.gz
./code tunnel service install
sudo loginctl enable-linger $USERsudo apt install vimset number
syntax onsudo add-apt-repository ppa:git-core/ppa
sudo apt install git[user]
email = x@y.z
[alias]
co = checkout
s = status
d = diff
[core]
editor = vimsudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"ZSH_THEME="steeef"sudo vi /etc/passwd
# username:x:1634231:100:Your Name:/home/username:/bin/zshgit clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect' # Save/restore sessions
set -g @plugin 'tmux-plugins/tmux-continuum' # Auto save/restore
# Continuum settings
set -g @continuum-restore 'on' # Auto restore on tmux start
set -g @continuum-save-interval '15' # Save every 15 minutes
# Optional better defaults
set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
# Initialize TPM (must be at the very bottom)
run '~/.tmux/plugins/tpm/tpm'Install plugins: Ctrl+b I
| Command | Shortcut / Command |
|---|---|
| New session | tmux new -s name |
| New session (named) | Ctrl+b :new -s name |
| List sessions | tmux ls or Ctrl+b s |
| Attach to session | tmux attach -t name |
| Detach from session | Ctrl+b d |
| Switch to next session | Ctrl+b ) |
| Switch to previous session | Ctrl+b ( |
| Kill session | tmux kill-session -t name |
| Command | Shortcut |
|---|---|
| New window | Ctrl+b c |
| Next window | Ctrl+b n |
| Previous window | Ctrl+b p |
| Switch to window | Ctrl+b 0-9 |
| Rename window | Ctrl+b , |
| Close window | Ctrl+b & |
| Command | Shortcut |
|---|---|
| Split vertical (left/right) | Ctrl+b % |
| Split horizontal (top/bottom) | Ctrl+b " |
| Switch panes | Ctrl+b + arrow keys |
| Cycle panes | Ctrl+b o |
| Close pane | Ctrl+b x |
| Zoom pane (fullscreen) | Ctrl+b z (toggle) |
| Show pane numbers | Ctrl+b q |
| Command | Shortcut |
|---|---|
| Manual Save | Ctrl+b Ctrl+s |
| Manual Restore | Ctrl+b Ctrl+r |
| Auto restore on start | (enabled via continuum) |
| Command | Shortcut / Command |
|---|---|
| Scroll / Copy mode | Ctrl+b [ → q to exit |
| Reload config | Ctrl+b : → source ~/.tmux.conf |
| Kill all tmux | tmux kill-server |
| Mouse support | set -g mouse on (in config) |
sudo apt install build-essential
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
nvm use --ltsbrew tap homebrew/cask-versions
brew install corretto8 --caskexport M2_HOME=$HOME/maven
export PATH=$M2_HOME/bin:$PATH
export PATH=/opt/homebrew/bin:$PATHCreate service file:
sudo touch /etc/systemd/system/azores.service[Unit]
Description=Azores
After=network.service
[Service]
ExecStart=/home/[username]/azores.sh
[Install]
WantedBy=default.targetCreate script:
touch azores.sh#!/bin/sh
CMD="java -jar /home/[username]/server.jar > /home/[username]/server.log"
#sudo -u [username] screen -dmS [screenname] bash -c "$CMD"
su - [username] -c screen -dmS [screenname] bash -c "$CMD"chmod +x azores.sh
sudo systemctl start azores
sudo systemctl enable azoressudo ssh-keygen -A
sudo apt install openssh-server
sudo systemctl enable ssh
# optional: copy over .ssh folder
eval $(ssh-agent -s)
ssh-addssh-keygen -t ed25519 -C x@y.z
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_ed25519gpg --list-keys
gpg --export --armor <id>
gpg -a --export-secret-key <id>gpg --import
# paste key
# Ctrl+Dgpg --list-secret-keys --keyid-format=long
git config --global user.signingkey <id>
git config --global commit.gpgsign trueexport GPG_TTY=$(tty)~/.gnupg/gpg-agent.conf
default-cache-ttl 86400
max-cache-ttl 86400
gpg --full-generate-keybrew install pinentry-mac
echo "pinentry-program /opt/homebrew/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent && gpg-agent --daemonsudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9 python3.9-dev python3.9-venv
sudo apt install python3.10 python3.10-dev python3.10-venv
sudo apt install python3.11 python3.11-dev python3.11-venv
sudo apt install python3.12 python3.12-dev python3.12-venvFix apt_pkg error on sudo apt update:
sudo apt-get install python3-apt --reinstall
cd /usr/lib/python3/dist-packages
sudo cp apt_pkg.cpython-38-x86_64-linux-gnu.so apt_pkg.sosudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 3
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 4
sudo update-alternatives --config python3sudo apt install python3-pipor
curl -OL https://bootstrap.pypa.io/get-pip.py
python3 get-pip.pyexport PATH=$HOME/.local/bin:$PATHpython3 -m venv venvwget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install cuda-drivers-555
sudo apt-mark hold cuda-drivers-555CUDA Toolkit
sudo apt install cuda-toolkit-12-5cuDNN
sudo apt list -a cudnn
sudo apt install cudnn=9.3.0-1
sudo apt-mark hold cudnnEnvironment Setup
export PATH=/usr/local/cuda-12.5/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}/boot/firmware/config.txt
[pi5]
arm_freq=1000
arm_freq_min=600
gpu_freq=400
over_voltage=-2
arm_boost=0
force_turbo=0lscpusudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
sudo apt update
sudo apt install syncthing
syncthing # creates config fileEdit ~/.local/state/syncthing/config.xml or ~/.config/syncthing/config.xml:
<gui>
<address>0.0.0.0:8384</address>
</gui>sudo systemctl enable syncthing@myuser.service
sudo systemctl start syncthing@myuser.servicesudo launchctl stop com.sdrplay.sdrplay_servicecurl -OL [rsyslog].deb
sudo dpkg -i [rsyslog].deb
mkdir ~/logs
touch ~/logs/[app].log
sudo systemctl start remote_syslog
sudo systemctl enable remote_syslog
sudo vi /etc/log_files.ymlfiles:
- /path/to/your/file.log
destination:
host: logs2.papertrailapp.com
port: 123
protocol: tls
pid_file: /var/run/remote_syslog.pidsudo apt install mysql-server
sudo systemctl status mysql
sudo systemctl enable mysql
sudo mysql_secure_installationmacOS:
brew install mysql@5.7
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
brew link --force mysql@5.7
brew services start mysql@5.7
sudo mysql_secure_installation[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
default-time-zone='+00:00'
wait_timeout=999999999
interactive_timeout=999999999sudo mysql
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> exit
sudo systemctl restart mysqlmysqldump -uroot -p reversi > reversi.sql
mysql -uroot -p reversi < reversi.sqlsudo apt install alsa-utils alsa-oss
sudo usermod --append --groups audio <username>
sudo rebootList devices:
aplay -l
arecord -lStream:
ffmpeg -f alsa -i hw:3 -f alsa hw:2
ffmpeg -f alsa -i hw:3 -af 'asetrate=48000*1.0091,aresample=48000,atempo=1/1.0091' -f alsa hw:2/boot/firmware/config.txt
#dtparam=audio=on
dtoverlay=iqaudio-dacplus
dtoverlay=iqaudio-dacplus,auto_mute_ampsudo apt install alsa-utils systemd-dev
sudo usermod --append --groups audio <username>
sudo apt install --no-install-recommends build-essential git autoconf automake libtool \
libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev \
libplist-dev libsodium-dev libavutil-dev libavcodec-dev libavformat-dev uuid-dev libgcrypt-dev xxdgit clone https://github.com/mikebrady/nqptp.git
cd nqptp
autoreconf -fi
./configure --with-systemd-startup
make
sudo make install
sudo systemctl enable nqptp
sudo systemctl start nqptpgit clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -fi
./configure --sysconfdir=/etc --with-alsa \
--with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
make
sudo make install
sudo systemctl enable shairport-syncgeneral = {
name = "Bedroom";
resync_threshold_in_seconds = 0.150;
};
alsa = {
output_device = "hw:1,0";
};
sudo systemctl start shairport-syncsudo apt install build-essential libncurses5-dev libncursesw5-dev zlib1g-dev gawk git gettext libssl-dev xsltproc wget unzip python
# kmod-r8169: RTL8111
# kmod-usb-net-rtl8152: RTL8152
make info
make image PROFILE=rpi-4 PACKAGES="kmod-r8169 luci luci-ssl"sudo fdisk -l
gunzip openwrt-21.02.0-bcm27xx-bcm2711-rpi-4-ext4-factory.img.gz
sudo dd if=openwrt-21.02.0-bcm27xx-bcm2711-rpi-4-ext4-factory.img of=/dev/sda bs=4K
sudo parted /dev/sda
# (parted) print
# (parted) resizepart 2 30G
# (parted) print
# (parted) quit
sudo resize2fs /dev/sda2ssh root@192.168.1.1
passwdopkg update
opkg install screen
screen -S update
opkg update && opkg list-upgradable | awk '{print $1}' | tr '\n' ' ' | xargs -r opkg upgradeCM4 WiFi fix:
cd /lib/firmware/brcm
cp brcmfmac43455-sdio.raspberrypi,4-model-b.txt brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
rebootconfig globals 'globals'
...
packet_steering '1'
config interface 'wan'
option ifname 'eth0.201' # centurylink
option proto 'pppoe'
option username '***'
option password '***'
option mtu '1492'
option peerdns '0'
option dns '1.1.1.1 1.0.0.1'
config interface 'lan'
option type 'bridge'
option ifname 'eth1'
option proto 'static'
option ipaddr '11.0.0.1'
option netmask '255.255.255.0'
option ip6assign '60'
config wifi-device 'radio0'
option type 'mac80211'
option channel '100'
option hwmode '11a'
option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option legacy_rates '0'
option htmode 'VHT40'
option disabled '0'
option country 'US'
config wifi-iface
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid '***'
option encryption 'sae'
option key '***'
config wifi-device 'radio1'
option type 'mac80211'
option channel '1'
option hwmode '11g'
option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option legacy_rates '0'
option htmode 'HT20'
option short_gi_40 '0'
option disabled '0'
option country 'US'
config wifi-iface
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid '***'
option encryption 'sae'
option key '***'
config defaults
option flow_offloading 1
option flow_offloading_hw 1
config redirect
option name 'forward 8080'
option src 'wan'
option dest 'lan'
option src_dport '8080'
option dest_ip '11.0.0.200'
option dest_port '8080'
option target 'DNAT'
sudo ./rpiboot(usbboot)- Toggle RPiBOOT switch
- Power on
sudo systemctl disable bluetooth.servicesudo bash -c "echo 2 > /sys/module/hid_apple/parameters/fnmode"
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k allsudo nvidia-xconfig --no-use-edid-dpi
# Add under "monitor": Option "DPI" "96 x 96"cd /home/username/Documents; exec zshsudo fsck.ext4 -f /dev/sda1- DNS only root and www CNAMEs
- Wait for GitHub to retrieve TLS cert
- Enforce HTTPS
- Switch records to proxied
- Change SSL/TLS encryption to Full (strict)
ncdu
sudo sh Ventoy2Disk.sh -i /dev/sda
sudo mount /dev/sda /media/usb1sudo add-apt-repository ppa:awesometic/ppa
sudo apt install realtek-r8125-dkms