Skip to content

Instantly share code, notes, and snippets.

View 53645714n's full-sized avatar

Daniël Schoenmaker 53645714n

View GitHub Profile
@53645714n
53645714n / rename.py
Last active May 28, 2021 13:04
Adding leading zeros to date in file name
View rename.py
#!/usr/bin/env python
import sys,os,re
for file in sys.argv[1:]:
if __file__ in file: continue
words = re.split('_|\.',file)
words[-3] = words[-3].zfill(2)
words[-4] = words[-4].zfill(2)
new_name = "_".join(words[:-1]) + "." + words[-1]
os.rename(file,new_name)
@53645714n
53645714n / temp.py
Last active October 6, 2020 19:20
Reading, filtering and sending DHT sensor readings on a raspberry pi
View temp.py
import math
import numpy
import threading
from time import sleep
from datetime import datetime
import sys
import Adafruit_DHT
import urllib.request
# parameters
View Version and update info btc&lnd.txt
#!/bin/bash
#create variable btcversion
btcpi=$(bitcoin-cli -version | sed 's/.*\(.......\)/\1/')
btcgit=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
if [ "$btcpi" = "$btcgit" ]; then
btcversion="$btcpi"
else
btcversion="$btcpi"", update available"
fi
@53645714n
53645714n / keybase.md
Created September 25, 2019 19:26
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object: