This playbook is my laptop's configuration for both private and work, running
Debian or Ubuntu distributions. You should install the base OS with a SSH server
and run the playbook from another host initialy which will create the user.
After the 1st run, you can run the update.sh
script from the user home.
./update.sh
./vagrant-test.sh
ansible localhost -m ansible.builtin.setup
To customize the LUKFS and LVM setup, the disk should be laid out using a live CD before performing the installation. After booting on the live CD:
- Partition the disk for:
- EFI volume (~500MB)
- /boot (~700MB)
- a single partition with the rest to crypt
- Create the LUKS container:
cryptsetup luksFormat /dev/nvmen0p3
(see to change defaults) - Open the container:
cryptsetup luksOpen /dev/nvmen0p3 cryptlvm
- Create a physical volume on top of the opnened LUKFS container:
pvcreate /dev/mapper/cryptlvm
- Create a volume group:
vgcreate vglaptop /dev/mapper/cryptlvm
- Create the logical volumes for
/root
,/home
...:lvcreate -L 70G vglaptop -n root
lvcreate -L 8G vglaptop -n swap
lvcreate -l 100%FREE vglaptop -n home
- Format the filesystems:
mkfs.ext4 /dev/vglaptop/root
mkfs.ext4 /dev/vglaptop/home
mkswap /dev/vglaptop/swap
- Install the system on the corresponding mount points
- Perform those operations to configure the LUKS opening from the live CD:
mount /dev/vglaptop/root /mnt
mount /dev/vglaptop/home /mnt/home
mount /dev/nvmen0p2 /mnt/boot
mount --bind /dev /mnt/dev
mount --bind /run/lvm /mnt/run/lvm
mount /dev/nvmen0p1 /mnt/boot/efi
(EFI partition)chroot /mnt
- From inside the chroot partition:
mount -t proc proc /proc
mount -t sysfs sys /sys
mount -t devpts devpts /dev/pts
- Setup crypttab (grep uuid from
blkid | grep LUKS
):echo "cryptlvm `blkid| grep LUK | awk -F '"' '{printf "UUID=" $2}'`none luks" > /etc/crypttab
- Rebuild boot files:
update-initramfs -c -k all
update-grub
orgrub-mkconfig -o /boot/grub/grub.cfg
In case there's some info on Archlinux - LVM on LUKS.
Warning
Currently holding the network-manager package as the openconnect plugin seems to fail to correctly setup the configuration: sudo apt-mark hold network-manager=1.46.0-2
.
To create the set of keys:
wg genkey | tee vpn-client-private.key | wg pubkey > vpn-client-public.key
To import connection in the NetworkManager:
nmcli connection import type wireguard file <file.conf>
To add the AWS network ranges to go through the VPN, download the latest file at https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html. Insert them in the VPN entry with:
# IPv4
curl --silent https://ip-ranges.amazonaws.com/ip-ranges.json \
| jq -r '.prefixes | .[].ip_prefix' \
| tr '\n' ',' \
| sed 's/,$//' \
| xargs nmcli connection modify <vpn-name> ipv4.routes
# IPv6
curl --silent https://ip-ranges.amazonaws.com/ip-ranges.json \
| jq -r '.ipv6_prefixes | .[].ipv6_prefix' \
| tr '\n' ',' \
| sed 's/,$//' \
| xargs nmcli connection modify <vpn-name> ipv6.routes
The default desktop is i3, but if it seems too raw, there's an alternative easier to use: https://regolith-linux.org/.
To pair with a device:
bluetoothctl
devices
pair A8:5B:78:A0:37:48
<confirm the code>
trust A8:5B:78:A0:37:48
To pair with the MX Ergo, don't open the BT manager but do everything from the command line.
To clear an entry from the ZSH history: sed -i '/myword/d' $HISTFILE
.