Skip to content

Instantly share code, notes, and snippets.

<iframe src="http://www.google.com/talk/service/badge/Show?tk=z01q6amlqds2ocfa7occdcfjga2cakqe0d40n0tbanbeslbn2vadcq7ags0ab7vm1s8ftk971vmma9g7lfj3rkrikt0rgbm7esslsmva5dtsaqftf3bhisgljpbskmvj0cmtte0t5a56qd55ekqnoi9v258u89llmrm9bclss4tjh6morbm7jiop585i89bunco&amp;w=200&amp;h=60" frameborder="0" allowtransparency="true" width="200" height="60"></iframe>
Hallo Basti.
@herrbuerger
herrbuerger / README
Created September 8, 2012 07:09 — forked from amcclosky/README
Anonymous Rotating Proxies with Monit, Tor, Haproxy and Delegated. Idea by http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/
0 - Read http://blog.databigbang.com/running-your-own-anonymous-rotating-proxies/
1 - Install monit, haproxy, tor and delegated.
2 - Setup your environment in the setup.rb file
3 - Just run > ruby setup.rb
4 - ...........
5 - PROFIT! > http://www.southparkstudios.com/clips/151040/the-underpants-business
<context-param>
<param-name>net.myrrix.web.InitListener.USER_NAME</param-name>
<param-value>admin</param-value>
</context-param>
<context-param>
<param-name>net.myrrix.web.InitListener.PASSWORD</param-name>
<param-value>password</param-value>
</context-param>
➜ sample imagedups . --search -f 92bc12786d430083be1e166a2174b4888ba0b4ba.jpg
92bc12786d430083be1e166a2174b4888ba0b4ba.jpg
Traceback (most recent call last):
File "/usr/local/bin/imagedups", line 228, in <module>
prog.main()
File "/usr/local/bin/imagedups", line 60, in main
self.cmd_search()
File "/usr/local/bin/imagedups", line 90, in cmd_search
self.compare_with_db(hashdb, self.args.samplefile)
File "/usr/local/bin/imagedups", line 193, in compare_with_db
from math import sqrt
def confidence(ups, downs):
n = ups + downs
if n == 0:
return 0
z = 1.96 #1.96 = 95%
phat = float(ups) / n
@herrbuerger
herrbuerger / gist:10961577
Last active October 28, 2015 15:51
Rotating snapshots for Elasticsearch

Rotationg snapshots for Elasticsearch (poor-man's version)

This is a very basic method to do rotating snapshots for Elasticsearch. For this to work you will need to have jq installed (http://stedolan.github.io/jq/).

PLEASE, PLEASE, PLEASE don't put this blindly in your commandline and execute it :)

curl -s -S -XGET "localhost:9200/_snapshot/my_s3_repository/_all?pretty=true" | jq '.snapshots[] | .snapshot + " " + .end_time' | sed 's/^.\(.*\).$/\1/' | sort -k 2 -r | awk '{ if (NR > 1) { system("curl -XDELETE " "localhost:9200/_snapshot/my_s3_repository/"$1) } } END { system("curl -XPUT " "localhost:9200/_snapshot/my_s3_repository/`date +\%s`") }'

Details

48000693
49000693
50000693
51000693
52000693
53000693
54000693
55000693
56000693
57000693
from annoy import AnnoyIndex
index = AnnoyIndex(1)
for x in range(10000):
id = "%d000%d" % (x,x)
index.add_item(int(id),[x])