Skip to content

Instantly share code, notes, and snippets.

@olegbliaher
olegbliaher / self-signed-ssl-ca-san.md
Created March 16, 2021 09:29
Self-signed CA SSL certificate with SAN
  1. Generate a private key: openssl genrsa -out domain.key 2048
  2. Create a certificate signing request: openssl req -new -sha256 -key domain.key -subj "/C=SE/ST=VG/O=Company, /CN=domain.com" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=DNS:domain.com\n")) -out domain.csr
  3. Generate the certificate with the CA in question: openssl x509 -req -extfile &lt;(printf "subjectAltName=DNS:domain.com") -in my-new-domain.com.csr -CA cacert.pem -CAkey cakey.pem -out my-new-domain.com.crt -CAcreateserial -days 500 -sha256
@olegbliaher
olegbliaher / nmap.md
Created March 16, 2021 09:23
nmap chatsheet

TEST AN ADDRESS

nmap -n -vv --min-rate 5000 -oA website-tcp -p- site.com

nmap -n -vv -Pn --min-rate 5000 -oA website-udp -sU -p- site.com

test a port

nmap -n -vv -Pn -sV -sC -oA version -p22 site.com

nmap -n -v -Pn -sV -sC -oA udp-version -sU -p1234 site.com

@olegbliaher
olegbliaher / zfs-tricks.md
Created March 12, 2021 08:57
zfs tricks with and without encryption

Flag tricks:

zfs get all tank/dataset zpool get all tank

zfs set syncoid:no-sync=true tank/users/attie/scratch

zfs set com.sun:auto-snapshot=false tank1/container/child

zfs set snapdir=visible tank/test

@olegbliaher
olegbliaher / new-ext4-disk.txt
Last active March 12, 2021 09:00
creating and mounting ext4 disk
# This uses /var/lib/docker as an example.
zpool labelclear -f /dev/sdb1 # if device was a zpool earlier on
fdisk /dev/sdb
d
n
w
mkfs.ext4 /dev/sdb1
@olegbliaher
olegbliaher / ffmpeg.txt
Last active March 11, 2021 08:08
ffmpeg video compression
ffmpeg -i file.flv -vcodec libx264 -strict -2 out.mp4