Skip to content

Instantly share code, notes, and snippets.

@T0aD
T0aD / zarkeygen.py
Created December 4, 2017 20:03
ZAR "keygen"
#! /usr/bin/python -u
import hashlib
import random
class ZAR_Keygen():
def __init__(self):
self._random_init = False
self.serials = {}
self.md5s = {}
---
- hosts: [all]
gather_facts: false
vars:
- foo: bar
remote_user: root
tasks:
- apt: name=wondershaper state=present
- shell: sed -i 's/10mbit/1000mbit/' /sbin/wondershaper
# find public interface:
@T0aD
T0aD / changelog.sh
Created March 31, 2016 09:29
Generate changlog from last 2 tags of a gGIT repository
#! /bin/bash
git pull --all # fetch last changes from all branches
git pull --tags # fetch all tags
# switch to prod:
git checkout prod
#git tag # display tags
@T0aD
T0aD / dup_checker.py
Created March 30, 2016 12:01
Little script to count duplicates from Twitter Public API Stream
#! /usr/bin/env python
#-*- coding: utf-8 -*-
from twitter import *
consumer_key='XXXXXXXXXX'
consumer_secret='XXXXXXXXXXXXXX'
token = 'XXXXXXXXXXXXXXXXX'
token_secret = 'XXXXXXXXXXXXXXX'
@T0aD
T0aD / ct-submit.py
Created November 25, 2015 09:13 — forked from rraptorr/ct-submit.py
Simple Certificate Transparency certificate submission client
#!/usr/bin/python
import sys
import argparse, json, base64, struct
import urllib2
from datetime import datetime
LOGS = [
'https://ct.googleapis.com/aviator',
'https://ct.googleapis.com/pilot',
#! /usr/bin/env python
# conf. for ES exports:
ADD_ES_ID = False
import sys, json, time
try:
filename = sys.argv[1]
except:
#! /usr/bin/env python
import calendar, time, sys
try:
d = sys.argv[1]
except:
print 'Syntax: %s [time string, i.e. 2015-09-07 14:00:00]'
exit(1)
@T0aD
T0aD / kibana-julien
Created July 7, 2015 08:13
Kibana dashboard config riemann1
{
"title": "julien",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
#! /usr/bin/python
from ctypes import *
libc = CDLL('libc.so.6')
quotactl = libc.quotactl
"""
struct dqblk
{
#! /usr/bin/env python
import os
def move_segments(root_dir, outdir):
for dirpath, dirnames, filenames in os.walk(root_dir):
for d in dirnames:
path = os.path.join(dirpath, d)
marker = os.path.join(path, 'isPushedMarker')
if os.path.exists(marker):