Skip to content

Instantly share code, notes, and snippets.

View lhazlewood's full-sized avatar

Les Hazlewood lhazlewood

  • Las Vegas, California, USA
  • 02:36 (UTC -07:00)
View GitHub Profile
@lhazlewood
lhazlewood / gist:24134e708248b8a651ed9dd43df15cad
Created February 6, 2019 01:44
macos sierra on virtualbox addendum
$ NAME="macOSSierra"
$ VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-F22589C8"
$ VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "CK1156I6DB6"
$ VBoxManage modifyvm "$NAME" --paravirtprovider none
# after reboot:
$ VBoxManage modifyvm "$NAME" --paravirtprovider default
@lhazlewood
lhazlewood / m2
Created March 24, 2016 21:10
Bash script to switch maven configurations by name
#!/usr/bin/env bash
LINK_FILE="$HOME/.m2/settings.xml"
if [ ! -L "$LINK_FILE" ]; then
echo "This program expects $LINK_FILE to be a symbolic link."
exit 1
fi
if [ -z "$1" ]; then
@lhazlewood
lhazlewood / get_jdk_vendor
Created November 27, 2019 20:02
Determine the jdk vendor from the command line
java -XshowSettings:properties -version 2>&1 | grep 'java.vendor =' | awk -F'= ' '{print $2}'
@lhazlewood
lhazlewood / all_jdk_ec_curve_names.groovy
Created October 25, 2021 00:47
List all of a JDKs supported elliptic curve names
for (Provider provider : Security.getProviders()) {
for (def service : provider.getServices()) {
if (service.getType() == 'AlgorithmParameters' && service.getAlgorithm() == 'EC') {
String result = service.getAttribute('SupportedCurves')
String[] split = Strings.delimitedListToStringArray(result, '|')
println "supported curves: "
for(String s : split) {
String[] cleaned = Strings.delimitedListToStringArray(s, ',' ,'[]')
Set<String> names = io.jsonwebtoken.lang.Collections.setOf(cleaned)
println names.join(', ')