Skip to content

Instantly share code, notes, and snippets.


Denis Andrejew seeekr

  • Austria
View GitHub Profile
seeekr /
Created Apr 27, 2019
run one off tasks in a docker swarm context
#!/usr/bin/env bash
set -euo pipefail
replicas () {
docker service ls -f name=$svc --format '{{.Replicas}}'
seeekr /
Created Apr 27, 2019
`docker exec -it` equivalent in multi-node Docker Swarm context
#!/usr/bin/env bash
docker_containerinfo() {
local taskid=$(docker service ps -f desired-state=running -q $1)
[[ -n "$taskid" ]] || { echo "no running task for service $1" >&2; return 1; }
local containerinfo=($(docker inspect --format '{{.NodeID}} {{.Status.ContainerStatus.ContainerID}}' $taskid))
local host=$(docker node ls -f id="${containerinfo[0]}" --format '{{.Hostname}}')
echo "$host ${containerinfo[1]}"
seeekr /
Created Jun 15, 2018
de-/serialize enums by ordinal with GSON
package com.denisandrejew.util;
import lombok.experimental.var; // if java < 10
import java.lang.reflect.Type;
public class GsonEnumByOrdinalSerializer<T extends Enum> implements JsonSerializer<T>, JsonDeserializer<T> {
public T deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
View render.json
seeekr / blockstack.txt
Created Dec 20, 2017
blockstack verification
View blockstack.txt
Verifying my Blockstack ID is secured with the address 1FBLBQvNBJAovcSncxafDXBpWPd2rgRSCc
seeekr / confix.ex
Last active Aug 14, 2017 — forked from jmglov/config.ex
Elixir: override Mix config with environment variables
View confix.ex
defmodule Confix do
defmacro __using__(app: app_name) do
quote do
import unquote(__MODULE__), only: :macros
@confix_app unquote(app_name)
defmacro cfg(key, type \\ :string) do

Keybase proof

I hereby claim:

  • I am seeekr on github.
  • I am seeekr ( on keybase.
  • I have a public key whose fingerprint is 7551 6CEC 6BBF CBC4 EACD 5602 7D16 0A7D B3C0 C44D

To claim this, I am signing this object:

seeekr / 0001-fixing-shariff-s-custom-post-handling-logic.patch
Created Feb 27, 2016
fixing shariff custom post types on/off detection
View 0001-fixing-shariff-s-custom-post-handling-logic.patch
From 1531e3ed5393f28e1bcf8ef275cd6df0dbd1cefe Mon Sep 17 00:00:00 2001
From: Denis Andrejew <>
Date: Thu, 25 Feb 2016 14:42:55 +0100
Subject: [PATCH] fixing shariff's custom post handling logic
shariff.php | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/shariff.php b/shariff.php
seeekr /
Last active Nov 25, 2018
Using RAID with CoreOS (btrfs; RAID0, RAID1)
# replace with whatever your additional device is called
# /dev/sda should be where your CoreOS install lives right now
# 0 or 1
# make sure to download the single-partition.layout file as well
seeekr / apache-webp-rewrite.conf
Last active Mar 30, 2021
enabling apache to serve WebP image files if accepted by browser (and .webp files available)
View apache-webp-rewrite.conf
## !! This snippet has been updated, but not tested in practice. It should work, please check / leave comments in case it doesn't. !! ##
# originally from
<IfModule mod_rewrite.c>
# TODO: don't forget to put
# AddType image/webp .webp
# in your mods-available/mime.conf
# (though this is optional because we're setting
# the mime type manually in the RewriteRule)