Skip to content

Instantly share code, notes, and snippets.

@mtigas
mtigas / gist:952344
Last active October 16, 2024 09:03
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@johnboxall
johnboxall / dns.py
Created August 15, 2011 21:57
Twisted DNS server!
# http://notmysock.org/blog/hacks/a-twisted-dns-story.html
# http://blog.inneoin.org/2009/11/i-used-twisted-to-create-dns-server.html
# twistd -y dns.py
import socket
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import reactor
from twisted.names import dns
from twisted.names import client, server
@kespindler
kespindler / gist:1933962
Created February 28, 2012 17:52
Python Null object, behaves like nil in Objective-C
## {{{ http://code.activestate.com/recipes/68205/ (r1)
#!/user/bin/env python
"""null.py
This is a sample implementation of the 'Null Object' design pattern.
Roughly, the goal with Null objects is to provide an 'intelligent'
replacement for the often used primitive data type None in Python or
Null (or Null pointers) in other languages. These are used for many
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@aaronwolen
aaronwolen / slides.md
Last active November 11, 2022 23:57
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@babyking
babyking / autohotkey.ahk
Last active December 18, 2019 03:01
自己使用的Autohotkey 脚本 绝大多数的习惯与我的MAC上定义快捷键是一致的. mac上实现此脚本中快捷键主要是通过 keyremap4macbook来实现的.大部分定义受vi以及unix的一些快捷键影响,另外,刚刚买了一个hhkb键盘,部分定义也受其启发.
/*
* email: [email protected]
* update: 2013/3/9
*/
;常用快捷命令
:://cmd:: ;打开命令行
Run cmd
return
@ChiaraHsieh
ChiaraHsieh / Sublime Text 2 Markdown Theme Editing.md
Last active December 22, 2015 21:39
Sublime Text 2 markdown syntax highlighting. Add tinkering code segment to your current .tmTheme. Edit the font colors in .tmTheme according to the sector names indicated in the "Markdown Theme Editing.md" gist. (Default color scheme: Green, designed for Phoenix Dark Green - Eighties.tmTheme)

Markup: Heading

Header


The line above is Markdown separator

  • This
  • Is
@takeshixx
takeshixx / hb-test.py
Last active November 6, 2024 06:58
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <[email protected]>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@MoyTW
MoyTW / xhrio_examples.cljs
Last active July 16, 2016 15:14
Some basic examples of how to use XhrIo. Server is at: https://github.com/MoyTW/BlogSnippets/tree/master/XhrIoExamples
(ns xhrio-examples.examples
(:require [goog.net.XhrIo :as xhrio]
[goog.structs :as structs]
[goog.Uri.QueryData :as query]))
(def get-text-url "http://localhost:3000/get-text")
(def get-json-url "http://localhost:3000/get-json")
(def post-url "http://localhost:3000")
(def post-form-url "http://localhost:3000/post-form")
(def post-json-url "http://localhost:3000/post-json")