Skip to content

Instantly share code, notes, and snippets.

@dexterlabora
dexterlabora / Code.gs
Last active January 24, 2025 10:08
Google Sheets Scripts with the Meraki Dashboard API
// Settings - Modify this with your values
// *************************
// User Defined in the Script
var API_KEY = '';
var ORG_ID = '';
var NET_ID = '';
var TIMESPAN = '';
// User Defined in a Sheet
@dexterlabora
dexterlabora / firebase-merakiSplashAuth
Created July 31, 2018 13:12
This Firebase Function will provide a `/splashAuth` route to authenticate a wireless client on a Meraki Network.
/**
* This Firebase Function will provide a `/splashAuth` route to authenticate a wireless client on a Meraki Network.
* Example
* [POST] https://merakicaptiveportal-vuejs.firebaseapp.com/splashAuth/
* Body:
{"clientMac":"24:18:1d:ae:4c:71","nodeMac": "88:15:44:60:1c:1a"}
* Returns:
{
"ssids": {
"4": {
@dexterlabora
dexterlabora / Code.gs
Last active June 12, 2025 19:48
Meraki Webooks Demo with Google Sheets
/*
Copy this function over the existing Code.gs file in a Google Sheet
Save the Sheet/Script
Publish App
- Execute as You
- Avaiable to Anyone (including anonymous)
Authorize App when prompted
The URL will act as the Webhook URL for Meraki to send alerts
*/
[
{
"id": "fc8601c3.25e5b",
"type": "tab",
"label": "MV MQTT",
"disabled": false,
"info": ""
},
{
"id": "8a8e0f9e.ea00c",
[
{
"id": "6b02c4a0.a0d1ac",
"type": "tab",
"label": "Alerts",
"disabled": false,
"info": ""
},
{
"id": "def605c1.7fb328",
@dexterlabora
dexterlabora / snow-meraki-webhook-alerts.js
Created March 18, 2019 15:57
ServiceNow - Meraki Webhook Alerts
(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
// Parse Meraki Alerts Webhook Data
var requestBody = request.body;
var requestString = requestBody.dataString;
var requestParsed = {};
requestParsed = JSON.parse(requestString);
var merakiAlert = requestParsed;
// Create SNOW Incident
@dexterlabora
dexterlabora / vue.config.js
Created April 1, 2019 11:24
Meraki API proxy config for VueJS with Webpack
module.exports = {
devServer: {
proxy: {
"/api/*": {
target: "https://api.meraki.com/api/v0",
secure: false,
changeOrigin: true,
pathRewrite: {
"^/api": ""
},
@dexterlabora
dexterlabora / parsePathParams.js
Created April 12, 2019 08:48
Regex to replace URL path params with values
var path = '/network/{id}/device/{serial}';
params = {
id:"123456",
serial: "abcd-abcd-abcd"
}
var paramNames = Object.keys(params);
console.log('paramNames', paramNames);
@dexterlabora
dexterlabora / esp8266-sniffer
Created August 7, 2019 11:24
A fork of esp8266-sniffer to pipe probe requests the serial port in JSON format to be easily used with Node-RED, etc.
#include <ArduinoJson.h>
#include <iostream>
#include <ESP8266WiFi.h> // added this
#include <ESP8266HTTPClient.h> // added this
const char* serial = "YYYY-YYYY-YYYY"; // fake AP serial
const char* networkId = "N_99999999999"; // fake network ID
const float txPower = 20.5; // power in dBm (0 - 20.5)
@dexterlabora
dexterlabora / mr-mqtt-nr-simulator.json
Created August 21, 2019 13:32
A simulation of WiFi and BLE probes and MQTT communication network.
[
{
"id": "c100fe2a.cb152",
"type": "debug",
"z": "90fbc492.9c31f8",
"name": "Broker",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,