Skip to content

Instantly share code, notes, and snippets.

View rotty3000's full-sized avatar

Raymond Augé rotty3000

View GitHub Profile
@rotty3000
rotty3000 / Dockerfile
Created September 26, 2022 13:45
Add Azul Zulu Debian repo without warnings and using `signed-by` pattern.
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xB1998361219BD9C9' | gpg --dearmor -o /etc/apt/keyrings/azul.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" \
| tee /etc/apt/sources.list.d/zulu-openjdk.list > /dev/null && \
apt-get update && \
apt-get install -y zulu11-jdk && \
apt-get clean
@rotty3000
rotty3000 / validate-custom-element.sh
Last active March 11, 2022 19:25
Validate Web Component Custom Element name with bash and grep
#!/bin/bash
# Derived from https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
PCENCHAR=[-.0-9_a-z\\xB7\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{203F}-\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2F2F}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}]
CUSTOM_ELEMENT_NAME_REGEX=^[a-z]${PCENCHAR}*-${PCENCHAR}*$
if ! (echo "$1" | grep -q -P $CUSTOM_ELEMENT_NAME_REGEX); then
echo "invalid custom element name '$1'"
fi
@rotty3000
rotty3000 / example.java
Last active December 18, 2021 16:08
jdeps as ToolProvider exception on reuse
/*
The jdeps args used can be:
*/
jdeps0(
"--ignore-missing-deps",
"--no-recursive",
"--print-module-deps",
"--multi-release",
System.getProperty("java.specification.version"),
file.getAbsolutePath());
@rotty3000
rotty3000 / script.java
Created December 11, 2021 21:04
JShell Script SEBANG line
//usr/bin/env jshell <(for V in "$@";do A+="\"$V\",";done;echo "String[] args = {$A}") "$0"; exit $?
Stream.of(
args
).map(
"ARG: "::concat
).forEach(
System.out::println
);
@rotty3000
rotty3000 / command.bash
Last active November 22, 2021 16:57
jaxb-api jdeps
jdeps -verbose:class --multi-release 17 \
--module-path ~/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar \
~/.m2/repository/javax/xml/bind/jaxb-api/2.4.0-b180830.0359/jaxb-api-2.4.0-b180830.0359.jar
@rotty3000
rotty3000 / gist:a68c8ea494f4c1b2e304822dc8a72a66
Created October 1, 2018 13:59
diff asm 7.0-BETA vs. 6.2.1
~]$ baseline -v ~/.m2/repository/org/ow2/asm/asm/7.0-beta/asm-7.0-beta.jar ~/.m2/repository/org/ow2/asm/asm/6.2.1/asm-6.2.1.jar
===============================================================
org.objectweb.asm 7.0.0.beta-6.2.1
===============================================================
Package Delta New Old Suggest If Prov.
org.objectweb.asm MAJOR 7.0.0.beta 6.2.1 ok -
MAJ class org.objectweb.asm.ClassVisitor
+ method visitNestHost(java.lang.String)
+ return void
- method visitNestHostExperimental(java.lang.String)
@rotty3000
rotty3000 / build.gradle
Created April 24, 2017 19:27
gradle flatten while copy
/*
Where:
origin/
├── foo
│   └── fum.txt
├── bar
│   └── other.txt
└── biz
   └── baf
   └── bop
@rotty3000
rotty3000 / vcs-repository-litmus-test.md
Last active September 16, 2017 03:58
Litmus Test for VCS Repository Separation

Litmus Test for VCS Repository Separation

How do you or should you break a monolithic repository into smaller pieces?

The question of whether separation should take place and how granular it should be is a debate that happens in very significantly large project I've been involved with to date.

If the goal is to make developers lives easier, then the split must certainly not cause more harm than good. There can't be a hard and fast rule such as "each module should have it's own repository" because the day to day impact of a project maintained by a single individual could be horrendous if the project contains hundreds of modules. On the other hand, a project with thoudsands of developers and thoudsands of modules likely will struggle equaly with such a rule.

Therefore I'm working on a initial litmus test to determine the criteria for breaking a large repository into several smaller repositories.

@rotty3000
rotty3000 / first-stacktrace-log
Created November 24, 2015 23:59
non-workspace bnd gradle plugin double build
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1365)
at com.liferay.ant.bnd.version.VersionVerifierPlugin.verify(VersionVerifierPlugin.java:43)
at aQute.bnd.osgi.Verifier.doVerifierPlugins(Verifier.java:544)
at aQute.bnd.osgi.Verifier.verify(Verifier.java:536)
at aQute.bnd.osgi.Builder.doVerify(Builder.java:503)
at aQute.bnd.osgi.Builder.build(Builder.java:152)
at aQute.bnd.osgi.Builder$build$1.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
@rotty3000
rotty3000 / gradle.log
Created November 13, 2015 20:34
failing bnd non-workspace plugin build
[rotty@rotty-XPS-15-9530 (pr-1030 *$) portal-rest-extender-test]$ ../../../gradlew clean deploy --stacktrace
Configuration on demand is an incubating feature.
:portal:portal-rest-extender-test:cleanBuildCSS UP-TO-DATE
:portal:portal-rest-extender-test:cleanBuildXSD UP-TO-DATE
:portal:portal-rest-extender-test:cleanCompileJSP
:portal:portal-rest-extender-test:cleanCompileJava
:portal:portal-rest-extender-test:cleanCompileTestIntegrationJava
:portal:portal-rest-extender-test:cleanCompileTestJava UP-TO-DATE
:portal:portal-rest-extender-test:cleanConfigJSModules UP-TO-DATE
:portal:portal-rest-extender-test:cleanCopyLibs