Skip to content

Instantly share code, notes, and snippets.

View frafra's full-sized avatar

Francesco Frassinelli frafra

View GitHub Profile
@frafra
frafra / rsession-wrapper.sh
Last active March 12, 2026 19:14
RStudio pixi integration
#!/bin/bash
# rsession-wrapper — RStudio Server rsession wrapper with per-project pixi support
#
# When a user opens (or switches to) a project that contains a pixi.toml,
# this wrapper activates the pixi environment before launching rsession.
# This gives each project its own R installation and library paths.
#
# HOW IT WORKS
# ------------
# RStudio Server does not pass project information to rsession at launch.
@frafra
frafra / kroki.js
Last active March 9, 2026 04:01
Render with mermaid and kroki, with support for mdbook
// <script type="module">
var server = "https://kroki.io";
var libraries = [
"bytefield",
"c4plantuml",
"d2",
"ditaa",
"erd",
"graphviz",
"dot",
@frafra
frafra / test.md
Created December 20, 2025 14:30
btrfs dup simulated corruption

Testing btrfs dup profile and automatic repairing on a USB drive.

$ sudo mkfs.btrfs -d dup -m dup -L Dati /dev/sdc1 -f
btrfs-progs v6.16.1
See https://btrfs.readthedocs.io for more information.

Label:              Dati
UUID:               9598b427-857e-44c7-9800-dbd90bd7cbe7
Node size:          16384
@frafra
frafra / chromebook-ideapad-flex-5i.md
Last active December 13, 2025 12:39
Chromebook with Linux

Hardware details

  • Model: Lenovo Chromebook IdeaPad Flex 5i 14''
  • Hardware ID: TAEKO-QSHQ
  • CPU: Intel Pentium Gold 8505
    • Alder Lake
    • 1 performance core (2 threads) + 4 efficient cores = 6 threads
    • Virtualization Technology, Quick Sync, AVX2
  • Storage: 64 GB eMMC
@frafra
frafra / mbox2html.py
Last active December 4, 2025 02:44
Mailbox to HTML conversion using Python 3 + Jinja2 in less than 100 lines (including GPLv3 license)
#!/usr/bin/env python3
#
# Copyright (C) 2016 - Francesco Frassinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
services:
postgres:
image: docker.io/library/postgres:18-alpine
environment:
POSTGRES_USER: wikijs
POSTGRES_PASSWORD: wikijs
volumes:
- ./postgresql/18:/var/lib/postgresql/18/docker
wikijs:
image: ghcr.io/requarks/wiki:2
@frafra
frafra / tutorial.md
Created July 26, 2025 14:23
Track software changes to Linux root using overlayfs
mkdir -p upper work merged

mount overlay -t overlay -o lowerdir=/,upperdir=upper/,workdir=work/ merged/

mount -t proc /proc merged/proc/
mount --rbind /sys merged/sys/
mount --rbind /dev merged/dev/

chroot merged/
@frafra
frafra / .gitlab-ci.yml
Created November 6, 2020 15:46
Build containers with GitLab CI without root nor daemons by using buildkit
build-container:
stage: build
image:
name: moby/buildkit:rootless
entrypoint: [ "sh", "-c" ]
variables:
BUILDKITD_FLAGS: --oci-worker-no-process-sandbox
before_script:
- |
mkdir ~/.docker
#!/bin/bash
set -eu
OLD_PASSWORD="old_endoded_pwd"
NEW_PASSWORD="new_endoded_pwd"
filter='(.resource.sources | (.sqlsource, .sqlsources[])? | select(.password == $old).password) |= $new'
for file in */resource.xml; do
@frafra
frafra / README.md
Last active January 10, 2025 09:06
GLX in nix-shell

How to solve Could not initialize GLX and similar errors?

Workaround (not recommended)

export QT_XCB_GL_INTEGRATION=none

-- NixOS/nixpkgs#82959 (comment)