Skip to content

Instantly share code, notes, and snippets.

#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include "BLE2902.h"
#include "BLEHIDDevice.h"
#include "HIDTypes.h"
#include "HIDKeyboardTypes.h"
// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
@sabas1080
sabas1080 / ESP32_HID.ino
Last active December 19, 2025 10:37
Example of HID Keyboard BLE with ESP32
/*
Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@dale3h
dale3h / lovelace-migrate.py
Created June 29, 2018 00:02
Lovelace UI Migration Script
"""
Migration tool for Home Assistant Lovelace UI.
"""
import argparse
import logging
import sys
import json
from collections import OrderedDict
from getpass import getpass
@bzerangue
bzerangue / disable-suspend.md
Last active September 27, 2025 02:38
Disable Sleep/Suspend and WiFi in Ubuntu 16.04 LTS

On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

And this to re-enable it:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

@pletch
pletch / scrape_pfsense_dhcp_leases.py
Last active November 15, 2025 19:38
Scrape PFSense DHCP Leases Status Page and Export Results to JSON
#!/usr/bin/env python3
# # This python script provides a function to query the pfsense (+v2.4) dhcp leases status page and return a list of tuples including
# ip, hostname, and mac address. To use, ensure LXML is installed via package manager or via pip.
#
# 16-Dec-2016 - Original release
# 3-Sep-2020 - Minor update to match formatting of leases page in latest pfSense version (2.4.5).
# 9-Sep-2020 - Backported improvements to handle table rows with missing data, use global variables for user/pass/server_ip,
# and return list from scrape function as implemented by fryguy04 in fork here:
# https://gist.github.com/fryguy04/7d12b789260c47c571f42e5bc733a813
@smeschke
smeschke / geoplotting
Last active August 17, 2016 20:57
Plotting the Proliferation of Mormon Temples with Basemap
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import csv
#get list of temple name, location, dedication data, lat, and lon
path = '/home/sm/Desktop/temple_data.csv'
temples = [] #create a list to store the temple data from the spread sheet
with open(path, 'rb') as csvfile: #open the csv file
temple_data = csv.reader(csvfile, delimiter=',', quotechar='"') #load temple data
for temple in temple_data: #iterate through data to change year to int
@verisgit
verisgit / pia.sh
Last active October 5, 2018 11:18 — forked from dapperfu/pia.sh
#!/bin/tcsh
# Grab user information.
echo "PrivateInternetAccess OpenVPN Setup:"
echo " https://www.privateinternetaccess.com/"
echo -n "User: "
set user = $<
echo -n "Pass: "
set pass = $<