lxc launch ubuntu:24.04 shahed-va -c limits.memory=2GB -c limits.cpu=2
lxc list -c=n -f=json|jq -r '.[]|select(.name=="shahed-va")|.status'
lxc config show shahed-va
cat <<'EXE'| lxc exec shahed-va -- bash
apt-get update;echo
mkdir -p /etc/apt/keyrings
apt list -a --upgradable;apt-get upgrade -y;echo
apt-get install -y apt-transport-https ca-certificates gnupg jq && apt-get clean
EXE
cat <<'EXE'| lxc exec shahed-va -- bash
free -th && echo && systemd-analyze && echo && df -h
EXE
cat <<'EXE'| lxc exec shahed-va -- bash
cat <<'INI'| sudo tee /etc/systemd/system/warp0.service >/dev/null
[Unit]
Description=Cloudflared WARP Routing Virtual Interface
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ip link add warp0 type dummy
ExecStartPost=/usr/sbin/ip addr add 10.20.40.200/32 dev warp0
ExecStartPost=/usr/sbin/ip link set warp0 up
ExecStop=/usr/sbin/ip link delete warp0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
INI
echo
ls -lah /etc/systemd/system/warp0.service && echo
cat /etc/systemd/system/warp0.service && echo
EXE
cat <<'EXE'| lxc exec shahed-va -- bash
systemctl daemon-reload
systemctl enable --now warp0.service
systemctl status warp0.service
ip a
EXE
cat <<'EXE'| lxc exec shahed-va -- bash
wget -cq https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb -P ${HOME}/Downloads
sudo dpkg -i ${HOME}/Downloads/cloudflared-linux-amd64.deb; sudo apt-get install -f
rm -rf ${HOME}/Downloads/cloudflared-linux-amd64.deb
EXE
cat <<'EXE'| lxc exec shahed-va -- bash
cat <<'CFG'| sudo tee -a /etc/sysctl.conf >/dev/null
###################################################################
# Cloudflared Tunnel Private Network Config
# This config added by Chorke Academia, Inc
# ICMP Group ID Range 0 to 10,000 Users
net.ipv4.ping_group_range = 0 10000
# assumed that following parameters were
# configured in the lxc host machine
# 208 KiB Default RX Buffer
# net.core.rmem_default=212992
# 208 KiB Default TX Buffer
# net.core.wmem_default=212992
# 8 MB Maximum RX Buffer
# net.core.rmem_max=8388608
# 8 MB Maximum TX Buffer
# net.core.wmem_max=8388608
CFG
sudo sysctl -p
EXE
lxc exec shahed-va -- sudo -i -u shahed-biz-argo bash
rm -rf ~/.cloudflared/cert.pem && history
# inspect & delete history
history -d 62-67
history -w
lxc exec shahed-va -- sudo bash
# inspect & delete history
history -d 68-74
history -w