This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean_html(html): | |
""" Remove HTML markup from the given string. """ | |
# remove inline JavaScript / CSS | |
x = re.sub(r'(?is)<(script|style).*?>.*?(</\1>)', '', html.strip()) | |
# remove html comments. must be done before removing regular tags since comments can contain '>' characters. | |
x = re.sub(r'(?s)<!--(.*?)-->[\n]?', '', x) | |
# remove the remaining tags | |
x = re.sub(r'(?s)<.*?>', ' ', x) | |
# remove html entities | |
x = remove_entities(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import logging | |
import chardet | |
import json | |
from optparse import OptionParser | |
from boilerpipy import (Extractor, isValidhtml, | |
compat_urllib_request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib | |
import pycurl | |
import sys | |
import json | |
from optparse import OptionParser | |
parser = OptionParser(usage="%prog: [options] [URL]") | |
parser.add_option('-p', '--projectid', help="Project ID") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"path/filepath" | |
"os" | |
"flag" | |
"fmt" | |
) | |
type fileattr struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 1st sed: remove colons | |
# 2nd sed: replace higher level folder names with dashes | |
# 3rd sed: indent graph three spaces | |
# 4th sed: replace first dash with a vertical bar | |
if [ $# -eq 1 ]; then | |
ls -R $1 | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' | |
elif [ $# -gt 1 ]; then | |
echo "Only one directory at a time please!!" | |
exit 255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "Please provide the pcap file for sharking.." | |
exit 255 | |
fi | |
capinfos $1 1>/dev/null 2>/dev/null | |
if [ $? -eq 1 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* g++ -O3 --std=c++0x -o test_mmap test_mmap.cpp | |
*/ | |
#include <vector> | |
#include <sys/mman.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def isvalidhostname(hostname): | |
""" | |
Validate hostname | |
""" | |
regex = re.compile("[^A-Z\d-]", re.IGNORECASE) | |
if len(hostname) > 255: | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_init() | |
{ | |
DIRZ=$( seq 1 100 ) | |
} | |
cleanup() | |
{ | |
echo "Cleaning the test" |
OlderNewer