This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <WebServer.h> | |
| #include <WiFi.h> | |
| #include <WiFiUdp.h> | |
| //set up to connect to an existing network (e.g. mobile hotspot from laptop that will run the python code) | |
| const char* ssid = "ssid"; | |
| const char* password = "password"; | |
| WiFiUDP Udp; | |
| unsigned int localUdpPort = 4210; // port to listen on | |
| char incomingPacket[255]; // buffer for incoming packets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <WebServer.h> | |
| #include <WiFi.h> | |
| #include <WiFiUdp.h> | |
| // the IP of the machine to which you send msgs - this should be the correct IP in most cases (see note in python code) | |
| #define CONSOLE_IP "192.168.1.2" | |
| #define CONSOLE_PORT 4210 | |
| const char* ssid = "ESP32"; | |
| const char* password = "12345678"; | |
| WiFiUDP Udp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Copied from https://github.com/FreePBXHosting/freepbx-scripts/tree/master/sshport | |
| # | |
| # To run the script, login as root via SSH and run the following command: | |
| # bash <(curl -Ls https://gist.github.com/worldadventurer/842f1a10762cba0ce27dc8f99a835377/raw) | |
| # | |
| ############################################# | |
| # FreePBXHosting.com - @freepbxhosting # | |
| # VERSION 1.6 UPDATED JUN 25 2015 # | |
| # DESC: CHANGES SSH PORT AND RESTARTS SSH # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.earthlinktele.faisaljamil.cinemana.push_notification; | |
| import android.app.Notification; | |
| import android.app.Notification.Builder; | |
| import android.app.NotificationManager; | |
| import android.app.PendingIntent; | |
| import android.app.Service; | |
| import android.content.Context; | |
| import android.content.Intent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| control app https://x.thunkable.com/copy/e8f633a8a9a3e979025112e18446d3b4 | |
| Video: https://www.youtube.com/watch?v=oCMOYS71NIU | |
| Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp | |
| Ported to Arduino ESP32 by Evandro Copercini | |
| Create a BLE server that, once we receive a connection, will send periodic notifications. | |
| The service advertises itself as: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E | |
| Has a characteristic of: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E - used for receiving data with "WRITE" | |
| Has a characteristic of: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E - used to send data with "NOTIFY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Create a WiFi access point and provide a web server on it. */ | |
| #include <ESP8266WiFi.h> | |
| #include "./DNSServer.h" // Patched lib | |
| #include <ESP8266WebServer.h> | |
| const byte DNS_PORT = 53; // Capture DNS requests on port 53 | |
| IPAddress apIP(10, 10, 10, 1); // Private network for server | |
| DNSServer dnsServer; // Create the DNS object | |
| ESP8266WebServer webServer(80); // HTTP server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # September 2013 | |
| # by Matthew Bordignon, @bordignon on Twitter | |
| # | |
| # Simple Python script (v2.7x) that subscribes to a MQTT broker topic and inserts the topic into a mysql database | |
| # This is designed for the http://mqttitude.org/ project backend | |
| # | |
| import MySQLdb | |
| import mosquitto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| OTA update over HTTPS | |
| As an example, we download and install ESP8266Basic firmware from github. | |
| Requires latest git version of the core (November 17, 2015) | |
| Created by Ivan Grokhotkov, 2015. | |
| This example is in public domain. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Source: | |
| # https://www.cloudflare.com/ips | |
| # https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables- | |
| for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done | |
| for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done | |
| # Avoid racking up billing/attacks | |
| # WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable. | |
| iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP |