Skip to content

Instantly share code, notes, and snippets.

@nmcv
nmcv / latency.txt
Created November 8, 2015 13:48 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@nmcv
nmcv / install_phpsh.sh
Created October 17, 2015 10:39 — forked from eric1234/install_phpsh.sh
Install phpsh on Ubuntu
# https://gist.github.com/eric1234/7324795
# Make sure git is installed
apt-get install -y git
# Remove functions that phpsh needs from config.
sed -i 's/pcntl_signal,//g' /etc/php5/cli/php.ini
sed -i 's/pcntl_fork,//g' /etc/php5/cli/php.ini
sed -i 's/pcntl_wait,//g' /etc/php5/cli/php.ini
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
##
## WPS on OpenWRT
## This script enables Wi-Fi Protected Setup on OpenWRT.
##
## Resources
## http://wiki.openwrt.org/doc/uci/wireless#wps.options
##
#Install the full wpad package
opkg update
#!/usr/bin/env python
# http://www.vnsecurity.net/t/length-extension-attack/
# sha1 padding/length extension attack
# by [email protected]
#
import sys
import base64
from shaext import shaext
@nmcv
nmcv / ssltest.py
Created April 10, 2014 14:22 — forked from ixs/ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
#
# Modified slightly by Andreas Thienemann <[email protected]> for clearer exploit code
# and 64k reads
#
# This version of the exploit does write received data to a file called "dump" in the local directory
# for analysis.
@nmcv
nmcv / ssltest.py
Created April 10, 2014 12:31 — forked from ixs/ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
#
# Modified slightly by Andreas Thienemann <[email protected]> for clearer exploit code
# and 64k reads
#
# This version of the exploit does write received data to a file called "dump" in the local directory
# for analysis.

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English

A Trello Board

[![Trello Development Board](https://trello.com/b/nC8QJJoZ.png)](https://trello.com/b/nC8QJJoZ)

Trello Development Board

A Trello Card