Skip to content

Instantly share code, notes, and snippets.

View bhamilton's full-sized avatar

Branden Hamilton bhamilton

  • Pantheon
  • Columbus, OH
View GitHub Profile
#!/bin/bash
function is_active() {
local s
s=$(echo "$BTOOL_INFO" | grep Nginx | awk -F":" '{print $2}' | xargs)
if [ -z "${s}" ] ; then
return 1
fi
@bhamilton
bhamilton / global-protect.sh
Created April 13, 2020 15:32 — forked from kaleksandrov/global-protect.sh
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
@bhamilton
bhamilton / README.md
Created December 20, 2017 17:06 — forked from mllrjb/README.md
Jenkins init.groovy.d role-based authorization strategy

Usage

Set a system environment variable AUTHZ_JSON_URL that points to a JSON file with the following structure:

{
  "admins": [
    "groupA", 
    "userA"
 ],
@bhamilton
bhamilton / JenkinsFile1
Created August 29, 2017 22:02 — forked from ericlong/JenkinsFile1
Let's Build a Jenkins Pipeline
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Hello from Build'
}
}
stage('Test') {
steps {
@bhamilton
bhamilton / .wakeup
Created August 14, 2017 13:49 — forked from ralph089/.wakeup
Restarts Bluetooth Module on Mac OS X El Capitan. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See README.md). I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
#!/bin/bash
#
# Restart Bluetooth Module on Mac OS X
#
# Requires Blueutil to be installed: http://brewformulas.org/blueutil
BT="/usr/local/bin/blueutil"
log() {
echo "$@"
@bhamilton
bhamilton / README.markdown
Created June 9, 2017 16:53 — forked from larrycai/README.markdown
check the plugin usage in jenkins
@bhamilton
bhamilton / puppet-check.sh
Created February 14, 2017 21:54 — forked from bpholt/puppet-check.sh
Puppet Module Syntax Check, Lint, Run Tests, and ERB Syntax Check. There is almost certainly a better way to do this.
#!/bin/bash
# Run from the base directory of your Puppet module
echo ===================
echo Parser Validation
echo ===================
find . -name "*.pp" | xargs -n 1 -t puppet parser validate
echo ===================
echo Linting
@bhamilton
bhamilton / autopart.sh
Created February 7, 2017 23:29 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
@bhamilton
bhamilton / seed_derivatives.drush.inc
Created July 6, 2016 21:24 — forked from typhonius/seed_derivatives.drush.inc
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
<?php
/**
* Implements hook_drush_command().
*/
function seed_derivatives_drush_command() {
$items = array();
$items['seed_derivatives'] = array(
'description' => "Create image derivatives",
@bhamilton
bhamilton / PopupDictionary.php
Created May 27, 2016 00:39 — forked from blazarecki/PopupDictionary.php
Alert, confirm and prompt with mink
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <[email protected]>
*/
trait PopupDictionary