Skip to content

Instantly share code, notes, and snippets.

View sammcj's full-sized avatar
🦃

Sam sammcj

🦃
View GitHub Profile
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
#!/usr/bin/python
import argparse
import sqlite3 as lite
import os
def _open_db(db):
try:
con = lite.connect(db)
cur = con.cursor()
#################################################################################
# start and stop the vpn from the command line from now on with these two commands
# or rename the aliases as you see fit.
#################################################################################
alias startvpn="sudo launchctl load -w /Library/LaunchDaemons/net.juniper.AccessService.plist; open -a '/Applications/Junos Pulse.app/Contents/Plugins/JamUI/PulseTray.app/Contents/MacOS/PulseTray'"
alias quitvpn="osascript -e 'tell application \"PulseTray.app\" to quit';sudo launchctl unload -w /Library/LaunchDaemons/net.juniper.AccessService.plist"
@sammcj
sammcj / openconnect.md
Last active September 22, 2015 07:55 — forked from moklett/openconnect.md
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@sammcj
sammcj / pg_change_schema_owner.sh
Created March 31, 2016 00:58 — forked from bspkrs/pg_change_schema_owner.sh
Changes the owner on all tables, sequences, views, and functions in a PostgreSQL database with support for identifiers with whitespace and non-public schemas.
#!/bin/bash -x
usage()
{
cat << EOF
usage: $0 options
This script sets ownership for all tables, sequences, views, and functions for a given schema.
Run this script as your postgres OS user.
$ mco federation trace dev1-0.choria
Received response from dev1-0.choria in 24ms
Reported Route:
client.choria
nats1.fed
nats3.fed
fb builder:1
nats2.choria
nats1.choria
@sammcj
sammcj / postmortem.md
Created October 17, 2017 01: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

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@sammcj
sammcj / glustertop.py
Created March 14, 2019 23:06 — forked from fpytloun/glustertop.py
Real time GlusterFS top-like monitoring
#!/usr/bin/env python
"""
Display gluster traffic
This tool uses gluster profiling feature, parsing cumulative statistics.
To understand correctly the results, you have to divide overall write statistics with number of replicas.
Also striped volumes needs to be taken in mind - overall statistics just print sum of all bricks
read/written bytes.
@sammcj
sammcj / Makefile
Created January 15, 2020 02:04 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)