Skip to content

Instantly share code, notes, and snippets.

View marcov's full-sized avatar

Marco Vedovati marcov

  • Italy
View GitHub Profile
@marcov
marcov / boot-fc.sh
Created October 23, 2019 07:45
A handy script to boot a firecracker VM
#!/bin/bash
#declare -r terminalRun="urxvt -g 90x50+1000+0 -e"
declare -r terminalRun="tmux split-window"
declare -r fcPath="./build/cargo_target/x86_64-unknown-linux-musl/release/firecracker"
[ -x ${fcPath} ] || { echo "ERROR: Missing firecracker binary at ${fcPath}"; exit -1; }
arch=`uname -m`
@marcov
marcov / boot-qemu.sh
Created September 28, 2019 08:31
Generic QEMU on-the-fly VM startup from a disk image
#!/bin/bash
#########################################################
#
# Generic QEMU on-the-fly VM startup from a disk image.
#
# Adapted from: https://github.com/kholia/OSX-KVM
#
#########################################################
set -e
@marcov
marcov / recover-paused-ride-wahoo.md
Last active September 1, 2023 16:05
Recover a accidentally paused ride on the Wahoo Fitness App

Recover a paused ride on the Wahoo Fitness App

If you like me use the Wahoo Fitness App to track your bike rides, from time to time it may happen to inadvertitely pause the recording in the middle of a ride.

Sometimes this really sucks cause it will of course not include the full mileage and duration from your ride and also skip valuable Strava segments recorded.

What I found out is that the app is actually recording all the GPS points of the track, but when exporting it will split it up is as many additional tracks as the times your have paused/resumed.

So with some reverse engineering I found a way to avoid this and to have a single and complete track when exporting to online services like Strava. The only limitation I found is that the app will continue to show the rides with the reduced mileage & durations (not a big deal if you export your tracks anyway).

@marcov
marcov / filter-tcx-gpx.md
Created May 29, 2019 12:42
Filter out private fields from TCS / GPX files

Filter out private fields from TCX or GPX files

If you dont want n'importe qui (a.k.a. everybody) to see you power or heart rate value of your public Strava activities, just give the log file a nice scrub with sed.

Examples

Removing power from TCX:

sed -i -E "/^ *<Watts>[0-9]*<\/Watts> *$/d" myride.tcx
@marcov
marcov / seccomp-investigation.md
Last active November 29, 2019 10:35
Why runc seccomp filtering for the chmod syscall does not work on aarch64?

Why runc seccomp filtering for the chmod syscall does not work on aarch64?

TLDR, because the chmod syscall does not exist for aarch64, and you should use fchmodat.


When using libseccomp with runc, there's no easy way to detect that the specified syscall does not exist for a given arch.

Disassemble chmod

@marcov
marcov / qemu-and-kata.md
Last active March 8, 2021 04:17
Running QEMU from CLI with Kata kernel & images

Notes

Memory backend file

  • Question: on x86 qemu is configured to boot the rootfs from nvdimm, with memory backend file the kata rootfs image. What's preventing the image file from being modified, since the file system is mounted rw?
  • Answer: that is because with memory backend file, "share=on/off" qemu option controls the visibility of guest writes. If share=on, then guest writes will be applied to the backend file.