Skip to content

Instantly share code, notes, and snippets.

@dosssman
dosssman / full-disk-encryption-arch-uefi.md
Created October 16, 2022 22:22 — forked from huntrar/full-disk-encryption-arch-uefi.md
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@dosssman
dosssman / CritBatHib.md
Last active August 16, 2019 13:41
Automate the hibernation process with i3

Hibernate when battery is critical level using systemd-timers

The following script will check if the battery is in critical state, and launch the lock and hibernate sequence correspondingly.

Put the file in /home/$USER/.bin/hibernate_critical_bat.sh

Here the critical level is set to 8, in if [ "$status" = Discharging -a "$capacity" -lt 8 ]; then

#!/bin/sh
@dosssman
dosssman / tmuxautoconf.sh
Last active October 5, 2019 04:31
Tmux Fast Config
#!/bin/bash
# Although it is put to the end, the lines coming before assume TPM is installed or
# at least is to be
TMUXCONFFILE="$HOME""/.tmux.conf"
if [ ! -z $1 ]; then
echo "Custom tmux config file provided"
TMUXCONFFILE="$1"
fi
@dosssman
dosssman / MongoDBReminders.md
Created February 18, 2019 14:20
MongoDB Basic Console Command

Show Databases

show dbs

Show Collections

show collections

Create Collection

use <database_name>; db.createCollection("<collection_name>");

@dosssman
dosssman / baselines-torcs-env-auto.sh
Created February 4, 2019 15:49
Auto create baselines-envs to run Baselines algorithms on Torcs
# !!! run "source baselines-torcs-env-auto.sh"
# Create env (if not exists ?)
if [ -z $(conda info --envs | grep "baselines-torcs") ]; then
echo "Conda env not detected. Proceeding to creation:"
# Create envs with necessary packages
conda create -n "baselines-torcs" python=3.6 -y
conda activate "baselines-torcs"
conda install --yes tensorflow-gpu=1.8 gcc_linux-64 gxx_linux-64
conda install -c conda-forge --yes tqdm
conda install -y mpi4py
@dosssman
dosssman / auto-gym-torcs-install.bash
Last active February 4, 2019 15:18
Install gym torcs depencies Centos 7.2
# System dependencies
# !!! To be run as root
# Centos limited
yum install -y mesa-libGL{,-devel} freealut{,-devel} libvorbis{,-devel} cmake3 libXrender{,-devel} libXrandr{,-devel} zlib{,-devel} libpng{,-devel}$
# Build the Torcs
# Clone it
git clone https://github.com/dosssman/gym_torqs.git
cd gym_torqs
@dosssman
dosssman / basrc.bash
Created February 4, 2019 14:02
.bashrc Common tricks
# General
# Enable bash actualisation inside terminal session
alias reload-bash="source ~/.bashrc"
# Add path to PATH variable without inducing redundancy through reload-bashrc
for x in /path/1 /path/2 /path/soon; do
case ":$PATH:" in
*":$x:"*) :;; # already there
*) PATH="$x:$PATH";;
esac
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->