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 boto.route53.connection import Route53Connection | |
import urllib2 | |
from syslog import syslog | |
# ======= CONFIG ======== | |
AWS_ACCESS_KEY_ID = 'XXXXXXXXXXXXXXXXXX' | |
AWS_SECRET_ACCESS_KEY = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
DDNSNAME = "foo.example.com." # Should end in period | |
ZONEID = "XXXXXXXXX" | |
# ===== END CONFIG ====== |
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
def do_task(): | |
""" | |
Customise this | |
""" | |
this_will_always_fail() | |
def attempt_task(): | |
try: | |
do_task() | |
print "Success at last!" |
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
/* | |
Check : https://github.com/sajal/Cloudfront-Purge-Tool/blob/master/cloudfrontapi.js for maintained version. | |
Author: Sajal Kayan | |
URL: http://www.cdnplanet.com/ | |
License: Undecided probably BSD style | |
Description: Access to CloudFront API from browser. Requires crossdomain XHR!!!. | |
Wont work from webpages, but i'm making this for chrome extention. | |
Sample Usage : |
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
/* | |
jQuery UI Datepicker plugin wrapper | |
@param [ui-date] {object} Options to pass to $.fn.datepicker() merged onto ui.config | |
*/ | |
angular.module('ui.directives').directive('uiDate', [ | |
'ui.config', function(uiConfig) { | |
var options; | |
options = {}; |
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 disco.worker.classic.func import task_output_stream | |
class S3Output(object): | |
""" | |
Output stream for S3. | |
key from each reduce becomes key name in S3 | |
If gzip param is True, it gzips before uploading. | |
AWS_KEY, AWS_SECRET and BUCKET_NAME in params is required. | |
""" | |
def __init__(self,stream,params): |
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 collections import defaultdict | |
import math | |
class MagicList(): | |
""" | |
An attempt to make a python object which could potentially hold | |
unlimited values with finite distinct values. | |
All items are not stored in memory, only the count of each distinct item is. | |
So if you want to hold say 1 million numbers where each number is between 1 to 5000, | |
this should be a better choice than a list. |
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 disco.worker.classic.func import task_output_stream | |
class S3LineOutput(object): | |
""" | |
Output stream for S3. | |
key from each reduce becomes key name in S3 | |
If gzip param is True, it gzips before uploading. | |
AWS_KEY, AWS_SECRET and BUCKET_NAME in params is required. | |
""" | |
def __init__(self,stream,params,partition, url): |
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
# | |
# Automatically generated file; DO NOT EDIT. | |
# OpenWrt Configuration | |
# | |
CONFIG_MODULES=y | |
CONFIG_HAVE_DOT_CONFIG=y | |
# CONFIG_TARGET_ppc40x is not set | |
# CONFIG_TARGET_realview is not set | |
# CONFIG_TARGET_arm64 is not set | |
# CONFIG_TARGET_sunxi is not set |
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
package main | |
import ( | |
"encoding/base64" | |
"fmt" | |
"github.com/miekg/dns" | |
) | |
func main() { | |
//Decode base64 to binary |
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
var Packet = require('native-dns-packet'); | |
var buf = new Buffer("f2+AgAABAAEAAAAAA3d3dwRyaXBlA25ldAAAAQABwAwAAQABAAA3+gAEwQAGiw==", 'base64'); | |
var p = Packet.parse(buf) | |
console.log(p) |
OlderNewer