Skip to content

Instantly share code, notes, and snippets.

@shaneog
shaneog / fb-ad-clean.js
Last active October 30, 2023 20:42
Clean Facebook Ad Preferences
// This script will remove all Interests and Advertisers from your Facebook profile
//
// Instructions
//
// Go to: https://www.facebook.com/ads/preferences/
//
// Open the browser console
//
// Paste the following code into the console and execute it
@shaneog
shaneog / stdlib.sh
Created January 18, 2023 01:49 — forked from anonymous/stdlib.sh
aws_ecr_curl() {
login_cmd=$(aws ecr get-login)
username=$(echo "$login_cmd" | cut -d " " -f 4)
password=$(echo "$login_cmd" | cut -d " " -f 6)
endpoint=$(echo "$login_cmd" | cut -d " " -f 9)
args=("$@")
args_length=${#args[@]}
args_last=${args[$args_length-1]}
unset 'args[${args_length}-1]'
@shaneog
shaneog / hostname.sh
Created July 13, 2012 16:06
Change Ubuntu hostname on startup based on vCloud Director machine name
#!/bin/bash
### BEGIN INIT INFO
# Provides: hostname
# Required-Start:
# Required-Stop:
# Should-Start: glibc
# X-Start-Before: networking
# Default-Start: S
# Default-Stop:
# Short-Description: Sets the hostname based on the vCloud Director OVF details
@shaneog
shaneog / setup.sh
Created March 20, 2018 21:39
GCE install for Buildkite Agent v3 (Beta)
#!/usr/bin/env bash
set -eo pipefail
DATE=$(date +%Y%m%d-%H%M%S)
GROUP_NAME="buildkite-agent"
TEMPLATE_NAME="${GROUP_NAME}-${DATE}"
# Builder Group
gcloud compute instance-templates create "${TEMPLATE_NAME}-builder" \
@shaneog
shaneog / pre-commit
Created October 10, 2014 22:57
Git pre-commit hook to prevent commits to master branch
#!/bin/sh
# Check to see if we are on master branch. Stop accidental commits
if [ $(git symbolic-ref HEAD 2>/dev/null) == "refs/heads/master" ]
then
echo "Cannot commit to master branch"
exit 1
fi
exit 0
@shaneog
shaneog / update_acl.rb
Created August 30, 2011 16:20
Capifony Task to Set ACLs on Symfony2 app/cache and app/logs directories as per http://symfony.com/doc/current/book/installation.html
# Change ACL on the app/logs and app/cache directories
after 'deploy', 'deploy:update_acl'
# This is a custom task to set the ACL on the app/logs and app/cache directories
namespace :deploy do
task :update_acl, :roles => :app do
shared_dirs = [
app_path + "/logs",
@shaneog
shaneog / nginx.yaml
Created May 23, 2017 21:44 — forked from mikejk8s/nginx.yaml
full nginx ingess + ssl
apiVersion: v1
kind: Service
metadata:
name: nginx-ingress
spec:
loadBalancerIP: xxxxxxx
type: LoadBalancer
ports:
# - port: 80
# name: http
#!/usr/bin/python
# encoding: utf-8
# Based off the script from https://gist.github.com/Paaskehare/3949299
# @author: Ash Ramesh (27/10/2016)
import cookielib
import urllib
import urllib2
import re
@shaneog
shaneog / postmortem.md
Created October 10, 2016 13:20 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@shaneog
shaneog / strap.sh
Last active September 22, 2016 17:24
My custom strap.sh file
#!/bin/bash
#/ Usage: bin/strap.sh [--debug]
#/ Install development dependencies on Mac OS X.
set -e
# Keep sudo timestamp updated while Strap is running.
if [ "$1" = "--sudo-wait" ]; then
while true; do
mkdir -p "/var/db/sudo/$SUDO_USER"
touch "/var/db/sudo/$SUDO_USER"