This file contains hidden or 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 | |
# Maximilian Mitchell (max.me.uk) | |
# cron: | |
# 0 * * * * /usr/bin/curl -s https://gist.githubusercontent.com/maxisme/ea9bfe4cfcf5b89494a7a793253b8a60/raw/5Gmonitor.sh | bash | |
# requirements: | |
# - jq | |
# - speedtest | |
# - t | |
EXPECTED_DL=400 |
This file contains hidden or 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
package main | |
import ( | |
"archive/tar" | |
"bytes" | |
"compress/gzip" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" |
This file contains hidden or 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
https://google-cloud-python.readthedocs.io/en/latest/logging/usage.html | |
https://google-cloud-python.readthedocs.io/en/latest/logging/usage.html#integration-with-python-logging-module | |
https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry | |
NOTE: as of 9/7/18 | |
https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5878 | |
https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5885 | |
See the snippets "guide.md" and "redis.md" below.
If you're wanting to run Docker Swarm on your Raspberry Pi checkout these instructions:
This guide creates a reverse SSH tunnel to route all Plex server traffic through it.
Step 2 is done on the tunnel, all other steps are done on the plex server.
On plex server:
This file contains hidden or 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
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) |
This file contains hidden or 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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains hidden or 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
import zmq | |
def main(): | |
try: | |
context = zmq.Context(1) | |
frontend = context.socket(zmq.SUB) | |
frontend.bind('tcp://*:5559') | |
frontend.setsockopt(zmq.SUBSCRIBE, '') |
NewerOlder