Skip to content

Instantly share code, notes, and snippets.

View DuncanCasteleyn's full-sized avatar

Duncan Casteleyn DuncanCasteleyn

View GitHub Profile
@DuncanCasteleyn
DuncanCasteleyn / tcpping
Last active August 3, 2023 11:12
tcpping
#!/bin/sh
#
# tcpping: test response times using TCP SYN packets
# URL: http://www.vdberg.org/~richard/tcpping.html
#
# uses tcptraceroute from http://michael.toren.net/code/tcptraceroute/
#
# (c) 2002-2005 Richard van den Berg <richard@vdberg.org> under the GPL
# http://www.gnu.org/copyleft/gpl.html
#
@DuncanCasteleyn
DuncanCasteleyn / AESGCMEncryptDecrypt.java
Last active December 20, 2022 20:28
AES GCM String Encrypt and decrypt component for Spring
import org.springframework.stereotype.Component;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.ByteBuffer;
import java.security.SecureRandom;