Skip to content

Instantly share code, notes, and snippets.

{
"Statement" : [
{
"Effect" : "Deny",
"Action" : "Update:*",
"Principal": "*",
"Resource" : "*",
"Condition" : {
"StringEquals" : {
"ResourceType" : ["AWS::RDS::DBInstance"]
@tedder
tedder / gist:7181a73ca05736d0b5da0bd6c94f2094
Created March 9, 2017 20:25
motion.conf relevant settings
width 1280
height 720
framerate 15
minimum_frame_time 0
netcam_url rtsp://192.168.0.31:554/live/ch0
netcam_keepalive on
netcam_tolerant_check off
auto_brightness off
brightness 0
contrast 0
@tedder
tedder / gist:b6af9b01fd422450fc3dea37dd982fd4
Created January 14, 2017 04:40
duplicity b2backend progress patch
$ diff b2backend.py b2backend-changes.py
30c30
< from duplicity import log
---
> from duplicity import log, progress
116a117,119
> file_size = os.path.getsize(source_path.name)
> progress.report_transfer(0, file_size)
>
122c125

I've left some instances out. These are ones I tend to use. This is also only for us-east-1. Feel free to add rows in the comments.

size nov 2016 pricing dec 2016 pricing pct savings monthly savings
t2.nano 0.0065 0.0059 9.23% $0.432
t2.micro 0.013 0.012 7.69% $0.720
t2.small 0.026 0.023 11.54% $2.160
t2.medium 0.052 0.047 9.62% $3.600
t2.large 0.104 0.094 9.62% $7.200
m4.large 0.12 0.108 10.00% $8.640
@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)
@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 / 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."
// 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
#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;
@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'"