Skip to content

Instantly share code, notes, and snippets.

@Deses
Deses / pibenchmark.sh
Created April 10, 2019 22:58
Simple script to record the temps of a Raspberry Pi during some CPU benchmarks
#!/bin/bash
clear
echo -e "\e[32m~~~~Initial temps~~~~\e[39m"
/opt/vc/bin/vcgencmd measure_temp
for f in {1..10}
do
echo -e "\e[32m~~~~Starting run" $f"~~~~\e[39m"
sysbench --test=cpu --cpu-max-prime=2 --num-threads=4 run > /dev/null 2>&1
@Deses
Deses / turn-off-tuya-plug.js
Last active February 14, 2020 18:12
A little script to turn off a Tuya plug,
const TuyAPI = require('tuyapi');
const device = new TuyAPI({
id: 'XXXXXXXXXXXXXXXXXXXX',
key: 'XXXXXXXXXXXXXXXX'});
let stateHasChanged = false;
// Find device on network
device.find().then(() => {
const TuyAPI = require('tuyapi');
const device = new TuyAPI({
id: 'XXXXXXXXXXXXXXXXXXXX',
key: 'XXXXXXXXXXXXXXXX'});
let stateHasChanged = false;
// Find device on network
device.find().then(() => {