Skip to content

Instantly share code, notes, and snippets.

View spacehuhn's full-sized avatar
💭
🐔➡️🚀

Stefan spacehuhn

💭
🐔➡️🚀
View GitHub Profile
@spacehuhn
spacehuhn / arduinolib.md
Last active January 16, 2024 18:16
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 README.md 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
spacehuhn / esp32_apa102.ino
Created August 21, 2018 17:00
ESP32 FastLED APA102-2020 LED Example
#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():

  if(digitalRead(D6)){
    if(!attack.isRunning()){
      serialInterface.runCommand("stopap");                    // stop access point and web interface
@spacehuhn
spacehuhn / deauthall.md
Last active September 19, 2020 21:53
Deauth-All-Button

Disclaimer

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
spacehuhn / startwlan.md
Last active January 16, 2024 18:17
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: startWlan.sh [Interface:wlan0] [Channel:1] [Txpower:30] [Bandwidth:HT20|HT40+|HT40-]

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

Script:

@spacehuhn
spacehuhn / arduino_flash_esp8266.md
Last active January 16, 2024 18:14
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
TX RX
RX TX
GND GND
GND GPIO-15
@spacehuhn
spacehuhn / esp8266webserver_download_hack.md
Last active January 16, 2024 18:17
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.