Skip to content

Instantly share code, notes, and snippets.

View virtadpt's full-sized avatar
💭
First thing that Microsoft does when buying Github: Add statuses. Whee.

The Doctor virtadpt

💭
First thing that Microsoft does when buying Github: Add statuses. Whee.
View GitHub Profile
@virtadpt
virtadpt / browser.py
Last active August 29, 2015 14:06 — forked from tdfischer/browser.py
#!/usr/bin/env python
from PyQt4 import QtCore, QtWebKit, QtGui, QtDeclarative
import sys
import random
app = QtGui.QApplication(sys.argv)
view = QtDeclarative.QDeclarativeView(QtCore.QUrl("browser.qml"))
view.show()
@virtadpt
virtadpt / README.md
Created February 16, 2012 17:10 — forked from thedod/README.md
Demagnetizr - Tweetable magnet urls
@virtadpt
virtadpt / gist:3230577
Created August 1, 2012 20:47 — forked from loki42/gist:2349796
multilingual python web app with babel
# get all langs from db
all_available_languages = [a['lang'] for a in cur.fetchall()]
def get_lang(lang):
default = 'en'
mo_dir = os.path.join(os.path.abspath(os.curdir), 'locale')
domain = 'musicfilmcomedy'
langs = [lang.replace('-', '_')]
langs.append(default)
@virtadpt
virtadpt / rhi-mesh-01.md
Created November 13, 2012 23:27 — forked from boxysean/rhi-mesh-01.md
Red Hook Initiative mesh update: first edition

This is the first of periodic updates I'll make as I gather information.

About

Internet connectivity is largely out in Red Hook. (Open question: How out?) A collection of initiatives are working together to rapidly build infrastructure to provide free, reliable Internet connectivity to Red Hook.

The goal of this project is twofold: to provide Internet connectivity in the short-term for the disaster relief effort, and to create an infrastructure for future disaster responses.

Groups involved:

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@virtadpt
virtadpt / utm.sed
Created December 25, 2016 23:43 — forked from thequux/utm.sed
#!/bin/sed -rf
# How to run:
# echo 'A A<1+B1-C>B<1-A1+B>D<1-B1qC> 0<0>0'
# Note: Your local sed may use a different flag for "extended" regexes; this is written for GNU sed.
#
# tape: [active-state] " " (state-name "<" (write move next-state)_0 (write move next-state)_1 ">")* " " tape... "<" curpos ">" tape...
# State names can be any character not in " <>".
# The tape consists of 0's and 1's.
# The "move" field can be "-" to move left, "+" to move right, or "q" to halt.
import hanzo.warctools.record as r
from http.client import HTTPResponse
from io import BytesIO
from bs4 import BeautifulSoup
from urllib.parse import urlparse
from collections import defaultdict
class FakeSocket():
def __init__(self, response_str):
#!/usr/bin/env sh
if [ "$1" != "" ]; then
sBatchList=""
sBatchMessage="$3"
while IFS=, read col1 col2
do
sBatchList="$sBatchList $col1"
@virtadpt
virtadpt / breachcompilation.txt
Created December 20, 2017 23:05
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
@virtadpt
virtadpt / spectre.c
Created January 4, 2018 22:21 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif