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 AWS = require('aws-sdk'); | |
var path = require('path'); | |
var https = require('https'); | |
/** | |
* This assumes that messages are added to DynamoDB | |
* with parameters `name` and `message`. | |
* | |
* To get this to work with your slack channel, you | |
* first need to configure Incoming Webhook for your |
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 tarhash(tarpath, hash='sha1'): | |
""" | |
given a path to a tar file, return a checksum of its | |
summed / concatenated contents. | |
tarpath - a tar.gz path string to open | |
hash - one of the hash methods supported by hashlib | |
""" | |
total_hash = hashlib.new(hash) | |
with open(tarpath, 'rb') as input_file: |
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 os | |
import hashlib | |
def get_git_object_hash(filepath): | |
""" | |
If you use git hash-object <file>, it will give you git's | |
internal hash for that object: http://stackoverflow.com/a/552725/78202 | |
This method provides a way to get a git-compatible hash of the file | |
at path `filepath`. | |
""" |
NewerOlder