Skip to content

Instantly share code, notes, and snippets.

@cmattoon
cmattoon / Actual1
Last active September 24, 2018 16:08
Boat Wiring - Falstad
$ 1 0.000005 10.20027730826997 50 5 50
v 224 96 224 176 0 1 40 5 0 0 0.5
v 224 224 224 304 0 1 40 5 0 0 0.5
w 448 160 448 176 0
w 448 176 448 192 0
w 448 192 448 208 0
s 480 160 560 160 0 1 false
s 480 176 560 176 0 1 false
s 480 208 560 208 0 1 false
s 480 192 560 192 0 1 false
@cmattoon
cmattoon / fabfile.py
Created February 14, 2019 00:48
CVE-2019-5736 - Apply patch with Fabric
#!/usr/bin/env python
import os
from fabric import Connection
# kubectl get nodes | grep ip | cut -d'-' -f2,3,4,5 | cut -d'.' -f1 | sed 's/-/./g' | xargs echo | sed s'/ /",\"/g'
def getConnection(host):
return Connection(host=host,
user='admin',
connect_kwargs={
@cmattoon
cmattoon / Makefile.docker
Last active April 13, 2019 13:29
Makefile Templates
.DEFAULT_GOAL := help
.PHONY:
PROJECT_NAME = foo-bar
PROJECT_NS = cmattoon
GIT_REPO ?= $(PROJECT_NS)/$(PROJECT_NAME)
GIT_URL ?= [email protected]/$(GIT_REPO).git
VCS_REF = $(strip $(shell git describe --tags --dirty --always))
@cmattoon
cmattoon / get_acm_certificate.yml
Created September 10, 2019 14:38
Get ACM Certificate with Ansible
---
- hosts: localhost
tasks:
- name: Get ACM Certificates
shell: aws acm list-certificates --region=us-east-1
register: acm
- name: Set ACM Certificate
set_fact:
acm_arn: "{{ item.CertificateArn }}"
SELECT blocked_locks.pid AS blocked_pid,
blocked_activity.usename AS blocked_user,
blocking_locks.pid AS blocking_pid,
blocking_activity.usename AS blocking_user,
blocked_activity.query AS blocked_statement,
blocking_activity.query AS current_statement_in_blocking_process
FROM pg_catalog.pg_locks blocked_locks
JOIN pg_catalog.pg_stat_activity blocked_activity
ON blocked_activity.pid = blocked_locks.pid
JOIN pg_catalog.pg_locks blocking_locks