Skip to content

Instantly share code, notes, and snippets.

@tovrstra
tovrstra / remove-links-pdf.py
Created November 9, 2025 12:29
Remove all links from a PDF
# Copyright 2025 Toon Verstraelen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@tovrstra
tovrstra / online_teaching_howto.md
Last active June 5, 2025 23:57
Share iPad/IPhone/Android screen in all sorts of ways...

Turn any Linux laptop into a wireless access point

When your institution's WiFi is flaky or overloaded by students voting on your polls, you can set up your own WiFi access point as follows on your Linux laptop for your tablet (in case your tablet does not support USB tethering, i.e. you're stuck with an iPad):

nmcli d wifi hotspot ifname <wifi_device> ssid <YOURSSID> band a password <your_pass>
#!/usr/bin/env python3
"""Convert Openstreetmap Way to GPX format.
This Python script is derived from the following PERL script:
https://wiki.openstreetmap.org/wiki/Relations/Relations_to_GPX
Usage:
./waytogpx.py <way>
class OneDTransform:
def eval(self, r):
raise NotImplementedError
def inv(self, t):
raise NotImplementedError
def deriv1(self, r):
raise NotImplementedError
@tovrstra
tovrstra / group_generator.ipynb
Last active October 20, 2018 07:06
group_generator.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tovrstra
tovrstra / mictest.py
Created September 1, 2012 08:10
Test program for 'minimum image convention' routines for triclinic cells
#!/usr/bin/env python
'''Test program for 'minimum image convention' routines for triclinic cells
This program is public domain.
Author(s): Toon Verstraelen
The minimum image convention (MIC) is a standard method in molecular
simulations of periodic systems. The convention states that one can
approximate the interaction between atom i and all periodic images of atom j