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
//transforms a range of [iMin, iMax] to [outMin, outMax] | |
//returns the transformed value | |
int range_transform(int input, int iMax, int iMin, int outMax, int outMin) | |
{ | |
//transform range for histogram operation | |
int output = (((input - iMin) * (outMax - outMin)) / (iMax - iMin)) + outMin; | |
return output; | |
} |
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 | |
# @midibyte | |
# (^ V ^) | |
# tested on Rpi zero W | |
min_freq=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq) | |
max_freq=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq) | |
current_freq=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq) | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) |
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 | |
# System-wide crontab file and cron job directory. Change these for your system. | |
CRONTAB='/etc/crontab' | |
CRONDIR='/etc/cron.d' | |
# Single tab character. Annoyingly necessary. | |
tab=$(echo -en "\t") | |
# Given a stream of crontab lines, exclude non-cron job lines, replace |
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 | |
#tested on Manjaro 5.7 | |
#adapted from https://pastebin.com/TLJMAU9V | |
# this directory must already exist | |
export PSXDIR=$HOME/psxISO | |
if [ $1 -z -o $2 -n ]; | |
then | |
echo "\nERROR: Invalid usage.\n" | |
echo "\n Usage: psxrip [filename]\n" | |
echo "\n where filename is the desired name, minus extensions.\n" |