This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install --upgrade pip | |
pip list --outdated --format=freeze | grep odoo | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # 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" | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
try: | |
from smbus2 import SMBus | |
except ImportError: | |
from smbus import SMBus | |
from bme280 import BME280 | |
# Initialise the BME280 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This can be used as a starting point for developing your own image e.g. for running MirageOS on an Pi3 | |
You will need an arm64 / aarch64 cross compiler. You can use e.g. the cross compiler shipped by Ubuntu or get the toolchain of your choice for your OS. | |
apt-get install gcc-aarch64-linux-gnu | |
Now we setup the SD card. We need to create two partitions like shown below | |
Device Boot Start End Sectors Size Id Type | |
2018-03-13-raspbian-stretch-lite.img1 8192 93802 85611 41,8M c W95 FAT32 (LBA) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR1=~/bar/ | |
DIR2=~/foo/ | |
SIZE1=0 | |
SIZE2=0 | |
for file in $DIR1*; do | |
file2=$DIR2$(basename "$file") | |
if [[ -f $file ]] && [[ -f $file2 ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MIN_SIZE=6G | |
IN_DIR=. | |
OUT_DIR=out | |
find $IN_DIR -maxdepth 1 -type f -size +$MIN_SIZE -exec ffmpeg -y -i {} -c:v libx264 -preset slow -tune film -profile:v high -level 4.2 -crf 23 -c:a copy -c:s copy $OUT_DIR/{} \; |
NewerOlder