Skip to content

Instantly share code, notes, and snippets.

ColdHeat /
Created June 6, 2022 02:16
One line simple http server with openbsd netcat
while true; do printf 'HTTP/1.1 200 OK\nContent-Length: 7\nContent-Type: text/html; charset=UTF-8\nServer: netcat!\n\n\nhello\n' | nc -l 80; done
ColdHeat /
Created October 29, 2021 16:48 — forked from nacx/
Compute the inverse list of CIDR blocks
"""Use it like this: main('')"""
IPV4_MIN = 0
def not_network(ipv4_address, ipv4_netmask):
assert IPV4_MIN <= ipv4_address <= IPV4_MAX
assert IPV4_MIN <= ipv4_netmask <= IPV4_MAX
def hostmask_netmask(m):
ColdHeat /
Last active July 24, 2020 19:21
Script to help update CTFd Pages to CommonMark
import re
import subprocess
import tempfile
import cmarkgfm
import mistune
from bs4 import BeautifulSoup
from sqlalchemy import create_engine
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import sessionmaker
ColdHeat /
Last active June 21, 2018 07:43
PSNee pinout on Attiny45

On an Attiny45 you can perhaps expect the following pinout which you can slowly remap back to the MM3 pinout diagrams. This is untested by me.

1 - N/A
2 - N/A
3 - GATE
4 - GND
5 - SQCK
6 - SUBQ
7 - DATA
ColdHeat /
Created June 10, 2017 02:22
Functions to convert IP addresses to decimals and back
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
from struct import unpack, pack, error as struct_error
def ip2long(ip):
'''Converts a user's IP address into an integer/long'''
if '.' in ip:
# ipv4
return unpack('!i', inet_pton(AF_INET, ip))[0]
ColdHeat /
Created October 2, 2015 08:19
(PWN350) autobots challenge from CSAW CTF 2015
import random
import hashlib
import threading
import subprocess
import SocketServer
import os
import signal
from subprocess import Popen, PIPE, STDOUT
import subprocess, shlex
View gist:877137829fe63c720ead
### Keybase proof
I hereby claim:
* I am ColdHeat on github.
* I am kchung ( on keybase.
* I have a public key whose fingerprint is 2317 E0FF BFD0 ED07 26A6 D553 5931 7106 359B FFE8
To claim this, I am signing this object: