IP-LOCATION-ISP
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 redis | |
POOL = redis.ConnectionPool(host='127.0.0.1', port=6379, db=0) | |
if __name__=="__main__": | |
while True: | |
my_server = redis.Redis(connection_pool=POOL) | |
kafka_message = my_server.lpop("src:queue") | |
if kafka_message: |
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
/* | |
* Copyright (c) 2013 by Wil Tan <wil@cloudregistry.net> | |
* | |
* Based on dump_dns.c from the dnscap <https://www.dns-oarc.net/tools/dnscap> | |
* originally written by Paul Vixie. | |
* | |
* Copyright (c) 2007 by Internet Systems Consortium, Inc. ("ISC") | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above |
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
# A quick and dirty plugin for Jekyll by Eli Naeher | |
# | |
# This plugin creates a site.years template variable which allow you to group archive links by year and month. | |
# The structure of site.years is: | |
# site.years = 2001=>[[post1, post2...], [...]], 2002=>[...] | |
# | |
# Usage should look something like this: | |
# {% for year in site.years %} | |
# <h2>Year {{ year.first.first.date | date: "%Y" }}</h2> |
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
rewrite_by_lua ' | |
REDIR_R = { | |
["/r/1"] = "/d/1", | |
["/r/2"] = "/d/2", | |
} | |
if REDIR_R[ngx.var.uri] then | |
return ngx.redirect(REDIR_R[ngx.var.uri]); | |
end | |
'; |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
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
aliyun.yml | |
*.csv |
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
require 'socket' | |
require 'pp' | |
require 'xdr' | |
# Inspiration | |
# https://github.com/fastly/ganglia/blob/master/lib/gm_protocol.x | |
# https://github.com/igrigorik/gmetric/blob/master/lib/gmetric.rb | |
# https://github.com/ganglia/monitor-core/blob/master/gmond/gmond.c#L1211 | |
# https://github.com/ganglia/ganglia_contrib/blob/master/gmetric-python/gmetric.py#L107 |
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
source 'http://ruby.taobao.org' | |
gem "poseidon" # kafka | |
gem "thrift" | |
gem "opentsdb" |
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 ruby | |
require 'rubygems' | |
require 'aliyun' | |
require 'time' | |
$DEBUG=true | |
options = {:access_key_id => "ALIYUN_KEY_ID", | |
:access_key_secret => "ALIYUN_KEY_SECRET", | |
:service => :cms} |
OlderNewer