Skip to content

Instantly share code, notes, and snippets.

@axdotl
axdotl / github-app-ratelimit-info.sh
Last active April 12, 2024 10:29
Shell Script to get rate limit status for a Github App installation
#!/bin/bash
set -o pipefail
app_id=$1 # App ID as first argument
installation_id=$2 # Installation ID as second argument
pem=$( cat $3 ) # file path of the private key as third argument
now=$(date +%s)
iat=$((${now} - 60)) # Issues 60 seconds in the past
@axdotl
axdotl / backstage-integration.sh
Created April 21, 2021 09:21
[Backstage] Add catalog-info.yaml for all repos in a GitHub org
#!/bin/bash
## Running this script will do following for all passed repos:
## - Create a branch `backstage-integration`
## - Add catalog-info.yaml
## - Creates a PullRequest
##
## This script expects following files
## - repos.txt: a file with repository names (one per line)
## - catalog-info.yaml: A minimal manifest template with content like
panic: interface conversion: interface {} is map[string]interface {}, not *schema.Set
2021-01-21T11:57:16.440Z [DEBUG] plugin.terraform-provider-opsgenie_v0.6.0:
2021-01-21T11:57:16.440Z [DEBUG] plugin.terraform-provider-opsgenie_v0.6.0: goroutine 543 [running]:
2021-01-21T11:57:16.440Z [DEBUG] plugin.terraform-provider-opsgenie_v0.6.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).setSet(0xc00015f480, 0xc00023c0c0, 0x3, 0x3, 0xc13140, 0xc00023c030, 0xc00039c000, 0xc00046f260, 0x40ef04)
2021-01-21T11:57:16.440Z [DEBUG] plugin.terraform-provider-opsgenie_v0.6.0: github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.0/helper/schema/field_writer_map.go:344 +0xbce
2021-01-21T11:57:16.440Z [DEBUG] plugin.terraform-provider-opsgenie_v0.6.0: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MapFieldWriter).set(0xc00015f480, 0xc00023c0c0, 0x3, 0x3, 0xc13140, 0xc00023c030, 0x2, 0x2)
2021-01-21T11:57:16.440Z [DEBUG] plugin.terraform-provider-opsgenie_v0.6.0: github.com/hashicorp
@axdotl
axdotl / kubectl-neat.plugin.zsh
Created September 25, 2020 12:44
OhMyZsh plugin which adds useful aliases for kubectl-neat plugin
## Requires https://github.com/itaysk/kubectl-neat
if [[ -z $commands[kubectl neat] ]]; then
echo 'kubectl is not installed.'
echo 'See https://github.com/itaysk/kubectl-neat'
return 1
fi
# Pod
alias kgpn='kubectl neat get -- pod'
@axdotl
axdotl / fix-opera-video-issue.sh
Last active November 22, 2021 07:44
Opera - Fix video playback error on Ubuntu
#!/bin/bash
## Backup original file
sudo mv /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so.bak
## Link file from other location to use instead
# sudo ln -sf /snap/chromium/current/usr/lib/chromium-browser/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
# sudo ln -sf /usr/share/code/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
# sudo ln -sf /usr/lib/slack/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
# ...
@axdotl
axdotl / helm-values.yaml
Last active December 29, 2023 23:10
Helm example values for stable/jenkins v1.1.17
master:
useSecurity: true
adminUser: "admin"
fsGroup: 1000
runAsUser: 1000
serviceType: ClusterIP
installPlugins:
@axdotl
axdotl / keycloak-export-import-k8s.md
Last active October 30, 2023 08:43
Keycloak Export in Kubernetes

Perform Keycloak Export and Import on Kubernetes

  • Setup Keycloak in non-HA mode (replica 1)
  • Disable UserFederation
  • You might have to increase the resource limits to avoid that pod beeing killed by memory or CPU limits

See Keycloak Documentation for more details.

Export

@axdotl
axdotl / jenkins-plugin-class-provider.groovy
Last active November 6, 2018 13:08
Which Jenkins Plugin is providing this class?
String className = "org.yaml.snakeyaml.Yaml"
def clazzResource = className.replaceAll("\\.", "/") + ".class"
println "Looking for: ${clazzResource}\n"
Jenkins.instance.pluginManager.activePlugins.forEach { PluginWrapper plugin ->
def c = plugin.classLoader.getResources(clazzResource)
if (c.hasMoreElements()) {
println "Found in ${plugin}"
println Collections.list(c).join("\n") + "\n"
}

Introduction

Here is described how to setup Selenium for a SpringBoot maven-project.

Setup

Maven

Add following dependency to projects pom.xml

@axdotl
axdotl / gist:15c0489169d01b960c20eb118a9ca719
Created May 3, 2017 09:19
[Argus] HBase schema creation
/opt/hbase/bin/hbase shell
create 'metric-schema', {NAME => 'f', BLOOMFILTER => 'ROW', VERSIONS => '1', DATA_BLOCK_ENCODING => 'FAST_DIFF'}
create 'scope-schema', {NAME => 'f', BLOOMFILTER => 'ROW', VERSIONS => '1', DATA_BLOCK_ENCODING => 'FAST_DIFF'}