Nicholas-Autio-Mitchell / automate

Small projects to automate simple things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

automate

Scripts used locally to run mundane tasks or perform checks regularly using tools like cron.


Speed test

Checks the internet connection speed and if below a certain threshold, will send a tweet to e.g. the internet provider along with the image containing the speed test results. Can make this run on a Raspberry Pi quite easily.

This requires two non-standard package installations:

  1. pip install twitter - homepage
  2. pip install speedtest-cli - homepage

Example image in tweet:

alt text

Push IP

This is required because modern (public) IP4 addresses are dynamic - changing roughly once per day. Attains the local public IP address of a machine and writes it to a log file in a dynamically synchronised folder (e.g. Dropbox, Google Drive), from where it can be read and used for remote ssh connection.

It retrieves the IPv4 address of a machine from one of a few possible online resources, checks whether or not the obtained IP is different to the last recorded, and if so updates a file that logs all recorded IP addresses.

A simple bash function can be used to parse the most recent IP address from said file, and paste that into an ssh command, along with any other required settings.

About

Small projects to automate simple things

License:GNU General Public License v3.0


Languages

Language:Python 100.0%