Skip to content

Instantly share code, notes, and snippets.

View pixelatedpic's full-sized avatar

Mohamed Afzal pixelatedpic

View GitHub Profile
@pixelatedpic
pixelatedpic / ESPWebSock.ino
Created April 26, 2022 07:33 — forked from bbx10/ESPWebSock.ino
ESP8266 Web server with Web Socket to control an LED
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web
@pixelatedpic
pixelatedpic / Grafana Alert Template.md
Created March 19, 2022 10:17 — forked from Himura2la/Grafana Alert Template.md
How to fix Grafana Alerts to Telegram
  • Template name: telegram.message
  • Content:
    {{ define "alert_list" }}{{ range . }}{{ range .Annotations.SortedPairs }}<strong>{{ .Name }}</strong>: {{ .Value }}
    {{ end }}<strong>value</strong>: {{ or .ValueString "[no data]" }}
    {{ range .Labels.SortedPairs }}<strong>{{ .Name }}</strong>: {{ .Value }}
    {{ end }}| {{ if gt (len .GeneratorURL) 0 }}<a href="{{ .GeneratorURL }}">source</a> | {{ end }}{{ if gt (len .DashboardURL) 0 }}<a href="{{ .DashboardURL }}">dashboard</a> | {{ end }}{{ if gt (len .SilenceURL) 0 }}<a href="{{ .SilenceURL }}">silence</a> | {{ end }}{{ if gt (len .PanelURL) 0 }}<a href="{{ .PanelURL }}">panel</a> |{{ end }}
    —
    {{ end }}{{ end }}
    {{ define "telegram.message" }}
    
@pixelatedpic
pixelatedpic / Arduino-IR-TX-NEC
Created February 13, 2021 10:20 — forked from EEVblog/Arduino-IR-TX-NEC
A simple Arduino driver for the NEC (Japanese) Infrared IR protocol. Drive an IR LED direct with your own code. This is a direct pin bit-bang approach, so beware about interrupts and timing difference between hardware. Feel free to use hardware PWM to generate the carrier frequency if you want better accuracy.
//*****************************************
// NEC (Japanese) Infrared code sending library for the Arduino
// Send a standard NEC 4 byte protocol direct to an IR LED on the define pin
// Assumes an IR LED connected on I/O pin to ground, or equivalent driver.
// Tested on a Freetronics Eleven Uno compatible
// Written by David L. Jones www.eevblog.com
// Youtube video explaining this code: http://www.youtube.com/watch?v=BUvFGTxZBG8
// License: Creative Commons CC BY
//*****************************************
@pixelatedpic
pixelatedpic / piGps.py
Created July 26, 2018 09:50
Raspberry PI interfaced GPS
import serial
from time import sleep
gpsport = serial.Serial("/dev/ttyAMA0",bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=0, rtscts=0)
#gpsport.flush()
#sleep(5)
while True:
# sleep(.5)
# gpsport.flush()
raw = gpsport.readline()
@pixelatedpic
pixelatedpic / mosquitto_websockets.md
Created May 28, 2018 08:49 — forked from smoofit/mosquitto_websockets.md
Howto install mosquitto with websockets