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
[compiler] sudo apt-get install build-essential | |
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev | |
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev | |
cd ~/<my_working _directory> | |
git clone https://github.com/Itseez/opencv.git | |
mkdir build | |
cd build |
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 | |
EXITCODE="0" | |
SERVICES=( | |
"memcached &" | |
"mongod &" | |
"redis-server &" | |
"neo4j start" | |
"elasticsearch" |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
fabfile for Django | |
------------------ | |
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/ | |
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle) | |
several additions, corrections and customizations, too |
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 | |
from __future__ import with_statement # needed for python 2.5 | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
from fabric.contrib import files | |
USAGE = """ | |
================================================================ | |
NOTE: | |
using this fabfile expects that you have the python utility |
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
# from http://stackoverflow.com/questions/3274597/how-would-i-determine-zodiac-astrological-star-sign-from-a-birthday-in-python | |
from bisect import bisect | |
signs = [(1,20,"Cap"), (2,18,"Aqu"), (3,20,"Pis"), (4,20,"Ari"), | |
(5,21,"Tau"), (6,21,"Gem"), (7,22,"Can"), (8,23,"Leo"), | |
(9,23,"Vir"), (10,23,"Lib"), (11,22,"Sco"), (12,22,"Sag"), | |
(12,31,"Cap")] | |
def zodiac_sign(m,d): | |
return signs[bisect(signs,(m,d))][2] | |
assert zodiac_sign(3,9) == "Pis" |
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
from joblib import Parallel, delayed | |
import multiprocessing | |
inputs = range(100000) | |
def processInput(i): | |
return i * i | |
num_cores = multiprocessing.cpu_count() | |
print str(num_cores) |
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
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs | |
# fallback to google or any other DNS server to resolv domains not present on Redis | |
# to set a new domain on redis, just issue a SET domain.tld ip_addr | |
# run with twistd -ny txredns.tac | |
# gleicon 2011 | |
from twisted.names import dns, server, client, cache | |
from twisted.application import service, internet | |
from twisted.internet import defer | |
from twisted.python import log |
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/python -u | |
import sys, os, time | |
import random | |
class DNSLookup(object): | |
"""Handle PowerDNS pipe-backend domain name lookups.""" | |
ttl = 30 | |
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
[program:lss] | |
process_name=Shipper | |
command=java -jar /usr/local/logstash/bin/logstash-1.1.9-monolithic.jar agent --config /usr/local/logstash/conf/shipper.conf --log /usr/local/logstash/log/shipper.log | |
user=logstash | |
startretries=3 | |
redirect_stderr=true | |
std_out_logfile=NONE | |
startsecs=3 | |
environment=HOME="/usr/local/logstash/" |
OlderNewer