This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mastodon.py client setup | |
# Install mastodon module with pip install --user Mastodon.py or equiv | |
# See https://mastodonpy.readthedocs.io/en/stable/ for more information | |
from getpass import getpass | |
from mastodon import Mastodon | |
import argparse | |
parser = argparse.ArgumentParser(description = ("Generate secret file " | |
"for mastodon.py api")) | |
parser.add_argument("name", help="Name of app, e.g. mybot") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Compare dns results between two servers | |
DNS1=192.168.1.1 | |
DNS2=23.216.52.39 | |
diff -y --color=always <(host -t a "$1" "$DNS1") <(host -t a "$1" "$DNS2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Functions to calculate if a date | |
# is a holiday or weekend. | |
# Functions are vectorised, so can | |
# be used with columns of dates. | |
# Note: Holidays are mondayised if they fall on weekends | |
# and the Saturday/Sunday parts of Easter are excluded. | |
# Change the code if this is not the way you want it to work. | |
# Note: Mondayisation for ANZAC and Waitangi were introduced |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env Rscript | |
# This script scrapes the table from http://www.centralpho.org.nz/PracticesandFees, geocodes it, and then saves to ../data | |
url <- "http://www.centralpho.org.nz/PracticesandFees" | |
xpath <- '//*[@id="dnn_ctr700_View_PracticeGrid"]' | |
library(rvest) | |
table <- url %>% html() %>% html_nodes(xpath=xpath) %>% html_table() |