Skip to content

Instantly share code, notes, and snippets.

View toolboc's full-sized avatar

Paul DeCarlo toolboc

View GitHub Profile
@toolboc
toolboc / Exim_and_Dovecot_On_Ubuntu_On_Azure.md
Created October 6, 2017 20:41
Exim_and_Dovecot_On_Ubuntu_On_Azure.md

Exim and Dovecot on Ubuntu on Azure

Create MX Record in DNS

  • Create an A Record for 'mail' that point to the VM ip
  • Create an MX Record that points @ to mail.[sitename.TLD]

Confirm proper routing using:

dig mail.[sitename.TLD]

Install and Configure Exim

@toolboc
toolboc / backup.sh
Created September 14, 2017 20:16
backup.sh
#!/bin/bash
#set -e
BACKUPDIR="/backups"
BACKUPDEV="/dev/sdb1"
DATE=`date +%F`
CLEANDATE=`date +%F -d "1 month ago"`
#see if its mounted
@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
@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
<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 / 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/
@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 / 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
#!/bin/sh
# adblocker.sh - by Todd Stein (toddbstein@gmail.com), 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 / 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