Skip to content

Instantly share code, notes, and snippets.

@bademux
bademux / Jacoco2coberturaConverter.groovy
Last active April 16, 2024 19:03
Pure groovy jacoco2cobertura converter to be used with Gradle
import groovy.xml.XmlNodePrinter
import groovy.xml.XmlSlurper
import groovy.xml.slurpersupport.GPathResult
import groovy.xml.slurpersupport.NodeChild
import groovy.xml.slurpersupport.NodeChildren
import java.util.concurrent.TimeUnit
//put file into buildSrc/src/main/groovy
class Jacoco2coberturaConverter {
@bademux
bademux / tesseract-ocr-mrz.Dockerfile
Created January 4, 2024 18:43
Dockerfile.tesseract-ocr-mrz
FROM alpine:3.19 as mrz-builder
RUN apk --no-cache add --update make wget findutils bash unzip bc leptonica-dev python3 py3-pip tesseract-ocr tesseract-ocr-data-eng tesseract-ocr-data-pol
WORKDIR /build
RUN wget -qO- https://github.com/tesseract-ocr/tesstrain/archive/master.tar.gz | tar -zxv --strip-components=1
RUN pip install -r requirements.txt --break-system-packages
RUN make tesseract-langdata -e -j
RUN wget -qO- https://github.com/DoubangoTelecom/tesseractMRZ/archive/master.tar.gz | tar -zxv --strip-components=1
@bademux
bademux / sensorWatchBuilder.Dockerfile
Last active November 26, 2022 15:31
Sensor Watch Builder Dockerfile
#use DOCKER_BUILDKIT=1 to cache downloaded layer and --output to export built Artefact
FROM scratch as caching-downloader
ADD https://github.com/bademux/Sensor-Watch/archive/refs/heads/feature/vendoring_ext_libs.tar.gz /sensor-watch.tar.gz
#DOCKER_BUILDKIT=1 docker build --file builder.Dockerfile -t sensor-watch-builder --target builder . && docker run -it -p 8000:8000 sensor-watch-builder and then open http://localhost:8000
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y --no-install-recommends make libnewlib-arm-none-eabi gcc-arm-none-eabi emscripten &&\
rm -rf /var/lib/apt/lists/*
RUN adduser --disabled-password user
@bademux
bademux / JavaWine.Dockerfile
Last active November 6, 2022 20:14
java wine docker apline
#use DOCKER_BUILDKIT=1 to cache downloaded layer and --output to export built Artefact
#DOCKER_BUILDKIT=1 docker build --progress=plain --output type=tar,dest=../artefact.tar .
FROM scratch as caching-downloader
ADD https://api.adoptium.net/v3/binary/latest/19/ga/windows/x64/jdk/hotspot/normal/eclipse /jdk.zip
FROM alpine:3.16 as builder
RUN apk add --no-cache --update wine git util-linux
RUN adduser -D user
ENV WINEPREFIX=/home/user \
WINEDEBUG=-all \
@bademux
bademux / enable_hardware_acceleration.sh
Last active October 20, 2022 14:05
Enable hardware acceleration and dark mode for UngoogledChromium
~/.var/app/com.github.Eloston.UngoogledChromium/config/chromium-flags.conf << EOF
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-gpu-compositing
--enable-accelerated-2d-canvas
--enable-zero-copy
--canvas-oop-rasterization
--enable-accelerated-video-decode
--enable-accelerated-video-encode
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiIgnoreDriverChecks
@bademux
bademux / Rockrobo-spotifyd.md
Last active November 28, 2021 13:39
Install Spotifyd on rooted rockrobo
  • Download spotifyd
wget -qO- https://github.com/Spotifyd/spotifyd/releases/download/v0.3.2/spotifyd-linux-armv6-slim.tar.gz | tar -xvz -C /opt
  • Add it to upstart nano /etc/init/spotifyd.conf
description "spotifyd service"
start on (local-filesystems and net-device-up IFACE!=lo) 
@bademux
bademux / APKBUILD
Last active August 8, 2021 23:11
alpine pkg that let you run installation hook, please see package()
# pkg that let you run installation hook, please see package()
# to enable it please
# 1. Run pmbootstrap init and add pmbootstrap-install-hook to custom packages
# 2. pmbootstrap newapkbuild pmbootstrap-install-hook && curl https://gist.githubusercontent.com/bademux/b3f8e9ae7d95f51f75307118ca6eb44a/raw/APKBUILD > ~/.local/var/pmbootstrap/cache_git/pmaports/main/pmbootstrap-install-hook/APKBUILD
pkgname=pmbootstrap-install-hook
pkgver=1
pkgrel=0
pkgdesc="Install dependencies and configs for headless server"
url="https://gist.github.com/bademux/b3f8e9ae7d95f51f75307118ca6eb44a"
arch="all"
@bademux
bademux / k3d_docker_registry_localhost.md
Last active February 14, 2024 11:40
How to use localhost:5000 docker registry along with k3d cluster

Install k3d https://k3d.io/#installation

Create registry k3d registry create registry.localhost --port 5000

Create Cluster with registry and expose port k3d cluster create mycluster -p "8081:80@loadbalancer" --registry-use k3d-registry.localhost:5000 --registry-config registries.yaml

registries.yaml:

@bademux
bademux / installAlpineAsDataDisk.md
Last active December 30, 2021 21:01
install Data Disk alpine with zfs /var

Download latest Extended Alpine https://alpinelinux.org/downloads/

Copy all files from alpine iso to USB drive formatted as a single efi partition.

Setup Apline

setup-alpine
apk add util-linux nano udev zfs
setup-udev
modprobe zfs
@bademux
bademux / DockerHackfixRMISocketFactory.java
Last active May 23, 2021 16:16
Using java jmx over rmi with remote docker container. MIT licensed :)
import com.github.dockerjava.api.command.InspectContainerResponse;
import com.github.dockerjava.api.model.Container;
import com.github.dockerjava.api.model.ContainerNetwork;
import com.github.dockerjava.api.model.ContainerPort;
import lombok.SneakyThrows;
import lombok.experimental.Delegate;
import java.util.*;
/**
* init asap with utils.DockerHackfixRMISocketFactory#init(), then target container run using env var