Skip to content

Instantly share code, notes, and snippets.

@kmcintyre
kmcintyre / route53_mx_record.py
Last active December 24, 2015 23:59
python script for setting the route53 mx record.
"""
Requeriments:
$ sudo pip install boto
Edit ~/.boto to use your AWS credentials
This is a script that updates the mx record for a domain to the ec2 instance public dns
"""
@kmcintyre
kmcintyre / s3copy.py
Last active July 10, 2016 01:31
Everybody has a s3 boto copy. Here is mine
#!/usr/bin/python
#
# I'm pretty sure there's better scripts
#
import sys, getopt, boto, gzip, StringIO
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from socket import gethostname
@kmcintyre
kmcintyre / browser-pref question
Last active August 29, 2015 14:25
Ask for document or window access post response.
var canada_bcs = [
"CAE-B1N", "CAE-B2N", "CAE-B3N", "CAE-B4N", "CAE-B5N", "CAE-B6N", "CAE-B7N", "CAE-B8N", "CAE-B9N", "CAE-BAN", "CAE-BBN", "CAE-BCN", "CAE-BDN", "CAE-BEN", "CAE-BFN", "CAE-BGN", "CAE-BHN", "CAE-BIN", "CAE-BJN", "CAE-T1N", "CAE-T2N", "CAE-T3N", "CAE-T4N", "CAE-T5N", "CAE-T6N", "CAE-T7N", "CAE-T8N", "CAE-T9N", "CAE-TAN", "CAE-TBN", "CAE-TCN", "CAE-TDN", "CAE-TDN", "CAE-TEN", "CAL-T1N", "CAP-B1N", "CAP-B3N", "CAP-B4N", "CAP-B5N", "CAP-B6N", "CAP-B7N", "CAP-B8N", "CAP-B9N", "CAP-BAN", "CAP-BBN", "CAP-BCN", "CAP-BDN", "CAP-BEN", "CAP-BFN", "CAP-BGN", "CAP-BHN", "CAP-BHN", "CAP-T1N", "CAP-T2N", "CAP-T3N", "CAP-T4N", "CAP-T5N", "CAP-T6N", "CAP-T7N", "CAP-T8N", "CAP-T9N", "CAP-TAN", "CAP-TBN", "CAP-TCN", "CAP-TDN", "CAP-TEN", "CAP-TFN", "CAP-TGN", "CAP-THN", "CAP-TIN", "CAP-TJN", "CAS-B3N", "CAS-B4N", "CAS-B5N", "CAS-B6N", "CAS-B7N", "CAS-B8N", "CAS-B9N", "CAS-BAN", "CAS-BBN", "CAS-BCN", "CAS-FRE", "CAS-T1N", "CAS-T2N"
import websocket
import json
import pprint
from web3 import Web3
from eth_abi import decode_single, decode_abi
subs = [{
'id': 1,
@kmcintyre
kmcintyre / price step 2
Created March 25, 2021 17:28
still fun - getting operational with dynamo db
const puppeteer = require('puppeteer');
const WebSocket = require('ws');
var AWS = require('aws-sdk');
AWS.config.update({ region: 'us-east-1' });
var ddb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
let table = 'price'
const { request, gql } = require('graphql-request');
// first is proxied in case you f' up and get cloudflared
//const endpoint = 'https://beta.scewpt.com/subgraphs/name/dasconnor/pangolindex'
const endpoint = 'https://graph-node.avax.network/subgraphs/name/dasconnor/pangolindex'
const avaxusdtpairid = '0x9ee0a4e21bd333a6bb2ab298194320b8daa26516'
const avaxdaipairid = '0x17a2e8275792b4616befb02eb9ae699aa0dcb94b'
const pngdaipairid = '0xd765b31399985f411a9667330764f62153b42c76'
@kmcintyre
kmcintyre / bash_flow_lambda
Created April 22, 2022 02:34
bash to zip file on AWS lambda with onflow fcl-js - (failed layer)
#!/bin/bash
mkdir -p nodejs
cd nodejs
cat <<EOF >> package.json
{
"name": "attempted_layer",
"type": "module",
"description": "",
"version": "0.1.0",