Skip to content

Instantly share code, notes, and snippets.

@DartPower
DartPower / MSVS2010ExpressKeys.txt
Last active July 11, 2025 07:43
Microsoft Visual Studio 2010 Express Activation CD Keys
VC# 2010 Express: PQT8W-68YB2-MPY6C-9JV9X-42WJV
VC++ 2010 Express: 6VPJ7-H3CXH-HBTPT-X4T74-3YVY7
VWD 2010 Express: CY8XP-83P66-WCF9D-G3P42-K2VG3
VB.NET 2010 Express: 2KQT8-HV27P-GTTV9-2WBVV-M7X96
@SeanPesce
SeanPesce / https_server.py
Last active July 24, 2025 17:11
Simple Python 3 HTTPS Server (SSL/TLS)
#!/usr/bin/env python3
# Author: Sean Pesce
# References:
# https://stackoverflow.com/questions/19705785/python-3-simple-https-server
# https://docs.python.org/3/library/ssl.html
# https://docs.python.org/3/library/http.server.html
# Shell command to create a self-signed TLS certificate and private key:
# openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out cert.crt -keyout private.key
@mdonkers
mdonkers / server.py
Last active August 9, 2025 14:56
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@simonw
simonw / recover_source_code.md
Last active September 28, 2024 08:10
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@htp
htp / curl-websocket.sh
Last active May 28, 2025 02:24
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@lqd
lqd / gist:1c841dea193698bf50fefa19c6b3fb99
Last active December 10, 2023 19:17
Some of my favorite development streams and shows
Why coding streams/shows are interesting to me: in some livestreams, the experience is very similar to pair programming,
but those people are experts. In VODs, it's more about problem solving and learning skills and approaches. The devs are really good
at what they do and there is *always* a lot to learn.
In no particular order:
1) Handmade Hero
About the author: Casey Muratori. Worked at RAD.
Description and why I like it: It kinda started the whole thing for me. Casey is coding a complete game and engine on stream,
from scratch, one hour a day. He knows what he's doing on so many of the domains of game development and regular programing,
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 31, 2025 14:21
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@jonvaldes
jonvaldes / deinterleave.c
Last active March 13, 2023 17:42
In-place sequence de-interleaving
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
// In response to watching Casey Muratori think about in-place de-interleaving of audio samples
// in Handmade Hero ep 138, here's a solution for sequences with power-of-two length.
//
// Algorithm swaps the 2 internal elements in blocks of 4 elems, then grows block size to 8, 16, etc
// For example, for a sequence of length 8:
// a,1,b,2,c,3,d,4 --> a,b,1,2,c,d,3,4 --> a,b,c,d,1,2,3,4
@AlexsJones
AlexsJones / gist:0a574d32a0541a384f81
Last active February 16, 2024 10:02
CMake Unity build example
cmake_minimum_required(VERSION 2.8)
set(CMAKE_INSTALL_PREFIX /usr)
project(UNITY_BUILD_NAME)
function(enable_unity_build UB_SUFFIX SOURCE_VARIABLE_NAME)
set(files ${${SOURCE_VARIABLE_NAME}})
# Generate a unique filename for the unity build translation unit
set(unit_build_file ${CMAKE_CURRENT_BINARY_DIR}/ub_${UB_SUFFIX}.cpp)
# Exclude all translation units from compilation
set_source_files_properties(${files} PROPERTIES HEADER_FILE_ONLY true)
@ipedrazas
ipedrazas / gist:2c93f6e74737d1f8a791
Created September 18, 2014 22:13
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}