Flash LineageOS on Google Pixel 2 XL (taimen)

Prepare
https://wiki.lineageos.org/devices/taimen/install

# Enable debug mode on phone
# Enable OEM unlocking
# Enable USB debugging
 
adb reboot bootloader
fastboot flashing unlock
# confirm with keys
adb reboot bootloader

Boot TWRP
https://dl.twrp.me/taimen/
https://dl.twrp.me/taimen/twrp-3.7.0_9-0-taimen.img

fastboot boot Downloads/twrp-3.7.0_9-0-taimen.img
 
adb shell twrp wipe data
adb shell twrp wipe dalvik

LineageOS image
https://download.lineageos.org/devices/taimen/builds
#https://mirrorbits.lineageos.org/full/taimen/20230615/lineage-20.0-20230615-nightly-taimen-signed.zip
https://mirrorbits.lineageos.org/full/taimen/20230831/lineage-20.0-20230831-nightly-taimen-signed.zip

adb shell twrp sideload zip from host adb
adb sideload Downloads/lineage-20.0-20230615-nightly-taimen-signed.zip

OPTIONAL: Install Gapps
https://wiki.lineageos.org/gapps

https://mde1.androidfilehost.com/dl/O8LqKOYRERDF1DLI5HU5rQ/1686923682/4279422670115734716/MindTheGapps-13.0.0-arm64-20230408_162909.zip
 
adb sideload Downloads/MindTheGapps-13.0.0-arm64-20230408_162909.zip

Upgrade
https://wiki.lineageos.org/devices/taimen/upgrade
http://downloads.codefi.re/d/CNzxbgzaLdfGLGZSIP-cUQ/1685985608/jdcteam/javelinanddart/gapps/MindTheGapps-12.1.0-arm64-20220605_112439.zip

GRML - Linux Live-CD for sysadmins

# install grml2usb
cat < /etc/apt/sources.list.d/chromium.list
deb http://deb.grml.org/ grml-testing main
EOF

# install grml2usb package
apt-get update
apt-get install grml2usb -y --force-yes

# format partition on USB pen (OPTIONAL)
mkfs.vfat /dev/sdb1

# install GRML to USB pen
grml2usb grml-small_2009.10.iso /dev/sdb1

LINKS
http://git.grml.org/?p=grml-live.git;a=blob_plain;f=templates/GRML/grml-cheatcodes.txt;hb=HEAD
http://www.linux-user.de/ausgabe/2006/06/008-grml/index.html

Deploy LXD container with terraform

Docs
https://registry.terraform.io/providers/terraform-lxd/lxd/latest/docs
https://registry.terraform.io/providers/terraform-lxd/lxd/latest/docs/resources/container

Create LXD container

# terraform init
# terraform apply -auto-approve
# terraform destroy -auto-approve
 
 
terraform {
  required_providers {
    lxd = {
      source = "terraform-lxd/lxd"
    }
  }
}
 
provider "lxd" {
  generate_client_certificates = true
  accept_remote_certificate    = true
}
 
resource "lxd_container" "lxd_container_u2004" {
  name  = "u2004"
  image = "ubuntu:20.04"
 
  config = {
    "boot.autostart" = true
  }
 
  limits = {
    cpu = 2
  }
}
 
resource "lxd_container" "lxd_container_u2110" {
  name = "u2110"
  image = "ubuntu:21.10"
  # image = "images:ubuntu-minimal:21.10" # fixme
 
  config = {
    "boot.autostart" = true
  }
 
  limits = {
    cpu = 2
  }
}

Links
https://dev.to/smashse/snap-lxd-terraform-3f0p

Side2Side VPN connection between OpenStack VPN and AVM Fritz!Box

FRITZBOX_WAN_IP=111.1.2.3  # curl ipinfo.io/ip
FRITZBOX_CIDR=192.168.178.0/24
OS_USER=foo
PROJECT_ID=xxxxxxxxxxxxxx
PSK='PASS1234'   # apg -m 32 -a1
 
openstack vpn ike policy create ${OS_USER}-ike-aes256-sha512 \
  --encryption-algorithm aes-256 \
  --auth-algorithm sha512 \
  --pfs group2
 
openstack vpn ipsec policy create ${OS_USER}-ipsec-aes256-sha512 \
  --encryption-algorithm aes-256 \
  --auth-algorithm sha512 \
  --pfs group2
 
# openstack router list
# ROUTER_ID=$(openstack router list -c ID -f value)
openstack vpn service create ${OS_USER}-vpn-service1 \
  --router ${ROUTER_ID} \
  -c external_v4_ip \
  -f value
 
# openstack subnet list
# SUBNET_ID=$(openstack subnet list -c ID -f value --name ${OS_USER}-subnet)
openstack vpn endpoint group create ${OS_USER}-vpn-endpoint-local \
  --type subnet \
  --value ${SUBNET_ID}
 
openstack vpn endpoint group create ${OS_USER}-vpn-endpoint-peer \
  --type cidr \
  --value ${FRITZBOX_CIDR}
 
openstack vpn ipsec site connection create ${OS_USER}-vpn-conn1 \
  --vpnservice ${OS_USER}-vpn-service1 \
  --ikepolicy ${OS_USER}-ike-aes256-sha512 \
  --ipsecpolicy ${OS_USER}-ipsec-aes256-sha512 \
  --peer-address ${FRITZBOX_WAN_IP} \
  --peer-id ${FRITZBOX_WAN_IP} \
  --psk ${PSK} \
  --local-endpoint-group ${OS_USER}-vpn-endpoint-local \
  --peer-endpoint-group ${OS_USER}-vpn-endpoint-peer
 

Cleanup / delete OpenStack objects

PROJECT_ID=f0f745a9c79c47fdbbdd187d728f9e41
 
# Delete VMs
openstack server list --project ${PROJECT_ID}
openstack server delete ${SERVER_ID}
 
openstack volume list --project ${PROJECT_ID}
openstack volume delete ${VOLUME_ID}
 
openstack image list --private --long | grep ${PROJECT_ID}
openstack image delete ${IMAGE_ID}
 
# Delete loadbalancer
openstack loadbalancer list --project ${PROJECT_ID}
openstack loadbalancer delete --cascade ${LOADBALANCER_ID}
 
# Delete secrets
openstack secret list
openstack secret delete ${SECRET_URL}
 
# Delete VPNs
openstack vpn ipsec site connection list --long | grep ${PROJECT_ID}
openstack vpn ipsec site connection delete ${IPSEC_SITE_CONNECTION_ID}
openstack vpn endpoint group list --long | grep ${PROJECT_ID}
openstack vpn endpoint group delete ${VPN_LOCAL_ENDPOINT_GROUP_ID} ${VPN_PEER_ENDPOINT_GROUP_ID}
openstack vpn service list --long | grep ${PROJECT_ID}
openstack vpn service delete ${VPN_SERVICE_ID}
openstack vpn ipsec policy list --long | grep ${PROJECT_ID}
openstack vpn ipsec policy delete ${VPN_IPSEC_POLICY_ID}
openstack vpn ike policy list --long | grep ${PROJECT_ID}
openstack vpn ike policy delete ${VPN_IKE_POLICY_ID}
 
# Delete k8s
openstack coe cluster list 
 
# Delete floating ip
openstack floating ip list --project ${PROJECT_ID}
openstack floating ip delete ${FLOATING_IP}
 
# Delete router

OpenStack Debug VPN connection

Find the VPN server and the relevant router UUID

# get VPN connection ID
openstack vpn ipsec site connection list | grep foo
openstack vpn ipsec site connection list --long | grep <project_id>
 
VPN_CONNECTION_ID=142dc25f-13bb-4fda-b093-edf13df98ed8
openstack vpn ipsec site connection show ${VPN_CONNECTION_ID}
 
VPN_SERVICE_ID=$(openstack vpn ipsec site connection show ${VPN_CONNECTION_ID} -c 'VPN Service' -f value)
openstack vpn service show ${VPN_SERVICE_ID}
 
# get router ID
ROUTER_ID=$(openstack vpn service show ${VPN_SERVICE_ID} -c Router -f value)
echo "ROUTER_ID=${ROUTER_ID}"

Find the ctl Node where the active router is running

ROUTER_PORT_ID=$(openstack port list --device-owner network:router_gateway -f value -c id --router ${ROUTER_ID})
CONTROL_NODE=$(openstack port show ${ROUTER_PORT_ID} -c binding_host_id -f value)
echo "CONTROL_NODE: ${CONTROL_NODE}"
 
echo "ssh ${CONTROL_NODE} sudo ip netns exec qrouter-${ROUTER_ID} ip a s"

Connect to that ctl node and "jump" in its neutron-l3-agent docker container