Skip to content

Instantly share code, notes, and snippets.

View matchaxnb's full-sized avatar

Matcha matchaxnb

View GitHub Profile
@matchaxnb
matchaxnb / style-overrides.css
Last active January 27, 2022 15:35
Ultimate-Guitar printing - better formatting - for Tampermonkey / userscripts...
div.page-container._2OWtf {
width: 297mm;
height: 210mm;
max-width: 297mm;
max-height: 210mm;
padding: 5mm;
}
@page {
size: auto;
@matchaxnb
matchaxnb / auchan-tampermonkey.userscript.js
Created June 22, 2020 10:40
UserScript Tampermonkey Auchan
// ==UserScript==
// @name AuchanToSpreadsheet
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Auchan - get output in a way that can be pasted in a spreadsheet.
// @author Matcha
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @match https://www.auchan.fr/checkout/cart/
// @grant none
#!/usr/bin/env python
"""This dumps data from a Traefik v2 acme.json"""
import json
import sys
import base64
# stolen from https://gist.githubusercontent.com/JayH5/1a427e2f52444f45280f30215d5a92d9/raw/63ca1d54496d1b159fe41febe765251e33200365/acme-cert-dump-all.py
def to_pem_data(cert, key):
return b''.join((base64.b64decode(cert),
base64.b64decode(key)))
@matchaxnb
matchaxnb / generate-trust-anchor.py
Created November 12, 2019 15:10
generate trust-anchors.conf file for dnsmasq
#!/usr/bin/env python
"""Released under the terms of the Artistic License
This script generates a trust-anchors.conf from the IANA website.
Its output is as safe as your connection to the Web. A bad trusted CA
certificate will help attackers spoof the trust anchors.
Run this from a machine you control and trust.
"""
#!/bin/bash
SONG=$1
START_TIME=$2
DURATION=${3:-0:02}
BN=$(basename "$SONG" .flac)
if [ "" = "$START_TIME" ];then
sox "${SONG}" -n remix 1 spectrogram -x 3000 -y 513 -z 120 -w Kaiser -o "$HOME/spectro-analysis/${BN}.spectre.png"
else
sox "${SONG}" -n remix 1 spectrogram -x 3000 -y 513 -z 120 -w Kaiser -S ${START_TIME} -d ${DURATION} -o "$HOME/spectro-analysis/${BN}.spectre.zoom.${START_TIME}__${DURATION}.png"
@matchaxnb
matchaxnb / push_text.js
Created August 18, 2018 08:54
After Effects / expression for Text Source to animate a text as if it were pushed item by item
var t = thisComp.layer(1).timeToFrames(time);
var sourceText = "sample text";
var timePerFrame = 4;
numChar = t / timePerFrame;
sourceText.substring(0, numChar);
@matchaxnb
matchaxnb / genpw.sh
Last active February 9, 2018 15:40
Unambiguous password generator
# these passwords are compatible with azerty and qwerty keyboards (considering you input numbers on the numpad).
# also, characters that can be misinterpreted like big-O and zer0, small l and 1 are ruled out.
GenPw() {
REGEX_PASSWORD="^[ertyuiopsdfghjkxcvbnERTYUIPSDFGHJKLXCVBN23456789]+$"
NUM=${1:-8}
LEN=${2:-9}
if [ $(( $LEN % 3 )) -ne 0 ]; then
echo "param 2 must be a multiple of 3"
return
fi
@matchaxnb
matchaxnb / put_in_your_shrc.sh
Created November 20, 2017 10:40
Offending SSH key script
# inspired by ze
Offending() {
keytype=$1
_=$2
_=$3
FILEPATH=$4
shift 4
FILENAME=$(echo $FILEPATH | cut -d: -f1)
FILELINE=$(echo $FILEPATH | cut -d: -f2)
gsed -i -e "${FILELINE}d" $FILENAME || sed -ibak -e "${FILELINE}d" $FILENAME
@matchaxnb
matchaxnb / Notes for AD migration from Samba to Synology.md
Created October 29, 2017 14:46
Migration from Samba to Synology AD

We cover how to migrate from Samba to Synology, while changing AD domain name and keeping permissions.

Install SetACL.exe

From Helge Klein's site.

Prepare Synology and migrate file data

Create shared volumes on your Synology. Enable extended attributes (Windows attributes) in the Control Panel.

@matchaxnb
matchaxnb / README.md
Created April 24, 2017 22:17
Wrapper for Alfresco OCR using alfresco-simple-ocr

Alfresco OCR

I need a very basic Alfresco OCR for my documents. My life is a mess and I believe I can sort stuff out using code. If this can help the commumity it's even better.

I have written a simple img2pdf converter that I will put soon online on Github.

This way when I receive a letter, I just take a pic of it and feed it to a folder on my Alfresco. Then it is converted to PDF, the original is archived, and the PDF is OCRed.