Skip to content

Instantly share code, notes, and snippets.

View lprimak's full-sized avatar

Lenny Primak lprimak

View GitHub Profile
@lprimak
lprimak / update-copyright.sh
Created January 8, 2023 19:17
Update copyright license year
@lprimak
lprimak / cicd_best_practices
Created November 26, 2022 05:14
CI/CD best practices article
https://www.cloudbees.com/blog/apache-maven-continuous-deliverydeployment-devoptics-teams-approach
@lprimak
lprimak / upgrade_postgres
Last active September 15, 2023 19:56
How to upgrade postgres
Assume the new version is 15, old is 14
* If new postgres is not available in code, make sure Tap petere/postgresql exsists
* Do not uninstall the old database version until the end
stop the database (as postgres user)
pg_ctl -mf stop
brew install postgres@15
/opt/homebrew/Cellar/postgresql@15/15.0/bin/initdb ~/var/postgres_new -U admin --locale=C --encoding=UTF8
LC_ALL=C /opt/homebrew/Cellar/postgresql@15/15.0/bin/pg_upgrade -b /opt/homebrew/Cellar/postgresql@14/14.5_5/bin -B /opt/homebrew/Cellar/postgresql@15/15.0/bin -d ~/var/postgres -D ~/var/postgres_new -U admin
migrate postgresql.conf and pg_hba.conf manually
@lprimak
lprimak / fix_wireshark
Created September 30, 2022 03:36
Fix Wireshark
sudo dseditgroup -o edit -a lprimak -t user access_bpf
@lprimak
lprimak / shiro-key
Created September 30, 2022 00:47
How to create Shiro cipher key
openssl enc -aes-128-cbc -k secret -P -md sha256
@lprimak
lprimak / private-mh
Created September 19, 2022 01:43
calling private methods w/MethodHandles
var lookup = MethodHandles.privateLookupIn(EagerBeansWebListener.class, MethodHandles.lookup());
var mh = lookup.findStatic(EagerBeansWebListener.class, "disable", MethodType.methodType(void.class));
mh.invokeExact();
@lprimak
lprimak / pr-pull
Created January 22, 2021 23:27
How to pull PRs
$ git fetch upstream pull/5081/head
@lprimak
lprimak / SoteriaSecurity
Created September 22, 2020 18:59
Soteria Security Examples
here's a full set of tests/samples here:
https://github.com/eclipse-ee4j/soteria/tree/master/test
Every test is a full web application.
There's a larger application using Jakarta EE security available here: https://github.com/javaeekickoff/java-ee-kickoff-app
Let me know if that works for you.
@lprimak
lprimak / version-and-deploy
Last active April 15, 2024 05:01
How to version, update and deploy things
# Version things
mvn versions:set -DprocessAllModules=true -DgenerateBackupPoms=false -DoldVersion=2.5-SNAPSHOT -DnewVersion=2.6-SNAPSHOT
# Update deps
mvn versions:use-latest-versions -DgenerateBackupPoms=false -Dmaven.version.rules=file://$HOME/.m2/versions-ruleset.xml
mvn versions:update-properties -DgenerateBackupPoms=false -Dmaven.version.rules=file://$HOME/.m2/versions-ruleset.xml
mvn -U versions:display-plugin-updates -DgenerateBackupPoms=false -DprocessUnboundPlugins=true
# Deploy Arquillian Core
mvn release:prepare -DaltReleaseDeploymentRepository=payara-nexus-artifacts::default::https://nexus.payara.fish/repository/payara-artifacts \