First run
npm install -g browserify
npm install -g native-dns-packet
browserify main.js > bundle.js
| package main | |
| import ( | |
| "encoding/base64" | |
| "fmt" | |
| "github.com/miekg/dns" | |
| ) | |
| func main() { | |
| //Decode base64 to binary |
| var Packet = require('native-dns-packet'); | |
| var buf = new Buffer("f2+AgAABAAEAAAAAA3d3dwRyaXBlA25ldAAAAQABwAwAAQABAAA3+gAEwQAGiw==", 'base64'); | |
| var p = Packet.parse(buf) | |
| console.log(p) |
First run
npm install -g browserify
npm install -g native-dns-packet
browserify main.js > bundle.js
| 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 ====== |
| def do_task(): | |
| """ | |
| Customise this | |
| """ | |
| this_will_always_fail() | |
| def attempt_task(): | |
| try: | |
| do_task() | |
| print "Success at last!" |
| /* | |
| 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 : |
| /* | |
| 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 = {}; |
| 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): |
| 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. |
| 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): |