Skip to content

Instantly share code, notes, and snippets.

@apnof
apnof / GetTemp.sh
Last active November 11, 2018 08:57
#!/bin/bash
# Outputs CPU and GPU temperature of the Raspberry Pi
# Tested on RPi 2 Model B with raspbian
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
echo CPU temp"="$cpuTemp1"."$cpuTempM"'C"
echo GPU $(/opt/vc/bin/vcgencmd measure_temp)
#!/bin/bash
PROGNAME=${0##*/}
if ! [ $# -eq 1 ]
then
echo -e "ERROR:\twrong parameter count."
echo -e "\tNeed to know which playlist to download."
echo -e "Usage:\t$PROGNAME c64|amiga|mix"
echo -e "\tc64 =\tStone Oakvalleys Authentic SID Collection (SOASC=)"
$ mkdir -p extract/DEBIAN
$ dpkg-deb -x package.deb extract/
$ dpkg-deb -e package.deb extract/DEBIAN
[...do something, e.g. edit the control file...]
$ mkdir build
$ dpkg-deb -b extract/ build/
-x extracts the package contents
-e extracts the control files
-b builds the new package
@apnof
apnof / KeepSpinning.sh
Created July 30, 2011 11:49
shellscript - avoid hdd spin-down.
#!/bin/sh
# this script finds out the mountpoint for the given DISKLABEL
# and touches the file ${MOUNTPOINT}/tempfile periodically every
# INTERVAL.
# adjust the following two values.
DISKLABEL="WD_500G_NTFS"
INTERVAL="5s"
@apnof
apnof / pause.sh
Created May 29, 2011 10:15
Test: bash script
#!/bin/bash
function pause(){
read -p "$*"
}
pause 'Press enter to continue…'