Skip to content

Instantly share code, notes, and snippets.

View robertwe's full-sized avatar
💭
https://github.com/kelseyhightower/kubernetes-the-hard-way

Robert W robertwe

💭
https://github.com/kelseyhightower/kubernetes-the-hard-way
View GitHub Profile
@robertwe
robertwe / cypress-partial.js
Created January 26, 2022 16:40 — forked from hosuaby/cypress-partial.js
Primitive load-balancer to run Cypress specs in parallel on CI without recording
/**
* Primitive load-balancer to split Cypress specs across multiple runners. This script assumes that
* all your specs are in the folder '<project root>/cypress/integration'. It uses the number of
* tests per spec file as sole criteria to split specs between runners.
*
* This script accepts two arguments: the total number of runners and the index (starting from 0) of
* the current runner. Example:
* $ node cypress-partial.js 5 2
* This command asks for specs to give to the third runner of five runners.
* The output of the script is a coma-separated list of specs that can be given to Cypress. Example:
@robertwe
robertwe / jenkins-decrypt.groovy
Created October 27, 2020 18:22 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@robertwe
robertwe / gist:a1d1db70a9da37eeff40c0cd15fb21c0
Created December 16, 2017 02:21 — forked from anildigital/gist:862675ec1b7bccabc311
Remove dangling docker images
docker rmi $(docker images -q -f dangling=true)
@robertwe
robertwe / values_pointers.go
Created October 10, 2017 23:51 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@robertwe
robertwe / Makefile
Created August 4, 2017 04:11 — forked from pgporada/Makefile
Terraform Makefile
.ONESHELL:
.PHONEY: help set-env init update plan plan-destroy show graph apply output taint
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
set-env:
@if [ -z $(ENVIRONMENT) ]; then\
echo "ENVIRONMENT was not set"; exit 10;\
fi
@robertwe
robertwe / jenkins-job-dsl.groovy
Created May 4, 2016 19:23 — forked from stuartstevenson/jenkins-job-dsl.groovy
Jenkins job dsl with distributed job config files. The seed.groovy file scans stash repo branches for jenkins-job-dsl.groovy files and runs them centrally.
Closure job = {
// Job Name
name "${stashProjectKey}-${projectName}-${branchSimpleName}"
// Where should jenkins run the job
label ('master')
// Where should Jenkins get the source code from
scm {
git {
@robertwe
robertwe / 0_reuse_code.js
Created April 26, 2016 08:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static

Objective-C on Linux

Just run:

curl -ks https://gist.github.com/nicerobot/5652802/raw/install.sh | bash -
@robertwe
robertwe / git selective merge
Created May 29, 2012 09:55 — forked from katylava/git-selective-merge.md
git selective merge
Example: You have a branch 'refactor' that is quite different from master. You can't merge all of the
commits, or even every hunk in any single commit or master will break, but you have made a lot of
improvements there that you would like to bring over to master.
# on master
> git co -b temp
# on temp
> git merge --no-commit --no-ff refactor