Skip to content

Instantly share code, notes, and snippets.

View elops's full-sized avatar

Hrvoje Spoljar elops

  • Koh Phangan, Thailand
View GitHub Profile
@elops
elops / Jenkinsfile
Created April 24, 2019 10:19 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage c…
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8-alpine
@elops
elops / keybase.md
Created April 6, 2015 14:54
keybase.io stuff

Keybase proof

I hereby claim:

  • I am elops on github.
  • I am hrvojespoljar (https://keybase.io/hrvojespoljar) on keybase.
  • I have a public key whose fingerprint is 5E0C 008F 3C9A 9710 059A E8AC 14FB D153 7C32 D33E

To claim this, I am signing this object:

@elops
elops / builder.rb
Created July 17, 2014 13:53
Builder example
#!/usr/bin/env ruby
class Bar
attr_reader :name
def s_name(string)
@name = string
end
def self.make(&baz)
@elops
elops / gist:7b98457b355a20cc3c64
Last active August 29, 2015 14:02
check ip?
#!/usr/bin/env ruby
require 'ipaddr'
def valid_cidr?(spec)
return true if spec.nil?
IPAddr.new(spec)
true
rescue IPAddr::Error
false
@elops
elops / my_rewrite_resolv_conf.sh
Last active August 29, 2015 14:01
my_rewrite_resolv_conf.sh
#!/bin/bash
# rewrite resolv.conf
# chkconfig: 2345 98 98
# description: rewrites resolv.conf on boot
graceful_exit() {
local rc=$?
trap - EXIT
case "$rc" in
0) echo 'OK'
#!/bin/bash
VERBOSE=0
_debug() {
if [ "$VERBOSE" -le 0 -a "$#" -ge 1 ]; then
_verbose "${@/#/DEBUG: }"
fi
}