Skip to content

Instantly share code, notes, and snippets.

View toolboc's full-sized avatar

Paul DeCarlo toolboc

View GitHub Profile
@toolboc
toolboc / SoilMonitor.ino
Created November 25, 2015 22:02
SoilMonitor.ino for Particle Photon
// This #include statement was automatically added by the Particle IDE.
#include "AzureMobileService/AzureMobileService.h"
// This #include statement was automatically added by the Particle IDE.
#include "SparkFun_Photon_Weather_Shield_Library/SparkFun_Photon_Weather_Shield_Library.h"
//Azure Mobile Service Configuration
#define MYSERVICE "soilmonitor"
#define MYKEY "FINDTHISKEYINAZUREPORTAL"
AzureMobileService ams;
@toolboc
toolboc / LightSaberHeartRate.ino
Created January 25, 2016 21:04
Biofeedback Heart Monitor with Particle Photon and Microsoft Band
/*-------------------------------------------------------------------------
Spark Core and Photon library to control WS2811/WS2812 based RGB
LED devices such as Adafruit NeoPixel strips.
Currently handles 800 KHz and 400kHz bitstream on Spark Core and Photon,
WS2812, WS2812B and WS2811.
Also supports:
- Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream.
- TM1829 pixels
@toolboc
toolboc / LightSaberLightShow.ino
Created February 4, 2016 19:51
Building a Modified Lightsaber with Progammable LEDs
/*-------------------------------------------------------------------------
Spark Core and Photon library to control WS2811/WS2812 based RGB
LED devices such as Adafruit NeoPixel strips.
Currently handles 800 KHz and 400kHz bitstream on Spark Core and Photon,
WS2812, WS2812B and WS2811.
Also supports:
- Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream.
- TM1829 pixels
#!/bin/sh
# adblocker.sh - by Todd Stein ([email protected]), Saturday, October 25, 2014
# for use on routers running OpenWRT firmware
# Periodically download lists of known ad and malware servers, and prevents traffic from being sent to them.
# This is a complete rewrite of a script originally written by teffalump (https://gist.github.com/teffalump/7227752).
HOST_LISTS="
@toolboc
toolboc / quakeinstaller.sh
Last active March 27, 2017 20:23
Quake on Bash on Ubuntu on Windows
#!/bin/bash
#Quake on Bash on Ubuntu on Windows
[[ `id -u` -eq 0 ]] || { echo "Must be root to run script, try running again with sudo"; exit 1; }
#ensure Xming is installed
if [ -f "/mnt/c/Program Files (x86)/Xming/Xming.exe" ]
then
echo "XMing is installed on Windows Filesystem, please ensure that it is running";
else
@toolboc
toolboc / JekyllonAzurefromVSwithBashDemo
Last active January 22, 2017 23:58
Demo showcasing development and deployment of jekyll blog from Bash on Windows in VS Code with Deployment to Azure
*******
Prereqs
*******
Install Jekyll as per http://biserkov.com/blog/2016/06/04/Steps-to-install-Jekyll-on-Ubuntu-on-Windows/
Install the azure xplat-cli https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/
enable DBUS in BoUoW : sudo sed -i 's$<listen>.*</listen>$<listen>tcp:host=localhost,port=0</listen>$' /etc/dbus-1/session.conf
*******
@toolboc
toolboc / squid.conf
Created August 7, 2016 04:14
squid.conf with PAM authentication for squid3 - tested on Ubuntu 16.04
# WELCOME TO SQUID 3.5.12
# ----------------------------
#
# This is the documentation for the Squid configuration file.
# This documentation can also be found online at:
# http://www.squid-cache.org/Doc/config/
#
# You may wish to look at the Squid home page and wiki for the
# FAQ and other documentation:
# http://www.squid-cache.org/
<form action="URL_TO_YOUR__AZURE_FUNCTION (will look something like this: https://MYFUNCTIONDOMAIN.azurewebsites.net/api/FUNCTIONNAME?code=TMU4yAbRxEPq8/aHAjW2naiGYp27ja6rJYUQahSSRbbjkPP5NoYkfg==" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_live_YOUR_STRIPE_KEY"
data-image="images/marketplace.png"
data-name="My Online business"
data-description="1-Week Subscription Plan"
data-amount="350"
data-label="Sign Up Now For Only Tree-Fiddy!">
</script>
@toolboc
toolboc / StripeSubscription-AzureFunction
Last active June 7, 2017 14:41
StripeSubscription-AzureFunction
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
var stripe = require('stripe')(process.env.StripeSecret);
var qs = require('querystring');
var post = qs.parse(req.body);
//create a plan - technically this code only needs to ever be ran one-time to create the initial plan
@toolboc
toolboc / akafinder.sh
Created August 29, 2017 16:18
aka.ms url finder
#!/bin/bash
cat /dev/null > output.txt
for x in {a..z}
do
for y in {a..z}
do
echo -n aka.ms/$x$y, >> output.txt
curl aka.ms/$x$y | grep "href=" | cut -d'"' -f2 >> output.txt