Skip to content

Instantly share code, notes, and snippets.

View cfstras's full-sized avatar

Claus F. Strasburger cfstras

  • Düsseldorf, Germany
  • 12:21 (UTC +02:00)
View GitHub Profile
@cfstras
cfstras / 0_Mirror a repository using GitLab CI.md
Last active April 7, 2024 04:00
How to mirror a repository using GitLab CI

Mirroring a repository using GitLab CI

inspired by https://gitlab.com/freifunkks/mirror-scripts

This can be used, for example, to clone a repository living on github over to GitLab in order to run CI

Setup

  • Setup separate repository with mirror scripts. We'll call it "mirror-scripts"
  • push the two files below.
  • in the .gitlab-ci.yml replace MY_REPO with your repo name
@cfstras
cfstras / -Custom styles for SevDesk.md
Last active April 2, 2024 09:38
Custom Styling for SevDesk on laptop screens

SevDesk is a useful tool, but on my 13" MacBook, I find it wastes too much whitespace on menu elements and such, which makes it hard to keep an overview.

These styles can easily be applied using StyleBot or your CSS-tweaking tool of choice.

Some aspect ratios will look yanky with this applied, so YMMV.

Parsing SML Energy Meter Values for Loxone Miniservers

This is a custom PicoC program to parse the SML energy readings in a tibber+Loxone setup.

Our system runs a [tibber Pulse], connected to a [EMH ED300L][ED300L] energy meter. We run this code on a [Loxone Miniserver][loxone], which can run custom PicoC code.

We use the TCP stream method to read the current SML data packet from the tibber bridge

Getting started

@cfstras
cfstras / -Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
Last active March 29, 2024 09:25
Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
See the bash script below. :)
Tested on debian bookworm-slim (`docker pull debian:bookworm-slim`).
### Prerequisites
```bash
apt update
apt install -y build-essential wget bison
```

Firefox userChrome.css for macOS & Tree Style Tab

  • for use with Tree Style Tab
  • high space utilization on small displays by reducing the height of the title bar

I like it this way.

Setup

To use this:

@cfstras
cfstras / 0 YtLight.md
Last active January 30, 2024 17:27
Lightweight YouTube Oneboxer for Discourse.

Note (2024): This was relevant in 2014, when the YouTube OneBoxer integrated with Discourse was not exactly behaving how I liked it, so I made this one.
It probably doesn't work anymore.

YtLight

Replace those nasty YouTube iframes with static images for ultimate loading time in threads with lots of videos

When clicked, they get replaced by the actual iframe.

@cfstras
cfstras / shepard.js
Last active January 30, 2024 17:22
Shepard tone with muzikilo.js
// https://github.com/anuejn/muzikilo.js
const {sin, PI, round, pow, abs, floor, exp} = Math
this.t += 1/44100
const sine = (name, f) => {
let phi = this[name] += 1/44100 * 2 * PI * f * saw(name+10000,f*0.5)
this[name] %= 2*PI
return sin(phi)
}
@cfstras
cfstras / _Styling for Tree Style Tab.md
Last active January 30, 2024 17:13
My Firefox styling for Tree Style Tab
@cfstras
cfstras / _lima-on-m1.md
Last active January 30, 2024 17:11
Lima M1

Note (2024): I've used this for a while to get a reasonably workable Docker installation on my M1 MacBook. For simplicity I use colima nowadays. The setup below should still work though.


  1. Install lima
    brew install lima