Skip to content

Instantly share code, notes, and snippets.

Bernd ecki

Block or report user

Report or block ecki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ecki
ecki / sqlservercert.ps1
Created Mar 8, 2019
Powershell to generate self-signed SQL Server TLS certificate
View sqlservercert.ps1
# Create Self Signed RSA Cert for SQL Server usage
#
# Customize:
# + -Subject should contain hostname (or virtal name for FCI)
# + -FriendlyName is anything which helps you to recognize the key
# + -DnsName should list all variants (FQDN) of hostnames used by clients (VIP+Machines)
# + -NotAfter set expire accoring to your policy
# + (Non)Exportable is more secure but harder to manage
#
# - Using RSASSA-PSS (-AlternateSignatureAlgorithm) does not work with Java 8 clients:
@ecki
ecki / Filesystems.java
Last active Jul 29, 2018
Mising named mounts on Windows (Java FileStore)
View Filesystems.java
/* License: ASL2 */
package net.eckenfels.test.javasystemtest;
import java.io.File;
import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
@ecki
ecki / HashBenchmark.java
Created Dec 4, 2014
JMH Test Crypt Hash Performance
View HashBenchmark.java
package net.eckenfels.test.jmh;
import java.nio.ByteBuffer;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
import javax.crypto.KeyGenerator;
@ecki
ecki / commands.txt
Created Dec 9, 2017
GPG ECC Key Details
View commands.txt
> gpg.exe --verbose --list-keys
pub brainpoolP384r1 2017-12-09 [SC]
971D76C158AFD6D6AC53205327C195C6F0FB0EDA
uid [ ultimativ ] Bernd Eckenfels (test) <ecki@zusammenkunft.net>
sub brainpoolP384r1 2017-12-09 [E]
> gpg.exe --export-secret-key > unsecret.pgp
> gpg.exe --verbose --list-packets unsecret.pgp
@ecki
ecki / ca.bat
Last active Aug 28, 2017
ECC Test CA
View ca.bat
@rem Batch file creates 2 P12 keystores with ECC Certificates (intermediate + root in chain)
@del *.pem
@del *.csr
@del *.crt
@del *.p12
@rem -param_enc explicit not possible with Win 7
set NAME=ECC Test
@ecki
ecki / ToString.java
Last active Jul 20, 2017
JMH int to String Benchmark
View ToString.java
// class name and method names are not Java convention but readable
package net.eckenfels.jmhtest;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
@ecki
ecki / PipeTest.java
Last active Jul 10, 2017
Testing Listening Port
View PipeTest.java
package net.eckenfels.test.javasystemtest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.nio.channels.Pipe;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@ecki
ecki / RenameFile.java
Last active Jul 6, 2017
Overwrite libc rename() for Java with LD_PRELOAD
View RenameFile.java
/*
* RenameFiles.java
*
* created at 2017-07-06 by Bernd Eckenfels <b.eckenfels@seeburger.de>
*
* License: ASL 2.0
*/
package net.eckenfels.test.javasystemtest;
import java.io.IOException;
View ReaderTests.java
package net.eckenfels.test.xxe;
import java.io.File;
import java.io.IOException;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
View openantrag-j2c.ps1
#
# This will format http://openantrag.de/api/proposal/ID/gettop/100 JSON files into CSV
#
$list = @()
foreach($file in Get-ChildItem -Filter proposal-*.json .) {
$list += ((Get-Content -Encoding UTF8 $file) -join "`n" | ConvertFrom-Json)
}
# Inspect Result graphically: PS1> $list | Out-GridView
You can’t perform that action at this time.