Skip to content

Instantly share code, notes, and snippets.

View breath103's full-sized avatar
💭
Creating Something

Kurt breath103

💭
Creating Something
View GitHub Profile
@breath103
breath103 / athena.ts
Last active February 23, 2018 08:34
CloudFront logs athena table partition indexer
import * as AWS from "aws-sdk";
// Athena Helper
export async function executeAthenaQuery(query: string | string[], outputLocation: string) {
const athena = new AWS.Athena();
let queryString: string;
if (typeof query === "string") {
queryString = query;
} else {
CREATE EXTERNAL TABLE cloudfront_logs (
date date COMMENT '',
time string COMMENT '',
location string COMMENT '',
bytes bigint COMMENT '',
requestip string COMMENT '',
method string COMMENT '',
host string COMMENT '',
uri string COMMENT '',
status int COMMENT '',
// Custom made dynamoose declaration file.
declare module "dynamoose" {
export function local(url: string): void;
export function model<DataSchema, KeySchema, ModelSchema extends Model<DataSchema>>(
modelName: string,
schema: Schema,
options?: ModelOption
): ModelConstructor<DataSchema, KeySchema, ModelSchema>;
export function setDefaults(options: ModelOption): void;
@breath103
breath103 / gist:8641954
Created January 27, 2014 01:30
When getting SSL error from excon
p:
Error: Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file` or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::SocketError)
s:
export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem
@breath103
breath103 / gist:7944930
Created December 13, 2013 14:19
when installing ruby 2.0.0-p353 on mac..
CC=/usr/local/bin/gcc-4.2 rvm install 2.0.0 --enable-shared --enable-dtrace=false