This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Download data from KNMI API. | |
Copyright (C) 2024 Maximilian Pierzyna, except when indicated otherwise | |
in the docstring of the functions. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set microbin server URL here | |
BASE_URL=xxxxxxxx | |
# Take expiration time as input and default to 10 minutes. | |
if [[ "$1" == "" ]]; then | |
expiration=10min | |
else | |
expiration=$1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: pdf clean todo preflight figures nomenclature snapshot | |
TEX_FILES := $(wildcard *.tex) | |
TEX_FILES_EXCEPT_MAIN := $(filter-out main.tex, $(TEX_FILES)) | |
PYTHON := ~/.virtualenvs/MA/bin/python | |
SNAPSHOT_DIR := ../latex_snapshots | |
pdf: literature.bib | |
latexmk -pdf main.tex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import warnings | |
from typing import Callable, Iterable | |
import numpy as np | |
from scipy.optimize import root_scalar | |
def multi_root(f: Callable, bracket: Iterable[float], args: Iterable = (), n: int = 30) -> np.ndarray: | |
""" Find all roots of f in `bracket`, given that resolution `n` covers the sign change. | |
Fine-grained root finding is performed with `scipy.optimize.root_scalar`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=WS2812 Server (socket) | |
After=network.target | |
[Service] | |
# Change this to match your install directory | |
# Send stdout and stderr to /dev/null because RAM might overflow otherwise | |
ExecStart=/opt/rpi-ws2812-server/ws2812svr -tcp 9999 > /dev/null 2&>1 | |
Restart=on-failure | |
User=root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
.PHONY: start dev shell build | |
start: | |
@docker-compose ps web | grep -q "Up" || docker-compose start | |
dev: start | |
docker-compose logs -f | |
shell: start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Modified Pi-hole script to generate a generic hosts file | |
# for use with dnsmasq's addn-hosts configuration | |
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh | |
# Address to send ads to. This could possibily be removed, but may be useful for debugging purposes? | |
destinationIP="0.0.0.0" | |
outlist='./final_blocklist.txt' | |
tempoutlist="$outlist.tmp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after. | |
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
# Disable SIP (System Integrity Protection) like this: | |
# 1. Reboot into recovery mode (Cmd + R) | |
# 2. Open Terminal | |
# 3. Type `csrutil disable` | |
# 4. Reboot |