Skip to content

Instantly share code, notes, and snippets.

View schulzh's full-sized avatar

Hans Schulz schulzh

  • SAP SE
  • Baden-Württemberg, Germany
View GitHub Profile
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@ryanjbaxter
ryanjbaxter / bluegreen.sh
Last active May 16, 2018 20:14
Blue/Green Deployment Script
#!/bin/bash
#
# This product includes software originally developed by IBM Corporation.
#
#
# Copyright IBM Corp. 2015
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@pozs
pozs / json_object_agg.sql
Last active May 18, 2020 10:58
Multiple functions to modify json objects in PostgreSQL
-- Aggregate function to aggregate key-value pairs to json object (opposite of json_each())
-- requires PostgreSQL 9.3+ (but < 9.4!)
-- requires function "json_object_set_key"
DROP AGGREGATE IF EXISTS "json_object_agg" (TEXT, anyelement);
CREATE AGGREGATE "json_object_agg" (TEXT, anyelement)
(
STYPE = json,
SFUNC = "json_object_set_key",
@rob-murray
rob-murray / add_intellij_launcer
Last active May 7, 2024 21:18
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ