Skip to content

Instantly share code, notes, and snippets.


Twirrim twirrim

View GitHub Profile
twirrim /
Created Feb 6, 2019
Check compression in use
#!/usr/bin/env python
from multiprocessing.dummy import Pool
from collections import defaultdict
import requests
import logging
def uses_compression(domain):
import socket
import ssl
import datetime
from multiprocessing.dummy import Pool as ThreadPool
# Tuples containing host and port
CERTS_TO_CHECK = [("host_one", 443),
("host_two", 25)]
twirrim /
Created Aug 10, 2018
Quick attempt to emit Raspberry Pi throttling state metrics through telegraf
#!/usr/bin/env python3
import re
import socket
from subprocess import check_output
def eval_position(position, status):
if status[position] == 1:
return 1
from PIL import Image
import numpy as np
import numexpr as ne
import time
import numbers
from functools import reduce
import pdb
import timeit
View gist:66bfd2b0705f612f9fa8
#!/usr/bin/env python
import socket
import ssl
import datetime
import smtplib
import argparse
import sys
import logging
View gist:03049569a59082edd619
CPython 2.7:
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
Jython 2.7.0:
>>> sys.version_info
(2, 7, 0, 'final', 0)
View gist:d3acbd63b6c4a5fd84a5
#!/usr/bin/perl -l
use strict;
use warnings;
use Term::ProgressBar;
use Memoize;
use DB_File;
tie my %cache => 'DB_File','primecache',O_RDWR|O_CREAT, 0666;
memoize 'it_is_prime', SCALAR_CACHE => [HASH => \%cache];
View gist:4afba160b87071446747
$ java -jar ~/Downloads/jython-standalone-2.7-b3.jar
Jython 2.7b3 (default:e81256215fb0, Aug 4 2014, 02:39:51)
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_65
Type "help", "copyright", "credits" or "license" for more information.
>>> dir(__builtins__)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name '__builtins__' is not defined
$ python
View gist:b2fbb8cbfa2092aea52d
"Version": "2012-10-17",
"Statement": [
View gist:d6f4236edc79687c3adf
vagrant@vagrant:~/git/Haywire$ ./
Cloning submodules
Compiling wrk
make: Nothing to be done for `all'.
Configuring and compiling for Linux
You can’t perform that action at this time.