Skip to content

Instantly share code, notes, and snippets.

@JIeIIIa
JIeIIIa / install-ubuntu-luks-lvm.md
Created February 23, 2025 21:01 — forked from superjamie/install-ubuntu-luks-lvm.md
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy) and 20.04 (focal).

@JIeIIIa
JIeIIIa / Betaflight for ubuntu
Created January 27, 2024 22:23 — forked from wlgrd/Betaflight for ubuntu
How to set up betaflight fc with Ubuntu
1. Create a rule for the DFU
$ (echo '# DFU (Internal bootloader for STM32 MCUs)' echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null
2. Monitor connection and find your model (unplug/plug the fc while this cmd is active)
$ udevadm monitor --environment --udev | grep ID_MODEL_ID
3. Update the /etc/udev/rules.d/45-stdfu-permissions.rules file with your model. E.g, my MODEL_ID is 5740, and the .rules file
ends up like this:
https://dkbalachandar.wordpress.com/2016/07/05/thread-dump-from-a-docker-container/
Thread & Heap dumps From a Docker container
Follow the below steps to take the thread and Heap dumps from a docker container
1. Run the below command to bash into the container. Please change the CONTAINER_NAME appropriately
docker exec -it CONTAINER_NAME bash
  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@JIeIIIa
JIeIIIa / git_statistics.sh
Created January 11, 2020 10:06
Git: Print added, removed and total lines by an author
#!/bin/sh
git log --author="Oleksii Onishchenko" --pretty=tformat: --numstat \
| gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' -
@JIeIIIa
JIeIIIa / txt
Created July 21, 2019 11:58 — forked from telekosmos/txt
Remote Debugging a Java Application Inside a Docker Container
One problem when trying to debug a Java application running inside a Docker container is:
You can't expose an additional port when re(starting) a Docker container.
Here are the steps I used to create a remote debugging session for Planets:
In our scenario we can't simply override the Dockerfile CMD or pass an environment variable JAVA_OPTS to enable remote debugging.
So we have to "enter" the container with exec and add the JAVA_OPTS to the start script there: