Skip to content

Instantly share code, notes, and snippets.

Padraic Renaghan prenagha

Block or report user

Report or block prenagha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
prenagha /
Last active Oct 31, 2018
Lambda CloudWatch Log Retention Manager
import boto3
import os
def lambda_handler(event, context):
default_region = os.environ.get('AWS_REGION', 'us-east-1')
retain_days = int(os.environ.get('RETAIN_DAYS', '30'))
session = boto3.Session()
client = session.client('ec2', region_name=default_region)
prenagha / log-retain-manager-policy.json
Last active Oct 17, 2018
Set the retention days on any AWS CloudWatch log group that isn't set yet
View log-retain-manager-policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "SetLogRetain",
"Effect": "Allow",
"Action": [
prenagha / DebugEvent.js
Created Oct 16, 2018
Lambda@Edge CloudFront Debugging Sample Records
View DebugEvent.js
'use strict';
* Lambda@Edge to log CloudFront event and context.
* Note: this runs in Lambda@Edge which means it runs in a variety
* of regions, the region closest to the browser making the request.
* So be sure and check other regions if you don't see the logs in
* CloudWatch in the region you normally use.
prenagha / sVim.rc
Last active Oct 2, 2018
sVim Safari Extension settings
View sVim.rc
" sVim Safari Extension settings
let scrollstep = 120
" Neat shortcuts
map "v" goToInput
map "c" lastClosedTab
map "e" quit
map "d" createHint
prenagha / karabiner.json
Created Jun 14, 2017
Karabiner Elements Config for Basic vi-style movements and Hyper Key
View karabiner.json
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
"profiles": [
"complex_modifications": {
"rules": [
prenagha /
Created Apr 27, 2017
Micropub sample post to
CONTENT="Sample Post Here -"
curl --verbose \

Keybase proof

I hereby claim:

  • I am prenagha on github.
  • I am prenagha ( on keybase.
  • I have a public key ASC04lRyBGeCmnZDKGqGfErdoTXJCGmx9XgSGdj5Nive8go

To claim this, I am signing this object:

prenagha / init.lua
Created Sep 30, 2016
Hammerspoon Config File, Hyper Key, Karabiner-Elements
View init.lua
-- hattip
-- hattip
-- A global variable for the sub-key Hyper Mode
k ={}, 'F18')
-- Hyper+key for all the below are setup somewhere
-- The handler already exists, usually in Keyboard Maestro
-- we just have to get the right keystroke sent
prenagha /
Created May 23, 2016
Arq Backup Check
# Use with Arq Backup
# To check backup complete marker files in Amazon AWS S3
# See related script that writes these files
set -e
trap 'notify' INT TERM ERR
prenagha /
Last active Feb 16, 2018
Arq Backup Complete Marker
# Use with Arq Backup
# To write a backup complete marker file to Amazon AWS S3
# Set as backup complete script in Arq settings for the backup destination
# See related script that checks these files
if [ -z "${arg}" ]
You can’t perform that action at this time.