Skip to content

Instantly share code, notes, and snippets.

View renelink's full-sized avatar

René Link renelink

View GitHub Profile
#!/usr/bin/env bash
# runs a bash script test under MSYS2 (e.g. git bash) environment in an isolated directory.
#
# A test is named *.test.sh and passed as argument to this script.
# Since the test will run in an isolated directory (chroot), you
# might have to setup additional files that your test needs. E.g.
# another script that should be tested. Do do that place a script named
# *.before.sh beside your test script. The before script will be called
# with the root of the isolated test directory as it's first argument.
@renelink
renelink / gist:70bd7e22ae32484fd2ddf8242faf6865
Created October 29, 2023 17:22
java-developer-exclusions.ps1
# powershell -executionpolicy bypass -File .\java-developer-exclusions.ps1
Add-MpPreference -ExclusionExtension ".java"
Add-MpPreference -ExclusionExtension ".class"
Add-MpPreference -ExclusionExtension ".jar"
Add-MpPreference -ExclusionExtension ".xml"
Add-MpPreference -ExclusionExtension ".properties"
Add-MpPreference -ExclusionExtension ".md"
Add-MpPreference -ExclusionProcess "java.exe"
Add-MpPreference -ExclusionProcess "javaw.exe"
@renelink
renelink / gist:3cd595a2d5f60224bd77a65f93293785
Created October 29, 2023 17:20
windows-defender-hyper-v-exclusions.ps1
# powershell -executionpolicy bypass -File .\windows-defender-hyper-v-exclusions.ps1
Add-MpPreference -ExclusionExtension ".vhd"
Add-MpPreference -ExclusionExtension ".vhdx"
Add-MpPreference -ExclusionExtension ".avhd"
Add-MpPreference -ExclusionExtension ".avhdx"
Add-MpPreference -ExclusionExtension ".vhds"
Add-MpPreference -ExclusionExtension ".vhdpmem"
Add-MpPreference -ExclusionExtension ".iso"
Add-MpPreference -ExclusionExtension ".rct"
@renelink
renelink / SpringMethodParameterResolver.java
Created March 18, 2022 07:48
Inject Spring beans as method parameters in JUnit5
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.ParameterResolver;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.lang.reflect.Parameter;
@renelink
renelink / git_alias_collection_win.sh
Last active November 27, 2023 10:33
Collection of useful Git aliases for windows
#!/bin/bash
# Run to install: curl -s https://gist.githubusercontent.com/renelink/2943682e2f6962e55c029b981e8e9ed1/raw/git_alias_collection_win.sh | bash
# !!!! RUN THIS SCRIPT IN CYGWIN OR WIN GIT BASH ONLY !!!!
#
# This script uses windows paths that will only work in cygwin or the windows git bash
# add git np alias if notepad++ exists
if [ -f "C:\Program Files\Notepad++\notepad++.exe" ]; then
@renelink
renelink / ssc.sh
Last active September 28, 2021 10:52
Create self-signed certificate script
#!/bin/bash
usage() {
echo "Generates a self-signed certificate."
echo
echo "Usage: $0 [-h] [-d] [-c <county>] [-s <state>] [-l <city>] [-o] [-n <common_name>] [-f] [<path>]"
echo -e "options:"
echo -e "\tpath The output path where the key and crt files are generated."
echo -e "\t-c The certificate country. E.g. DE or US"
echo -e "\t-s The certificate state."