Skip to content

Instantly share code, notes, and snippets.

https://askubuntu.com/a/821681/595802
@JurrianFahner
JurrianFahner / resources.md
Last active December 9, 2017 13:47
Valuable resources
@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 / 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 / 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 / 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 / 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());
git init --initial-branch=main
@JurrianFahner
JurrianFahner / generate-folders-for-advent-of-code.ps1
Created November 29, 2022 21:30
generate folders for advent of code
# creates all directories for advent of code in the following format:
# day01
# day01
# ...
# day25
 
for ($i = 1; $i -le 25; $i++)
{
$daystr = "day" + $i.ToString("00")
cargo new $daystr # cargo new is bootstrapping a rust project, example: cargo new day01
for i in /etc/update-motd.d/*; do if [ "$i" != "/etc/update-motd.d/98-fsck-at-reboot" ]; then $i; fi; done