Skip to content

Instantly share code, notes, and snippets.

View simonkowallik's full-sized avatar
👂
to [ -~]+

Simon Kowallik simonkowallik

👂
to [ -~]+
View GitHub Profile
@simonkowallik
simonkowallik / Dockerfile
Created April 11, 2024 11:23
f5networks collections ansible dockerfile
FROM python:3.11-bullseye
RUN useradd ansible -d /ansible -M -u 1000
RUN apt update; apt upgrade -y;
RUN apt install -y \
jq \
less \
vim \
iproute2 \
@simonkowallik
simonkowallik / retry.sh
Last active March 11, 2021 11:12 — forked from sj26/LICENSE.md
Bash retry function
# Retry a command with a fixed numer of times until it exits successfully,
# with exponential back off + 1.
# usage:
# $ source ./retry.sh
# $ retry echo "hello world"
# hello world
# $ retry false
# Retry 1/7: command exited with code 1, retrying in 2 seconds. Retrying...
# Retry 2/7: command exited with code 1, retrying in 3 seconds. Retrying...
# Retry 3/7: command exited with code 1, retrying in 5 seconds. Retrying...

Keybase proof

I hereby claim:

  • I am simonkowallik on github.
  • I am simonkowallik (https://keybase.io/simonkowallik) on keybase.
  • I have a public key ASD4-lijd4R2Cp7czAtcL9zQibKYP_mYOj3VSmN-8XWytwo

To claim this, I am signing this object:

@simonkowallik
simonkowallik / gist:41eb8fd0286affd6a3ac113a6f9944b2
Created April 30, 2019 14:50
f5 bigip in GCP - accessing management via ssh in a 3nic deployment

gcloud compute ssh only targets nic0, therefore it is not possible to use it. The same applies to the SSH button in the VM instances list within the GCP Cloud Console.

Here is how I do it using gcloud and openssh from my Mac.

Make sure you have setup the Google Cloud SDK which provides you with the gcloud cli.

Check if you have a default project set

> gcloud config get-value project
black-transport-233607
@simonkowallik
simonkowallik / download_latest_github_release.sh
Last active June 23, 2018 04:30
download latest release from github
function download_latest_github_release() {
release=$(curl --silent "https://api.github.com/repos/$1/releases/latest" |
grep -Po '"tag_name": "\K.*?(?=")')
curl -sLO https://github.com/$1/archive/${release}.tar.gz
}
@simonkowallik
simonkowallik / docker-registry-daily-garbage-collection-with-s6.sh
Last active March 31, 2018 22:33
docker registry daily garbage collection with s6-overlay
# github issue https://github.com/docker/distribution/issues/2094 and https://github.com/docker/distribution/issues/2270
# Dockerfile, based on the official registry:2 image
cat <<EOF > Dockerfile
FROM registry:2
ADD s6-overlay-amd64.tar.gz /
ADD rootfs /
RUN sed -ie 's/^root::/root:!:/' /etc/shadow; \\
addgroup -g 9999 registry; \\
@simonkowallik
simonkowallik / ZBXNEXT-1170.patch
Created June 11, 2012 07:43
ZBXNEXT-1170 Patch - Support for trigger expressions with more than 255 characters - Version 2.0.0 (Stable)
--- frontends/php/include/schema.inc.php.orig 2012-05-24 10:01:11.117073587 +0200
+++ frontends/php/include/schema.inc.php 2012-05-24 10:01:35.909073589 +0200
@@ -2197,13 +2197,13 @@
'expression' => array(
'null' => false,
'type' => DB::FIELD_TYPE_CHAR,
- 'length' => 255,
+ 'length' => 1024,
'default' => '',
),
@simonkowallik
simonkowallik / ZBXNEXT-1170.patch
Created April 11, 2012 12:00
ZBXNEXT-1170 Patch - Support for trigger expressions with more than 255 characters - Patch works till 2.0.0rc4
--- ./src/libs/zbxserver/expression.c.orig 2012-03-30 14:55:53.136539389 +0200
+++ ./src/libs/zbxserver/expression.c 2012-03-30 14:52:37.516538689 +0200
@@ -465,7 +465,7 @@
const char *__function_name = "DCexpand_trigger_expression";
char *tmp = NULL;
- size_t tmp_alloc = 256, tmp_offset = 0, l, r;
+ size_t tmp_alloc = 1025, tmp_offset = 0, l, r;
DC_FUNCTION function;
DC_ITEM item;