Skip to content

Instantly share code, notes, and snippets.


Steffen Uhlig suhlig

  • IBM
  • Cloud
View GitHub Profile
View git-duet-rebase.markdown

from git-duet:

Rebasing (resets the committer to the committer of the current pair):

$ git rebase -i --exec 'git duet-commit --amend'
suhlig / events.sql
Created May 17, 2020
In Grafana, show events stored in InfluxDB
View events.sql
# Insert an event into InfluxDB
use e5573;
INSERT events title="Disabled unattended-upgrades",description="We should see reduced bandwidth usage from here on",tags="apt,debug,bandwidth";
# Configure the annotation in Grafana
SELECT title, description from events WHERE $timeFilter ORDER BY time ASC;
set -euo pipefail
# This is an updated version of
main() {
View switch-fly-version.markdown

I work with a lot of different Concourse servers that have a variety of versions. fly rejects working with servers that are off to much. Therefore I have fly-3.14.1, fly-4.2.3 etc. on my machine.

But many set-pipeline scripts assume that a single fly command exists and that it magically is of the right version. So I need to switch; preferably per directory or per shell.

Did not work

  • Shell aliases are never exported, so that a set-pipeline script does not know about the alias.
  • I use ZSH, where functions cannot be exported.


suhlig / cf-which-org
Created Jul 12, 2019
Prints the space and org names for a given route, filtered down to the hostname
View cf-which-org
#!/usr/bin/env ruby
# Prints the space and org names for a given route, filtered down to the hostname
require 'json'
require 'shellwords'
def curl(url)
while url
JSON.parse(`cf curl #{Shellwords.escape(url)}`).tap do |result|
suhlig / cf-all-apps
Created Jun 29, 2019
List all cf apps across all orgs and spaces
View cf-all-apps
#!/usr/bin/env ruby
require 'json'
require 'shellwords'
HIERARCHY = %w(/ org space app)
def curl(url)
while url
JSON.parse(`cf curl #{Shellwords.escape(url)}`).tap do |result|
suhlig / inline-erb.rb
Last active Jul 20, 2018
'Blocky' ERB syntax
View inline-erb.rb
require 'erb'
class UserTemplate
def initialize(user)
@user = user
def to_s
# In the ERB template, we can refer to all instance variables, etc. due to
# the binding being passed.
View imagemagick.txt
2colorthresh - Automatically thresholds an image to binary (b/w) format using an adaptive spatial subdivision color reduction technique
3Dbox - Generates a perspective view of a 3D box at any orientation with pictures pasted on each of its sides
3Dcover - Wraps an image around the front and left or right side of box viewed in rotated perspective
3Dreflection - Adds a fading reflection below an image and views it in perspective
3Drotate - Applies a perspective distortion to an image by providing three rotation angles, zoom, offsets, background color, perspective exaggeration and auto zoom/centering 3Dtext - Converts text into an image with a 3D extrusion effect accentedges - Applies accented edges to an image
adaptivegamma - Enhances the contrast/brightness in an image using a locally adaptive gamma method
anglegradient - Creates a gradient effect at a specific orientation angle
aspect - Resizes an image to a specific size allowing either cropping or padding to deal with the aspect ratio change
aspectcrop - Cr
suhlig / install-tmux
Last active Feb 6, 2021 — forked from philipsd6/install-tmux
Install tmux on rhel/centos
View install-tmux
# Install tmux on rhel/centos 7
# What do we want?
# install deps
yum install gcc kernel-devel make ncurses-devel
suhlig / cf-app-lifecycle.markdown
Created Dec 8, 2017
Presentation on the Cloud Foundry Application Lifecycle
View cf-app-lifecycle.markdown

Cloud Foundry Application Lifecycle


What happens between cf push and "state: running"? We will have a look at how the Cloud Foundry part of the IBM Cloud creates and manages applications. Attending this session will give you an in-depth understanding of application deployment works and where to look in case of trouble. (edited)

Happy Day

cd ~/workspace/cf-acceptance-tests/assets/dora