I needed to deploy WireGuard VPN to 48 Windows machines on an Active Directory domain. Creating clients one by one in the UniFi UI was not an option, so I reverse engineered the API using Firefox DevTools. Sharing everything here since there is almost no documentation on this.
This is the most straightforward config for parsing the Ambient Weather API into a time series database with Telegraf. I use InfluxDB to store the data and Grafana to view the data.
Note that this is not a complete Telegraf config. What follows is a fragment that you would add to the bottom of your telegraf.conf file. You must set up Influx yourself.
You MUST replace the xxxxxxxx strings in the urls parameter with your personal Application key and API key. See https://www.ambientweather.com/api.html for help if you don't have your keys.
The measurement name can be set to anything you want with the name_override parameter.
The devices endpoint gives data for all weather stations associated with your account, but this config simply takes the first one. This is done with the json_query = "0.lastData" line. Other devices could be selected by changing the 0 to another number. Properly handling multiple weather stations is too complex for any sane config of the http plugin for Telegraf. Hard
| #!/bin/sh | |
| # default commands for osx to make it nicer to work with | |
| ########################## | |
| # General UI?UX settings # | |
| ########################## | |
| # Set hostname (hex of MVB9APPS) | |
| sudo scutil --set ComputerName "0x4d56423941505053" | |
| sudo scutil --set HostName "0x4d56423941505053" |
| export default [ | |
| "Reticulating splines...", | |
| "Generating witty dialog...", | |
| "Swapping time and space...", | |
| "Spinning violently around the y-axis...", | |
| "Tokenizing real life...", | |
| "Bending the spoon...", | |
| "Filtering morale...", | |
| "Don't think of purple hippos...", | |
| "We need a new fuse...", |
| # Monit on pfSense 2.4 ARM (SG-1000) | |
| # Install the package from the FreeBSD repository | |
| pkg add http://pkg.freebsd.org/FreeBSD:11:armv6/latest/All/monit-5.18.txz | |
| # Rename the rc.d script to .sh and fix permissions so pfSense will start it automatically | |
| mv /usr/local/etc/rc.d/monit /usr/local/etc/rc.d/monit.sh | |
| chmod 0755 /usr/local/etc/rc.d/monit.sh | |
| # Add monit_enable=YES to a local rc.conf |
| Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
| The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
| The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
| To use: | |
| 1. Install [Ansible](https://www.ansible.com/) | |
| 2. Setup an Ubuntu 16.04 server accessible over ssh | |
| 3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
| 4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |