Skip to content

Instantly share code, notes, and snippets.

View ekapujiw2002's full-sized avatar

Eka Puji Widiyanto ekapujiw2002

View GitHub Profile
@ekapujiw2002
ekapujiw2002 / espNow_broadcast
Created March 19, 2025 08:23 — forked from Daniel-dk/espNow_broadcast
ESP-Now broadcast example
/**
ESPNOW - Basic communication - Broadcast
Date: 28th September 2017
Original Author: Arvind Ravulavaru <https://github.com/arvindr21>
modified by Daniel de kock
Purpose: ESPNow Communication using Broadcast
Resources: (A bit outdated)
a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf
@ekapujiw2002
ekapujiw2002 / mqtt-in-your-browser.md
Created September 11, 2024 05:04 — forked from narutaro/mqtt-in-your-browser.md
MQTT in your browser

MQTT in your browser

MQTT is probably best known as a lightweight messaging protocol implemented for small sensors, but there is actually a JavaScript implementation called MQTT.js. It's a JavaScript implementation, so of course it works in a browser. I think it's a great option for front-end engineers who are working with MQTT/IoT-related projects (for example, creating a dashboard to visualize MQTT data). In this article, I'd like to write about what I did when I tried to connect MQTT.js to the test server (broker) of Mosquitto™.

@ekapujiw2002
ekapujiw2002 / README.md
Created June 15, 2024 01:37 — forked from corenel/README.md
RTSP Port Forwarding

之前在这里研究过的用iptables配置跨网段的端口转发

Assume we have the following network environments:

  • Device:
    • eth0 (192.168.6.59): for external access
    • enx000ec6a490c5 (192.168.1.2): for ip camera
  • IP Camera:192.168.1.10
  • PC:192.168.6.2
@ekapujiw2002
ekapujiw2002 / rsync-rootfs.md
Created June 9, 2024 03:52 — forked from kalaksi/rsync-rootfs.md
Copy the whole root filesystem excluding pseudo-filesystems and mountpoints

Copying the whole linux root filesystem locally or remotely using rsync

Explanation of chosen options:

  • Verbose output with speed and progress information
  • Try to preserve all possible information: file attrs, hardlinks, ACLs and extended attrs,
  • Exclude contents of pseudo-filesystems and mountpoints
  • In this example source host is remote and destination local.
rsync --info=progress2  -vaHAX --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} source.host:/ /local/destination
@ekapujiw2002
ekapujiw2002 / gather_limit.py
Created May 17, 2024 09:42 — forked from Guiforge/gather_limit.py
asyncio.gather with max number of concurrent tasks.
import asyncio
from collections.abc import Coroutine
from typing import Any
async def gather_limit(
*tasks: Coroutine[None, None, Any],
return_exceptions: bool = False,
max_con: int = 100,
) -> Any:
@ekapujiw2002
ekapujiw2002 / remount.sh
Created April 26, 2024 02:26 — forked from ertseyhan/remount.sh
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@ekapujiw2002
ekapujiw2002 / TextCleaning.py
Created April 12, 2024 07:27 — forked from kaenova/TextCleaning.py
Indonesian Text Cleaning with Sastrawi Library
import pandas as pd
import re
import string
from tqdm import tqdm
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory
class DataCleaning:
# Initialization
factory = StemmerFactory()
stemmer = factory.create_stemmer()
@ekapujiw2002
ekapujiw2002 / OpencvTemplateScaleMatch.py
Created March 18, 2024 06:45 — forked from yplam/OpencvTemplateScaleMatch.py
Opencv Template Matching with template scale
import numpy as np
import cv2
import imutils
template = cv2.imread('template.jpg') # template image
image_o = cv2.imread('image.jpg') # image
template = cv2.cvtColor(template, cv2.COLOR_BGR2GRAY)
image = cv2.cvtColor(image_o, cv2.COLOR_BGR2GRAY)
@ekapujiw2002
ekapujiw2002 / struct_union.ino
Created June 1, 2023 16:29 — forked from nonsintetic/struct_union.ino
Arduino structures and unions
/* Arduino data manipulation and concatenation with structures and unions
*
* This simple (ish) sketch shows you how to organize your data into a struct
* and then access the whole thing as a byte array.
*
* Useful if you want to concatenate several variables into a single byte array
* to send over bluetooth, i2c, lora or any other protocol that works with arrays.
* In other words you have a fixed byte array, and we squeeze in variables of different
* data types and lengths into it, while still using it as a byte array afterwards.
*
@ekapujiw2002
ekapujiw2002 / pywebio_ldap.py
Created April 23, 2023 23:37
Use LDAP Authentication in PyWebIO
from ldap3 import Server, Connection, ALL
from tornado.web import create_signed_value, decode_signed_value
import pywebio
from pywebio.input import *
from pywebio.output import *
from pywebio.session import *
LDAP_AUTH_URL = "ldap://localhost:389"
LDAP_AUTH_SEARCH_BASE = "dc=example,dc=org"