Skip to content

Instantly share code, notes, and snippets.

@b1tninja
b1tninja / blowfish_irc.py
Last active August 29, 2015 14:22
Blowfish for IRC
import struct, string
from Crypto.Cipher import Blowfish
def blow(key, plaintext):
if not isinstance(plaintext, str):
raise TypeError('Plaintext must be str')
else:
if len(plaintext) % 8 != 0:
plaintext += "\0" * (8-(len(plaintext)%8))
@b1tninja
b1tninja / mapping.json
Last active January 13, 2018 13:37
masscan --readscan
{
"masscan": {
"order": 0,
"template": "masscan-*",
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "1"
}
},
#include <stdio.h>
#include <wchar.h>
#include <windows.h>
#include <tlhelp32.h>
#include <shlwapi.h>
#include <cstdarg>
//#include <Python.h>
typedef void PyObject;
//#include <pystate.h>
import evetypes
import stackless
#import uthread
import service
import session
from inventorycommon import const
from eve.client.script.ui.services.menuSvcExtras.movementFunctions import WarpToItem
from eve.common.script.sys.eveCfg import GetActiveShip
from eve.client.script.ui.shared.inventory.treeData import TreeDataShip
import binascii
from enum import IntEnum
# class UniversalClassTags(IntEnum):
# sequence_of = 16
# set_of = 17
# numeric_string = 18
# printable_string = 19
# t61_string = 20
# videotex_string = 21
from xml.etree import ElementTree
import string
def parse(xml):
root = ElementTree.fromstring(xml)
return root.tag, tree_to_dict(root)
def tree_to_dict(element, parents=None):
@b1tninja
b1tninja / glacier.py
Created March 23, 2016 03:50
Amazon Glacier Multipart Uploader
import datetime
import hashlib
import logging
import os
import bz2
from itertools import zip_longest
from socket import gethostname
from io import RawIOBase
import cryptography.hazmat
#include <stdio.h>
#include <wchar.h>
#include <windows.h>
#include <tlhelp32.h>
#include <shlwapi.h>
#include <cstdarg>
//#include <Python.h>
typedef void PyObject;
//#include <pystate.h>
@b1tninja
b1tninja / PKGBUILD
Last active March 29, 2019 04:40
archlinux-packages-keyring
pkgname='archlinux-packages-keyring-git'
pkgver=0.g6541223ad07
pkgrel=1
#SOURCE_DATE_EPOCH=$(date -u '+%s')
arch=('any')
_arch_git=${archgit:-'https://git.archlinux.org/svntogit/packages.git'}
_keyserver=${keyserver:-'hkps://hkps.pool.sks-keyservers.net'}
arch=('any')
makedepends=('pacman' 'bash')
depends=('pacman')
fetch('https://www.archlinux.org/master-keys/').then(resp=>{
resp.text().then(html=>{
parser = new DOMParser();
doc = parser.parseFromString(html, "text/html");
xpath_result = doc.evaluate('//tr[th/text()]//a[contains(@href, "https://sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&exact=on&search=")]', doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE)
for (i = 0; i < xpath_result.snapshotLength; i++) {
a = xpath_result.snapshotItem(i);
fingerprint = (new URL(a.href,window.location)).searchParams.get('search');
developer = doc.evaluate('ancestor::tr/th/text()', a, null, XPathResult.STRING_TYPE).stringValue;
console.log(`${fingerprint} ${developer}`);