Skip to content

Instantly share code, notes, and snippets.

View guyc's full-sized avatar

Guy Carpenter guyc

  • Clearwater Software
  • Australia
View GitHub Profile
#!/usr/bin/env bash
# When eval'd, the output from script will export the AWS_ACCESS_KEY_ID and
# AWS_SECRET_ACCESS_KEY credentials from the a specific profile in
# ~/.aws/credentials.
#
# Usage:
#
# export-aws-credentials [PROFILE]
#
@guyc
guyc / Forgiveness
Last active August 29, 2015 14:12
This is a Groovy script for Jenkins that will change the first failure to a success status, subsequent failures will be reported as failures. We use this to shut up spurious failure notifications for intermittent failures while we get some false alarms from our Sahi monitoring system ironed out.
Boolean failed = manager.getResult() != "SUCCESS";
def file = new File(manager.build.getWorkspace().getRemote() + '/FailedBuildsCount.txt');
def count = 0;
if (failed) {
if (!file.exists()) {
file.createNewFile();
} else {
FileReader reader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(reader);
@jedi4ever
jedi4ever / upload-to-appstore.sh
Created August 18, 2014 12:13
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@bnyeggen
bnyeggen / upgradablelock.go
Last active July 25, 2019 03:31
Upgradable read -> write locks in Go
package main
import (
"fmt"
"runtime"
"sync"
)
type UpgradableLock struct {
uglMutex sync.RWMutex