Skip to content

Instantly share code, notes, and snippets.

@hfreire
hfreire / rpi-hdmi.sh
Last active December 24, 2017 13:20
Enable/disable your Raspberry PI HDMI output
#!/bin/sh
is_hdmi_output_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
stop)
tvservice -o
@hfreire
hfreire / rpi-tv.sh
Last active December 24, 2017 13:20
Power on/off your TV through your Raspberry PI
#!/bin/sh
CECCLIENT=$(which cec-client)
power_on () {
echo "on 0" | $CECCLIENT -s -d 1 >/dev/null
}
power_off () {
echo "standby 0" | $CECCLIENT -s -d 1 >/dev/null
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location