Skip to content

Instantly share code, notes, and snippets.

View siberex's full-sized avatar
🛠️
Your stack will not be full without me

Stepan Legachev siberex

🛠️
Your stack will not be full without me
View GitHub Profile
#!/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
@siberex
siberex / coroutine.php
Created November 19, 2012 15:33 — forked from nikic/coroutine.php
A coroutine example: Streaming XML parsing using xml_parser
<?php
error_reporting(E_ALL);
/* Data can be send to coroutines using `$coroutine->send($data)`. The sent data will then
* be the result of the `yield` expression. Thus it can be received using a code like
* `$data = yield;`.
*/
/* What we're building in this script is a coroutine-based streaming XML parser. The PHP