Skip to content

Instantly share code, notes, and snippets.

@krokwen
krokwen / Fedora34Hibernation.md
Created January 6, 2022 18:38 — forked from eloylp/Fedora35Hibernation.md
Fedora 34 hibernation with swapfile, only for hibernation and resume

Fedora34 hibernation

This guide helps to configure the hibernation on a default Fedora34 installation by using a swap file. The Fedora34 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
@krokwen
krokwen / encrypt_openssl.md
Created May 7, 2019 12:58 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

# ubuntu 16.04 used on all nodes
# all your nodes must have static ip in local network
# all your nodes must no have enabled swap partition
# perform this on all nodes:
apt update && apt upgrade -y
apt install -y docker.io
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
#!/bin/bash
if [ -z "$1" ]; then
MB=1024
else
MB="$1"
fi
if [ -z "$2" ]; then
browser="google-chrome-beta"
@krokwen
krokwen / idea-reset-evaluation.sh
Created August 17, 2016 22:46
reset intellij idea 14 evaluation
#!/bin/bash
echo "removeing evaluation key"
rm ~/.IntelliJIdea15/config/eval/idea15.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea15/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml
@krokwen
krokwen / 1-Yubikey_session_lock.md
Created May 25, 2016 07:00 — forked from jhass/1-Yubikey_session_lock.md
Lock (Gnome) session when removing Yubico U2F key

Setup

  1. Copy 99-u2f_lock_screen.rules to /etc/udev/rules.d.
  2. Copy gnome_lock_all_sessions to /usr/local/bin.
  3. Mark gnome_lock_all_sessions as executable: chmod +x /usr/local/bin/gnome_lock_all_sessions
  4. Reload udev: udevadm control -R