Skip to content

Instantly share code, notes, and snippets.

@bencollerson
bencollerson / weather.sh
Last active August 10, 2022 03:12
openweathermap minimalist bash script
#!/bin/bash
location=sydney
units=metric # or "imperial" (or even "standard" if you like using kelvin for temperature)
appid= #put your openweathermap id here
weather_curl=$(curl -sf "https://api.openweathermap.org/data/2.5/weather?q=$location&units=$units&appid=$appid")
currenttime=$(date +%s)
temperature=$(echo $weather_curl | jq .main.temp)
---------------------------------------------------------------------------
-- A text-only layout box widget for the awesome window manager.
--
-- Usage:
--
-- 1. Put this file in ~/.config/awesome/widgets
--
-- 2. Put something like this in your theme.lua file:
--
-- theme.layout_text_tile = "[t]"
@bencollerson
bencollerson / sms2me.gs
Created October 10, 2012 03:06
Google apps script to create an sms notification from a email tagged in gmail.
// Copyleft (ɔ) Ben Collerson {benc::benc::cc}
// Last modified 2012-10-10 14:17+10
// This code is based on this Google Apps scripting tutorial written by Romain Vialard.
// https://developers.google.com/apps-script/articles/gmail_filter_sms
// Notes on getting this code to work..
//
// In addition to following the steps from the link above the following steps must be done:
//
@bencollerson
bencollerson / iiscraper.pl
Created September 28, 2012 12:02
Scrape usage from the iinet toolbox site. (iinet is an Australian ISP)
#!/usr/bin/env perl
# iiscraper.pl
#
# This script gets your login details from your ~/.netrc file:
#
# machine iinet.net.au login <iinet-username> password <iinet-password>
#
# From there set up a crontab like this for daily updates:
#
# 0 7 * * * $HOME/bin/iiscraper.pl | mailx -s 'iinet usage' <your email>