Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@astrikos
astrikos / stale_security_groups.py
Created November 9, 2017 15:52
Script to detect stale AWS security groups
#!/usr/bin/env python
import boto3
import argparse
class StaleSGDetector(object):
"""
Class to hold the logic for detecting AWS security groups that are stale.
"""
def __init__(self, **kwargs):
@pklaus
pklaus / simplenote_backup.py
Last active June 14, 2020 00:51
A Python script for backing up your simplenote notes.
#!/usr/bin/env python
import simplenote
import os, json
from datetime import date, datetime as dt
def main():
import argparse, getpass
parser = argparse.ArgumentParser()
@ttscoff
ttscoff / changelog.rb
Last active January 4, 2025 07:21
Generate release notes from git commit messages
#!/usr/bin/ruby -W1
# frozen_string_literal: true
require 'optparse'
require 'shellwords'
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged
# release where commit messages contain NEW, FIXED, CHANGED, and IMPROVED
@vasansr
vasansr / aws_create_users_ubuntu.sh
Last active April 3, 2025 12:14
AWS User Data Script to create users when launching an Ubuntu server EC2 instance
#!/bin/bash
#
# Initial script to create users when launching an Ubuntu server EC2 instance
#
declare -A USERKEY
#
# Create one entry for every user who needs access. Be sure to change the key to their
@voidfiles
voidfiles / index.json
Created May 19, 2017 22:08
Hugo JSON Feed Template add to layouts/index.json
{
"version": "https://jsonfeed.org/version/1",
"title": {{ .Site.Title | jsonify }},
"home_page_url": {{ .Permalink | jsonify }},
{{ with .OutputFormats.Get "json" -}}
"feed_url": {{ .Permalink | jsonify }},
{{- end }}
{{ if (.Site.Params.author) or (.Site.Params.author_url) -}}
"author": {
{{ if .Site.Params.author -}}
#! /bin/bash
set -euo pipefail
# This script will remove automatic association for all networks not listed in the whitelist
# passed as the first argument. Passwords will NOT be removed from the Keychain.
#
# Alternatively, you can untick "Remember networks" in Network Preferences > Wi-Fi > Advanced,
# but then you won't be able to auto-join networks even temporarily, and you might already
# have a long list to go through.
#
@peccu
peccu / README.org
Last active February 26, 2023 17:46 — forked from codebycliff/ReadingList
AppleScript command for adding entry to safari reading list.

Add to Reading List from Command

Install

Add contents of ReadingList.sh to .bashrc or .zshrc etc.

Usage

atrl URL

Example

atrl http://google.com

@RichardForrester
RichardForrester / init.lua
Last active September 26, 2018 01:06
Karabiner Elements and Hammerspoon on MacOS Sierra
-- ln -s ~/repos/config/init.lua ~/.hammerspoon/init.lua
-- Global variable for the Command Mode
cMode = hs.hotkey.modal.new({}, "F17")
-- Global variable for Delete Mode
dMode = hs.hotkey.modal.new({}, 'F20')
-- Global variable for Select Mode
sMode = hs.hotkey.modal.new({}, 'F19')
@rterbush
rterbush / MockSQS.java
Created October 11, 2016 14:47 — forked from UnquietCode/MockSQS.java
Mock AWS SQS implementation which operates in-memory rather than hitting the real SQS.
package com.studyblue.test.aws;
import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.ResponseMetadata;
import com.amazonaws.regions.Region;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.model.*;
import com.google.common.hash.Hashing;
@ttscoff
ttscoff / init.lua
Last active June 6, 2025 19:31
Hammerspoon config examples for hyper key
-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")
-- Trigger existing hyper key shortcuts
k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end)
-- OR build your own
launch = function(appname)