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 | |
# Main loop to continuously monitor the temperature | |
while true; do | |
clear | |
echo "Monitoring Coral PCIe Accelerators Temperature" | |
# Dynamically find all apex devices and read their temperatures | |
for device_path in /sys/class/apex/apex_*; do | |
if [ -f "$device_path/temp" ]; then |
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
# https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf | |
# 2.10. Supporting both RP2040 and RP2350 (Page 31) | |
sudo apt install -y autoconf automake autotools-dev curl python3 python3-pip \ | |
libmpc-dev libmpfr-dev libgmp-dev gawk build-essential \ | |
bison flex texinfo gperf libtool patchutils bc \ | |
zlib1g-dev libexpat1-dev ninja-build git cmake libglib2.0-dev libslirp-dev | |
sudo mkdir -p /opt/riscv/gcc14-rp2350-no-zcmp | |
sudo chown -R $(whoami) /opt/riscv/gcc14-rp2350-no-zcmp |
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
# https://x.com/seldo/status/1823126087423099192 | |
sudo lsof -iTCP -sTCP:LISTEN -n -P | awk 'NR>1 {print $9, $1, $2}' | sed 's/.*://' | while read port process pid; do echo "Port $port: $(ps -p $pid -o command= | sed 's/^-//') (PID: $pid)"; done | sort -n |
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
# https://superuser.com/a/1711576/1129367 | |
# sudo apt install -y curl libxml2-utils | |
FRIGATE_RTSP_PASSWORD="admin" | |
curl -u "admin:${FRIGATE_RTSP_PASSWORD}" --anyauth -X POST "http://10.0.0.2:8000/onvif/device_service" \ | |
-H 'Content-Type: application/soap+xml; charset=utf-8'\ | |
-H 'SOAPAction: "http://www.onvif.org/ver10/media/wsdl/GetProfiles"'\ | |
-d ' | |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsdl="http://www.onvif.org/ver10/media/wsdl"> |
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 | |
# apt install -y wvkbd | |
PID="$(pidof wvkbd-mobintl)" | |
if [ "$PID" != "" ]; then | |
killall wvkbd-mobintl | |
else | |
wvkbd-mobintl -L 300 --landscape-layers full,special | |
fi |
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
ps aux | grep chrom | grep -v grep | awk '{print $2}' | xargs sudo kill -9 |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
API_BASEURL="https://api.cloudflare.com/client/v4" | |
# https://dash.cloudflare.com/profile/api-tokens | |
# DNS:Edit | |
CF_TOKEN="$(cut -d '=' -f2 < $HOME/.cloudflare.auth | xargs)" | |
INTERNAL_IP="$(tailscale ip -4)" | |
HOSTNAME="home.sib.li" |
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
const multipliers = new Map(); | |
const multiplications = new Set(); | |
for (let i = 0; i < 10; i++) { | |
for (let j = i; j < 10; j++) { | |
const res = i * j; | |
multiplications.add(res); | |
multipliers.set( | |
i.toString() + j.toString(), | |
res, |
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 | |
printf '%(%Y-%m-%d %H:%M:%S)T\n' -1 | |
# Note rPi CPU and GPU are on the same chip, and GPU don't hanve any separate temperature sensor | |
# vcgencmd and sysfs provide the same data | |
cpu_temp_sysfs=$(</sys/class/thermal/thermal_zone0/temp) | |
echo "vcgencmd => $(vcgencmd measure_temp | grep -o -E '[[:digit:]].*')" | |
echo "sysfs => $((cpu_temp_sysfs/1000))'C" |
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
# List all projects with assigned billing and status | |
gcloud beta billing accounts list --format 'value(ACCOUNT_ID)' | while read -r BILLING_ACCOUNT_ID; do | |
gcloud beta billing projects list --billing-account "$BILLING_ACCOUNT_ID" --format 'value(PROJECT_ID, BILLING_ACCOUNT_ID, BILLING_ENABLED)' | |
done | |
# Check if billing is enabled for Project Id | |
GOOGLE_CLOUD_PROJECT=${1:-$(gcloud config list --format 'value(core.project)')} | |
function isBillingEnabled() { | |
GOOGLE_CLOUD_PROJECT=$1 |
NewerOlder