Edit /boot/config.txt
and add the following line:
dtoverlay=gpio-shutdown,gpio_pin=3
// References: | |
// https://stackoverflow.com/questions/17625495/how-do-you-programmatically-access-the-ambient-light-sensor-on-mac-os-x-10-5 | |
// https://stackoverflow.com/a/73955907 | |
// Build command: | |
// clang -o lightsensor lightsensor.mm -F /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks -framework Foundation -framework IOKit -framework CoreFoundation -framework BezelServices | |
#include <mach/mach.h> | |
#import <Foundation/Foundation.h> | |
#import <IOKit/IOKitLib.h> |
! uBlock filter to disable YouTube's new UI | |
youtube.com##+js(set, yt.config_.EXPERIMENT_FLAGS.kevlar_watch_grid, false) |
#!/bin/bash | |
# Script to enable Touch ID authentication for sudo | |
echo "Current config:" | |
cat /etc/pam.d/sudo | |
echo "Press ENTER to continue" | |
read |
#!/bin/bash | |
# Usage: leds <state>, where state can be 0 or 1 | |
sudo sh -c "echo $1 > /sys/class/leds/PWR/brightness" | |
sudo sh -c "echo $1 > /sys/class/leds/ACT/brightness" |
podman run -i --rm -v "$(pwd)":/data w33ble/youtube-dl -x --audio-format mp3 "$1" |
sudo hcitool lescan --duplicates |
Edit /boot/config.txt
and add the following line:
dtoverlay=gpio-shutdown,gpio_pin=3
/usr/bin/vcgencmd measure_temp | awk -F "[=']" '{print($2 * 1.8)+32}'
# Possible values: | |
# 0: no-op | |
# 2: Mission Control | |
# 3: Show application windows | |
# 4: Desktop | |
# 5: Start screen saver | |
# 6: Disable screen saver | |
# 7: Dashboard | |
# 10: Put display to sleep | |
# 11: Launchpad |