Skip to content

Instantly share code, notes, and snippets.

Avatar

Sanne Grinovero Sanne

View GitHub Profile
@Sanne
Sanne / OtherApp.java
Created May 12, 2022
Exploring scheduling strategy of async CompletableFuture(s)
View OtherApp.java
import java.util.concurrent.CompletableFuture;
public class OtherApp {
private static final boolean wait = false;
public static void main(String[] args) {
VeryParallelExecutor executor = new VeryParallelExecutor( 4 );
OneOffDelegatingExecutor taskControl = new OneOffDelegatingExecutor( executor );
View gist:812bdaeed0d88f092034609bbac5ce40
[INFO] --- karaf-maven-plugin:4.2.3:verify (validate) @ infinispan-commons ---
[INFO] Using repositories: https://repo.maven.apache.org/maven2/@id=central,https://repository.jboss.org/nexus/content/groups/public-jboss@id=jboss-public-repository-group@snapshots
java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @161d606f
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.getMethod(Injector.java:222)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.acces
View git-update.sh
#!/bin/bash
# Temporarily checks out the "master" branch, fetches updates from upstream,
# pushes a copy to "origin" to keep it in synch, and then returns to the original
# branch.
#
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
#
# Copyright (c) 2014 Sanne Grinovero
requireBranchName() {
View Simple Rsync backup
#!/bin/sh
# version 20170828
# Backup script using rsync to create multiple snapshots of the source.
# A little known trick of rsync is to be able to run a three-way comparison,
# so to only transfer the diffs but store a full copy in a new directory,
# while comparing and hard linking to the previous snapshot.
# This allows to make many frequent snapshots at minimal network and storage
# impact.
#
# This version doesn't do any form of rotation: you'll eventually run out of space.
@Sanne
Sanne / gitPS1
Last active Feb 16, 2017
gitPS1
View gitPS1
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1="$(if (( EUID == 0 )); then echo '\[\033[01;31m\]\h'; else echo '\[\033[5;32m\]\u@\h \[\033[00m\]\w\[\033[01;32m\]$(parse_git_branch)\[\033[00m\]$ '; fi)"
@Sanne
Sanne / release.sh
Created Jun 8, 2013
Search release script
View release.sh
SHORT_VERSION="4.3"
FULL_VERSION="4.3.0.Final"
NEXT_FULL_VERSION="4.3.1-SNAPSHOT"
##
# When editing the rsync commands, always test then with a dry run (-n) !
##
# Upload documentation to jboss.org:
@Sanne
Sanne / jenkins.appl
Last active Dec 13, 2015
BoxGrinder script: Jenkins machine for Hibernate
View jenkins.appl
name: jenkins-hibernate
summary: Jenkins instance to run builds of Hibernate
version: 1
release: 1
os:
name: fedora
version: 17
password: yyy
hardware:
cpus: 4
View git-deep-prune.sh
#!/bin/bash
# Script to loop on local and remote branches, to delete all those which are
# already merged in master.
# Assumes "origin" and "master" are your references: replace all occurrences
# of "origin" with the name of your personal remote.
#
# Careful with branches which should are meant as tags in the past!
#
# Inspired from http://devblog.springest.com/a-script-to-remove-old-git-branches
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
@Sanne
Sanne / git-pull
Created May 3, 2012
Send a pull request from command line
View git-pull
#!/bin/bash
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
#
# Copyright (c) 2012 Sanne Grinovero
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
}
function git_project_id {
@Sanne
Sanne / git-inspect
Created Apr 26, 2012
See differences between current branch and master [other branch]
View git-inspect
#!/bin/bash
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
# Copyright (c) 2012 Sanne Grinovero
if [[ $# -eq 0 ]]; then
rm -f *.patch && git format-patch -M80% -C80% master && gedit -w -s *.patch && rm *.patch
else
rm -f *.patch && git format-patch -M80% -C80% "$@" && gedit -w -s *.patch && rm *.patch
fi