Skip to content

Instantly share code, notes, and snippets.

FROM ubuntu:18.04
# Install dependencies
RUN apt-get update && \
apt-get -y install apache2
# Install apache and write hello world message
RUN echo 'Hello World!' > /var/www/html/index.html
# Configure apache
@matbor
matbor / connectagent.py
Last active December 22, 2020 02:32
Quick example of using python and Twilio for connecting agent to customer using the VERIFIED caller id of the agent to make the call.
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
import os
from twilio.twiml.voice_response import Dial, VoiceResponse
from flask import Flask, request
app = Flask(__name__)
# Your Account SID from twilio.com/console
account_sid = os.environ.get('TWILIO_ACCOUNT_SID')
# Your Auth Token from twilio.com/console
@matbor
matbor / Outside_accesory.js
Last active June 8, 2017 12:48
Example of receiving an mqtt temperature for https://github.com/KhaosT/HAP-NodeJS
var OutsideTemperature = 0.0;
// MQTT Setup
var mqtt = require('mqtt');
console.log("Connecting to MQTT broker...");
var mqtt = require('mqtt');
var options = {
port: 1883,
host: '192.168.4.24',
clientId: 'AdyPi_OutsideTemperatureSensor'
@matbor
matbor / plex_create_rating_collection.py
Created March 8, 2017 09:20
This script will create a collection of your movies based on the movie rating, ie. If you want all G rated movies in a collection on it's own.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Create a Plex collection from based on content rating.
# Original Author: /u/SwiftPanda16
# Modified by: @bordignon on Twitter.
# Requires: plexapi, requests
#
import requests
@matbor
matbor / 00readme.md
Last active February 14, 2016 11:43
Display temperature on a SPI OLED screen running off a ESP8266 board. Pic; https://twitter.com/bordignon/status/698727496271863808

by Matthew Bordignon Feb 2016 (@bordignon on twitter)

Quick demo for displaying temperature on oled screen.

  • connects to wifi
  • connects to an MQTT server
  • subscribes to topic
  • displays temperature (needs to be in xx.xx format)

Based on the built-in examples from ESP8266 MQTT lib and the SPI OLED ESP8266 lib from somhi.

@matbor
matbor / esp8266_pubsubclient.ino
Last active August 29, 2015 14:25 — forked from igrr/esp8266_pubsubclient.ino
PubSubClient sample for ESP8266 Arduino
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
const char* ssid = ".................";
const char* password = "................";
char* topic = "esp8266_arduino_out";
char* server = "iot.eclipse.org";
#!/usr/bin/env python
#
# Based on https://github.com/Supervisor/superlance/blob/master/superlance/crashmail.py
#
# A event listener meant to be subscribed to PROCESS_STATE_CHANGE
# events. It will publish an MQTT message when processes that are children of
# supervisord transition unexpectedly to the EXITED state.
# A supervisor config snippet that tells supervisor to use this script
# as a listener is below.
@matbor
matbor / install_sdr_pi.sh
Last active March 3, 2017 13:02
First script, installs the SDR rtl on the Pi, see webpage below for more info. Should also work on Ubuntu.
#!/bin/bash
#from http://zr6aic.blogspot.com.au/2013/02/setting-up-my-raspberry-pi-as-sdr-server.html
#install software packages
sudo apt-get update
sudo apt-get -y install cmake libusb-1.0-0.dev build-essential git
#Now install the RTL-2832U USB dongle driver src and compile
cd
@matbor
matbor / install_sdr_pi_pager.sh
Created July 11, 2015 08:27
Second script, this one install the pager components for the Pi.
#!/bin/bash
#from https://www.raspberrypi.org/forums/viewtopic.php?t=45142#
# Install dependencies
sudo apt-get update
sudo apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake libpulse-dev libx11-dev
# Fetch and compile rtl-sdr source
mkdir -p ~/src/
cd ~/src/
@matbor
matbor / gist:a00331c968e1ea68112f
Created July 10, 2015 01:50
nxlog config file for windows 8.1 to send data to graylog server. check the ip address!
## This is a sample configuration file. See the nxlog reference manual about the
## configuration options. It should be installed locally and is also available
## online at http://nxlog.org/nxlog-docs/en/nxlog-reference-manual.html
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog