Skip to content

Instantly share code, notes, and snippets.

@frederikstroem
frederikstroem / .gitignore
Last active December 27, 2018 23:34
MPLAB .gitignore
# MPLAB
*.cof
*.err
*.hex
*.lst
*.map
*.mcp
*.mcs
*.mcw
*.o
@frederikstroem
frederikstroem / .bash_aliases
Created January 28, 2020 20:43
A sleppy alias using redshift
alias night="redshift -v -P -O 2000K"
alias night1500="redshift -v -P -O 1500K"
alias night2500="redshift -v -P -O 2500K"
alias night3000="redshift -v -P -O 3000K"
alias night3500="redshift -v -P -O 3500K"
alias night4000="redshift -v -P -O 4000K"
alias night4500="redshift -v -P -O 4500K"
alias nightOff="redshift -v -x"
@frederikstroem
frederikstroem / docker-compose.yml
Last active December 31, 2023 15:41
Run tensorflow/tensorflow:latest-gpu-jupyter docker image on localhost without having to authenticate. Useful if you SSH into your machine etc.
version: "3.9"
# https://www.tensorflow.org/install/docker
services:
tensorflow:
image: tensorflow/tensorflow:latest-gpu-jupyter # https://hub.docker.com/r/tensorflow/tensorflow/
container_name: tensorflow
hostname: tensorflow
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/dockerfiles/dockerfiles/gpu-jupyter.Dockerfile
# https://stackoverflow.com/a/60327026
@frederikstroem
frederikstroem / proof.txt
Last active March 23, 2022 20:47
Session ID proof
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Session ID: 05370a12bfe51c546b06bbc5dc131bfd091aeaf02bdfd5d9d4f8784f495522dc49
-----BEGIN PGP SIGNATURE-----
iHUEARYKAB0WIQRuImp4wxgx4e3uWqPaQi3qJfhRSAUCYjuF5QAKCRDaQi3qJfhR
SJFOAP9LEFIM2mye+d/v+J64gI+XZ06UR9aT12KJC1nv73UxCAD+J9WZHfP2L/uq
Pm10NZgsVrwcbB4pmU/eVWxSfhj4MAE=
=BH+I
@frederikstroem
frederikstroem / joplin_vscode_workspace.md
Last active April 30, 2023 12:18
Joplin Note and VS Code Workspace

Joplin Note and VS Code Workspace

Configure Joplin's external editor settings to open a specific workspace in Visual Studio Code when editing notes.

Path (Linux): /usr/bin/code

Arguments: --wait --new-window /home/your_username/copilot-powered.code-workspace

@frederikstroem
frederikstroem / tts
Last active August 2, 2023 20:36
Cogai TTS using docker & script placed at ~/.local/bin/tts
#!/usr/bin/env bash
# Test: `echo "This should be read up for me" | tts`
# Read all input into variable and replace newlines with spaces
input=$(cat | tr '\n' ' ')
# Save current time in ISO8601 format and replace special characters with underscore
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ")
@frederikstroem
frederikstroem / automated_github_cloner.service
Last active June 9, 2024 10:03
2024-06-09 snapshot of automated GitHub cloning tool. Clone or pull all GitHub repositories (submodules included) and Gists across all GitHub organizations and personal account every x hours. Discord webhook on errors. Script is hacked together and unstable!
[Unit]
Description=Automated GitHub cloning tool
[Service]
Type=simple
Environment=DATA_DIR=/tank/automated_github_cloner
EnvironmentFile=%h/automated_github_cloner/.env
ExecStart=/usr/bin/python3 %h/automated_github_cloner/main.py
Restart=always
RestartSec=5
@frederikstroem
frederikstroem / waiting_service.service
Created January 16, 2024 22:59
Wait for Tailscale/Headscale backend to start before starting Systemd user service
[Unit]
Description=Waiting for Tailscale Backend
[Service]
Type=simple
EnvironmentFile=%h/waiting_service/.env
ExecStartPre=/usr/bin/bash -c 'until [[ "$(tailscale status --json | jq -r '.BackendState')" == "Running" ]]; do sleep 1; done' # Wait for Tailscale/Headscale to start.
ExecStart=/usr/bin/python3 %h/waiting_service/main.py
Restart=always
RestartSec=5
@frederikstroem
frederikstroem / sieve_filter.txt
Created February 28, 2024 14:59
SimpleLogin auto-label Sieve filter (created & tested for ProtonMail)
# `envelope` command `from` retrieves `return-path` header, e.g. "[email protected]".
# Sources:
# - https://proton.me/support/sieve-advanced-custom-filters
# - https://simplelogin.io/docs/getting-started/troubleshooting/
# Require `envelope` and `fileinto` extensions.
require ["fileinto", "envelope"];
# Emails from SimpleLogin domains are filed into "SimpleLogin".
if envelope :domain :is "from" ["simplelogin.co", "simplelogin.io"] {