Technology

This page is for goofy stuff that I wrote because I had a use for it. If it’s also useful to you, cool.

Raspberry Pi Temperature (Raspbian)

#!/bin/bash
CPUSOURCE=`cat /sys/class/thermal/thermal_zone0/temp`
GPUSOURCE=`vcgencmd measure_temp | cut -c 6-9`
CPUCALC=`expr $CPUSOURCE / 1000`
CPU=`echo “scale=2;((9/5) * $CPUCALC ) + 32”| bc`
GPU=`echo “scale=2;((9/5) * $GPUSOURCE ) + 32”| bc`
echo CPU = $CPU
echo GPU = $GPU

Output:

pi@benoist:~ $ ./temp.bash
CPU = 100.40
GPU = 100.22

Weird Little Roller (Linux)

The Weird Little Roller was inspired by working with svxlink, a voice server typically used for amateur radio. It came with a bunch of GNU text-to-speech reading numbers. Since I play a lot of D&D, I thought it would be fun to write a dice roller that’s accessible — You choose your die, it rolls (and displays) your result and reads the number to you in audio. It’s pretty ugly, but it works.

Download: Weird Little Roller (gzipped tar)