Skip to content

Instantly share code, notes, and snippets.

View c1sc0's full-sized avatar
🥝
bewi

Krisztian Somogyi c1sc0

🥝
bewi
View GitHub Profile
@c1sc0
c1sc0 / button.ino
Created March 4, 2023 20:38 — forked from phnahes/button.ino
ESP32 button with debounce and no repeat pressed while hold button
volatile unsigned long DebounceTimer;
volatile int ButtonPressed;
volatile unsigned int delayTime = 200;
volatile unsigned int delayRepeatTime = 500;
volatile byte state = LOW;
unsigned long lastInterrupt;
#define pin 34
#define ledPin 2
@c1sc0
c1sc0 / PiCluster-1586518792687.json
Created May 28, 2022 17:59 — forked from dinofizz/PiCluster-1586518792687.json
A Grafana dashboard using Prometheus (with node_exporter and rpi_exporter) to present some basic measurements
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@c1sc0
c1sc0 / curl.md
Created January 25, 2022 17:43 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@c1sc0
c1sc0 / vpn_namespace.md
Created May 1, 2020 20:00 — forked from EnigmaCurry/vpn_namespace.md
OpenVPN and browser specific network routing with ip netns

OpenVPN and browser specific network routing with ip netns

Create network bridge

A network bridge allows us to have a virtual router that we can plug multiple network interfaces into. The IP address is assigned to the bridge rather than the individual network interface.

Create the bridge device, br0 :

@c1sc0
c1sc0 / FactoryPatternImplementation.cs
Created October 12, 2019 13:31 — forked from rohit-lakhanpal/FactoryPatternImplementation.cs
Patterns - Factory Pattern (Real World Example): Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
using System;
using System.Collections.Generic;
namespace DesignPatterns.Factory.RealWorld
{
/// <summary>
/// MainApp startup class for Real-World
/// Factory Method Design Pattern.
/// </summary>
class MainApp
@c1sc0
c1sc0 / main.c
Created September 11, 2018 21:07 — forked from AnttiNykanen/main.c
STM32F103C8 USART example
#include "stm32f10x.h"
#include "stm32f10x_conf.h"
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
uint16_t rxbuf[64];
int rxbuf_pos = 0;
@c1sc0
c1sc0 / gist:1f8756ebbc305cb69996139ddc24ab22
Created September 10, 2017 10:53 — forked from rlex/gist:7841736d679f0afba0d12d8324c24999
IPv6 minimal firewall for mikrotik
add chain=input comment="Router: Allow established connections" connection-state=established
add chain=input comment="Router: Allow related connections" connection-state=related
add chain=input comment="Router: Allow IPv6 ICMP" protocol=icmpv6
add action=drop chain=input comment="Drop everything else"
add chain=forward comment="LAN: Allow established connections" connection-state=established
add chain=forward comment="LAN: Allow related connections" connection-state=related
add chain=forward comment="LAN: Allow IPv6 ICMP" protocol=icmpv6
#example rule for opening port
add chain=forward comment="LAN: Allow SSH" dst-port=22 protocol=tcp
add chain=forward comment="Allow any to internet" out-interface=sixbone
@c1sc0
c1sc0 / custom.js
Created February 5, 2017 01:07 — forked from drewjoh/custom.js
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.1)
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {

ESP8266 Web Server to storing ap config to EEPROM.

Original by chriscook8 from esp8266.com I just modified to use ESP8266WebServer library for easy to handle the http request.

This is sample code not yet complete.

Todo

  • when Wifi connected need to close the softAP.

Git cheat sheet

Common commands

General

Create repository:

git init