Skip to content

Instantly share code, notes, and snippets.

@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 / vim.commands
Last active October 8, 2015 15:07
vim.commands
Paste toggleEdit
Vim provides the 'paste' option to aid in pasting text unmodified from other applications. You can set it manually like:
:set paste
:set nopaste
@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 / docker.sh
Last active December 1, 2015 11:26
A collection of docker related commands
#Build a docker image
cd myproject
docker run --rm -v "$(pwd):/src" -v /var/run/docker.sock:/var/run/docker.sock centurylink/golang-builder
#Create Docker machine on AWS
docker-machine create --driver amazonec2 --amazonec2-access-key $AWS_ACCESS_KEY_ID --amazonec2-secret-key $AWS_SECRET_ACCESS_KEY --amazonec2-vpc-id vpc-be157ddb --amazonec2-region eu-west-1 --amazonec2-instance-type t2.medium aws01
eval $(docker-machine env aws01)
#Swarm + Compose on AWS
export CLUSTER_ID=$(docker run swarm create)
@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 / mvn.sh
Last active April 14, 2016 14:46
A collection of maven commands
# maven ignoring license
mvn install -Dlicense.skip=true -DskipTests
# maven fat jar
mvn assembly:assembly -DdescriptorId=jar-with-dependencies -DskipTests
# maven generate webapp project
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp
# maven generate empty project
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false