Skip to content

Instantly share code, notes, and snippets.

View pgmot's full-sized avatar
🏠
Working from home

mot pgmot

🏠
Working from home
View GitHub Profile
#!/bin/bash
# ref: https://github.com/ymyzk/mackerel-plugins/blob/master/raspberrypi/temp.sh
SECONDS=`date '+%s'`
NAME='temperature.cpu'
TEMP=`cat /sys/class/thermal/thermal_zone0/temp`
VALUE=`echo "scale=3; ${TEMP} / 1000" | bc`
echo -e "${NAME}\t${VALUE}\t${SECONDS}"
#!/usr/bin/python
import sys
import Adafruit_DHT
from datetime import datetime
sensor = Adafruit_DHT.AM2302
pin = 17
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
time = datetime.now().strftime('%s')
begin remote
name aircon
flags RAW_CODES
eps 30
aeps 100
gap 200000
toggle_bit_mask 0x0
begin raw_codes
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 <aar_file> [<output_path>]" 1>&2
exit 1
fi
unzip $1 -d /tmp/aar2jar > /dev/null
if [ -z "$2" ]; then
dir=.