Skip to content

Instantly share code, notes, and snippets.

View abirkill's full-sized avatar

Alexis Birkill abirkill

View GitHub Profile
@abirkill
abirkill / linode_dns_update.php
Created August 25, 2018 03:45
Update an existing Linode DNS A or AAAA record to a supplied IP address using the Linode v4 API. Can be used with the pfSense custom dynamic DNS client.
<?php
/* An extremely basic example using PHP to update a Linode DNS entry via the
Linode v4 API (<https://developers.linode.com/api/v4>).
Takes an IP address as a GET parameter.
Can be used with pfSense's custom Dynamic DNS service (add a new Dynamic
DNS client, choose service type of 'Custom' or 'Custom (v6)' for IPv6, add
an update URL of 'https://yourlinode.com/yourscript.php?ip=%IP%', and add
@abirkill
abirkill / visual_magnitude.py
Created July 26, 2018 00:15
Calculate the visual magnitude of a satellite (e.g. the ISS) using PyEphem
#!/usr/bin/env python
import ephem
import math
'''
Takes two PyEphem objects, one for the sun and one for the satellite, and the
satellite's standard magnitude value (-1.3 for the International Space Station),
and calculates the visual magnitude of the satellite.
'''
def calculate_visual_magnitude(sun, satellite, standard_magnitude):