linux

Install minikube

Install docker
http://www.panticz.de/docker

Install minikube
https://minikube.sigs.k8s.io/docs/start/

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_$(dpkg --print-architecture).deb
sudo dpkg -i minikube_latest_*.deb
rm minikube_latest_*.deb
 
sudo usermod -aG docker $USER && newgrp docker
 
minikube start
 
minikube addons enable ingress

Install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management

network namespaces netns

preparation

ufw disable

create namespapce

ip netns add red
ip netns add blue

veth

ip link add veth-red type veth peer name veth-blue
ip link set veth-red netns red
ip link set veth-blue netns blue
ip -n red addr add 192.168.15.1 dev veth-red
ip -n blue addr add 192.168.15.2 dev veth-blue
ip -n red link set veth-red up
ip -n blue link set veth-blue up
 
# delete
ip -n  red link del veth-red
 
# show unattached veth
ip -c link show type veth

bride

MultiBootUSB

DEVICE=/dev/sdb
VOLUME=MultiBootUSB
 
# create filesystem on usb pen
sudo mkfs.vfat -n ${VOLUME} ${DEVICE}1
 
# mount usb
mount ${DEVICE}1 /mnt/
 
# install grub2 on usb pen
grub-install --no-floppy --root-directory=/mnt ${DEVICE}
 
# create grub config
cat <<EOF> /mnt/boot/grub/grub.cfg
menuentry "Ubuntu Live 11.04 64bit" {
        loopback loop /boot/iso/ubuntu-11.04-desktop-amd64.iso
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-11.04-desktop-amd64.iso noeject noprompt --
        initrd (loop)/casper/initrd.lz
}
 
menuentry "Ubuntu Live 9.10 32bit" {
 loopback loop /boot/iso/ubuntu-9.10-desktop-i386.iso

LXD: Create X11 container

CONTAINER=x11
 
lxc remote add --protocol simplestreams ubuntu-minimal https://cloud-images.ubuntu.com/minimal/releases/
 
lxc launch ubuntu-minimal:22.04 ${CONTAINER}
 
lxc exec ${CONTAINER} -- sudo --login --user ubuntu
sudo apt update
sudo apt install -y x11-apps mesa-utils
exit
 
lxc config set ${CONTAINER} raw.idmap "both $UID 1000"
 
lxc restart ${CONTAINER}
 
lxc config device add ${CONTAINER} X0 disk path=/tmp/.X11-unix/X0 source=/tmp/.X11-unix/X0
lxc config device add ${CONTAINER} Xauthority disk path=/home/ubuntu/.Xauthority source=${XAUTHORITY}

Links
https://blog.simos.info/running-x11-software-in-lxd-containers/
https://blog.simos.info/how-to-run-teamviewer-in-lxd/
https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/

Install vivaldi

wget -O - http://repo.vivaldi.com/stable/linux_signing_key.pub | sudo apt-key add -
sudo apt-add-repository -y 'deb [arch=amd64] https://repo.vivaldi.com/archive/deb/ stable main'
sudo apt update
sudo apt install -y vivaldi-stable

Create anyconnect VPN connection on command line with nmcli

Create connection

VPN_GATEWAY=vpn1.example.com
VPN_USER=foo
VPN_ROUTES=192.168.11.0/24
 
nmcli connection add \
    connection.id vpn1 \
    connection.type vpn \
    connection.permissions "user:${USER}" \
    ipv4.routes "${VPN_ROUTES}" \
    ipv4.ignore-auto-routes yes \
    vpn.service-type org.freedesktop.NetworkManager.openconnect \
    vpn.data "
        protocol = anyconnect,
        authtype = cert,
        gateway = ${VPN_GATEWAY},
        cacert = ${HOME}/vpn1/ca.pem,
        usercert = ${HOME}/vpn1/certificate.pem,
        userkey = ${HOME}/vpn1/priv.pem,
        cookie-flags = 2
    " \
    vpn.secrets "
        form:main:group_list=CLIENTGROUP,
        form:main:username=${VPN_USER},
        save_passwords=yes
    "

Start connection and enter password once

nmcli connection up vpn1

Debug

#journalctl -fxe NM_CONNECTION=8d5ec3cb-99c5-47ea-84e2-38174cd14702
journalctl -fxe -t NetworkManager
 
cat /etc/NetworkManager/system-connections/vpn1.nmconnection 
nmcli con show vpn1

Links
https://0xsys.blogspot.com/2019/06/configure-vpn-using-nmcli.html