Skip to content

Instantly share code, notes, and snippets.

@nori3tsu
nori3tsu / aes-cipher.py
Last active December 24, 2015 01:49
AES/ECB/PKCS5Padding
from Crypto.Cipher import AES
import base64
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class AESCipher:
def __init__(self, key):
self.key = key
@rufuspollock
rufuspollock / csv2sqlite.py
Last active April 14, 2016 14:22
UPDATED VERSION NOW AT https://github.com/rgrp/csv2sqlite [Script to load CSV to SQLite]
#!/usr/bin/env python
# A simple Python script to convert csv files to sqlite (with type guessing)
#
# @author: Rufus Pollock
# Placed in the Public Domain
import csv
import sqlite3
def convert(filepath_or_fileobj, dbpath, table='data'):
if isinstance(filepath_or_fileobj, basestring):
#!/usr/bin/python
import sys #for cmd line argv
#take command line args as the input string
input_string = sys.argv
#remove the program name from the argv list
input_string.pop(0)
#convert to google friendly url (with + replacing spaces)
echo "[+] Getting \system\\currentcontrolset\\services"
$raw_services = Get-ChildItem -Path hklm:\system\\currentcontrolset\\services | select Name
$services = @()
foreach ($srv in $raw_services) {
$shortname = "$srv".Split("\")[-1]
$shortname = $shortname.Substring(0,$shortname.Length-1)
$services += $shortname
}
@kiyukuta
kiyukuta / autoencoder.py
Last active January 23, 2020 06:16
Minimum implementation of denoising autoencoder.Error function is cross-entropy of reconstruction.Optimizing by SGD with mini-batch.Dataset is available at http://deeplearning.net/data/mnist/mnist.pkl.gz
#coding: utf8
"""
1. Download this gist.
2. Get the MNIST data.
wget http://deeplearning.net/data/mnist/mnist.pkl.gz
3. Run this code.
python autoencoder.py 100 -e 1 -b 20 -v
"""
import numpy
import argparse
@pala
pala / hack.sh
Created March 31, 2012 17:08 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
anonymous
anonymous / dump.csv
Created April 8, 2017 21:24
Parsed out compromised hosts from #ShadowBrokers
ID Host IP Address Year Month Day Implant Version OS
PITCHIMPAIR ns1.youngdong.ac.kr 202.30.58.5 1969 12 31 INCISION 1.1.2.1 hppa2.0w-hp-hpux11.00
INTONATION tx.micro.net.pk 203.135.2.194 2000 8 17 JACKLADDER 2.0 sparc-sun-solaris2.7
INTONATION hakuba.janis.or.jp 210.232.42.3 2000 8 22 JACKLADDER 2.0 sparc-sun-solaris2.6
INTONATION mail.interq.or.jp 210.157.0.87 2000 8 24 JACKLADDER 2.0 sparc-sun-solaris2.6
INTONATION mx1.freemail.ne.jp 210.235.164.21 2000 8 28 JACKLADDER ? i386-pc-solaris2.7
INTONATION webnetra.entelnet.bo 166.114.10.28 2000 8 30 JACKLADDER 2.0 sparc-sun-solaris2.6
INTONATION opcwdns.opcw.nl 195.193.177.150 2000 9 6 JACKLADDER 2.0 sparc-sun-solaris2.6
INTONATION rayo.pereira.multi.net.co 206.49.164.2 2000 9 20 JACKLADDER 2.0 sparc-sun-solaris2.6
INTONATION most.cob.net.ba 195.222.48.5 2000 9 21 JACKLADDER 2.0 sparc-sun-solaris2.6
@garthk
garthk / dumpsqlite3tocsv.py
Created May 1, 2012 01:07
Unicode-safe Python script to dump sqlite3 tables to CSV for Trac data extraction
#!/usr/bin/env python
"""
Script to open a sqlite3 database and dump all user tables to CSV files.
Tested in Unicode-rich environment.
Usage:
dumpsqlite3tocsv foo.db
"""
import sqlite3, csv, codecs, cStringIO, os, os.path
@briandeheus
briandeheus / punk.py
Last active April 1, 2022 02:53
Don't be a punk, punk
import binascii
import struct
class Punk(object):
_END_CHUNK_TYPE = 'IEND'
_PUNK_CHUNK_TYPE = 'puNk'
_MAX_BYTES = 2147483647
_chunks = dict()
@quinncomendant
quinncomendant / umbrella
Last active May 13, 2022 06:52
[WARNING: this script no longer works with newer versions of the roaming client software, which now has a *Disable* control in its menu so use that instead.] Cisco Umbrella Roaming Client management script for Mac OS X. This makes it easy to manage the background processes of umbrella to start, stop, restart, sleep and get status.
#!/bin/bash
# Quinn Comendant <quinn@strangecode.com>
# https://gist.github.com/quinncomendant/3be731567e529415d5ee
# Since 25 Jan 2015
# Version 1.2.2
# q 13942 0.0 0.3 4408332 22096 ?? SN 7:32PM 0:00.27 /Applications/OpenDNS Roaming Client/RoamingClientMenubar.app/Contents/MacOS/RoamingClientMenubar
# nobody 13937 0.0 0.1 4296740 5164 ?? Ss 7:31PM 0:00.06 /usr/local/sbin/dnscrypt-proxy --user nobody --local-address=127.0.0.1:53 --plugin=libdcplugin_erc.so -d
# root 13903 0.0 0.2 4366308 13752 ?? SNs 7:31PM 0:00.25 /Library/Application Support/OpenDNS Roaming Client/dns-updater