Skip to content

Instantly share code, notes, and snippets.

@jkullick
jkullick / block-tor-exit-nodes-iptables.md
Last active March 29, 2024 08:05
Block Tor Exit Nodes with IPTables
  1. Install ipset:
apt-get install ipset
  1. Create new ipset:
ipset create tor iphash
@jkullick
jkullick / raspberry-pi-chroot-armv7-qemu.md
Last active March 24, 2024 14:36
Chroot into Raspberry Pi ARMv7 Image with Qemu
# install dependecies
apt-get install qemu qemu-user-static binfmt-support

# download raspbian image
wget https://downloads.raspberrypi.org/raspbian_latest

# extract raspbian image
unzip raspbian_latest
@jkullick
jkullick / headless-luks-encrypted-ubuntu-server.md
Last active March 15, 2024 21:08
Headless LUKS encrypted Ubuntu Server on Hetzner
# stop active raid
mdadm --stop /dev/md[01]

# destroy partition table on hdds
dd if=/dev/zero of=/dev/sda bs=1M count=512
dd if=/dev/zero of=/dev/sdb bs=1M count=512

# create new partition table
sgdisk -og /dev/sda
@jkullick
jkullick / secure-mailserver-postfix-dovecot-letsencrypt-debian-jessie.md
Last active March 8, 2024 18:14
Secure Mailserver with Postfix, Dovecot and Let's Encrypt on Debian Jessie

Prerequirements

Config Options

export FQDN="mail.example.org"
export DOMAIN="example.org"
export MAILBOX="user"
export DEBIAN_FRONTEND="noninteractive"
export A_RECORD=$(curl -sSL https://icanhazip.com)
@jkullick
jkullick / curl-github-api-render-markdown.md
Created August 1, 2016 18:30
Render Markdown with cURL & Github API
curl \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{"text": "$TEXT", "mode": "markdown"}' \
  https://api.github.com/markdown
@jkullick
jkullick / run-docker-registry.md
Created August 5, 2016 10:36
Run Docker Registry
docker run --name=registry --restart=always -d -p 5000:5000 registry:2
@jkullick
jkullick / sqlmap-cheat-sheet.md
Last active February 12, 2024 18:00
SQLMap Cheat Sheet
# Enumerate databases
sqlmap --dbms=mysql -u "$URL" --dbs

# Enumerate tables
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" --tables

# Dump table data
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" -T "$TABLE" --dump
@jkullick
jkullick / reset-windows-password-chntpw-linux.md
Last active February 12, 2024 17:55
Reset Windows Password with chntpw on Linux
  1. Install required Packages:
apt-get install chntpw ntfs-3g
  1. Mount Windows Partition:
mount -t ntfs /dev/sda2 /mnt
@jkullick
jkullick / ifconfig-cheat-sheet.md
Created September 16, 2016 12:36
Ifconfig Cheat Sheet
# set static ip address
ifconfig eth0 $IP netmask $NETMASK broadcast $BROADCAST

# change mac address
ifconfig eth0 hw ether $MAC_ADDRESS

# add alias interface
ifconfig eth0:0 $ALIAS_IP
@jkullick
jkullick / build-docker-image-without-dockerfile.md
Created December 22, 2016 08:35
Build Docker Image without Dockerfile
docker build -t $IMAGE_NAME - << EOF
FROM alpine:latest
...
EXPOSE 80
EOF