Skip to content

Instantly share code, notes, and snippets.

@popk
popk / hello.sh
Last active August 29, 2015 14:15 — forked from nazt/hello.sh
#!/bin/ash
used=`top -n1 | grep -v grep | grep Mem | awk '{ print $2 }' | cut -d'K' -f 1`
free=`top -n1 | grep -v grep | grep Mem | awk '{ print $4 }' | cut -d'K' -f 1`
cat > /root/feed_update_payload.json <<EOF
{
"version":"1.0.0",
"datastreams":[
{"id":"used",
@popk
popk / pcmmakerclub.blinky.c
Last active August 29, 2015 14:15 — forked from nazt/makefile
/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
@popk
popk / README.md
Created March 15, 2014 15:11 — forked from adamvr/README.md

Openwrt scripts

A couple of scripts for publishing the state of an openwrt router to mqtt.

Relies on mosquitto_pub and mosquitto_sub being present

init

Init.d scripts including one to start a pair of file monitors and one to publish whether or not the router is onlien