Skip to content

Instantly share code, notes, and snippets.

View delabassee's full-sized avatar
👇
Don't raise your voice. Improve your argument.

David Delabassée delabassee

👇
Don't raise your voice. Improve your argument.
View GitHub Profile
@delabassee
delabassee / dual-vlc.sh
Last active March 15, 2023 09:50
Dual VLC instances on dual displays (full screen) - Raspberry Pi 4
// launch 2 VLC instances
SECOND=false;
wmctrl -l | grep -i vlc | cut -c 1-12 | while read win_id ; do
if [ "$SECOND" = false ]; then
echo "1st screen : $win_id"
SECOND=true
wmctrl -i -r "$win_id" -e0,2000,24,1000,550
wmctrl -i -r "$win_id" -b toggle,fullscreen
else
echo "2nd screen : $win_id"
# Install Docker on OEL
sudo yum -y install docker
sudo usermod -aG docker ${USER}
sudo systemctl enable docker.service
sudo systemctl start docker.service
sudo su - $USER
#docker run hello-world
@delabassee
delabassee / Main.java
Created August 17, 2020 12:56
ODL - Simple Helidon service
package mypackage;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.LogManager;
import io.helidon.config.Config;
import io.helidon.health.HealthSupport;
import io.helidon.health.checks.HealthChecks;
import io.helidon.media.jsonp.JsonpSupport;
@delabassee
delabassee / vm-setup.sh
Last active April 12, 2022 14:09
0DL: Using OCI to Build a Java Application - VM setup
##!/bin/bash
# Last update:
# 09/14 - source .path (javap)
# 09/11 - conf. nano to show line numbers
# 09/10 - small typo, Heldion default config, javap
# 09/02 - updated Helidon CLI URL from 2.0.2 to 2.1.0
# 08/29 - added nano XML support
# 20/01/21 - updated Helidon CLI URL from 2.1.2, OpenJDK to 15.0.2
# 01/02/21 - updated OpenJDK to JDK 16b34
import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
import java.io.File;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
public class Test {
@delabassee
delabassee / Dockefile
Created August 2, 2019 05:32
Fn init-image with jlink
FROM delabassee/fn-cache:latest as cache-stage
FROM maven:3.6.0-jdk-12-alpine as build-stage
WORKDIR /function
ENV MAVEN_OPTS -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.nonProxyHosts= -Dmaven.repo.local=/usr/share/maven/ref/repository
ADD pom.xml /function/pom.xml
ADD src /function/src
RUN ["mvn", "package"]
RUN ["mvn", "package", \
FNSERVER_IP=$(docker inspect --type container -f '{{.NetworkSettings.IPAddress}}' fnserver)
docker run --rm -d \
-p 8081:8081 \
-e API_URL="http://$FNSERVER_IP:8080/invoke" \
-e no_proxy=$FNSERVER_IP \
--name flowserver \
fnproject/flow:latest
FLOWSERVER_IP=$(docker inspect --type container -f '{{.NetworkSettings.IPAddress}}' flowserver)
@delabassee
delabassee / divefn.sh
Last active December 19, 2018 04:25
Simple Dive wrapper to explore an Fn function layers
#!/bin/bash
if [[ "$#" -ne 2 ]]; then
echo "Illegal number of arguments, it should be '<myapp>' '<myfunction>'."
else
FUNC="$(fn list fn $1 | grep $2 | grep -o '[0-9a-zA-Z\-\.\_\/]*:[0-9a-zA-Z.]*')"
if [ $? -eq 0 ]; then
dive "$FUNC"
else
echo "Unable to find the function, check the arguments."
@delabassee
delabassee / Dockerfile
Created November 12, 2018 10:32
Dockerfile to build Hotwrap (without vendors dips)
# docker build -t delabassee/hotwrap .
FROM golang:1.10 as builder
#COPY vendor /go/src/github.com/fnproject/hotwrap/vendor
COPY hotwrap.go /go/src/github.com/fnproject/hotwrap/hotwrap.go
RUN go get github.com/fnproject/fdk-go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /hotwrap /go/src/github.com/fnproject/hotwrap/hotwrap.go
@delabassee
delabassee / Bio 112 words
Created November 8, 2018 15:46
Bio 112 words
Over the years, David has championed Java extensively throughout the world, presenting at conferences and user groups, large and small, local and global.
David currently works in the Serverless Developer Relations team at Oracle where he is spending most of his time on "Fn Project", an open source polyglot FaaS platform.
Prior to that, he was involved in Java EE 8 and its transition to the Eclipse Foundation as part of the Jakarta EE initiative.
David lives in Belgium. In his spare time, he enjoys playing video games with his daughter and tinkering with technologies such as Home Automation, 3D printers, electronics, and pinballs.
You can find David on Twitter under @delabassee.