Skip to content

Instantly share code, notes, and snippets.


coseos coseos

View GitHub Profile

JPA @Identity Stragey values

Just to remember the strategies available in JPA for id generation. In most cases, AUTO will work fine as in


Sometimes AUTO does not work. Use IDENTITY for a database that supports autoincement columns and SEQUENCE for a database that supports sequences. Few databases require TABLE

# Simple Python Script to flash LED on Raspberry Pi Pico
from machine import Pin
import time
led = Pin(25, Pin.OUT)
while True:
#!/usr/bin/env bash
# Credits for this script to:
# Run this script on your Raspberry Pi (Bullseye) to turn it into a bridge.
# You can now connect a network printer to the ethernet port of your
# This is a template on how to add a CTRL-C handler in your Python script
# With this handler, you can include a proper cleanup before the script is terminated.
from signal import signal, SIGINT
from sys import exit
View typelog.js
// typelog: a simple function to log the type and value of a variable
// This is a short function to show the type and value of a variable that i use in my JavaScript trainings.
// It helps students to understand what they are working with in JavaScript, since JavaScript does not
// require programmers to provide the data type for a variable.
// Example:
// typelog( "A string" );
// typelog( 42 );
View DX.bin
{"timestamp": "2022-11-04T09-00-01_00-00", "state": "U2FsdGVkX1+AyIV8Mkc/W/uc3THqGxYRDVfu0XJwtEA="}
View Linux crontab

Linux crontab shortcuts

With cron, you can use some shortcuts that let you see when an entry is triggered without remembering the more difficult numbers that you would have to put there:

Synonym        Meaning and equivalent crontab values
-----------    ---------------------------------------------------
@reboot        Run once, at startup (only works with this synonym)
@yearly        Run once a year, equals "0 0 1 1 *".
@annually (same as @yearly)
View Docker on Raspberry Pi

Docker on Raspberry Pi 4

It's so simply to use Docker on the Raspberry Pi. All you have to do is:

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install

sudo usermod -aG docker pi

sudo systemctl reboot
coseos /
Created Jun 6, 2022
Razer Book 13 with Debian Bullseye Fix Audio problem

Razer Book 13 with Debian Bullseye: Fix Audio Problem

The Razer Book 13 is my second Razer notebook. The fine silver makes a nice difference to the beautiful black of the Stealh 13. Even though the technical specs leave some wishes open as 16 GB of RAM is the max, the look and touch is great. In my opinion this is the most beautiful non black notebook available in 2022.

Razor Book 13

Audio may not work out of the box though when you install Debian Bullseye (11) on your Razor Book 13.

When your output lists only the Dummy-device, fix that with the following command (run as root):