Skip to content

Instantly share code, notes, and snippets.

View derpeter's full-sized avatar
🖖

derpeter derpeter

🖖
  • planet earth, milkiway
View GitHub Profile
@derpeter
derpeter / proyektortest.xml
Last active June 25, 2019 19:27
proyektortest
<schedule>
<version>1.0</version>
<conference>
<title>Fusion Festival - Content 2019</title>
<acronym>fusion19</acronym>
<days>5</days>
<start>2019-06-26</start>
<end>2019-06-30</end>
<timeslot_duration>0:30</timeslot_duration>
</conference>
@derpeter
derpeter / ubuntu-mate-gpd-micropc.sh
Last active July 7, 2019 11:00 — forked from joshskidmore/ubuntu-mate-gpd-micropc.sh
ubuntu-mate-gpd-micropc.sh
#!/usr/bin/env bash
# update
apt -y update
apt -y upgrade
apt -y dist-upgrade
# 5.2 mainline kernel
cd /tmp
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2-rc6/linux-headers-5.2.0-050200rc6_5.2.0-050200rc6.201906222033_all.deb
@derpeter
derpeter / gpd-micropc-keyboard.sh
Created July 7, 2019 11:05 — forked from joshskidmore/gpd-micropc-keyboard.sh
Uses xmodmap + xcape to use the MicroPC's bottom row a bit more efficiently
#!/usr/bin/env bash
# resets keyboard; kills all running instances of xcape
reset_kbd () {
local xcape_cnt=$(pgrep xcape | wc -l)
echo " - reset_kbd"
echo " - killing $xcape_cnt instances of xcape"
setxkbmap -layout us
@derpeter
derpeter / bme280.py
Created March 29, 2021 09:26
BME280 telegraf exec plugin
#!/usr/bin/env python3
import time
try:
from smbus2 import SMBus
except ImportError:
from smbus import SMBus
from bme280 import BME280
# Initialise the BME280
# # Retrieve data from MODBUS slave devices
[[inputs.modbus]]
# ## Connection Configuration
# ##
# ## The plugin supports connections to PLCs via MODBUS/TCP or
# ## via serial line communication in binary (RTU) or readable (ASCII) encoding
# ##
# ## Device name
name = "SOLAR"
#
@derpeter
derpeter / update-odoo-pip
Created February 9, 2022 08:12
Small script to update odoo modules installed via pip
pip install --upgrade pip
pip list --outdated --format=freeze | grep odoo | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
@derpeter
derpeter / to25fps.py
Created May 31, 2024 09:39
to25fps.py
import os
import subprocess
path = os.getcwd()
for file in os.listdir(path):
if file.endswith("mp4"):
if "old" not in file:
f = os.path.join(path, file)
print("found " + f)
old_file = os.path.join(path, file.split(".")[0] + "-old.mp4")