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
import sys | |
from cymru import CymruIPtoASNService | |
a = CymruIPtoASNService() | |
queries = [] | |
with open(sys.argv[1]) as fd: | |
i = 0 | |
for l in fd: |
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 | |
# encoding: utf-8 | |
""" | |
cymru.py | |
""" | |
import sys | |
import os | |
import socket | |
import unittest |
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
### Keybase proof | |
I hereby claim: | |
* I am zakird on github. | |
* I am zakir (https://keybase.io/zakir) on keybase. | |
* I have a public key whose fingerprint is 1237 0644 0259 3491 7A91 3F4B 763B 58DE C2F6 F0AA | |
To claim this, I am signing this object: |
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
// bitmap of observed IP addresses | |
static uint64_t *ip_seen = NULL; | |
static const int IP_SEEN_SIZE = 0x4000000; // == 2^32/64 | |
// check if we've received a response from this address previously | |
static inline int check_ip(uint32_t ip) | |
{ | |
return (ip_seen[ip >> 6] >> (ip & 0x3F)) & 1; | |
} |
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 | |
""" | |
Module that provides a simple Pythonic interface to the Truthy twitter API. | |
Documentation on how the API works is available at https://www.mashape.com/truthy/truthy-1. This | |
library provides a very simple interface that hands back data from each of the Truthy API endpoints | |
and manages pagination. Each class (TruthyMemes, TruthyNetworks, TruthyTimelines, TruthyUsers) has | |
a single method `get` which accepts all of the parameters defined by the Truthy API and returns | |
all results. API exceptions are all children of APIError. Note that because this library manages | |
pagination, none of the library calls accept the offset parameter defined by the API documentation. |
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
#include "postgres.h" | |
#include "fmgr.h" | |
#include <openssl/x509.h> | |
#include <openssl/x509v3.h> | |
#include <openssl/bio.h> | |
#ifdef PG_MODULE_MAGIC | |
PG_MODULE_MAGIC; | |
#endif |
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
import M2Crypto | |
address = "mail.google.com" | |
context = M2Crypto.SSL.Context(); | |
context.set_allow_unknown_ca(True) | |
context.set_verify(M2Crypto.SSL.verify_none, True) | |
conn = M2Crypto.SSL.Connection(context) | |
conn.connect((address, 443)) |
NewerOlder