This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Xlib.display import Display | |
from Xlib import X | |
from Xlib.ext import record | |
from Xlib.protocol import rq | |
import time | |
disp = None | |
keysym_map = { | |
32: "SPACE", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, sys; json.dump(json.load(open(sys.argv[1])), open(sys.argv[1], "w"), indent=4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
try: | |
raw_input("Symptoms: ") | |
except NameError: | |
input("Symptoms: ") | |
print("Diagnosis: {0}".format(random.choice(["Pregnant", "Cancer"]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt | |
sudo wget https://www.factorio.com/get-download/0.12.35/headless/linux64 | |
sudo tar xzf linux64 | |
sudo groupadd factorio | |
sudo useradd -g factorio factorio | |
sudo passwd factorio | |
sudo chown -R factorio:factorio factorio/ | |
sudo mkdir factorio_data | |
sudo git clone https://github.com/Bisa/factorio-init.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOME ?= $HOME | |
CWD = $(shell pwd) | |
VENVS ?= $(HOME)/.virtualenvs | |
PYTHON2 = $(VENVS)/builder2.7/bin/python2.7 | |
PYTHON3 = $(VENVS)/builder3.5/bin/python3.5 | |
PYTHONS = $(VENVS)/builder2.6/bin/python2.6 $(VENVS)/builder2.7/bin/python2.7 $(VENVS)/builder3.5/bin/python3.5 $(VENVS)/builder3.3/bin/python3.3 $(VENVS)/builder3.4/bin/python3.4 | |
PYPY = $(VENVS)/builderpypy/bin/python | |
.PHONY: all test clean help register build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import os | |
import logging | |
from OpenSSL import crypto | |
log = logging.getLogger("x509_cert") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In .bashrc and .profile | |
# export PYTHONSTARTUP="$HOME/.pythonrc.py" | |
# pip install python-box reusables pdir2 | |
from __future__ import print_function, with_statement, absolute_import | |
try: | |
from box import Box, BoxList | |
except ImportError: | |
print("Box not available") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import reusables | |
@reusables.time_it() | |
def test_lbyl(messages): | |
out = [] | |
for _ in range(10000): | |
if messages and messages[0] and len(messages[0]) >= 3: | |
out.append(messages[0][2]) | |
return out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import reusables | |
import os | |
# to be fair, start out at same state for both tests | |
os.makedirs("folder", exist_ok=True) | |
@reusables.time_it() | |
def test_lbyl(remove_folder=False): |
OlderNewer