Skip to content

Instantly share code, notes, and snippets.

View deriamis's full-sized avatar

Ryan Egesdahl deriamis

View GitHub Profile
@deriamis
deriamis / keybase.md
Last active September 15, 2023 01:36
Keybase Proof

Keybase proof

I hereby claim:

  • I am deriamis on github.
  • I am deriamis (https://keybase.io/deriamis) on keybase.
  • I have a public key ASBGWFFRLrc01YFDCnGRpPeLfwaSyziCC2hfWwCajCwR7Qo

To claim this, I am signing this object:

@deriamis
deriamis / openpgp.md
Created September 9, 2023 02:07
Keyoxide Proof

openpgp4fpr:053bad760b03f08c1ae9d8b5d4890255dbe5b65d

@deriamis
deriamis / cloudfront_auto_invalidator.py
Last active April 19, 2020 00:19
A simple AWS Lambda script which automatically invalidates URLS in a CloudFront distribution based on files uploaded to its associated S3 bucket. To use it, you need to create a DynamoDB table named {bucket}-change-tracker with two String columns named "request_path" and "eTag" to contain tracked changes.
import boto3
import json
import urllib
import time
cloudfront_client = boto3.client('cloudfront')
def get_change_tracker(bucket):
tracker = None
try:
@deriamis
deriamis / lambda_function.py
Created May 12, 2019 08:18
CloudFront auto-invalidator with change tracking (to make it cheaper)
import boto3
import json
import urllib
import time
cloudfront_client = boto3.client('cloudfront')
def get_change_tracker(bucket):
tracker = None
try:

Keybase proof

I hereby claim:

  • I am deriamis on github.
  • I am deriamis (https://keybase.io/deriamis) on keybase.
  • I have a public key ASC3gs2J0_XvYvHdG7HMSvIC0I32bQfvYgeCeUUGuf0Idwo

To claim this, I am signing this object:

@deriamis
deriamis / style-guide.c
Last active April 23, 2017 03:45
C Style Guide
// Sample file demonstrating my C coding style.
//
// Based on:
// https://gist.github.com/davidzchen/9187878
//
// General rules:
// - Indents are four spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Comments can be // or /* but // is most commonly used.
// - File names should be lower_case.c or lower-case.c
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "terminus:size=12" };
static const char dmenufont[] = "terminus:size=12";
static const char col_gray1[] = "#002b36";
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char font[] = "Terminus:pixelsize=12:antialias=true:autohint=true";
static int borderpx = 2;
#define histsize 2000
/* See LICENSE file for copyright and license details. */
#define NUMCOLORS 17
/* appearance */
static const char *fonts[] = {
"terminus:size=12"
};
static const char dmenufont[] = "terminus:size=12";
static const char normbordercolor[] = "#002b36";
static const char selbgcolor[] = "#002b36";
@deriamis
deriamis / nonacs-install.sh
Last active November 18, 2016 05:09
Install an ACS look-alike using freely available software!
#!/bin/bash
# This script assumes a pre-installed Debian testing release, or at least one that
# has systemd 228 or newer installed. There should be no customizations to the server.
# We make some assumptions about static IP addresses and such. Make sure you read over
# this script to ensure it sets up something that will work on your network.
# An NTP server is set up with some good defaults for operating as a time source.
# The TACACS+ and RADIUS daemons are left unconfigured, as every network is different.