Skip to content

Instantly share code, notes, and snippets.

View pschichtel's full-sized avatar

Phillip Schichtel pschichtel

View GitHub Profile
@pschichtel
pschichtel / play_video.sh
Created May 18, 2019 14:26
Simple script to play the video from a capture card
#!/bin/bash
device=/dev/video2
amixer -c stk1160mixer sset Line unmute cap
vlc -vvv --color --input-slave=alsa://pulse --live-caching=300 \
--v4l2-standard=PAL --deinterlace-mode=yadif \
--video-filter=deinterlace "v4l://${device}"
@pschichtel
pschichtel / eurit-4000-phonebook-migrate.py
Created December 2, 2018 21:22
The is a script to convert the phonebook CSV export from the EuriTel Pro software (used for old Ascom/Swissvoice analog phones together with the "PC-Dialer III" device) to the CSV schema supported by outlook and sipgate.de. It applies a bunch of assumptions to extract customer numbers and other contact details to the proper fields.
# coding=utf-8
import sys
import csv
import vobject
import re
whitespace = re.compile('\s+')
numberCleaner = re.compile('^.*?(\d+).*$')
customerIdFormat = re.compile('^\S*?\d+$')
extern crate multimap;
use std::hash::Hash;
use multimap::MultiMap;
fn main() {
let mut mmap = MultiMap::new();
mmap.insert(1, 'a');
mmap.insert(1, 'a');
@pschichtel
pschichtel / install_entry.sh
Last active June 22, 2023 22:04
script to setup an EFISTUB entry on Arch Linux
#!/usr/bin/env bash
set -eu
esp_disk="/dev/nvme0n1"
esp_part="2"
declare -A bins
bins["arch/linux-signed.efi"]="Linux"
bins["arch/linux-fallback-signed.efi"]="Linux Fallback"
@pschichtel
pschichtel / ingdiba-html2csv.py
Last active September 28, 2018 14:50
Takes the output of poppler's pdftohtml tool when feeding in an ING-DiBa bank statement and produces csv that can be imported into e.g. Excel. Works mostly correct. Additional kinds might need to be added.
#!/usr/bin/env python3
import sys
import os
import re
import html
closure = 'Abschluss'
kinds = {
'Lastschrift': 'Lastschrift',
@pschichtel
pschichtel / BlockingFileQueue.java
Created September 20, 2018 21:49
BlockingQueue<byte[]> implementation based on tape2's QueueFile
package tel.schich.carla.collection;
import com.squareup.tape2.QueueFile;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
#include <stdio.h>
#include <sys/socket.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <sys/ioctl.h>
#include <libnet.h>
#include <net/if.h>
#include <sys/socket.h>
#include <stdbool.h>
Operating system: Linux
0.0.0 Linux 4.18.0-rc7-mainline #1 SMP PREEMPT Mon Jul 30 02:23:30 UTC 2018 x86_64
CPU: amd64
family 6 model 158 stepping 10
1 CPU
GPU: UNKNOWN
Crash reason: SIGSEGV /0x00000000
Crash address: 0x0
import scala.annotation.tailrec
object SudokuSolver {
type IndexGroup = Seq[Int]
def main(args: Array[String]): Unit = {
val undefined = 0
val domain = (1 to 9).toSet
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using System.Web;
using RestSharp;
using RestSharp.Authenticators;
using TwitchLib.Client;
using TwitchLib.Client.Events;
using TwitchLib.Client.Models;