Skip to content

Instantly share code, notes, and snippets.

@TheLinuxGuy
TheLinuxGuy / thelinuxguy-teslafi-data-exporter.py
Last active April 5, 2025 22:10
Export your TeslaFi user data to CSV format that TeslaMate can easily import (fixes bugs in the official script)
# Author: Giovanni Mazzeo (github.com/thelinuxguy)
# Script fetches your TeslaFi.com user data to allow importing into TeslaMate.
# Updated 04/05/2025 to include more fields to normalize based on comments in gist.
# My script fixes a couple bugs and issues seen by other people running the older script:
# 1) "Invalid CSV delimiter" issue: https://github.com/teslamate-org/teslamate/issues/4569
# 2) "battery_level" column integeter data change in 2024. https://github.com/teslamate-org/teslamate/issues/4477
# You can thank me by buying me a coffee :)
# docker container inspect portainermacvlan
[
"NetworkSettings": {
"Bridge": "",
"SandboxID": "48fd987a4ad8ecfbef8a2d44c067c07489ed70048ddeec2f1778e3f7cfa20377",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/48fd987a4ad8",
@TheLinuxGuy
TheLinuxGuy / initial-backup-calculator.go
Created June 5, 2017 03:22
golang total folder size, backup design question
package main
import (
"fmt"
"io/ioutil"
"math"
"strconv"
)
// decimal places rounding
func round(input float64, places int) (float64) {