Skip to content

Instantly share code, notes, and snippets.

@rgielen
rgielen / gitprompt.sh
Created November 16, 2023 16:39
Ubuntu style git-enhanced prompt
parse_git_dirty() {
[[ $(git status --porcelain 2> /dev/null) ]] && echo "*"
}
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ (\1$(parse_git_dirty))/"
}
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]$ "
@rgielen
rgielen / microk8s-patch-insecure-registries.sh
Last active October 2, 2020 10:30
This is a small script to patch a MicroK8s deployment with activated container registry add-on to accept the external facing IP address of the host as a valid insecure registry target.
#!/bin/bash
# To use Skaffold and other tools for k8s development, the external IP should consistently be used when refferring to an image in a private registry.
# To be able to do this in MicroK8s, one need to add the external IP to the accepted insecure registries
# See https://microk8s.io/docs/registry-private
#
# This script does automatic patching for this usecase.
#
# Apply directly from Guthub Gist on the MicroK8s host:
# source <(curl https://gist.githubusercontent.com/rgielen/3a5044c3f82690c5ae8caee04ff31ea6/raw/d5ba473f8de7282827da5bca224143d619834ce2/microk8s-patch-insecure-registries.sh)
@rgielen
rgielen / Jenkinsfile
Last active May 15, 2021 16:25
Maven Build and Docker Push Jenkinsfile
node {
properties([
parameters([
string(name: 'dockerRegistry',
defaultValue: 'registry.hub.docker.com',
description: 'The docker registry to use (DNS name only)',),
string(name: 'dockerRepository',
defaultValue: 'apache/struts-showcase',
description: 'The repository to push to',),
PS1=\[\]\u \[\]at \[\]\h \[\]in \[\]\w\[\]$([[ -n $(git branch 2> /dev/null) ]] && echo " on ")\[\]$(parse_git_branch)\[\]\n$ \[\]

Keybase proof

I hereby claim:

  • I am rgielen on github.
  • I am rgielen (https://keybase.io/rgielen) on keybase.
  • I have a public key whose fingerprint is 9109 2884 0777 A5D3 576A 4144 CD7E D2DF 50D5 9A9F

To claim this, I am signing this object: