Skip to content

Instantly share code, notes, and snippets.


Stefan spacehuhn

View GitHub Profile
spacehuhn /
Last active Oct 30, 2022
Arduino Library Cheat Sheet

Arduino Library Cheat Sheet

Create the library

  • Make a GitHub repository for it
  • The library name should not start with Arduino
  • Make enough examples with good comments
  • Write an extensive that explains how to install and use the library
  • Should be useful for all architectures, otherwise think twice if your library should be published to the library manager

Define version

spacehuhn / esp32_apa102.ino
Created Aug 21, 2018
ESP32 FastLED APA102-2020 LED Example
View esp32_apa102.ino
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 4
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 23
#define CLOCK_PIN 22

In the end of setup():

  pinMode(D6, INPUT_PULLUP); // enable button pin

At the end of loop():

      serialInterface.runCommand("stopap");                    // stop access point and web interface
spacehuhn /
Last active Sep 19, 2020


Applying and using the following modifications are up to your responsibility.
I provide this example for you to better understand the code and how such an automatic attack-all could work.
It doesn't mean it will work, I won't provide you with further assistence, or keep this up-to-date.
These modifications make it easy to attack devices you wouldn't want to attack, keep that in mind!
You may easily violate law by using such an attack in public space.

spacehuhn /
Last active Oct 18, 2022
little bash script to enable monitor mode

Some wireless cards support monitor mode but won't work with airmon-ng. This is a little script helps you turning the monitor mode on! (+ it also sets the channel and the tx-power)

Usage: [Interface:wlan0] [Channel:1] [Txpower:30] [Bandwidth:HT20|HT40+|HT40-]

./ - enables monitor mode on wlan0, sets channel to 1 and tx-power to 30dBm.
./ wlan1 11 33 - enables monitor mode on wlan1, sets channel to 11 and tx-power to 33dBm.
./ wlan0 6 - enables monitor mode on wlan0, sets channel to 6 and tx-power to 30dBm.


spacehuhn /
Last active Aug 18, 2022
Flash ESP8266 over an Arduino

How to flash your ESP8266 without a USB-Serial adapter but with an Arduino.

First be sure everything is connected correcly:

Arduino ESP82666
spacehuhn /
Last active Nov 18, 2021
ESP8266 Webserver: send or download huge files

The Arduino webserver library from the ESP8266 is very simple and you can get to its limits pretty fast!

So that beeing said I first want to recommend you this library: ESPAsyncWebServer.
It's a very good alternative with a lot of features and it's easy to use.

However I wanna show you an easy way to hack around the standard webserver library for projects which can't make use of the ESPAsyncWebserver library.

So what we want to do is making the ESP8266 serve files via its webserver that are bigger than the RAM size we have left.
A picture for example. You don't want to hold that in the RAM, it's limited and way to valuable to be used for this.