Skip to content

Instantly share code, notes, and snippets.

View Sophrinix's full-sized avatar

Andrew McElroy Sophrinix

View GitHub Profile
@Sophrinix
Sophrinix / gist:daebed85198d30da56cc9eab95f52da5
Created August 16, 2018 04:01
PostgreSQL COPY FROM PATCH 1745
# test unique violation
# test exclusion constraint violation
# output from unique violation (via ON CONFLICT IGNORE argument)
# output exclusion constraint violation (via ON CONFLICT IGNORE argument) (using \! {shell_command possibly using cat})
# GUC variable not found
test=# CREATE TABLE onek (
test(# unique1 int4,
@Sophrinix
Sophrinix / docker-install-rpi3.md
Created June 13, 2018 16:51 — forked from tyrell/docker-install-rpi3.md
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/

@Sophrinix
Sophrinix / woodpecker.grc
Created October 20, 2017 05:58 — forked from daniestevez/woodpecker.grc
OTH radar analysis
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.10'?>
<flow_graph>
<timestamp>Thu Dec 8 21:11:20 2016</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@Sophrinix
Sophrinix / KongJwt.md
Last active September 12, 2017 20:48 — forked from martinheld/KongJwt.md
Short example to use JWT with Kong

JWT Kong Example

  • Get and Start Kong and Co
git clone git@github.com:Mashape/docker-kong.git
cd docker-kong/compose
docker-compose up
  • Create Kong API Route
@Sophrinix
Sophrinix / telnet-imap
Created August 17, 2017 19:56 — forked from gustavohenrique/telnet-imap
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login user@gmail.com passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full
@Sophrinix
Sophrinix / telnet-imap
Created August 17, 2017 19:56 — forked from gustavohenrique/telnet-imap
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login user@gmail.com passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full
@Sophrinix
Sophrinix / ti.dynamiclib.js
Created March 20, 2017 16:57 — forked from hansemannn/ti.dynamiclib.js
Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop
/**
* Ti.DynamicLib
* @abstract Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop.
* @version 1.1.0
*
* Install:
* 1) Search and replace '../../src/<YourFramework>.framework' with your framework location.
The path is relative to the `build/iphone` directory.
* 2a) For classic modules:
* - Add 'LD_RUNPATH_SEARCH_PATHS=$(inherited) "@executable_path/Frameworks" $(FRAMEWORK_SEARCH_PATHS)'
@Sophrinix
Sophrinix / imap-capability.md
Created March 15, 2017 05:14 — forked from emersion/imap-capability.md
Common IMAP servers CAPABILITY responses

FastMail

* CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE AUTH=OTP SASL-IR
* CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH

Gandi.net

@Sophrinix
Sophrinix / overlap_cidr.py
Created March 10, 2017 01:03 — forked from zzzeek/overlap_cidr.py
detect overlapping CIDR ranges in SQL, prevent duplicate ranges using triggers
from sqlalchemy import event
from sqlalchemy import DDL
def mysql_cidr_overlap(engine, metadata):
@event.listens_for(metadata, "after_create")
def _create_mysql_proc(target, connection, **kw):
if connection.engine.name != 'mysql':
return
if connection.scalar(
@Sophrinix
Sophrinix / overlap_cidr.py
Created March 10, 2017 01:03 — forked from zzzeek/overlap_cidr.py
detect overlapping CIDR ranges in SQL, prevent duplicate ranges using triggers
from sqlalchemy import event
from sqlalchemy import DDL
def mysql_cidr_overlap(engine, metadata):
@event.listens_for(metadata, "after_create")
def _create_mysql_proc(target, connection, **kw):
if connection.engine.name != 'mysql':
return
if connection.scalar(