Skip to content

Instantly share code, notes, and snippets.

View welshstew's full-sized avatar
😎
henlo world

Stuart Winchester welshstew

😎
henlo world
View GitHub Profile
@welshstew
welshstew / gist:9df7f1d1baaa8340b625
Created March 19, 2015 04:19
bash one-liner to find items from the names in a file
while read line; do find . -name "$line" | xargs ls -l; done < items.txt
@welshstew
welshstew / XmlDocumentBuilder.groovy
Last active August 29, 2015 14:18
Builds a skeleton for building an XML Document with groovy
import groovy.util.slurpersupport.NodeChild
/**
* Generates the groovy script to create the xml document builder markup skeleton based
* on an existing xml input
* Created by swinchester on 31/08/2014.
*/
void nodeTraverser(node, parent, sb, root, markupBuilderName){
printNode(node, sb, root, markupBuilderName)
@welshstew
welshstew / gist:6de621232f0a5f842b7f
Created April 17, 2015 03:08
docker remove all "<none>" untagged images
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi
@welshstew
welshstew / csv-linefeeds.groovy
Created August 6, 2015 07:11
print out columns which have linefeeds
import groovy.io.FileType
import static com.xlson.groovycsv.CsvParser.parseCsv
/**
* Created by swinchester on 6/08/15.
*/
def dir = new File('/Users/swinchester/')
dir.eachFileRecurse (FileType.FILES) { file ->
@welshstew
welshstew / snippet.txt
Created February 3, 2016 16:29
docker debug tip : use bash in docker containers that fail to start
#if the docker images starts but immediately fails, a good way of exploring the file system after the failure
# is to commit the containerId as a temp image, then run the container and explore...!
docker commit f7391c7a2b97 temporary_image
docker run -it temporary_image /bin/bash
@welshstew
welshstew / snippet.txt
Created February 3, 2016 18:36
openshift tips for myself
# get openshift templates for pre canned stuffs
oc get template -n openshift
# get the template in json format - so you can build a deployment config from the template
oc get template eap64-amq-s2i -n openshift -o json
@welshstew
welshstew / ose-cdk-default.txt
Created February 9, 2016 14:28
ose-cdk-default.txt
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5444017f9eb7 openshift3/ose-haproxy-router:v3.1.0.4 "/usr/bin/openshift-r" 3 hours ago Up 3 hours k8s_router.8de04651_router-1-aaet6_default_1c1d3c51-cd89-11e5-9501-52540013d96e_084ad569
744114c68aaf prom/haproxy-exporter:latest "/bin/go-run -haproxy" 3 hours ago Up 3 hours k8s_metrics-exporter.f87bcbe2_router-1-aaet6_default_1c1d3c51-cd89-11e5-9501-52540013d96e_f82a1198
71d4b820236f openshift3/ose-docker-registry:v3.1.0.4 "/bin/sh -c 'REGISTRY" 3 hours ago Up 3 hours k8s_registry.2fdf0edf_docker-registry-1-7cqo6_default_204c6355-cd89-11e5-9501-52540013d96e_fdd6b654
edc3153a2d52 openshift3/ose-pod:v3.1.0.4 "/pod" 3 hours ago Up 3 hours
@welshstew
welshstew / startup docker ose.txt
Created February 9, 2016 16:20
startup docker ose
docker run --name openshift --privileged --net=host --pid=host -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v /var/lib/docker:/var/lib/docker:rw -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes:z -v /var/lib/origin/openshift.local.config:/var/lib/origin/openshift.local.config:z -v /var/lib/origin/openshift.local.etcd:/var/lib/origin/openshift.local.etcd:z registry.access.redhat.com/openshift3/ose start --master-config=/var/lib/origin/openshift.local.config/master/master-config.yaml --node-config=/var/lib/origin/openshift.local.config/node-single.ose.bp-vagrant.local/node-config.yaml --latest-images
@welshstew
welshstew / docker-downgrade-osx.txt
Created February 10, 2016 12:01
Getting your osx to talk to vagrant running in a VM
#downgrade docker on osx so the client can talk to openshift enterprise 1.8.1 docker
# allows deployments via mvn -Pf8-deploy
brew update
brew tap homebrew/boneyard
brew tap homebrew/homebrew-versions
brew install homebrew/versions/docker
brew unlink docker
brew install homebrew/versions/docker171
@welshstew
welshstew / my-broker-standard-amq-rc.yaml
Created March 11, 2016 16:45
simple-amq-replication-controller.yaml
apiVersion: v1
kind: ReplicationController
metadata:
generation: 1
labels:
cluster-id: my-broker
component: my-broker
group: my-broker
project: my-broker-1
provider: stu