Skip to content

Instantly share code, notes, and snippets.

View yvesf's full-sized avatar
🚒

Yves Fischer yvesf

🚒
  • Switzerland
View GitHub Profile
@yvesf
yvesf / sample.md
Created December 10, 2022 18:42
Remote access with i2p (experimental)

Remote access with i2p

I2P allows accessing the raspberrypi no matter where it's located as long as it's connected to the internet.

After first setup, on the RaspberryPi lookup and note down the i2p-address in the device (on RaspberryPi):

for f in /var/lib/i2pd/*keys; do echo "$f: $(head -c 391 $f | sha256sum | cut -f1 -d\  | xxd -r -p | base32 | tr '[:upper:]' '[:lower:]' | sed -r 's/=//g').b32.i2p"; done

On local computer start i2pd (and wait a bit):

@yvesf
yvesf / Makefile
Created June 22, 2022 20:26
very simple way to create a working debian package
PACKAGE_NAME=git-repo
PACKAGE_VERSION=0.1+git-$(shell git describe --always HEAD)
PREFIX=/usr/local/bin
include Makefile.package
work/data: work work/data/$(PREFIX)
work/data/$(PREFIX):
mkdir -p "$@"
cp git-repo "$@"
@yvesf
yvesf / fhsenv.nix
Created September 4, 2020 21:31
Running mediatek SP Flash Tool in nixos
let
pkgs = import <nixpkgs> {};
in pkgs.buildFHSUserEnv {
name = "fhs";
targetPkgs = pkgs: [
pkgs.nextcloud-client
pkgs.fontconfig
pkgs.freetype
pkgs.zlib
pkgs.wine
package main
/*
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
void (*go_handler)(int, siginfo_t *, void *);
@yvesf
yvesf / scrolling-x1-touchpad.sh
Last active April 11, 2017 21:53
Using touchpad as single scrolling area on Thinkpad X1 Carbon 5thgen/2017
#
# Completely disable the touchpad functionality but enable the whole touchpad for single-finger scrolling
#
# Disable touchpad mouse movements
xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 100000
# Disable touchpad mouse button events
xinput set-button-map 'SynPS/2 Synaptics TouchPad' map button 0
# Disable two finger scroll
@yvesf
yvesf / SaveCascadeSpec.groovy
Created February 17, 2017 12:53
Grails/GORM cascade on save with SimpleMapSession
package org.grails.datastore.gorm
import grails.gorm.tests.GormDatastoreSpec
import grails.persistence.Entity
import org.grails.datastore.mapping.dirty.checking.DirtyCheckable
class SaveCascadeSpec extends GormDatastoreSpec {
def "Test save() cascades on one-to-one"() {
given: "A domain model with a one-to-one"

Keybase proof

I hereby claim:

  • I am yvesf on github.
  • I am yvesf (https://keybase.io/yvesf) on keybase.
  • I have a public key whose fingerprint is 1216 25F9 DA5C 7241 DAF7 E874 DD79 51D8 867D EED0

To claim this, I am signing this object:

@yvesf
yvesf / README.md
Created January 13, 2016 16:56
Grails 3 Run-Command

Grails 3 no longer contains the functionality to execute Scripts within an running application context. Grails 2.x contained the 'run-script' command and also allowed to run arbitrary scripts implemented as Gant tasks under $dir/scripts directory of any project.

As a substitute grails 3 offers ApplicationContext Commands. The downside is that they cannot be implemented in the actual project because they have to be in the gradle buildscript classpath as well. This is also not desirable because one don't want to pollute this classpath with application dependencies.

This project provides a workaround for that. It is on one side a grails project and registers exactly one command that

#!/usr/bin/env python3
import json
import time
import netrc
import base64
import codecs
import urllib.request
import urllib.parse
from funcparserlib.lexer import make_tokenizer, Token, LexerError
@yvesf
yvesf / parse-chrome-pak.sh
Created May 2, 2015 20:35
Parse google-chrome .pak files in shell
#!/bin/bash
# Parse google-chrome .pak resourcefiles
parse_int() {
( echo "ibase=16; "; cat; echo -e "\n") | bc
}
endian_conversion() {
if [[ "$1" == "little" ]]; then
tac