This file contains hidden or 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 __future__ import print_function | |
import argparse | |
import csv | |
import sys | |
_EPILOG = """ | |
""" | |
if __name__ == '__main__': |
This file contains hidden or 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 wrap_list_in_result_dict(entities, page=1, total_pages=1, num_results=None): | |
return dict( | |
entities=entities, | |
page=page, | |
total_pages=total_pages, | |
num_results=num_results or len(entities)) | |
# this is the entire list | |
print wrap_list_in_result_dict([1,2,3,4]) | |
This file contains hidden or 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
application: GAE_APP_IDENTIFIER | |
version: 1 | |
runtime: python27 | |
api_version: 1 | |
threadsafe: yes | |
handlers: | |
- url: .* | |
script: main.app |
This file contains hidden or 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
<?php | |
phpinfo(); |
This file contains hidden or 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
-- query existing row with int (gets worse with amount of rows) | |
CREATE TABLE `identity` ( | |
`provider_name` varchar(256) NOT NULL, | |
`provider_user_id` varchar(256) NOT NULL, | |
`uuid` char(32) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`provider_name`,`provider_user_id`), | |
KEY `uuid` (`uuid`), | |
CONSTRAINT `identity_ibfk_1` FOREIGN KEY (`uuid`) REFERENCES `global_user` (`uuid`) |
This file contains hidden or 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
# download GeoIPCity.dat from http://dev.maxmind.com/geoip/geolite | |
# pip install pygeoip | |
# get ip list eg. from sshguard logs: | |
# zgrep Blocking /var/log/auth.log* | cut -d ' ' -f 7 | cut -d ':' -f 1 | sort -u > ips.txt | |
# python geoiplookup.py ips.txt (or directly cat) | |
import fileinput | |
import sys | |
import pygeoip |
This file contains hidden or 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
cursor = db.connection.cursor() | |
# borrowed from http://goo.gl/BWxNj | |
seq_fix_sql = """SELECT setval('django_messages_message_id_seq', coalesce((select max(id)+1 from django_messages_message), 1), true)""" | |
cursor.execute(seq_fix_sql) |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# # vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.ssh.forward_agent = true | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", 512] |
This file contains hidden or 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
127.0.0.1 bitcointalk.org | |
127.0.0.1 plus.google.com | |
127.0.0.1 thechive.com | |
127.0.0.1 www.9gag.com 9gag.com | |
127.0.0.1 www.amazon.de amazon.de | |
127.0.0.1 www.bitcoinity.org bitcoinity.org | |
127.0.0.1 www.eatliver.com | |
127.0.0.1 www.facebook.com facebook.com | |
127.0.0.1 www.geizhals.at geizhals.at | |
127.0.0.1 www.geizhals.de geizhals.de |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am tinnet on github. | |
* I am tinnet (https://keybase.io/tinnet) on keybase. | |
* I have a public key whose fingerprint is 4171 0F75 4E9F 2AA6 8AEE FAF8 8B4F 1E7F BAF4 AB2F | |
To claim this, I am signing this object: |