Skip to content

Instantly share code, notes, and snippets.

@peterc
peterc / pg_available_extensions.txt
Created February 14, 2019 18:40
Which Postgres extensions are available on DigitalOcean's new managed PostgreSQL service?
defaultdb=> SELECT * FROM pg_available_extensions;
name | default_version | installed_version | comment
------------------------------+-----------------+-------------------+---------------------------------------------------------------------------------------------------------------------
aiven_extras | 1.0.2 | | aiven_extras
plpgsql | 1.0 | 1.0 | PL/pgSQL procedural language
btree_gist | 1.5 | | support for indexing common datatypes in GiST
tcn | 1.0 | | Triggered change notifications
seg | 1.3 | | data type for representing line segments or floating-point intervals
pgrowlocks | 1.2 |
@cpuguy83
cpuguy83 / pull.go
Last active December 9, 2021 06:18
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/images"
@jhertz
jhertz / papers.md
Created July 30, 2018 03:16
Security Papers I Like

In absolutely no order

@fstanis
fstanis / upspin-drive-guide.md
Last active March 29, 2021 21:06
Upspin server backed by Google Drive on a Raspberry Pi

Set up an Upspin server backed by Google Drive

Overview

The purpose of this document is to explain how to deploy an Upspin server on a Debian or Ubuntu based machine - which can be a Raspberry Pi - and, optionally, use Google Drive to back the data.

Effectively, this will give you all the nifty advantages Upspin gives you in terms of file sharing without requiring a costly server.

Requirements

@metaskills
metaskills / sam-validate.rb
Created December 28, 2017 00:26
Parse AWS SAM YAML Templates & Validate JSON Schema
#!/usr/bin/env ruby
require 'pp'
require 'json'
require 'yaml'
require 'open-uri'
require 'json-schema'
SCHEMA = begin
file = open('https://raw.githubusercontent.com/awslabs/goformation/master/schema/sam.schema.json')
@acolyer
acolyer / jessfraz.md
Created November 19, 2017 13:39
Containers, operating systems and other fun things from The Morning Paper
@tallclair
tallclair / restricted-psp.yaml
Last active April 16, 2024 07:46
Restricted PodSecurityPolicy
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: restricted
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
@aelsabbahy
aelsabbahy / iamlookup
Last active October 22, 2019 01:57
Simple script to lookup IAM resource conditions
#!/bin/bash
set -e
REPO_DIR=~/.iam_lookup/complete-aws-iam-reference
REPO_URL=https://github.com/widdix/complete-aws-iam-reference
if [[ $1 == "update" ]];then
if [[ -e $REPO_DIR ]];then
(cd "$REPO_DIR" && git pull)
else
@mthenw
mthenw / gist:fe8c0b24876c3df3a258635617e826b8
Created September 22, 2017 08:11
systemd mounting and formatting
systemd:
units:
- name: format-ebs.service
command: start
contents: |
[Unit]
Description=Formats EBS /dev/xvdb volume
After=dev-xvdb.device
Requires=dev-xvdb.device
[Service]
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL