Skip to content

Instantly share code, notes, and snippets.

@dzlab
dzlab / fuzzer.py
Created August 26, 2012 21:03
A Fuzzer test sccript for randomly testing applications
#!/usr/bin/python
# 5-line fuzzer below is from Charlie Miller's
# "Babysitting an Army of Monkeys":
# Part 1 - http://www.youtube.com/watch?v=Xnwodi2CBws
# Part 2 - http://www.youtube.com/watch?v=lK5fgCvS2N4
# Presentation at http://www.scribd.com/doc/60008912/cmiller-CSW-2010
# List of files to use as initial seed
file_list=[
@dzlab
dzlab / coverage_test.sh
Created August 29, 2012 18:56
A python script for coverage testing, it takes a unit test case as a parameter
#!/bin/sh -e
err() { echo 1>&2 "$@"; exit 1; }
[ -n "$1" -a -z "$2" ] || err 'Usage: cover <filename>'
[ -r "$1" ] || err "Cannot read $1."
coverage erase || err 'Cannot run coverage.'
coverage run "$1"
rm -rf htmlcov
coverage html
@dzlab
dzlab / Tor network
Last active January 4, 2016 18:09
A sample Tor network configuration
= Tor Network Graph
:neo4j-version: 2.0.0-RC1
:twitter: @esoufy
:tags: domain:networks, use-case:Tor
This interactive Neo4j tutorial covers a scenario in a Tor Network with a large infrastructure that includes a number of host and servers, a Hidden Web Server, ARM application for monitoring the Tor network status.
'''
=== Tor Network meta-model
@dzlab
dzlab / github_repo_analyzer
Created February 9, 2014 16:16
A sample program for mining Github repositories to analyze a community of developers interested in similar things among the seed repository used for initial graph crawling
# Code example from the book 'Mining Social Web'
import os
from github import Github
import networkx as nx
import sys
from operator import itemgetter
from collections import Counter
from networkx.readwrite import json_graph
ACCESS_TOKEN = 'GET A Personal Access Key from through your Github account'
@dzlab
dzlab / Dockerfile
Last active August 29, 2015 14:00
A Dockerfile for installing erocci from an erlang image
# Use Ubuntu image where erlang is installed
FROM ubuntu
MAINTAINER dzlab dzlabs@outlook.com
# installing erlang-related prerequis
RUN apt-get install -y libssl-dev libstdc++-4.8-dev build-essential
# installing erocci prerequis
RUN apt-get install -y libncurses5-dev libexpat1-dev libxml2-dev uuid-runtime
@dzlab
dzlab / hiring.md
Created May 28, 2014 15:21 — forked from timf/hiring.md

Hiring!

The Dell Cloud Manager engineering team is growing. We're looking for seven new software developers at many different experience levels.

In this gist, I want to give you an idea of:

  • Who we are looking for
  • What we work on
@dzlab
dzlab / Spiral.java
Last active August 29, 2015 14:03
Filling a map with a Spiral algorithm (description here http://www.commentcamarche.net/forum/affich-1824691-algorithme-niveau-signore)
import java.awt.Point;
import java.util.Scanner;
public class Spiral {
private final int n;
private final int center;
private final int[][] matrix;
public Spiral(int n)
@dzlab
dzlab / commands.sh
Last active April 14, 2016 16:29
A collection of commands
# Virtualbox: Mount the shared folder
sudo mount -t vboxsf temp Shared
# process listening on a port (e.g. 5000)
lsof -i :5000 # find the process
lsof -i :80 # find the program running on a port
kill -9 PID # kill process
sudo netstat -lpn |grep :5000
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c # view list of connections and their states
ss -rota | less # list all connections and timers
@dzlab
dzlab / bosh-lite-cf-installer
Last active June 8, 2018 17:22
CloudFoundry Bosh Lite installer script
#!/usr/bin/env bash
##
## This script install prerequisites: git, virtualbox, vagrant, ruby/rubygems.
## Then, it boots up bosh-lite in a local Vagrant/Virtualbox VM,
## then uploads and deploys Cloud Foundry into it.
## Finally, it logs into Cloud Foundry as an admin user,
## creates an initial organization and space,
## then deploys an example application.
##
@dzlab
dzlab / text.sh
Last active April 14, 2016 16:29
Some useful text manipulation commands (sed, gawk, etc.)
# print the number of columns
gawk '{print NF}' file | sort -nu | tail -n 1
# Use head -n 1 for lowest column count, tail -n 1 for highest column count.
# print columns
gawk '{print $0}' file # all columns
gawk '{print $4}' file # 4th column
gawk -F "," '{print $2}' file # specific separator
# split a string with a delimiter into lines