Skip to content

Instantly share code, notes, and snippets.

View wtdcode's full-sized avatar
😇

lazymio wtdcode

😇
View GitHub Profile
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.pem with the following command:
# openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import http.server
@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@you0708
you0708 / ida_bochs_mac.md
Created February 20, 2018 14:38
Bochs Debugging on IDA for macOS

IDA Debugging with Bochs on macOS

This file describes how to debug with Bochs IDB mode on IDA for macOS.

Environment

IDA 7.0 macOS version + Bochs 2.6.9

Install

  1. Install IDA
  2. Download Bochs source code "bochs-2.6.9.tar.gz" from https://sourceforge.net/projects/bochs/files/bochs/2.6.9/
  3. Install Bochs 2.6.9 as below -- You can't use brew to install Bochs due to compile options
@KeithYeh
KeithYeh / Self-Signed SSL with SAN.md
Created October 14, 2017 13:12
Create self-signed SSL certificate with SubjectAltName(SAN)

How to create a self-signed SSL Certificate with SubjectAltName(SAN)

After Chrome 58, self-signed certificate without SAN is not valid anymore.

Step 1: Generate a Private Key

openssl genrsa -des3 -out example.com.key 2048

Step 2: Generate a CSR (Certificate Signing Request)

@fire1ce
fire1ce / oh-my-zsh on openwrt or lede-project.md
Last active April 9, 2025 05:24
Install oh-my-zsh on openwrt/lede-project

Install oh-my-zsh on OpenWrt

Install Requirements Packages

opkg update && opkg install ca-certificates zsh curl git-http

Install oh-my-zsh

@mfukar
mfukar / z3-salsa10.py
Last active September 3, 2020 08:07
Recover the key used by Petya to encrypt the MFT
# Recover the key used by the Petya ransomware to encrypt the MFT (master file table)
import z3
import sys, struct
# XOR key for salsa10-src.bin :
KEY_SECTOR = 0x37
# Counter position, as two words
CNTLO = 0
CNTHI = 0

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@denji
denji / golang-tls.md
Last active April 26, 2025 07:32 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active April 27, 2025 06:56
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@shamil
shamil / mount_qcow2.md
Last active April 24, 2025 04:34
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8