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 | |
# | |
# Play an mp3 file at start with the wifiberry-miniamp. | |
# Loads all necessary modules and uses ffplay (ffmpeg) to | |
# play the file. | |
# | |
start() { | |
echo "loading modules" |
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
/* | |
* This file is an MPU6050 demonstration. | |
* https://openest.io/en/2020/01/21/mpu6050-accelerometer-on-raspberry-pi/ | |
* Copyright (c) 2020 Julien Grossholtz - https://openest.io. | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, version 3. | |
* | |
* This program is distributed in the hope that it will be useful, but |
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
# run mpstat and top for 5 minutes, at then end, get a loadaverage value | |
export DURATION=300 # run for 5 minutes | |
rm -rf /tmp/analysis; mkdir -p /tmp/analysis; $(timeout -t $DURATION -s2 sh -c './mpstat 1 >/tmp/analysis/mpstat.txt') & $(timeout -t $DURATION -s2 sh -c 'top -b -d1 >/tmp/analysis/top.txt') & sleep $DURATION; cat /proc/loadavg >/tmp/analysis/loadavg.txt | |
# Filter top output (necessary as the top binary on my embedded system lack many options) | |
export PROCESS_NAME=communication | |
cat /tmp/analysis/top.txt | grep $PROCESS_NAME | awk '{ print $7 }' | sed 's/%//g' > /tmp/analysis/top_filtered.txt | |
awk '{ total += $1 } END { print total/NR }' /tmp/analysis/top_filtered.txt > /tmp/analysis/top_avg.txt | |
cat /tmp/analysis/top_filtered.txt | sort -nr | uniq -c > /btmp/analysis/top_weighted_categories.txt |
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 | |
# This script converts all the files in a given folder to a list a VAW files readable by the Horbert kid radio | |
var=0 | |
for file in *.mp3 ; do | |
ffmpeg -i "$file" -acodec pcm_s16le -ac 1 -ar 32000 $var.WAV | |
var=$((var+1)) | |
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
# Convert mp3 file to Hoerbert kid radio, copy files directly under the corresponding folders | |
ffmpeg -i InputFile.mp3 -acodec pcm_s16le -ac 1 -ar 32000 0.WAV | |
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
# Install the inotifywait package, on Fedora: | |
$ sudo dnf install inotify-tool | |
# Run inotify-wait on a loop | |
while true; do inotifywait -e modify -r <folder to watch>; < curstom ; commands> ; done | |
# eg: recompile a progam when a file is changed: | |
while true; do inotifywait -e modify -r sources/; make clean; make;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 | |
# This script can be used to determine the average load of 2 batteries | |
# It requires the acpi command. | |
battA=$(acpi | grep "Battery \0" | cut -d" " -f 4 | sed "s/[^0-9]//g") | |
battB=$(acpi | grep "Battery 1" | cut -d" " -f 4 | sed "s/[^0-9]//g") | |
avg=$((($battA+$battB)/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
I had this issue with Qt Creator 4.1 on Fedora 25: | |
SSH connection failure: Botan library exception: No object identifier found for secp521r1 | |
It seems to be realted with an internal QtCreator library. The easyest solution seems to remove the QtCreator package and to install it | |
with QtCreator installer: | |
http://download.qt.io/official_releases/qtcreator |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <modbus.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <sys/ioctl.h> | |
#include <linux/serial.h> | |
#include <asm/ioctls.h> | |
#define NB_REGS 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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout somewhen, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
NewerOlder