##MONGODB & PYTHON
###Ubuntu Install
sudo apt-get install mongodb
pip install pymongo
Table - Collection
Column - Property
Row - Document
##MONGODB & PYTHON
###Ubuntu Install
sudo apt-get install mongodb
pip install pymongo
Table - Collection
Column - Property
Row - Document
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pcap/pcap.h> | |
/* callback function when packet have captured */ | |
static void mycb(u_char *user, | |
const struct pcap_pkthdr *h, const u_char *packet) | |
{ | |
static int count = 1; | |
printf("Packet %d:\n", count); |
#!/usr/bin/env python | |
from __future__ import unicode_literals | |
import pymongo | |
import threading | |
DB_NAME = 'events' | |
COLLECTION_NAME = 'events' | |
class Subscriber(threading.Thread): |
#!/usr/bin/env python | |
import dpkt, socket | |
f = open('t.cap', 'rb') | |
pcap = dpkt.pcap.Reader(f) | |
c = 0 | |
ptr_c = 0 | |
log = open('4-seg-ip-dns-filter','w') |
#!/usr/bin/env python | |
import os | |
import pyuv | |
import sys | |
fd = os.getenv('PYUV_CHANNEL_FD') | |
if fd is None: | |
print "[Child] No channel fd found" |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
from multiprocessing import Pool | |
def fib(n): | |
if n <= 1: | |
return n | |
else: | |
return fib(n - 1) + fib(n - 2) | |
import logging | |
import logging.handlers | |
log = logging.getLogger(__name__) | |
log.setLevel(logging.DEBUG) | |
handler = logging.handlers.SysLogHandler(address = '/dev/log') | |
formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s') |
import pyuv | |
def on_close(tcp): | |
print "closed" | |
def on_read(tcp, data): | |
print "read" | |
if data is None: | |
tcp.close(on_close) | |
else: |
# dns server using dnslib and gevent | |
# based on https://bitbucket.org/paulc/dnslib/src/80d85555aae4/src/server/gevent_server.py | |
# set the key as | |
# set IP:name ip_addr | |
# set TXT:name txtfield | |
# fallback on gevent's dns resolver | |
# gleicon 2011 | |
import gevent |