Skip to content

Instantly share code, notes, and snippets.

@nmcv
nmcv / ie10_get_input_method.js
Created February 11, 2013 23:15
Determine input (interaction) method in IE10. Has to fire an event first.
var Globals = {};
function handleIE10TouchEvent(event)
// Determines which input method is available
// in IE10 - mouse, pen or a touch cap. device
{
switch (event.pointerType)
// Refactor to if-then-else for a faster
// and more compatible solution
{
@nmcv
nmcv / ic.py
Created March 1, 2013 02:27 — forked from enigmaticape/ic.py
Calculates Index of Coincidence
#!/usr/bin/env python
import sys
import collections
# Bag em
cipher_file = open( sys.argv[ 1 ], 'rb')
cipher_text = cipher_file.read()
# remove all non alpha and whitespace and force uppercase
console.logCopy = console.log.bind(console);
console.log = function()
{
if (arguments.length)
{
var timestamp = '[' + Date.now() + '] ';
this.logCopy(timestamp, arguments);
}
};
@nmcv
nmcv / crime.py
Created March 16, 2013 12:01 — forked from koto/crime.py
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/
import string
import zlib
import sys
import random
charset = string.letters + string.digits + "%/+="
@nmcv
nmcv / snitchkiller.sh
Created April 30, 2013 23:15
Little Snitch 3 trial reset
#!/bin/bash
kill -9 `ps auxc | grep "Little Snitch Daemon" | awk '{print $2}'`;
echo "Killed Little Snitch Daemon" > /tmp/snitchkiller.log;
date >> /tmp/snitchkiller.log;

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nmcv
nmcv / frameworks.md
Last active December 17, 2015 07:49 — forked from bkeepers/frameworks.md
#!/bin/bash
#
# This is an easier-to-tweak version of Steffen Honig's i3lock
# script. If it doesn't work, it's his fault ;)
#
TEMP_FILE=/tmp/lock.png
TEMP_FILE_POST=/tmp/lock.modified.png
BAR_BG_COLOR="orange"
BAR_FONT_COLOR="white"
BAR_FONT="Source-Code-Pro-Black"
@nmcv
nmcv / index.html
Created July 27, 2013 19:43 — forked from anonymous/index.html
Sakura
<canvas id="sakura"></canvas>
<div class="btnbg">
</div>
<!-- sakura shader -->
<script id="sakura_point_vsh" type="x-shader/x_vertex">
uniform mat4 uProjection;
uniform mat4 uModelview;
uniform vec3 uResolution;
uniform vec3 uOffset;
@nmcv
nmcv / msec.exploitable.bat
Created August 1, 2013 07:57
Batch script for standalone usage of MSEC extension of WinDBG (!exploitable). Good if you have a bunch of crash reports and you need to analyze them thru in bulk. Original @ http://msecdbg.codeplex.com/discussions/56156
@echo off
setlocal ENABLEEXTENSIONS
@REM get local Path of script
for /F %%I in ("%0") do set localDir=%%~dpI
@REM Check for MSEC.dll in current directory, and in script directory
if not exist .\msec.dll (
if not exist %localDir%\msec.dll (
echo.
echo MSEC.dll not in current directory, please copy MSEC.dll locally and