Skip to content

Instantly share code, notes, and snippets.

@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 August 20, 2024 09:03
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
@bademux
bademux / JdbcStream.java
Created January 30, 2021 11:40
Jdbs with java streams pos
package pl.com.tiger.httpaccess.messageManager;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@bademux
bademux / ExecutorUtils.java
Created January 28, 2021 11:58
Run task in current thread. Handy for testing. How it works: when thread factory returns null, ThreadPoolExecutor invokes CallerRunsPolicy
@UtilityClass
public class ExecutorUtils {
public static ExecutorService currentThreadExecutorService() {
return new ThreadPoolExecutor(0, 1, 0L, SECONDS, new SynchronousQueue<>(), r -> null, new CallerRunsPolicy());
}
}
@bademux
bademux / thq25-diy.md
Last active January 11, 2021 13:10
Samsung HT-THQ20 diy
name FPC rpi 1
TMS (MLRCK) 11 LRCK P5-4
BCK 12 BCK P5-3
TSD0 (MSDIN0) 13 DOUT P5-6
Gnd 22 Gnd P5-7
D+5 10 +5 P5-1
name FPC rpi stm8 bluepill
@bademux
bademux / ws2812.fs
Created May 3, 2020 12:57 — forked from TG9541/ws2812.fs
STM8 eForth WS2812 demo with tested timing
\ A STM8 eForth WS2812 demo with tested timing
\ 8 x WS2812B on PCB with 470µF capacitor at 5V supply
\ 3.3V MINDEV: PB4 with 1K pull-up to 5V works well
\res MCU: STM8S103
\res export PB_DDR PB_ODR PB_CR1
#require ]B!
#require ]CB