Skip to content

Instantly share code, notes, and snippets.

Avatar

Maciej Sawicki viroos

View GitHub Profile
@viroos
viroos / gist:1242279
Created Sep 26, 2011
This D-trace script lists all run programs with their arguments - works with OSX
View gist:1242279
#!/usr/sbin/dtrace -C -s
#pragma D option quiet
proc::posix_spawn:exec-success,proc::__mac_execve:exec-success
{
this->isx64=(curproc->p_flag & P_LP64)!=0;
#define SELECT_64_86(x64, x86) (this->isx64 ? (x64) : (x86))
#define GET_POINTER(base, offset) (user_addr_t)SELECT_64_86(*(uint64_t*)((base)+sizeof(uint64_t)*(offset)), *(uint32_t*)((base)+sizeof(uint32_t)*(offset)))
View pubkey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCjKxZ7tM25ucBjc+k9foQ2Jrv/vo9OpWv4i89IkFtxv5RYGE6NQqWazoris1fyByhT7hQONPZP2tFELKrg+rFOWSd5nTbZORdSfJIQLUe2W36oc/cfw0ZCRYxXundD1v/8YoxEzmjcgrzi75811+T8lo6OrGFPv3aXQb0mOcN++rRH89ee30EZYorkouGdYs5VG0cIoCF52LdeURC0s9TYs5PGV7It5EJn3My1B1Qq02VvO9q9bZRKK9uShj19zL0wKg2jpdwmc1CDQUvCFvDLoALr+Aop+EQnLn5ZLI7IxwoeiUpXyCrMw/10aCZWD4bxYZMO+cZ7VKD09ZqsvFp+0eYkAulOwuPLMeaYD9+Qckm+A9gmw7/iDaZM+o0N1JBIRgbShZPm7yiMKepBAvY6dVJ+rQGJ3eIP+RidDmi3SAVZcZVchuq/Z7egPNAsL1/PtHxXYo1mbqpaGqiga8sKgLhCz0LkoJXVMyOMHlX0unv3riPi2at3XzF6gvyz/H8= viroos@Maciejs-MacBook-Pro.local
View gist:182e06fc95f7a9b86388fb3276fa2adb
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import pandas as pd
from pathlib import Path
import sys
base_dir = sys.argv[1]
output_csv = sys.argv[2]
files = Path(base_dir).rglob('*.csv')
def read_file(file):
View join.py
import multiprocessing
from multiprocessing import Value, Pool
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import pandas as pd
from pathlib import Path
import sys
output_csv = 'output.csv'
base_dir = 'base_dir'