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
| #!/usr/bin/python2.7 | |
| # https://gist.github.com/daniel-woods | |
| import json | |
| from urllib2 import urlopen, HTTPError, Request | |
| def post_message(url, data): | |
| req = Request(url, data) | |
| f = urlopen(req) |
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
| #!/usr/bin/env python | |
| import boto3 | |
| import json | |
| sns = boto3.client("sns") | |
| topic_arn = "YOUR_SNS_TOPIC" | |
| proto = "http" | |
| endpoint = "YOUR_EDNPOINT" | |
| attributes = {"FilterPolicy": json.dumps({"key": ["foo", "bar"]})} |
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
| #!/usr/bin/python2.7 | |
| # Script for doing some common Rekognition Video queries | |
| import boto3 | |
| import json | |
| from time import sleep | |
| bucket = "YOUR_BUCKET" | |
| s3_path = "PATH/TO/FILE.mp4" | |
| region = "AWS_REGION" # ex: eu-west-1 |
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
| // ./hash_file.go sha256 /path/to/file | |
| package main | |
| import ( | |
| "crypto/md5" | |
| "crypto/sha1" | |
| "crypto/sha256" | |
| "fmt" | |
| "io" | |
| "log" |
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
| #!/usr/bin/python | |
| # Script to generate fake endpoints for a platform application. | |
| import boto3 | |
| import time | |
| sns = boto3.client("sns") | |
| platform_application = "YOUR_SNS_APPLICATION_PLATFORM_ARN" | |
| number_of_endpoints = 150321 | |
| i = 0 |
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
| #!/usr/bin/python | |
| # Script to count the number of endpoints in an SNS platform application | |
| # By calling list_ednpoints using pagination, append the response size to a counter. | |
| # Count the number of endpoints that are enabled. | |
| import boto3 | |
| import time | |
| start_time = time.time() |
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
| import random | |
| import math | |
| def perlinNoise(hex_x, hex_y, seed): | |
| random.seed(seed) | |
| pers_min = 0.45 | |
| pers_max = 0.75 |
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
| DECLARE | |
| CURSOR retUnassigned IS | |
| SELECT FaultSheet.fault_no FROM FAULTSHEET | |
| FULL OUTER JOIN Repairs ON FaultSheet.fault_no=Repairs.fault_no | |
| WHERE FaultSheet.fault_no NOT IN(SELECT fault_no FROM Repairs); | |
| BEGIN | |
| OPEN retUnassigned; | |
| FETCH retUnassigned INTO var1; | |
| --print Var1 |
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
| DROP TABLE REPAIRS; | |
| DROP TABLE SERVICECENTRE; | |
| DROP TABLE FAULTSHEET; | |
| DROP TABLE APPLIANCE; | |
| DROP TABLE STOCK; | |
| DROP TABLE CUSTOMER; | |
| DROP TABLE MANUFACTURER; | |
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
| #Open an Image File and display some simple metadata. | |
| import os # os.stat | |
| from tkinter import * | |
| import time # for getting time | |
| from tkinter import filedialog | |
| from tkinter import messagebox | |
| from tkinter import ttk | |