Skip to content

Instantly share code, notes, and snippets.

View jonbartlett's full-sized avatar

Jon Bartlett jonbartlett

  • Victoria, Australia
View GitHub Profile
@darconeous
darconeous / eagle-200-curl.md
Last active August 10, 2022 03:34
Eagle-200 Local Usage via CURL

Eagle-200 Local Usage via CURL

You can locally pull data from your Rainforest Eagle-200 using cURL.

Rainforest has published a local API document which explains the details of the protocol. But this particular document is about quickly getting to the point and giving you some cURL commands you can use to immediately start pulling out data.

Prerequisites

First, I'll assume that you have the following environment variables set:

#Adding weather to your tmux status bar.

##Python file that writes the weather to a text file.

#!/Users/jhwhite/anaconda/bin/python
# -*- coding: utf-8 -*-

import forecastio
import math
@pkuczynski
pkuczynski / parse_yaml.sh
Last active July 9, 2024 04:42
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@thewtex
thewtex / notify
Created February 17, 2013 02:13
Script to send a tmux, desktop, and audio notification after the completion of the given command when using tmux.
#!/bin/bash
# Send a tmux, desktop, and audio notification after the completion
# of the given command when using tmux.
#
# Requires: tmux
# Recommended: espeak, libnotify
tmux_window=$(/usr/bin/tmux list-windows \
-F "#{window_active} #{window_index} #{window_name}" | \