Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/python3
import xml.etree.ElementTree as ET
import sys
import dateutil.parser
print("first file: " + sys.argv[1])
#rootA = ET.parse(sys.argv[1]).getroot()
rootAactual = ET.parse(sys.argv[1])
rootA = rootAactual.getroot()
ec2.describe_vpcs(Filters=[{'Name':'tag', 'Values':[{'aws:cloudformation:stack-id':'stackidname'}]}])
@tedder
tedder / x
Created October 27, 2015 15:55
Verifying that +tedder42 is my blockchain ID. https://onename.com/tedder42
{
"country_code":"US",
"phone_number":"+12405233767",
"national_format":"(240) 523-3767",
"carrier":{
"mobile_country_code":null,
"mobile_network_code":null,
"name":"Bandwidth SMSEnabled",
"type":"voip",
"error_code":null
@tedder
tedder / gist:00a8856e5904969afd4e
Created February 7, 2016 20:53
twtxt post_tweet_hook
here's what I'm using to push the file to my S3 bucket. The bucket has CloudFront with a SNI-based https cert.
post_tweet_hook = "AWS_PROFILE=pjnet aws s3 cp {twtfile} s3://tedder/twtxt.txt --acl public-read --storage-class REDUCED_REDUNDANCY --cache-control 'max-age=60,public'"
#include <TinyGPS++/TinyGPS++.h>
#include <SoftwareSerial.h>
/*
This sample sketch demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 4800;
// Groovy Version: 2.4.6 JVM: 1.8.0_72-internal Vendor: Oracle Corporation OS: Linux
// openjdk version "1.8.0_72-internal"
// to run: groovy -Dgroovy.grape.report.downloads=true cred-npe.groovy
// running in my env:
// docker run -it tedder42/stanson-java8-jre bash
// curl -s get.sdkman.io | bash
// source "$HOME/.sdkman/bin/sdkman-init.sh"
// sdk install groovy
@tedder
tedder / ledstring.ino
Created April 29, 2016 05:38
particle.io photon fastled tv backlight controller
//This #include statement was automatically added by the Particle IDE.
#include "Sunrise/Sunrise.h"
#include "FastLED/FastLED.h"
FASTLED_USING_NAMESPACE;
#if FASTLED_VERSION < 3001000
#error "Requires FastLED 3.1 or later; check github for latest code."
@tedder
tedder / gist:cdbb57bf5bd08b7e6562f1614312f537
Created May 30, 2016 23:29
google cloud vision starter script.py
#!/usr/bin/python
# these should be sufficient to get you started.
# https://cloud.google.com/vision/reference/rest/v1/images/annotate#request-body
# https://cloud.google.com/vision/docs/pricing
# https://cloud.google.com/vision/docs/auth-template/cloud-api-auth#setting_up_your_project
from oauth2client.service_account import ServiceAccountCredentials
from apiclient.discovery import build
import sys
@tedder
tedder / gist:a58c4a8e200f5ee2ac74cfe5b51a1431
Created October 6, 2016 18:14
pizero conn drop debugging
==> /var/log/messages <==
Oct 5 23:03:37 pidoor kernel: [32124.463381] cfg80211: Regulatory domain changed to country: US
Oct 5 23:03:37 pidoor kernel: [32124.463413] cfg80211: DFS Master region: FCC
Oct 5 23:03:37 pidoor kernel: [32124.463424] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Oct 5 23:03:37 pidoor kernel: [32124.463441] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
Oct 5 23:03:37 pidoor kernel: [32124.463457] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 1700 mBm), (N/A)
Oct 5 23:03:37 pidoor kernel: [32124.463471] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
Oct 5 23:03:37 pidoor kernel: [32124.463484] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
Oct 5 23:03:37 pidoor kernel: [32124.463496] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)