Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am kylegordon on github.
* I am kylegordon (https://keybase.io/kylegordon) on keybase.
* I have a public key whose fingerprint is 1FC8 7A4B B0A3 CBA9 D8E7 4011 9787 19C2 96EF EE22
To claim this, I am signing this object:
@kylegordon
kylegordon / lcdlogger.cpp
Created October 20, 2012 16:33
lcdlogger
#include <LCDLogger.h>
#include <LiquidCrystal.h>
// Always check the feature is enabled before any code.
#ifdef ENABLE_LCD_OUTPUT
// initialize the library with the numbers of the interface pins
// The arguments are in this order (RS, EN, D4, D5, D6, D7)
LiquidCrystal LCDLogger::lcd(LCD_RS_PIN, LCD_EN_PIN, LCD_D1_PIN, LCD_D2_PIN, LCD_D3_PIN, LCD_D4_PIN);
@kylegordon
kylegordon / gist:3960418
Created October 26, 2012 18:15
wait_change()
void wait_change() {
int on;
unsigned char v;
do {
v = inb(status);
on = !!(v & 0x20);
usleep(1000);
} while (on == laston);
laston = on;
17-03-03 22:09:01 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform openhome
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File "uvloop/future.pyx", line 230, in __iter__ (uvloop/loop.c:110600)
File "uvloop/future.pyx", line 432, in uvloop.loop.BaseTask._fast_wakeup (uvloop/loop.c:113980)
File "uvloop/future.pyx", line 101, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108900)
File "/usr/local/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/components/media_player/openhome.py", line 44, in setup_platform
@kylegordon
kylegordon / sqs output
Created March 30, 2017 13:28
logstash sqs failure
# vim: tw=60 ts=2
input {
sqs {
queue => "linn-core-logging"
region => "eu-west-1"
# Once this is inside AWS, it should be switched using an IAM profile
# Policy detail at https://github.com/logstash-plugins/logstash-input-s3
access_key_id => "foo"
secret_access_key => "bar"
There seems to be an error. Please try again.
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'expiry_date'' in /var/www/html/install/index.php:31 Stack trace: #0 /var/www/html/install/index.php(31): PDOStatement->execute(Array) #1 /var/www/html/install/index.php(108): try_query(Array) #2 {main}
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint' in /var/www/html/install/index.php:31 Stack trace: #0 /var/www/html/install/index.php(31): PDOStatement->execute(Array) #1 /var/www/html/install/index.php(108): try_query(Array) #2 {main}
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint' in /var/www/html/install/index.php:31 Stack trace: #0 /var/www/html/install/index.php(31): PDOStatement->execute(Array) #1 /var/www/html/install/index.php(108): try_query(Array) #2 {main}
exception 'PDOException' with message 'SQLSTATE[HY000]:
filter {
if [sender] == "tcp-adapter" {
mutate {
add_field => {
"test_field" => "%{properties}"
}
}
json {
source => "test_field"
}
[ 150.649908] WARNING: at ../../../../../../kernel/oneplus/msm8974/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c:527 mdss_mdp_cmd_wait4pingpong+0x1d4/0x25c()
[ 150.650074] cmd kickoff timed out (0) ctl=0
[ 150.650148] [<c010b870>] (unwind_backtrace+0x0/0xf4) from [<c016e328>] (warn_slowpath_common+0x50/0x60)
[ 150.650260] [<c016e328>] (warn_slowpath_common+0x50/0x60) from [<c016e394>] (warn_slowpath_fmt+0x30/0x40)
[ 150.650372] [<c016e394>] (warn_slowpath_fmt+0x30/0x40) from [<c0384bd4>] (mdss_mdp_cmd_wait4pingpong+0x1d4/0x25c)
[ 150.650487] [<c0384bd4>] (mdss_mdp_cmd_wait4pingpong+0x1d4/0x25c) from [<c03771cc>] (mdss_mdp_display_commit+0x14c/0x2c4)
[ 150.650601] [<c03771cc>] (mdss_mdp_display_commit+0x14c/0x2c4) from [<c038a004>] (mdss_mdp_overlay_kickoff+0x204/0x554)
[ 150.650720] [<c038a004>] (mdss_mdp_overlay_kickoff+0x204/0x554) from [<c039cdbc>] (__mdss_fb_display_thread+0x9c/0x38c)
[ 150.650834] [<c039cdbc>] (__mdss_fb_display_thread+0x9c/0x38c) from [<c0188300>] (kthread+0x90/0x94)
[ 150.650900
@kylegordon
kylegordon / billingalert.yaml
Created March 29, 2019 13:29
AWS Billing Alert
# aws cloudformation deploy --region us-east-1 --stack-name billing-alerts --template-file billingalert.yaml
Description: "Billing alerts"
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
DevAlarmThreshold:
Description: Development account alarm threshold.
Type: Number
Default: 20
BEGIN MESSAGE.
7iiZYrVfdFaVBWH BWbIsAMHekKh4TH VD5lu5jl7G0binW KuprG10xwL2G1pL
84CTXnUOEU5Pu1g Medc3JpLFj5TCKq 6Xr2MZHgg6SeWi3 IbcXHfZqb8HSsDs
tTbIPcKwtD5ue5F fSup0469ddAgi2m 5j5vTwwAUi69eR6 L1RfRUlBTZNeCy2
y8k7JoSEnecskbM XYNV34Z6NQA2n5K SwDGm7tiSkCT.
END MESSAGE.