Skip to content

Instantly share code, notes, and snippets.

@JurrianFahner
JurrianFahner / CVETester.java
Last active June 7, 2022 21:43
Test whether your java version is safe for CVE-2022-21449
import java.security.*;
public class CVETester {
public static void main(String... args) throws Exception {
var keys = KeyPairGenerator.getInstance("EC").generateKeyPair();
var blankSignature = new byte[64];
var sig = Signature.getInstance("SHA256WithECDSAInP1363Format");
sig.initVerify(keys.getPublic());
sig.update("Some random text to be encrypted".getBytes());
@JurrianFahner
JurrianFahner / switch-java.ps1
Created May 1, 2021 09:52
Java switch script for powerhsell
param($java_version)
$java_install_dir = switch($java_version)
{
8 {"C:\Program Files\Zulu\zulu-8"}
15 {"C:\Program Files\Zulu\zulu-15"}
default {"unknown"}
}
if ($java_install_dir -ne "unknown") {
$old_path=(Get-ChildItem env:Path).value
@JurrianFahner
JurrianFahner / improve-speed-wsl2-git.sh
Created January 18, 2020 10:52
improve git speed on wsl2
git config --global core.preloadindex true
git config --global core.fscache true
@JurrianFahner
JurrianFahner / letsplaywith11
Created September 21, 2018 23:39
Java 11 allows shebang
#!/usr/bin/env -S java --source 11
import java.util.stream.Stream;
import java.util.function.Predicate;
public class Test {
public static void main(String[] args) {
Predicate<Integer> bla = (a) -> a > 10 ;
@JurrianFahner
JurrianFahner / list_all_go_files.sh
Created April 27, 2018 15:32
Simple script to list all go files with filenames
#!/usr/bin/env bash
find . -type f | grep "\.go" > files.txt
file='./files.txt'
lines=`cat $file`
for line in $lines; do
echo "Bestand: $line"
cat $line
@JurrianFahner
JurrianFahner / resources.md
Last active December 9, 2017 13:47
Valuable resources
https://askubuntu.com/a/821681/595802
for branch in `git branch | grep -v HEAD`;do echo -e `git show --format="%ci %cr %H" $branch | head -n 1` \\t$branch; done | sort -r
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads);do echo -e `git show --format="%ci %cr %H" $branch | head -n 1` \\t$branch; done | sort -r
docker rm $(docker ps -a -f exited=0 --format "{{.ID}}")
@JurrianFahner
JurrianFahner / ip.sh
Last active May 26, 2023 17:04
ifconfig to ip
ifconfig
# is similar to
ip addr show
ifconfig eth0
# is similar to
ip addr show eth0
ifup
# is similar to