Skip to content

Instantly share code, notes, and snippets.

View andysmithfal's full-sized avatar

Andy Smith andysmithfal

  • Falmouth University
  • Cornwall, UK
View GitHub Profile
@andysmithfal
andysmithfal / zerotier_gateway_vm.md
Last active January 21, 2022 23:16
Configuring a ZeroTier Network Gateway on an Ubuntu VM

Configuring a ZeroTier Network Gateway on an Ubuntu VM

We will set up an Ubuntu VM that will act as a gateway to an existing network. Clients will be assigned IP addresses within the existing network subnet by ZeroTier, and traffic will be routable to hosts within the network. You need to ensure you have a block of IP addresses available outside of the current DHCP pool, but within the subnet to assign to VPN clients.

This guide is based on ZeroTier's guide for Raspbian.

We will be using the following - make notes of the following for your own network:

Parameter Value
#!/usr/bin/env python3
#script to publish drive usage stats over mqtt
#requires paho-mqtt library:
# $ apt-get install python3-pip
# $ pip3 install paho-mqtt
#
#run this script on cron as required
import shutil
@andysmithfal
andysmithfal / boards.txt
Last active November 25, 2022 23:13
NodeMCU Dev kit v2 for Arduino8266
##############################################################
nodemcuv2.name=NodeMCU Dev Kit 2.0 (ESP8266 ESP-12E Module)
nodemcuv2.upload.tool=esptool
nodemcuv2.upload.speed=115200
nodemcuv2.upload.resetmethod=ck
nodemcuv2.upload.maximum_size=4194304
nodemcuv2.upload.wait_for_upload_port=true
nodemcuv2.serial.disableDTR=true
nodemcuv2.serial.disableRTS=true

Keybase proof

I hereby claim:

  • I am andysmithfal on github.
  • I am andysmith (https://keybase.io/andysmith) on keybase.
  • I have a public key whose fingerprint is 5C90 3869 E815 68B6 EB28 12EA 1FD3 DB16 0FF8 4D39

To claim this, I am signing this object:

@andysmithfal
andysmithfal / owm.pde
Created May 14, 2014 20:41
Open weather map json in Processing
JSONObject json;
//options - change these!
String location = "Falmouth,UK";
int refreshInterval = 5;
//static vars - don't change!
String weatherURL = "http://api.openweathermap.org/data/2.5/weather?units=metric&q=";
long lastRefresh = 0;
#include <Stepper.h>
const int stepsPerRevolution = 2050;
Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5);
void setup() {
myStepper.setSpeed(5);
}
@andysmithfal
andysmithfal / stepperDualServo.pde
Last active August 29, 2015 14:00
Arduino, two stepper motors with serial input driven like 360º servos. Processing interface.
//Code for Arduino
//
#include <Stepper.h>
//may need to change this depending on manufacturing variences..
const int stepsPerRevolution = 2050;
//placeholders to keep track of both motors' positions
unsigned int currentPos1 = 0;