The following gist is an extract of the article Building a simple crawler. It allows crawling from a URL and for a given number of bounce.
from crawler import Crawler
crawler = Crawler()
crawler.crawl('http://techcrunch.com/')
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: elasticsearch | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts elasticsearch | |
# Description: Starts elasticsearch using start-stop-daemon | |
### END INIT INFO |
#!/bin/bash | |
# Elastic Serarch Start and Stop Script | |
ES_HOME="/opt/elsearch/elasticsearch" | |
ES_USER="esearch" | |
PID=$(ps ax | grep elasticsearch | grep $ES_HOME | grep -v grep | awk '{print $1}') | |
#echo $PID |
The following gist is an extract of the article Building a simple crawler. It allows crawling from a URL and for a given number of bounce.
from crawler import Crawler
crawler = Crawler()
crawler.crawl('http://techcrunch.com/')
curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py > get-pip.py; | |
python get-pip.py; | |
rm -f get-pip.py; | |
# change directory here. Go in your project home dir. | |
# cd /opt/uuid_resolver/; | |
pip install virtualenv; | |
virtualenv venv; | |
# activate the virtualenv | |
source venv/bin/activate | |
# change here your requirements.txt location |
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U |
#!/usr/bin/env | |
# -*- coding: utf-8 -*- | |
import unittest | |
""" Quicksort implementation """ | |
def quicksort(arr): | |
""" Quicksort a list |
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
type test_struct struct { |
#!/bin/bash | |
APP_NAME="${1}" | |
if [ "$APP_NAME" = "" ]; then | |
echo "you must provide an application name!! " | |
echo "usage: <this script> <app name>" | |
exit | |
fi |
#!/usr/local/bin/python | |
from optparse import OptionParser | |
import os | |
PATH_SEPARATOR = os.sep | |
html_layout = "<!DOCTYPE html>\n" \ | |
"<html>\n" \ |
''' | |
Created on Nov 23, 2012 | |
@author: uolter | |
''' | |
from functools import wraps | |
from flask import request, current_app |