Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Accelerating software delivery

Eddie Webbinaro eddiewebb

🚀
Accelerating software delivery
View GitHub Profile
@eddiewebb
eddiewebb / add_metrics.sh
Created Dec 11, 2018
Add Custom Metrics Manually to CircleCI Server
View add_metrics.sh
#!/bin/bash
#
# This script is a workaround to a Replicated issue in which the configuration sections do not appear in the admin console.
# It should be run on the services box from a new/clean directory where a backup will be created.
#
if [ ! -f metrics.txt ];then
echo "Please run this script in a clean directory with a 'metrics.txt' file containing desired telegraf config"
@eddiewebb
eddiewebb / count.sh
Last active Aug 7, 2018
GitHub Contributor count/list by org
View count.sh
GH_TOKEN="1234"
ORG_NAME="some-org"
curl -H "Authorization: token ${GH_TOKEN}" https://api.github.com/orgs/${ORG_NAME}/repos | jq -r '.[].url' > /tmp/repos
rm /tmp/repos 2>/dev/null
while read REPO;do
curl -H "Authorization: token ${GH_TOKEN}" ${REPO}/contributors 2>/dev/null | jq -r '.[].login' >> /tmp/users
done < /tmp/repos
@eddiewebb
eddiewebb / sshActors.sh
Created Jun 28, 2018
Filter CIrcleCI build history by SSH rebuilds
View sshActors.sh
#! /bin/bash
#
# This script pulls recent circleci build history, using jq to filter by ssh rebuilds, and printing the summary
# Requires `jq` and a CIRCLE_TOKEN
#
CCI_PROJECT="orgname/projectname"
@eddiewebb
eddiewebb / tags3.sh
Last active Jun 21, 2018
Tagging S3 Objects by path
View tags3.sh
#! /bin/bash
#
# This file will filter all s3 objects where the key/path contains a specific pattern and apply the provided tag.
# Results are split into X number of backfground processes, each tagging 1000 objects
#
BUCKET_NAME="YOURBUCKET"
function tagObjects {
@eddiewebb
eddiewebb / downloadArtifacts.sh
Last active Jun 15, 2020
Download CircleCI Artifacts with directory structure
View downloadArtifacts.sh
#!/usr/bin/env bash
#
# Download all artitacts for given build, mimicing structure locally.
#
# Batch size is slighly misleading, as it;s only how many URLs to attempt before momentary pause
#
# Can be used on CCI builds with parallelism and will only download the files for matcing index.
#
#
USAGE="$0 username/repo 123 [bitbucket] [batch_size]"
@eddiewebb
eddiewebb / config.yml
Created May 4, 2018
CircleCI Python Cache
View config.yml
workflows:
version: 2
build-deploy:
jobs:
- build
version: 2
jobs:
build:
docker:
@eddiewebb
eddiewebb / TimingLambda.java
Created Mar 19, 2018
Timing Java method calls.
View TimingLambda.java
// This allows you to call methods wrapped in a timer for profilling.
// I used in a scenario where my abstract class delegated back to concrete implementations, and wanted to be aware of duration.
// Because timer runs in a lambda, it doesn't require any special treatment to see/manipulate current context/scope.
public abstract class AbstractClass{
public final loadDependencies(Map<String, Object> map){
//here we call some methods, they could be anywhere.
ChainResultsSummary results = timing("getChainResultsSummary",() -> getChainResultsSummary(map));
ImmutableChain chain = timing("getImmutableChain",() -> getImmutableChain(map));
View keybase.md

Keybase proof

I hereby claim:

  • I am eddiewebb on github.
  • I am edwardawebb (https://keybase.io/edwardawebb) on keybase.
  • I have a public key whose fingerprint is 4762 7E46 83E9 82CC 2591 0D28 01F3 D3D7 0CA9 2044

To claim this, I am signing this object:

You can’t perform that action at this time.