Skip to content

Instantly share code, notes, and snippets.

View Brantone's full-sized avatar

Brantone Brantone

  • Canada
View GitHub Profile

Keybase proof

I hereby claim:

  • I am brantone on github.
  • I am brantone (https://keybase.io/brantone) on keybase.
  • I have a public key whose fingerprint is 334B 1FC1 3F05 AB8C 1C61 9DBD 60B1 EBEA 766A 49A8

To claim this, I am signing this object:

@Brantone
Brantone / mac.sh
Created February 1, 2017 08:50
Disable bunch of #$!@ in Sierra
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
@Brantone
Brantone / pass.sh
Created February 9, 2017 00:30 — forked from deanet/pass.sh
Bash Password Manager with OpenSSL
#!/bin/bash
trap ctrl_c INT
function ctrl_c() {
echo "** WARNING HIT CTRL^C MAKE LOSS YOUR pass.enc File **"
}
file="pass.txt"
@Brantone
Brantone / cheftips.txt
Last active March 6, 2017 22:55
Chef Random tips
Commands
--------
Run on nodes
# knife ssh "name:macOS2*" "sudo DEVELOPER_DIR=/Library/Developer/CommandLineTools/ chef-client" -x [user] -P
Data Bags
---------
If not already have secret key:
@Brantone
Brantone / databag_encrypt_file.krb
Created March 4, 2017 00:06
Chef Knife script for encrypting a file into a data bag
#!/usr/bin/knife exec
# Knife exec script to put the contents of a file into a data bag, then encrypt it.
# Care of : https://www.coveros.com/chef-knife-script-for-encrypting-a-file-a-data-bag/
########### USAGE ############
this_file = File.basename(__FILE__)
usage = <<-EOS
#{this_file}: Encrypts and stores the contents of a file into a data bag item. This
is typically used to encrypt and store the contents of a PEM file.
@Brantone
Brantone / visualstudio.rb
Last active May 7, 2018 04:47
Chef VisualStudio install loop
node['agent']['visualstudio']['versions'].each do |vs|
directory "#{Chef::Config[:file_cache_path]}\\visualstudio\\#{vs.version}\\" do
action :create
recursive true
end
remote_file "#{Chef::Config[:file_cache_path]}\\visualstudio\\#{vs.version}\\#{vs.installer}" do
action :create
source "#{node['agent']['software_repo_root']}/microsoft/vs#{vs.version}/#{vs.installer}"
checksum vs.checksum
@Brantone
Brantone / Gemfile
Created May 16, 2018 21:49 — forked from jdennes/Gemfile
Export a list of members from a GitHub organisation
source "https://rubygems.org"
gem "octokit"
import hudson.FilePath
import jenkins.model.Jenkins
import com.cloudbees.hudson.plugins.folder.*
Jenkins jkns = Jenkins.instance
def build_vars = build.buildVariables
def base_folder_name = build_vars['baseFolderName']
def build_proj_file = 'ServerBuild.proj'
def tier = (build_vars['assembliesTier'].toInteger() - 1)
@Brantone
Brantone / gist:cc357a36d6199112a3fa9d80f8588802
Created June 28, 2018 08:20 — forked from evilchili/gist:1848087
invoke a downstream jenkins job with the current job parameters + additions
import hudson.model.*
// extract the version tag from the console log
def version_pattern = ".*\\[\\s*INFO\\s*\\]\\s+VERSION=(.*)\\s*\$"
def matcher = manager.getLogMatcher( version_pattern )
if ( matcher?.matches() ) {
// add the version string to the job summary
def ver = matcher.group(1)
manager.addInfoBadge( "Version: $ver" )
@Brantone
Brantone / git.migrate
Created May 21, 2019 17:42 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.