Self-Hosted Infrastructure
Crypto farming. WIP.
These instructions assume you're on a POSIX-compliant operating system. See Installation.
You'll need the following:
- USB Thumb Drive - 8 GB minimum
- A machine to download the
.isoimage. and burn it to the USB thumb drive. - Target machine with CPU, RAM, and a Network Interface Card
- Could even be a Raspberry Pi
Choose Operating System Kernel & User Space
Download the corresponding .iso file.
Burn ISO Image to USB
lsblkYour output will look something like this.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 1 7.5G 0 disk
├─sda1 8:1 1 2.6G 0 part
├─sda2 8:2 1 5M 0 part
├─sda3 8:3 1 300K 0 part
└─sda4 8:4 1 4.9G 0 part
zram0 254:0 0 4G 0 disk [SWAP]
nvme0n1 259:0 0 3.6T 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 3.6T 0 part /var/log
/var/cache/pacman/pkg
/home
/.snapshots
/
nvme1n1 259:3 0 1.9T 0 diskThe sda storage block is the USB and is highlighted in green above. Modern Linux systems use the sd prefix to indicate 'Storage Device'. a refers to the first detected device.
If you had other external storage devices connected, the letter for your newly connected USB will be different because it was discovered later (sdb, sdc, etc.).
The entries in the tree following sda such as sda1, sda2 etc. indicate disk storage partitions.
Unmount all partitions.
sudo umount /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4# Change location to whereever your .iso file is located
sudo dd if=~/Downloads/ubuntu-24.04.1-live-server-amd64.iso of=/dev/sda bs=4M status=progress oflag=syncAfter completion:
sudo eject /dev/sdaSet up server
Flash OS from USB to Server Hardware
Boot into USB from BIOS.
After installation completes, log in to your machine.
sudo apt update && sudo apt upgrade -y && \
sudo apt install openssh-server net-tools && \
sudo systemctl enable ssh && \
sudo systemctl start ssh && \
sudo systemctl status sshd # Verify service runningConfigure SSH for External Access (WIP)
Same Network
ip addrssh username@<machine_ip_addr>
# ssh user@10.0.1.2Different Networks
Set up port forwarding from router.
Find public IP address
curl ifconfig.meHarden SSH Security:
Disable root login in /etc/ssh/sshd_config.
PermitRootLogin no
Port 2222
sudo systemctl restart sshdInstall Nix
# Answer 'y' for all questions
sh <(curl -L https://nixos.org/nix/install) --daemon --yesexitLog in again.
nix-env -iA nixpkgs.zellijzellijzellij attachOptional
nix-env -iA nixpkgs.{git,gh,stow,zsh,ripgrep,fd,yazi,eza,bat,cowsay,cmatrix,lolcat,nyancat,fastfetch}
}Install Oh My Zsh, a framework to easily customize the look and feel of zsh.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Install PowerLevel10K, a theming system for the Oh My Zsh framework.
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k;Change value of ZSH_THEME in ~/.zshrc:
sed -i 's/^ZSH_THEME=".*"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc; source ~/.zshrcIf the Powerlevel10k configuration menu doesn't start, do:
p10k configureInstall and configure useful zsh plugins.
# Autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingsed -i 's/^plugins=(.*)$/plugins=(git zsh-autosuggestions zsh-syntax-highlighting web-search)/' ~/.zshrccat << 'EOF' >> ~/.zshrc
# Aliases
alias l='eza -lh --icons=auto'
alias ls='eza --icons=auto --sort=name --group-directories-first'
alias ll='eza -lha --icons=auto --sort --group-directories-first'
alias ld='eza -lhD --icons=auto'
alias lt='eza --icons=auto --tree'
alias y='yazi'
alias mkdir='mkdir -p'
EOFsource ~/.zshrcInstall Pnpm
curl -fsSL https://get.pnpm.io/install.sh | sh - && \
if [ -n "$ZSH_VERSION" ]; then source ~/.zshrc; elif [ -n "$BASH_VERSION" ]; then source ~/.bashrc; fipnpm env use 22.13.1 --globalInstall Playwright
pnpx playwright install --with-depsSet up GitHub Actions Runner
Visit github.com/organizations/cuhacking/settings/actions/runners/new for steps.