Skip to content

Instantly share code, notes, and snippets.

@ansemjo
ansemjo / encrypted-dvd.md
Last active February 13, 2024 11:25
create an encrypted dvd with squashfs and luks

1. Create compressed squashfs image

Use mksquashfs to create a compressed image from a directory. Depending on how compressible the files are you could put on much more than 4.7 GB on a single disc.

mksquashfs /path/to/my/directory image.sqfs

You can use a different compression algorithm with e.g. -comp zstd or append multiple times to one archive to fill it up to almost the allowable size.

2. Reencrypt the image to wrap it in a LUKS container

@sergey-dryabzhinsky
sergey-dryabzhinsky / sysctl-proxmox-tune.conf
Last active May 19, 2024 21:22
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
#
### NETWORK ###
@huyanhvn
huyanhvn / enable-luks-howto
Created July 25, 2016 18:12
Enable LUKS disk encryption with a key file
# Create strong LUKS key
openssl genrsa -out /root/luks.key 4096
chmod 400 /root/luks.key
# Fill random data to the device
shred -v --iterations=1 /dev/xvdb
# Format device
echo "YES" | cryptsetup luksFormat /dev/xvdb --key-file /root/luks.key
@p3t3r67x0
p3t3r67x0 / openssl_commands.md
Last active May 22, 2024 02:19
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@dcommander
dcommander / gencert.cn
Last active March 11, 2023 03:30
Scripts/config file that I use to create X.509 certificates for TurboVNC testing
set -e
SUBJ="/C=US/ST=Texas/L=Austin/O=The VirtualGL Project/OU=Software Development/"
# Fake Server CA
openssl genrsa -out ca_server.key 2048
openssl req -new -newkey rsa:2048 -nodes -out ca_server.csr -keyout ca_server.key -subj "$SUBJ""CN=VeNCryptFakeServerCA"
openssl x509 -req -days 3650 -startdate -enddate -in ca_server.csr -signkey ca_server.key -out ca_server.crt
rm -f *.csr *.srl
@staaldraad
staaldraad / pyforw.py
Last active February 19, 2024 06:54
Python script to create a Connect-Connect tunnel. For those times ncat/socat can't be put on the box and python is available..
#!/usr/bin/python
"""
Python script to create a Connect-Connect tunnel. For those times ncat/socat can't be put on the box and python is available..
Author: Etienne Stalmans <etienne@sensepost.com>
Version: 1.0 (22_01_2015)
Usage: python pyforw.py <targetIP> <targetPort> <jumpbox> <jumpboxPort>
python pyforw.py 10.1.1.1 3389 179.0.0.100 8081
"""
from socket import *