Skip to content

Instantly share code, notes, and snippets.

@schoettl
schoettl / csv2vcf.hs
Created January 14, 2022 22:46
CSV to vCard (.vcf) converter
#!/usr/bin/env stack
-- stack script --resolver lts-18.10 --package "cassava text vector bytestring regex-compat uuid classy-prelude containers"
-- Download Addresses from Xentral into CSV file from
-- https://xxx.xentral.biz/index.php?module=exportvorlage&action=edit&id=yyy
-- Then run:
-- cd /tmp && grep -vE ',"1",[^,]*,$' ~/Downloads/export.csv | csv2vcf.hs
-- Exportvorlage muss diese Felder in dieser Reihenfloge exportieren:
-- useredittimestamp; ansprechpartner; name; firma; mobil; telefon; email; telefax; id; geloescht;
@schoettl
schoettl / csv-to-3cx-addressbook-import-format.hs
Created September 20, 2021 08:18
Xentral Adressen Export umwandeln in 3CX Adressbuch Import-Format
#!/usr/bin/env stack
{- stack script
--resolver lts-18.10
--package "cassava text vector bytestring text-regex-replace"
-}
-- Download Adresses from Xentral into CSV file from
-- https://xxx.xentral.biz/index.php?module=exportvorlage&action=list
-- Then run:
-- ./csv-to-xxx < ~/Downloads/export.csv
@schoettl
schoettl / hiorg-termin-laden.js
Last active October 6, 2022 07:27
Termine aus Tabelle einfach in HiOrg anlegen
// ==UserScript==
// @name New script - hiorg-server.de
// @namespace Violentmonkey Scripts
// @match https://www.hiorg-server.de/termin.php
// @grant none
// @version 1.0
// @author -
// @description 16.6.2021, 23:20:58
// ==/UserScript==
@schoettl
schoettl / xentral-verbindlichkeit.js
Last active July 4, 2022 10:18
Highlight important input fields when creating Verbindlichkeiten
// ==UserScript==
// @name Xentral Verbindlichkeit
// @namespace https://intensovet.de
// @match https://*.xentral.biz/*?module=verbindlichkeit&action=edit&id=*
// @grant none
// @version 1.0
// @author Jakob Schöttl
// @description Highlight important input fields when creating Verbindlichkeiten
// ==/UserScript==
@schoettl
schoettl / xentral-auftrag.js
Last active July 4, 2022 10:18
Customize Xentral Auftrag
// ==UserScript==
// @name Xentral Auftrag
// @namespace https://intensovet.de
// @version 0.1
// @description Add link to open Werkstattauftrag
// @author Jakob Schöttl
// @match https://*.xentral.biz/*?module=auftrag&action=edit&*
// @icon https://www.google.com/s2/favicons?domain=xentral.biz
// @grant none
// ==/UserScript==
@schoettl
schoettl / dhl-generate-csv.sh
Last active November 15, 2020 19:18
Script to generate CSV for DHL Online Frankierung CSV-Import
#!/bin/bash
# Script to generate CSV for DHL Online Frankierung CSV-Import.
# Dependencies: perl fzf xclip awk iconv
printUsage() {
cat <<EOF
Usage: $PROGNAME [options]
Generiert CSV für den CSV-Import bei DHL Online Frankierung:
@schoettl
schoettl / csv2vcf.py
Last active September 28, 2019 21:05 — forked from mridah/csv2vcf.py
csv2vcf is a small command line tool to convert CSV files to VCard (.vcf) files.
"""
Original Author: Mridul Ahuja
Co-Author: Jakob Schöttl
GitHub: https://github.com/schoettl/csv2vcf
Description: A small command line tool to convert CSV files to VCard files
Changes:
- python3
"""
@schoettl
schoettl / hledger-register-remove-sum.sh
Created February 8, 2019 23:08
In hledger register output, remove running-total column and invert amount optionally (for € commodity)
#!/bin/bash
# Remove running sum and optionally invert amounts.
# Call with -i as first arg to invert amount!
# All other args are passed to hledger register.
set -o errexit -o pipefail -o nounset
removeSum() {
sed -r -e 's/ +[^ ]+ €$//'
}
@schoettl
schoettl / copy-sth-to-xclipboard.sh
Created February 2, 2019 19:01
Copy text to both normal X clipboard and primary selection (middle mouse button)
# Note the -f option for xclip:
echo foo | xclip -f -i -selection clipboard | xclip -i -selection primary
# Short form:
echo foo | xclip -f -selection c | xclip
# Before I discovered xclip -f, I tried this which did not work in my Bash 5:
@schoettl
schoettl / switch-audio-output.sh
Created April 29, 2018 17:05
Switch current audio output device (or toggle between sinks) – This code is for PulseAudio. I use it in an Xmonad key binding.
#!/bin/bash
# Switch the current audio output device.
# Without options: Toggle between two sinks.
# This script works for PulseAudio; pactl must be installed.
printUsage() {
cat <<EOF
usage: $PROGNAME [options]
options: