Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
while getopts ":a:r:p" opt; do
case ${opt} in
a )
account=$OPTARG
;;
r )
rolename=$OPTARG
@libertyy
libertyy / git-cleanup-repo
Last active December 9, 2020 23:33 — forked from robmiller/git-cleanup-repo
A script for cleaning up Git repositories; it deletes branches that are fully merged into `origin/master`, prunes obsolete remote tracking branches, and as an added bonus will replicate these changes on the remote.
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <rob@bigfish.co.uk>
# Adapted from the original by Yorick Sijsling
CLEANUP_REMOTE=${CLEANUP_REMOTE:-'no'}
git checkout master &> /dev/null
import boto3
import base64
import time
import csv
client = boto3.client('iam')
### Credentials Report
response = client.generate_credential_report()
while (response['State'] != 'COMPLETE'):
time.sleep(1)
@libertyy
libertyy / .bash_profile
Last active November 29, 2016 22:12 — forked from ahawthorne/.bash_profile
OSX ssh-agent forwarding -> .bash_profile
#####################
# ssh-agent stuff #
#####################
# get the ssh agent started
SSH_ENV="$HOME/.ssh/environment"
KEY_LIST="~/.ssh/id_rsa ~/.ssh/first.lastnameJan2016.pem"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
@libertyy
libertyy / gist:f8053383b7e0f9e23bd6
Last active August 29, 2015 14:19
sidekiq_collectd.rb example
require 'sidekiq/api'
require 'collectd'
def get_metrics(sidekiq_stats)
metrics = Hash.new()
[:enqueued, :failed, :processed, :scheduled_size, :retry_size].each do |name|
metrics[name] = sidekiq_stats.send(name)
end
metrics
end
{
"title": "Asterisk Dashboard",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
@libertyy
libertyy / kibana-webserver
Created February 24, 2015 01:29
apache dashboard
{
"title": "Apache logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
@libertyy
libertyy / gist:0508bdee4c995e80dbbd
Last active August 29, 2015 14:08
Manage credentials through pillar_roots
master_config
------
file_roots:
base:
- /srv/salt
pillar_roots:
base:
- /srv/pillar
local_dev:
- /srv/local_dev/pillar/
FROM ubuntu:14.04
MAINTAINER Liberty Young "liberty@flywheelnetworks.com"
RUN apt-get update -y
RUN apt-get install -y git-core curl emacs vim
RUN apt-get install -y build-essential curl libxslt-dev libxml2-dev
# Default RVM install
#Set env just in case
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin