Skip to content

Instantly share code, notes, and snippets.

View JonasGroeger's full-sized avatar
🏠
Working from home

Jonas Gröger JonasGroeger

🏠
Working from home
View GitHub Profile
@JonasGroeger
JonasGroeger / perf.sh
Last active May 7, 2018 15:39
Performancetest
bash -c "rm -rf /tmp/test-d/; mkdir -p /tmp/test-d; cd /tmp/test-d/; git init" 1>/dev/null
@JonasGroeger
JonasGroeger / OnShutdownCompressingRollingFileAppender.java
Created April 14, 2018 20:51
OnShutdownCompressingRollingFileAppender the compresses on logging context stop
package de.jonasgroeger.logback;
import ch.qos.logback.core.LogbackException;
import ch.qos.logback.core.rolling.RollingFileAppender;
import ch.qos.logback.core.rolling.RollingPolicy;
import ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicy;
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy;
import ch.qos.logback.core.rolling.helper.CompressionMode;
import ch.qos.logback.core.rolling.helper.Compressor;

Keybase proof

I hereby claim:

  • I am jonasgroeger on github.
  • I am jonasgroeger (https://keybase.io/jonasgroeger) on keybase.
  • I have a public key ASChemutzTh_F1v-seff00EIXO3DRuzZGd6cUWRMyGckowo

To claim this, I am signing this object:

@JonasGroeger
JonasGroeger / README.md
Last active June 2, 2017 10:52
Export iFiske data to a KML file

Steps to export iFiske data to a KML file

  1. Open Chrome on "http://www.ifiske.se/index.php/en/fishing-areas/karta"

  2. Press F12 and go to the "Console" tab

  3. Paste the following code:

    function Export_iFiske_To_KML() {
        var template = `
    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
    
@JonasGroeger
JonasGroeger / sync-projects
Last active November 4, 2023 13:10
Gitlab: Clone / Pull all projects in a group
#!/usr/bin/env bash
# Documentation
# https://docs.gitlab.com/ce/api/projects.html#list-projects
NAMESPACE="YOUR_NAMESPACE"
BASE_PATH="https://gitlab.example.com/"
PROJECT_SEARCH_PARAM=""
PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")"
PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
quiet_update() {
DEBIAN_FRONTEND=noninteractive apt-get update -qq < /dev/null > /dev/null
}
quiet_install() {
DEBIAN_FRONTEND=noninteractive apt-get install -qq "$@" < /dev/null > /dev/null
}
quiet_install_no_recommends() {
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq "$@" < /dev/null > /dev/null
#!/bin/bash
#
# This script copies the contents of the block below into a file.
# Useful for self-extracting configuration files or the like.
#
# Author: Jonas Gröger <jonas@huntun.de>
#
<<DATASECTION
@JonasGroeger
JonasGroeger / manman
Last active April 19, 2016 11:02
Jump to manpage flag
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage (i.e.): manman curl -u"
exit 3
fi
if [ $# -eq 1 ]; then
man "$1"
exit 0
@JonasGroeger
JonasGroeger / remote
Last active April 12, 2016 10:04
Script that allows makes a remote command seem like a local one. Useful for debugging.
#!/bin/bash
# This script executes arbitary commands on a remote server.
# Example: ./remote ls -alf
# If CMD is provided in the configuration section below
# Example (RMT_CMD="ls"): ./remote -alf
# If CMD is defined provided in the environment variables
# Example: RMT_CMD=ls ./remote -alf