Skip to content

Instantly share code, notes, and snippets.

View Markus-de-Koster's full-sized avatar

Markus de Koster Markus-de-Koster

View GitHub Profile
@Markus-de-Koster
Markus-de-Koster / email_config.md
Last active March 19, 2025 10:08
Calendar configuration with Google Calendar and caldav

Thunderbird

Google Calendar

  1. Install Addon Provider for Google Calendar
  2. In the Calendar Tab click on New Calendar Google Calendar and add your google account.

CalDav

  1. In the Calendar Tab click on New Calendar On the network
  2. Enter your username and the caldav address
@Markus-de-Koster
Markus-de-Koster / h5_conversion.py
Created August 14, 2024 09:33
Quick example for h5 to excel / csv conversion
import pandas as pd
import h5py
import numpy as np
import os
# h5 example file
h5_file_path = 'test_file.h5'
def h5_to_excel_or_csv(h5_file, output_file=None, output_format='csv'):
@Markus-de-Koster
Markus-de-Koster / extract_pdfs.py
Created July 1, 2024 10:45
Extract PDF files from Zotero used in LaTeX Bibliography of a document
import re
import shutil
import os
import glob
from pybtex.database.input import bibtex
AUXFILE = 'PQSE.aux'
BIBFILE = 'test.bib'
DEST_FOLDER = 'pdfs'
@Markus-de-Koster
Markus-de-Koster / open_byobu_here.md
Created June 26, 2024 07:46
Open Byobu in the current directory ("Open in Terminal") on Linux Ubuntu using Nautilus File Manager

Open Byobu here

Using byobu and trying to open a bash in a specific folder using "Open in Terminal" (Nautilus) will not result in the desired behaviour. Instead, byobu is opened in the current session, not at the desired location.

Steps

  1. Create the file open_byobu_here.sh (see below)
  2. chmod +x open_byobu_here.sh
  3. For Nautilus, create a script folder mkdir -p ~/.local/share/nautilus/scripts/
  4. Link the script ln -s ~/open_byobu_here.sh ~/.local/share/nautilus/scripts/Open\ in\ Byobu\ Here
@Markus-de-Koster
Markus-de-Koster / latex_diff_mark_changes.md
Created May 7, 2024 16:19
Mark changes in a LaTeX document in color

LaTeX changes in color

One of your papers was reviewed and you were asked to mark changes in a different color? No problem! Use this method to easily mark everything you changed in your LaTeX document since your submitted the original paper. Also applicable to non-science use cases.

Steps

  1. get the difference between two commits (which you want to compare) of the tex file and save the output
git diff   -- path/to/file.tex > changes.diff
@Markus-de-Koster
Markus-de-Koster / change_git_commit_email.sh
Last active April 4, 2024 18:37
Change all occurrences of a specific email address in git commits to a new one. Helps preventing exposure of private email addresses after committing with wrong config.
#!/bin/bash
echo "Enter the new email address:"
read CORRECT_EMAIL
OLD_EMAILS=""
first=true
while true; do
echo "Enter an old email address to replace (or press ENTER to continue):"
read OLD_EMAIL
@Markus-de-Koster
Markus-de-Koster / Teams_PWA_links.md
Last active March 5, 2025 13:35
Open Teams links in edge PWA, for all other links, use firefox (Linux Ubuntu)
@Markus-de-Koster
Markus-de-Koster / scanimage.sh
Last active March 7, 2024 10:43
Scanimage automated script for reading multiple pages and converting to PDF (linux)
#!/bin/bash
# Function to check if a command is available
check_command() {
if ! command -v "$1" &>/dev/null; then
echo "Command '$1' is required but not found. Please make sure it is installed and accessible in your PATH."
exit 1
fi
}
@Markus-de-Koster
Markus-de-Koster / zotero_libreoffice.md
Created January 10, 2024 08:38
Zotero Integration with LibreOffice on Linux using Flatpak

Zotero Integration with LibreOffice on Linux using Flatpak

Installation

  1. Open Zotero
  2. Go to tools addons and add Zotero LibreOffice Integration (?)
  3. Install libreoffice-java-common sudo apt-get install libreoffice-java-common
  4. Open LibreOffice
  5. Go to Tools > Extension Manager and press on Add
  6. Locate the .oxt extension file
@Markus-de-Koster
Markus-de-Koster / settings.json
Last active April 25, 2023 11:12
LaTeX workflow using visual studio code
{
"js/ts.implicitProjectConfig.experimentalDecorators": true,
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",