Skip to content

Instantly share code, notes, and snippets.

View MattBlack85's full-sized avatar
🦉
owly crap

Mattia Procopio MattBlack85

🦉
owly crap
  • Kraków
View GitHub Profile
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 390.77 (buildmeister@swio-display-x64-rhel04-14) Tue Jul 10 23:19:22 PDT 2018
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen1" 0 0
Screen 1 "Screen0" RightOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
(require ':cffi)
(defpackage :cffi-sock
(:use :common-lisp :cffi))
(in-package :cffi-sock)
(define-foreign-library msocket
(:unix (:or "libc.so.6" "libc.so"))
(t (:default "msocket")))
(require 'usocket)
(defun end-string (string how-many)
(let ((str-length (length string)))
(if (or (< str-length how-many)
(not string))
string
(subseq string (- str-length how-many) str-length))))
provider "aws" {
version = "2.13.0"
region = "eu-west-2"
shared_credentials_file = "/aws/credentials"
profile = "dev"
}
provider "aws" {
version = "2.13.0"
region = "us-east-1"
import logging
import time
from logging.handlers import SocketHandler
logger = logging.getLogger('test')
class BinarySocketHandler(SocketHandler):
def prepare_record(self, record):
return self.format(record).encode()
from aiohttp import web
async def hello(request):
print('HELLO')
return web.json_response({"Hello": "world"})
app = web.Application()
app.add_routes([web.post('/', hello)])
web.run_app(app)
resource "aws_iot_topic_rule" "shadow_rejection_errors" {
name = "shadow_rejected_error"
description = "Add a metric to cloudwatch if any shadow fails update"
enabled = true
sql = "SELECT *, topic(3) as device_id FROM '$aws/things/+/shadow/update/rejected'"
sql_version = "2016-03-23"
cloudwatch_metric {
metric_name = "Rejected"
metric_namespace = "Shadow"
2018-11-05T11:05:00.524+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: -----------------------------------------------------
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: 2018/11/05 11:05:00 [DEBUG] Creating IoT Topic Rule: {
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: RuleName: "shadow_rejected_error",
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: TopicRulePayload: {
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: Actions: [{
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: CloudwatchMetric: {
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: MetricName: "Rejected",
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: MetricNamespace: "Shadow",
2018-11-05T11:05:00.526+0100 [DEBUG] plugin.terraform-provider-aws_v1.29.0_x4: MetricTimestamp: "",
#include <stdio.h>
#include <stddef.h>
void foo(char **p, size_t lol);
void bar(char **p, size_t *lol);
void bar(char **p, size_t *lol) {
char method[] = "GET";
size_t lol_size = 50;
#!/usr/bin/python
#
# The wiring for the LCD is as follows:
# 1 : GND
# 2 : 5V
# 3 : Contrast (0-5V)*
# 4 : RS (Register Select)
# 5 : R/W (Read Write) - GROUND THIS PIN
# 6 : Enable or Strobe
# 7 : Data Bit 0 - NOT USED