Skip to content

Instantly share code, notes, and snippets.

View ekapujiw2002's full-sized avatar

Eka Puji Widiyanto ekapujiw2002

View GitHub Profile
@ekapujiw2002
ekapujiw2002 / node-red-nginx-proxy-house.example.net.conf
Last active June 24, 2025 07:53 — forked from njh/house.example.net.conf
Proxying Node-Red through Nginx
server {
server_name house.example.net;
listen 1.2.3.4:80 default_server;
listen [2001:1234:ffff::1]:80 default_server;
add_header Cache-Control "public,max-age=31536000";
return 301 https://$server_name$request_uri;
}
map $ssl_client_s_dn $ssl_username {
@ekapujiw2002
ekapujiw2002 / setup-nut-and-netdata-on-ubuntu.md
Created June 21, 2025 10:26 — forked from Jiab77/setup-nut-and-netdata-on-ubuntu.md
In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

Setup nut and netdata on Ubuntu

In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

It is basically the next chapter of my previous gist, Upgrade nut on Ubuntu 18.04.

I'll only document USB connected UPS and not the other supported connection modes.

Install required dependencies

@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)