Skip to content

Instantly share code, notes, and snippets.

View GarrettSocling's full-sized avatar

Online Notebook GarrettSocling

View GitHub Profile
@GarrettSocling
GarrettSocling / rpi3_iot_server.md
Created January 31, 2019 20:59 — forked from xoseperez/rpi3_iot_server.md
Raspberry Pi 3 with Mosquitto, Node-RED, InfluxDB, Grafana and Nginx (as a reverse proxy)
MIT LICENSE
Copyright 2018 Steve Cope
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@GarrettSocling
GarrettSocling / rpi-vnc-on-boot.md
Created January 21, 2019 22:19 — forked from cobyism/rpi-vnc-on-boot.md
How to set up a Raspberry Pi so that VNC starts on boot. Mostly from http://myraspberrypiexperience.blogspot.co.uk/p/setting-up-vnc.html

Starting VNC automatically on a Raspberry Pi

sudo apt-get install tightvncserver
vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565
  • Set up a password for access (optional)
sudo vi /etc/init.d/tightvncserver
@GarrettSocling
GarrettSocling / use-torch-rnn-on-alazon-gpu.md
Created December 7, 2018 20:46 — forked from lipsumar/use-torch-rnn-on-alazon-gpu.md
Run torch-rnn on GPU on Amazon EC2

Run torch-rnn on GPU on Amazon EC2

Using ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20161214 - ami-d8bdebb8

Prerequisities:

Optional: create a base ubuntu machine

If running MacOS, docker-nvidia is not available, therefore you need a first host machine.

@GarrettSocling
GarrettSocling / sys_uptime.py
Created June 16, 2018 09:22 — forked from carlkibler/sys_uptime.py
Retrieve system uptime with Python
import subprocess
def uptime():
raw = subprocess.check_output('uptime').replace(',','')
days = int(raw.split()[2])
if 'min' in raw:
hours = 0
minutes = int(raw[4])
else:
hours, minutes = map(int,raw.split()[4].split(':'))

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@GarrettSocling
GarrettSocling / - Syncthing + start on boot.md
Created August 4, 2017 15:52 — forked from hdml/- Syncthing + start on boot.md
How to install Syncthing on Raspberry Pi + start on boot [semi-automatic]

##Run install_syncthing.sh

$ curl -s https://gist.githubusercontent.com/hdml/7b079c114d3e20bf69f1/raw/1cd3647b1db4f80726c145fba725e27993a7fcdb/install_syncthing.sh | sudo bash

Start syncthing

$ syncthing

Wait until you get something like:

@GarrettSocling
GarrettSocling / mqtt.py
Created March 23, 2017 06:41 — forked from stylpen/mqtt.py
python MQTT wrapper
import thread, mosquitto, random, time
# mosquitto reference and download can be found here: http://mosquitto.org/documentation/python/
class mqtt():
def __init__(self, broker = "127.0.0.1", port = 1883, clientID = None):
self.__broker = broker
self.__port = port
self._client = None
self.__subscriptionsList = []
self.__pendingSubscriptionsList = []
@GarrettSocling
GarrettSocling / mqtt_subscriber.py
Created March 23, 2017 04:08
#mqtt #python #subscribe #mosquitto
#!/usr/bin/python
"""Example of MQTT client (subscriber) using Mosquitto
Authored by Daniel Shih <hotingwow@gmail.com>
"""
from mosquitto import Mosquitto
from sys import argv
from socket import gethostname
@GarrettSocling
GarrettSocling / readserial.py
Created March 23, 2017 03:22 — forked from andypiper/readserial.py
Scrape serial port for text data and publish on MQTT
#!/usr/bin/python
#
#simple app to read string from serial port
#and publish via MQTT
#
#uses the Python MQTT client from the Mosquitto project
#http://mosquitto.org
#
#Andy Piper http://andypiper.co.uk
#2011/09/15