Skip to content

Instantly share code, notes, and snippets.

View jrc's full-sized avatar

John Chang jrc

View GitHub Profile
# Monitor Wi-Fi signal on Linux (Debian)
import subprocess
import time
IS_TESTING_ON_MACOS = False
SLEEP_SECS = 60
#!/bin/bash
GATEWAY_IP=172.18.0.1
log() {
command echo "$(date --rfc-3339=seconds | sed 's/ /T/'): $@"
}
while true
do
@jrc
jrc / gist:72488b688b1aa99d3e4aa08f19d75799
Last active January 31, 2024 17:12
TimescaleDB on AWS
# Get ISO country codes and demonyms for all countries and geo regions
SELECT ?item ?itemLabel ?countryCode ?demonym
WHERE {
{
# see "Query not returning all expected results"
# https://www.wikidata.org/wiki/Wikidata_talk:SPARQL_query_service/queries
?item p:P31 [ps:P31 wd:Q6256]. # categoryof (P31) country (Q6256)
?item wdt:P297 ?countryCode .
?item wdt:P1549 ?demonym .
FILTER (LANG(?demonym) = "en") .

Keybase proof

I hereby claim:

  • I am jrc on github.
  • I am jrc (https://keybase.io/jrc) on keybase.
  • I have a public key whose fingerprint is 992C 4519 EF34 0CCA CA9E 08A3 0D2E 1F38 61F5 F472

To claim this, I am signing this object: