Skip to content

Instantly share code, notes, and snippets.

@willurd
willurd / web-servers.md
Last active November 13, 2024 13:44
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@tauzen
tauzen / hexstring.js
Last active September 9, 2024 18:13
Hex string to byte and other way round conversion functions.
function byteToHexString(uint8arr) {
if (!uint8arr) {
return '';
}
var hexStr = '';
for (var i = 0; i < uint8arr.length; i++) {
var hex = (uint8arr[i] & 0xff).toString(16);
hex = (hex.length === 1) ? '0' + hex : hex;
hexStr += hex;
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active November 7, 2024 05:22
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal