Skip to content

Instantly share code, notes, and snippets.

View chrisbsmith's full-sized avatar

Chris Smith chrisbsmith

View GitHub Profile
@welshstew
welshstew / oc-patch-new-envvars.groovy
Created September 25, 2016 08:27
simple bit of groovy to show how to execute an "oc patch"
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
//Simple example to show patching a container with new environment variables - need to have oc login before... :)
def dcToUpdate = "kie-app-postgresql"
def newEnvVars = [[name:"GROOVY_ROCKS", value: "true"], [name: "LOVE_OPENSHIFT", value: "of course"]]
def currentDC = new JsonSlurper().parseText(["oc", "get" , "dc" , dcToUpdate ,"-o" ,"json"].execute().text)
def containers = currentDC.spec.template.spec.containers
//add new env vars to container definition
@Khoulaiz
Khoulaiz / gist:41b387883a208d6e914b
Last active May 3, 2024 15:57
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23