Skip to content

Instantly share code, notes, and snippets.

View georghildebrand's full-sized avatar

ghildebrand georghildebrand

  • EU
View GitHub Profile
@georghildebrand
georghildebrand / holtwinters.py
Created June 13, 2017 09:03 — forked from andrequeiroz/holtwinters.py
Implementation of Holt-Winters algorithms in Python 2
#The MIT License (MIT)
#
#Copyright (c) 2015 Andre Queiroz
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
@georghildebrand
georghildebrand / download.py
Last active January 13, 2019 22:17
Download cryptocurrency metrics from Kraken for last 12 hours in 1 min interval
#/usr/bin/python
import requests as r
import datetime as dt
def nxtime2datetime(nix_time):
return dt.datetime.fromtimestamp(nix_time)
#get time of server
url = 'https://api.kraken.com/0/public/Time'
@georghildebrand
georghildebrand / gist:5caf70a2ad59d3a783e325aa30d781c0
Last active September 24, 2019 08:31
Using up some memory with python in a controlled way
# Eat up some memory until 30% of system total
import psutil, os
nb_process_id = os.getpid()
p = psutil.Process(nb_process_id)
from multiprocessing import Pool
import string
import random
@georghildebrand
georghildebrand / InstallGrafanaPrometheus.md
Last active October 8, 2019 17:47
Install Grafana on rockpi 4 with prometheus
@georghildebrand
georghildebrand / - Syncthing + start on boot.md
Last active October 9, 2019 04:27 — forked from hdml/- Syncthing + start on boot.md
How to install Syncthing on Raspberry Pi + start on boot [semi-automatic]
@georghildebrand
georghildebrand / gist:01e93cc36b1dc36d1014b9e0bd490df2
Created November 14, 2019 16:09
copy files younger than x days to new location and delete files older than x there
#!/bin/bash
source='/srv/dev-disk-by-label-'
target='/srv/dev-disk-by-label-'
days=30
# delete
find ${target} -mtime +$days -type f -exec rm "{}" \;
find ${source} -mtime -$days -type f -exec cp -a "{}" ${target} \;
@georghildebrand
georghildebrand / gist:6efcd5232d169aff136ea306bc2132ac
Last active November 14, 2019 19:16
copy files younger than x days to new location and delete files older than x there
#!/bin/bash
source='/srv/dev-disk-by-label-'
target='/srv/dev-disk-by-label-'
days=30
# delete
find ${target} -mtime +$days -type f -exec rm "{}" \;
# copy and link
find ${source} -mtime -$days -type f -exec cp -la "{}" ${target} \;
@georghildebrand
georghildebrand / gist:8b32083f2e51dbbeb23b80a2fd003009
Created July 20, 2020 07:39
Azure Function App Using Build.SourceDirectory as working Dir to avoid losing python path
trigger:
- master
variables:
# Azure Resource Manager connection created during pipeline creation
azureSubscription: 'conn'
# Function app name
functionAppName: 'functestnewtry'
@georghildebrand
georghildebrand / BrickSuperclass.ipynb
Last active February 5, 2021 15:44
Quick check of this issue when importing brickschema into azure DTLD for azure digital twins https://github.com/Azure-Samples/RdfToDtdlConverter/issues/2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@georghildebrand
georghildebrand / borg_backup_batch_restore.sh
Last active October 30, 2022 14:59
A simple script to do a bulk restore of certain paths from all selected backups in a borg archive
#!/bin/sh
set -euo pipefail
# Very simple script to extract all files from a list of archives
# The inlcude files is used to recursively only extract from paths specified in this file
# The include.txt has the following format
# R /path/to/include