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 / README.md
Created October 19, 2012 08:21
Tasker nexmo

Android tasker nexmo sms sender

Allows you to send sms-es with custom source number from android using Tasker application and this script.

Requirements:

@offlinehacker
offlinehacker / multiprocessing.py
Created November 11, 2012 17:30
Python poll based multiprocessing example that works
import random
from multiprocessing import Pool,TimeoutError
from time import sleep
servers=["s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11","s12","s13","s14","s15","s16","s17","s18","s19","s20","s21","s22","s23","s24","s25","s26","s27","s28","s29","s30"]
blah = "no callback"
def f(x):
print("start f(" + x + ")")
# initialization file (not found)
@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
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
*/
// npm install hapijs/joi#issue-577
'use strict';
var Joi = require('joi');
class TypableObject extends Object {
constructor(value, type) {
super(value);
Object.defineProperty(this, '_type', {value: type});
'use strict';
const amqp = require('amqplib-easy')('amqp://localhost');
const exchangeOptions = {
exchange: 'amq.headers',
exchangeType: 'headers'
};
// takes a default connection for handling errors
@offlinehacker
offlinehacker / darwin.nix
Created October 24, 2016 15:44
Nix crossbuild
import ./default.nix # The root nixpkgs default.nix
{
crossSystem = {
# That's the triplet they use in the mingw-w64 docs,
# and it's relevant for nixpkgs conditions.
config = "x86_64-w64-mingw32";
arch = "x86"; # Irrelevant
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
openssl.system = "mingw64";