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 / git-libsecret.md
Last active April 29, 2024 05:50 — forked from maelvls/README.md
Guide: How to install git-credential-helper / libsecret in Debian / Ubuntu

Storing your GIT credentials in libsecret

# Install dependencies
$ sudo apt install make gcc git libsecret-1-0 libsecret-1-dev libglib2.0-dev

# Compile binary
$ sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret

# Configure git to use binary as credential storage
@JonasGroeger
JonasGroeger / build.gradle
Last active January 23, 2024 07:55
Gradle: Read git commit hash.
def getCheckedOutGitCommitHash() {
def gitFolder = "$projectDir/.git/"
def takeFromHash = 12
/*
* '.git/HEAD' contains either
* in case of detached head: the currently checked out commit hash
* otherwise: a reference to a file containing the current commit hash
*/
def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD
def isCommit = head.length == 1 // e5a7c79edabbf7dd39888442df081b1c9d8e88fd
@JonasGroeger
JonasGroeger / PGP-Key.md
Last active January 11, 2024 14:32
Erstellen eines GPG Keys

Erstellen eines GPG Keys

$ gpg --expert --full-gen-key
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (7) DSA (set your own capabilities)
   (8) RSA (set your own capabilities)
@JonasGroeger
JonasGroeger / gen-ubuntu-sources-list.py
Created June 16, 2015 09:16
Generates '/etc/apt/sources.list' compatible lists for Ubuntu releases
#!/usr/bin/env python3
import argparse
import getpass
import os
import time
import sys
KNOWN_CODENAMES = ['lucid', 'precise', 'trusty', 'utopic', 'vivid', 'wily']
#!/usr/bin/env bash
set -
export UPDATED_YES=✅
export UPDATED_NO=❌
export DIRTY_YES=🐷
export DIRTY_NO=✨
export REPO_TRUNCATE_CHARS=32
@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 }"
@JonasGroeger
JonasGroeger / Rename-Me-To-Match-Your-PS1-File
Last active May 26, 2023 11:18
Generic .bat file to launch .ps1 file with same name in same directory. Example: You have "start.ps1" to do something. Download this Gist and save as "start.bat". The latter will launch "start.ps1" by double-clicking.
@echo off
setlocal
REM Generic .bat file to launch .ps1 files.
REM Name the .bat file like the .ps1 file and you are done.
set this_file_no_extension=%~n0
set ps1_file=%this_file_no_extension%.ps1

Balkonsolar (kostenoptimiert)

Annahmen:

  • Oberrohr mit ~40mm Durchmesser
  • Unterrohr mit ~13mm Durchmesser
  • Außensteckdose vorhanden
  • KFZ vorhanden für Fahrt nach Cadolzburg
  • Besuch bei Hornbach :)

Gesamtpreis: ~750€ + Preis vom Shelly

import org.hibernate.validator.HibernateValidator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import javax.validation.Configuration;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorFactory;
import java.util.List;
/**
package de.jonasgroeger.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
@Aspect
public class LogAspect {
@Around("execution(* de.jonasgroeger.aspect.SubmissionService.uploadAttachment(..))")