In global config:
This file contains 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 minimalmodbus | |
import serial | |
import struct | |
import time | |
def millis(): | |
return int(round(time.time() * 1000)) | |
def C(val): | |
return struct.pack('!H', val) |
This file contains 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/python3 | |
import requests | |
import json | |
# Setup OpenWeather Map | |
openweather_api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
lat = "xx.xxx" | |
lon = "-x.xxxx" | |
openweather_url = "https://api.openweathermap.org/data/2.5/onecall?lat=%s&lon=%s&appid=%s&units=metric&exclude=minutely,hourly,daily,alerts" % (lat, lon, openweather_api_key) |
This file contains 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
# rename all files with extension passed as argument 1 to m4v | |
# e.g to rename MOV extension to m4v ./rename-m4v.sh MOV | |
for file in *.$1 | |
do | |
mv "$file" "${file%.$1}.m4v" | |
done |
This file contains 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
# https://gist.github.com/KonradIT/ee685aee15ba1c3c44b4 | |
$ ls > gopro.txt | |
$ mencoder -nosound -ovc lavc -lavcopts \ | |
vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 \ | |
-vf scale=1920:1080 -mf type=jpeg:fps=20 \ | |
mf://@gopro.txt -o gopro.mp4 |
This file contains 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 | |
# Convert DHI phantom 4 / Mavi MP4/MPV to an MP4 that will play on android devices | |
# Adjust extension and handbreak preset as required | |
# To install Handbrake | |
# sudo add-apt-repository ppa:stebbins/handbrake-releases | |
# sudo apt-get update | |
# sudo apt-get install handbrake-gtk | |
# sudo apt-get install handbrake-cli |
This file contains 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
for file in ./*.html; do | |
[ -f "$file" ] && | |
length=$(tail -n 1 "$file" | wc -c) && | |
[ "$length" -gt 0 ] && | |
truncate -s "-$length" "$file" | |
done |
This file contains 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/sh | |
# sudo apt-get install vlc | |
# sudo apt-get install gstreamer1.0 | |
# sudo apt-get install gstreamer-tools | |
# https://play.google.com/store/apps/details?id=pl.effisoft.rpicamviewer2 | |
# Launch Stream | |
echo "Starting Stream" | |
echo $(date) |
This file contains 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 | |
# Convert filenames to lowercase | |
# and replace characters recursively | |
##################################### | |
if [ -z $1 ];then echo Give target directory; exit 0;fi | |
find "$1" -depth -name '*' | while read file ; do | |
directory=$(dirname "$file") | |
oldfilename=$(basename "$file") |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 3 in line 2.
This file contains 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
| Id | Designator | Package | Quantity | Designation | Supplier and ref | | |
|----|--------------------------------------------------------|------------------------|----------|----------------|------------------| | |
| 1 | 1PIN,1PIN1,1PIN2 | 1pin | 3 | P | | | |
| 2 | C17,C18,C13,C14,C15,C16,C19,C11,C6,C7,C8,C9,C10,C12 | SM0805 | 14 | C | | | |
| 3 | C20 | SM0805 | 1 | 10uf | | | |
| 4 | U1 | ESP-12 | 1 | ESP12 | | | |
| 5 | P19 | SMD-MICRO-USB | 1 | USB | | | |
| 6 | D4 | S |
NewerOlder