Skip to content

Instantly share code, notes, and snippets.

View tijszwinkels's full-sized avatar

Tijs Zwinkels tijszwinkels

  • TinkerTank
  • the Netherlands
View GitHub Profile
@tijszwinkels
tijszwinkels / teslamapillary.py
Created March 4, 2024 22:18
teslamapillary.py
#!/usr/bin/python3
# Rewrite of the tesla2mapillary.py script
#
# Differences:
# - Processes in cwd, leaves the original file alone
# - Deletes tmp-data after uploading, requires much less disk-space
# - Allows to specify video-files using wildcards
import os
@tijszwinkels
tijszwinkels / zfs
Created May 15, 2023 09:01
hetzner-rescue-zfs-script
#!/bin/bash
basename="$(basename "$0")"
if [[ "$basename" == "fsck.zfs" || "$basename" == "zdb" || "$basename" == "zed" || "$basename" == "zfs" || "$basename" == "zfs_ids_to_path" || "$basename" == "zgenhostid" || "$basename" == "zhack" || "$basename" == "zinject" || "$basename" == "zpool" || "$basename" == "zstream" || "$basename" == "zstreamdump" || "$basename" == "ztest" ]]; then
echo -e "The Hetzner Rescue System does not come with preinstalled ZFS support,\nhowever, we will attempt to compile and install the latest release for you.\nPlease read the information below thoroughly before entering any response.\n"
fi
echo -e "\e[31m\e[1mATTENTION\e[0m
This script will attempt to install the current OpenZFS release
import os
import re
import k_diffusion as K
import numpy as np
import PIL
import skimage
import torch
from einops import rearrange
from slugify import slugify
import os
import re
import k_diffusion as K
import numpy as np
import PIL
import skimage
import torch
from einops import rearrange
from slugify import slugify
import os
import re
import k_diffusion as K
import numpy as np
import PIL
import skimage
import torch
from einops import rearrange
from slugify import slugify
import os
import re
import k_diffusion as K
import numpy as np
import PIL
import skimage
import torch
from einops import rearrange
from slugify import slugify
@tijszwinkels
tijszwinkels / teslamapillary.py
Created May 2, 2022 11:08
Geotag video's from Tesla Dashcam based on a .gpx file, and upload them to the mapillary service.
#!/usr/bin/python3
# Rewrite of the tesla2mapillary.py script
#
# Differences:
# - Processes in cwd, leaves the original file alone
# - Deletes tmp-data after uploading, requires much less disk-space
# - Allows to specify video-files using wildcards
#
# TODO:
@tijszwinkels
tijszwinkels / tesla2mapillary.py
Last active September 13, 2023 01:12 — forked from tmdqfb/tesla2mapillary.py
Upload Tesla dashcam videos to mapillary. Requires accompanying GPX file recorded with mobile app or tracker.
#!/usr/bin/python
import os
import sys
import argparse
import gpxpy
import gpxpy.gpx
import subprocess
from pathlib import Path
from datetime import datetime, timedelta
# Test-case to illustrate https://github.com/biolab/orange3-associate/issues/19
import pandas as pd
import numpy as np
import collections as col
from datetime import datetime
from orangecontrib.associate.fpgrowth import *
db = [['00:00:00:00:00:529', '00:00:00:00:00:156'], ['00:00:00:00:00:529', '00:00:00:00:00:67', '00:00:00:00:00:156'], ['00:00:00:00:00:529', '00:00:00:00:00:67', '00:00:00:00:00:154', '00:00:00:00:00:156', '00:00:00:00:00:155'], ['00:00:00:00:00:155', '00:00:00:00:00:154', '00:00:00:00:00:836', '00:00:00:00:00:892', '00:00:00:00:00:116', '00:00:00:00:00:117', '00:00:00:00:00:156'], ['00:00:00:00:00:115', '00:00:00:00:00:529', '00:00:00:00:00:154', '00:00:00:00:00:737', '00:00:00:00:00:836', '00:00:00:00:00:739', '00:00:00:00:00:838', '00:00:00:00:00:66', '00:00:00:00:00:698', '00:00:00:00:00:599', '00:00:00:00:00:892', '00:00:00:00:00:116', '00:00:00:00:00:745', '00:00:00:00:00:114', '00:00:00:00:00:117', '00:00:00:00:00:105', '00:00:00:00:00:837', '00:00:00:00:00:156', '00:00:00:00:00:27
function updateQueue(queue) {
// Statistics
console.log("maxWait:" + queue.maxWait );
console.log("--- iterating over calls in queue" + queue);
var numCalls = _.size(queue.calls);
var totalRunTime = 0;
var maxRunTime = 0;
for (callId in queue.calls) {
var call = queue.calls[callId];