Skip to content

Instantly share code, notes, and snippets.

View offlinehacker's full-sized avatar
🤓
deploying awesomeness

Jaka Hudoklin offlinehacker

🤓
deploying awesomeness
View GitHub Profile
@offlinehacker
offlinehacker / file-force.py
Created March 26, 2013 10:55
Brute forcer for file names, with folder support. Could be used for some ASP web apps.
# -*- coding: utf-8 -*-
import sys
import time
import string
import socket
import requests
import urllib3
from urllib3 import HTTPConnectionPool
@offlinehacker
offlinehacker / git-annex-ubuntu.md
Created March 26, 2013 15:14
Ubuntu git-annex install

================ GIT Annex ubuntu

  • sudo apt-get install cabal-install
  • sudo cabal update
  • sudo apt-get install libgsasl7-dev
  • sudo apt-get install c2hs
@offlinehacker
offlinehacker / aes_brute.sh
Created March 29, 2013 23:42
Simple shell AES brute forcer (especially usefull for bitcoin private keys)
#!/bin/bash
echo "Using wordlist $1"
echo "Using key $2"
cat $1 | while read LINE ; do
#echo "pass: $LINE"
key=$2
p1=${key:0:64}
p2=${key:64}
echo "$p1"$'\n'"$p2" > process
ret=$(openssl enc -d -aes-256-cbc -in process -a -k $LINE 2>/dev/null)
@offlinehacker
offlinehacker / google_stt.py
Created June 14, 2013 07:35
Quick and dirty python implementation of client for google speech to text service using google speech stream API. It requires requests, pyaudio and pyflac to be installed. Don't forget to set your API key. Current limit seems to be around 5 minutes.
#!/usr/bin/python
import flac.encoder as encoder
import pyaudio
import sys
import requests
import random
from threading import Thread
from Queue import Queue, Empty
@offlinehacker
offlinehacker / mergewithbase.py
Last active January 8, 2022 18:21
Merges result of function or attribute from child class with result of function or attribute from the base class.
class merge_with_base(object):
"""
Merges result of function or attribute from child class with result of
function or attribute from the base class.
:param type: Use this base class instead of first base class found and
not with mixins
.. note::
@offlinehacker
offlinehacker / divide.py
Last active March 19, 2022 19:04
Devides list in all posible sublists, without repetitions
from itertools import combinations
def divide(l, p={}):
for v in (j for i in xrange(1, len(l) + 1) for j in combinations(l, i)):
r = tuple(set(l) - set(v))
for s in devide(r):
t = (v,) + (s if s else tuple())
if frozenset(t) in p: continue
else: yield t; p[frozenset(t)] = True
class overridable_property(property):
"""
Property where you can override return value by setting _name
>>> class test(object):
... @overridable_property
... def test(self):
... return "abcd"
...
>>> a = test()
/* This file defines the builds that constitute the Nixpkgs.
Everything defined here ends up in the Nixpkgs channel. Individual
jobs can be tested by running:
$ nix-build pkgs/top-level/release.nix -A <jobname>.<system>
e.g.
$ nix-build pkgs/top-level/release.nix -A coreutils.x86_64-linux
*/
VERSION=1.6.1
ARCH=`uname -m`
ARCH_SYS=`uname -s | tr "[A-Z]" "[a-z]"`
if [[ "$ARCH" = "i386" ]]
then
ARCH = "i686"
fi
WORK_DIR=`pwd`
{
"*": {
"setuptools": {"append_deps": ["pytest[test]"]},
"sqlalchemy": {"append_deps": ["pysqlite[test]"], "spec": "sqlalchemy==0.8.5"},
"sqlalchemy-imageattach": {
"src": "https://github.com/crosspop/sqlalchemy-imageattach/archive/{{spec.pinned}}.tar.gz#egg=sqlalchemy-imageattach-{{spec.pinned}}",
"append_deps": ["pysqlite[test]"]
},
"alembic": {"append_deps": ["pysqlite[test]"]}
}