Skip to content

Instantly share code, notes, and snippets.

@alex-bender
alex-bender / infosec_newbie.md
Created November 16, 2017 20:38 — forked from mubix/infosec_newbie.md
How to start in Infosec
@alex-bender
alex-bender / README.md
Created November 22, 2017 15:54 — forked from danriti/README.md
Line Profiling in Python

Install the line_profiler module:

[driti@ubuntu ]$ pip install line_profiler

Add the @profile decorator and run:

[driti@ubuntu ]$ kernprof.py -l -v example.py
@alex-bender
alex-bender / sleeper.py
Created December 6, 2017 08:34
wait for pid ends; correct error handling
import os
import time
import sys
from subprocess import call
def check_pid(pid):
""" Check For the existence of a unix pid. """
while True:
try:
os.kill(pid, 0)
@alex-bender
alex-bender / projects.txt
Created January 14, 2018 19:36
Project ideas, weekly report
week
date range
project name
description
============
2
08/01 - 14/01
-------------
toy-deploy
Aim of the project is not in solving any problem but in project design itself.
"""Open fixture json files and remove lines which contain '>>>', '|||', '<<<',
and check that `.field.permissions` are unique"""
for fname in files:
fp = open(fname)
perms = json.loads(fixit(fname))
fp.close()
for perm in perms:
item = perm['fields']['permissions']
res = uniq(item)