Skip to content

Instantly share code, notes, and snippets.

View abobija's full-sized avatar

Alija Bobija abobija

View GitHub Profile
@abobija
abobija / humidifier.yaml
Created August 19, 2022 18:37
Code of humidifier made in https://youtu.be/-uyNXLJjQtI
substitutions:
device_name: humidifier
device_name_verbose: Humidifier
esp8266:
board: d1_mini
esphome:
name: ${device_name}
@abobija
abobija / wsl2-ubuntu-lamp.md
Last active February 25, 2024 08:07
LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

Apache

sudo apt-get update && sudo apt-get upgrade 
sudo apt-get install -y apache2

PHP

@abobija
abobija / esp-idf-on-wsl2.md
Last active April 13, 2024 04:57
ESP-IDF on WSL2 - Build, Flash and Monitor

ESP-IDF on WSL2 - Build, Flash and Monitor ⚡

Demo

How to setup ESP-IDF on WSL2 Ubuntu 20.04 - Config, Build and Flash

Intro

WSL2 still does not support USB devices, but with a little effort we can make possible to flash and monitor ESP device from WSL2.

@abobija
abobija / esp-idf on ubuntu 20.04.1.md
Last active September 9, 2023 02:20
ESP-IDF on Ubuntu 20.04.1

ESP-IDF on Ubuntu 20.04.1

This is commands used in youtube video

How to setup ESP-IDF on Ubuntu 20.04.1

Commands:

sudo apt update && sudo apt upgrade -y
@abobija
abobija / init.lua
Created November 16, 2019 21:10
Code written for ESP32 in YouTube video https://youtu.be/b6W0ps3IhzA
local rfidmod = nil
local function init_rfid()
if rfidmod ~= nil then
return
end
rfidmod = require('rfid32')({
pin_sda = 22,
pin_clk = 19,
@abobija
abobija / Program.cs
Created November 16, 2019 14:22
Code written in YouTube video https://youtu.be/eSS5w29iVl8
using SimpleHttp;
using System.Threading;
namespace SimpleHttpDemo
{
class Program
{
static void Main(string[] args)
{
Route.Add("/", (req, res, props) =>
@abobija
abobija / index.html
Last active September 26, 2019 19:19
Code written in YouTube video https://youtu.be/2mlmr_HwWgo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ESP32</title>
<style>
button {
padding: 20px;
@abobija
abobija / index.html
Created September 26, 2019 13:25
Code written in YouTube video https://youtu.be/A_j-nDV46Ik
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ESP32</title>
</head>
<body>
<h1>Hello from ESP32</h1>
@abobija
abobija / index.js
Last active March 20, 2024 22:35
Code written in YouTube video https://youtu.be/q5tOByY1ch4
var mqtt = require('mqtt');
var client = mqtt.connect('mqtt://io.adafruit.com', {
username: 'ADAFRUIT_IO_USERNAME',
password: 'ADAFRUIT_UI_KEY'
});
var ssd1306topic = `${client.options.username}/f/ssd1306`;
client.on('connect', function() {
@abobija
abobija / init.lua
Created September 24, 2019 12:14
Code written from YouTube video https://youtu.be/00gPK3rfXZA
local username = 'ADAFRUIT_IO_USERNAME'
local aioKey = 'ADAFRUIT_IO_KEY'
local feed = 'ADAFRUIT_IO_MQTT_FEED_NAME'
local sda = 26
local scl = 27
local sla = 0x3c
i2c.setup(i2c.HW0, sda, scl, i2c.FAST)
local disp = u8g2.ssd1306_i2c_128x64_noname(i2c.HW0, sla)