Skip to content

Instantly share code, notes, and snippets.

View j4velin's full-sized avatar
:octocat:

Thomas Hoffmann j4velin

:octocat:
View GitHub Profile
@j4velin
j4velin / firefly.py
Created October 8, 2022 19:15
DKB -> Firefly CSV Converter
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import csv
import re
accounts = [ "add account numbers here" ]
def handleAccount(input):
@j4velin
j4velin / scan.sh
Created September 19, 2020 16:16
Scans the given number of pages and moves the resulting pdf to the input directory for the ocr.sh script
#/bin/bash
count=$1
resolution=150
cd /home/pi/scans
if [ $count -gt 1 ]
then
scanimage --batch=scan_%d.tiff --batch-count=$count --format=tiff --resolution $resolution --mode Gray
tiffcp scan_* scan.tiff
@j4velin
j4velin / ocr.sh
Last active January 20, 2022 14:30
Script to run ocrmypdf on new pdf files and move the ocr'ed version to the paperless input directory
#/bin/bash
workdir=/home/pi/ocr.work
scaninput=/home/pi/scaninput
outdir=/home/pi/paperless.consume
inotifywait -m -e close_write -e moved_to $scaninput |
while read -r path action file; do
echo "Waiting for $file..."
sleep 10
@j4velin
j4velin / fan_control.py
Last active March 7, 2020 17:26
Temperature based fan control script for Raspberry Pi 4
#! /usr/bin/python
import subprocess
import time
import re
from gpiozero import LED
PIN = LED(17)
MAX_TEMP = 50
MIN_TEMP = 45