Skip to content

Instantly share code, notes, and snippets.

Avatar

Brantone Brantone

  • Canada
View GitHub Profile
@Brantone
Brantone / upload.sh
Created Dec 11, 2020 — forked from ouchadam/upload.sh
Upload APK to appcenter app=my-cool-app owner=owner-in-appcenter file=path/to/file token=1234-api-token destination_name=group-to-apply
View upload.sh
#!/bin/bash
set -e
CONFIG=$@
for line in $CONFIG; do
eval "$line"
done
AUTH="X-API-Token: $token"
CONTENT_TYPE=application/vnd.android.package-archive
@Brantone
Brantone / git.migrate
Created May 21, 2019 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
View git.migrate
#!/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.
@Brantone
Brantone / gist:cc357a36d6199112a3fa9d80f8588802
Created Jun 28, 2018 — forked from evilchili/gist:1848087
invoke a downstream jenkins job with the current job parameters + additions
View gist:cc357a36d6199112a3fa9d80f8588802
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" )
View create-folders.groovy
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 / Gemfile
Created May 16, 2018 — forked from jdennes/Gemfile
Export a list of members from a GitHub organisation
View Gemfile
source "https://rubygems.org"
gem "octokit"
@Brantone
Brantone / visualstudio.rb
Last active May 7, 2018
Chef VisualStudio install loop
View visualstudio.rb
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 / databag_encrypt_file.krb
Created Mar 4, 2017
Chef Knife script for encrypting a file into a data bag
View databag_encrypt_file.krb
#!/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 / cheftips.txt
Last active Mar 6, 2017
Chef Random tips
View cheftips.txt
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 / pass.sh
Created Feb 9, 2017 — forked from deanet/pass.sh
Bash Password Manager with OpenSSL
View pass.sh
#!/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 / mac.sh
Created Feb 1, 2017 — forked from pwnsdx/disable.sh
Disable bunch of #$!@ in Sierra
View mac.sh
#!/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