Skip to content

Instantly share code, notes, and snippets.

@apolloclark
apolloclark / Buffer Overflow Tutorial in Kali.md
Last active Oct 14, 2021
Buffer overflow demonstration in Kali Linux, based on the Computerphile video
View Buffer Overflow Tutorial in Kali.md
@criccomini
criccomini / gist:3805436
Created Sep 29, 2012
Schedules & Scores API for Streaming Live Sports Stats - MSNBC
View gist:3805436
import pytz
import datetime
import time
import urllib2
import json
import os
import elementtree.ElementTree as ET
# e.g. http://scores.nbcsports.msnbc.com/ticker/data/gamesMSNBC.js.asp?jsonp=true&sport=MLB&period=20120929
url = 'http://scores.nbcsports.msnbc.com/ticker/data/gamesMSNBC.js.asp?jsonp=true&sport=%s&period=%d'
@ndarville
ndarville / secret-key-gen.py
Created Aug 24, 2012
Generating a properly secure SECRET_KEY in Django
View secret-key-gen.py
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`
View Mount NFS in OpenVZ VM
# vim /etc/sysctl.conf
sunrpc.ve_allow_rpc = 1
fs.nfs.ve_allow_nfs = 1
kernel.ve_allow_kthreads = 1
# sysctl -p
# vzctl stop 101
# vzctl set 101 --features "nfs:on" --save
@ryanb
ryanb / github_tree_slider.js
Created Dec 6, 2010
This is how GitHub's new AJAX file browser works.
View github_tree_slider.js
GitHub.TreeSlider = function () {
if (window.history && window.history.pushState) {
function a() {
if (e.sliding) {
e.sliding = false;
$(".frame-right").hide();
$(".frame-loading:visible").removeClass("frame-loading")
}
}
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {