Skip to content

Instantly share code, notes, and snippets.

View liotier's full-sized avatar

Jean-Marc Liotier liotier

View GitHub Profile
0 HEAD
1 SOUR Alfredo Bensaúde
2 TITL La Vie de José Bensaúde
2 PUBL Porto, 1936 (French translation by Olivier Bensaúde, Paris 2000)
1 GEDC
2 VERS 5.5.1
1 CHAR UTF-8
0 @I1@ INDI
1 NAME José /Bensaúde/
@liotier
liotier / BalooDuck.sh
Last active March 2, 2025 17:05
Monitor KDE screen lock/unlock through DBUS to trigger a command. Here, I suspend Baloo indexing while I'm logged on... I love BalooSearch but the indexer is a hog, so let him hog all it wants when I'm not using the host !
#!/bin/bash
dbus-monitor --session "type='signal',interface='org.freedesktop.ScreenSaver'" | while read -r line; do
if echo "$line" | grep -q "boolean true"; then
balooctl resume
elif echo "$line" | grep -q "boolean false"; then
balooctl suspend
fi
done
import sys
import os.path
from csv import reader
from geopy.geocoders import Nominatim
locator = Nominatim(user_agent="OSMF_survey")
inputfile = sys.argv[1]
base, ext = os.path.splitext(inputfile)
os.remove(base+"_reversed"+ext) if os.path.exists(base+"_reversed"+ext) else None
@liotier
liotier / splitter.vba
Created November 20, 2020 20:34
Split Microsoft Word mail merge
' Taken from https://answers.microsoft.com/en-us/msoffice/forum/all/split-a-mail-merge-document-into-subdocuments/898e11ce-5d81-4ca1-a2a2-8ee86f5273b2?page=1
Sub splitter()
' splitter Macro
' Macro created by Doug Robbins to save each letter created by a mailmerge
' as a separate file.
Dim Letters As Integer, Counter As Integer
@liotier
liotier / bluetooth-a2dp
Last active November 13, 2015 00:07 — forked from ragusa87/bluetooth-a2dp
Enable bluetooth A2DP on Raspberry-PI via pulseaudio.To install, edit /etc/udev/rules.d/88-bluetooth.rules and add the line:SUBSYSTEM=="bluetooth", RUN+="/usr/local/lib/udev/bluetooth-a2dp" - Then save this script as /usr/local/lib/udev/bluetooth-a2dp and set it executable. Bluetooth devices must be linked first.
#!/bin/bash
# This script is called by udev when you link a bluetooth device with your computer
# It's called to add or remove the device from pulseaudio
#
#
# Output to this file
LOGFILE="/var/log/bluetooth_dev"
# Name of the local sink in this computer