Skip to content

Instantly share code, notes, and snippets.

View nay-kang's full-sized avatar
🏠
Working from home

nay-kang

🏠
Working from home
View GitHub Profile
@nay-kang
nay-kang / macos_samba.md
Created November 3, 2025 04:57
mac os other way to acess remote storages like samba or webdav

Using rclone on macOS for Remote Storage (Samba/WebDAV) over Poor Networks

Accessing remote storage like Samba or WebDAV on macOS over unstable or slow networks can be frustrating—often 90% of operations fail or hang.
I even tried Cyberduck, but it frequently froze and had to be force-killed.

Today I found a free and reliable alternative: rclone!


Mounting a Remote with rclone

@nay-kang
nay-kang / seafile_deploy.md
Created October 12, 2025 16:14
seafile deploy

It is hard to imagine the long live seafile deploy make so poor.

First: change http port

my goal is local deployment.I do not need publish the service to internet,that could waste money for server,storage or bandwidth. and if careless it could has security issues.if I want access the service I can rely on wireguard.
so I just need to deploy it on my homeserver.and my homeserver has some other services.I don't want give 80 port to seafile.the offical document tell nothing about the port. I tried to change caddy.yml port binding.

ports:
@nay-kang
nay-kang / esphome_gree_yadof_remoter.md
Last active September 11, 2025 06:51
homeassistant versoin 2025.9 to operate gree yadof(Kelvinator) remote AC

incompatiable IRremoteESP8266 libraries with arduino version 3.x

  • first we need install Terminal plugin to be able get access to homeassistant
  • Download IRremoteESP8266 to homeassistant /config/esphome/lib/ (or whatever path you like)
  • Download arduino version 3.x patch to /config/esphome/lib/IRremoteESP8266/src/ override IRrecv.cpp file
  • edit yaml to include this library
esphome:
  name: you-board
  libraries:
@nay-kang
nay-kang / xiaomi_rw30u_flash.md
Last active July 29, 2025 03:25
xiaomi WR30U router flash

刷机有风险,有变转的可能性!

首先获取SSH权限

根据 https://github.com/PatriciaLee3/wr30u_ssh https://github.com/hqvv/wr30u_ssh 进行SSH破解, 里面对路由器的设置是必须的,否则破解不了。另外Ubuntu上也可以进行操作,也比较简单,就是把网线连接里面的IPv4设置成"shared to other computers"

刷入uboot

网线从wan口换到任意的lan口。
https://github.com/hanwckf/bl-mt798x 下载最新的uboot,解压文件出来,在里面找到mt7981_wr30u-fip-fixed-parts-multi-layout.bin文件, 利用scp传到服务器上,如果遇到错误

@nay-kang
nay-kang / btrfs_issue.md
Last active July 1, 2025 09:49
btrfs filesystem performance issue

recently I facing some problem with btrfs.sometime when I trigger right click on btrfs files or just browse folders.I can notice more than 1 second hangup. in windows some action could hang up too.
I using scrub,defragment,check but it does not help anything.
using fio --filename=./test_file.delete --size=20GB --direct=1 --rw=randrw --bs=4k --ioengine=libaio --iodepth=256 --runtime=120 --numjobs=4 --time_based --group_reporting --name=job_name --eta-newline=1to benchmark. result is

job_name: (groupid=0, jobs=4): err= 0: pid=7334: Tue Jul  1 10:16:35 2025
  read: IOPS=25.8k, BW=101MiB/s (105MB/s)(11.8GiB/120001msec)
    slat (usec): min=6, max=8608, avg=62.11, stdev=72.59
    clat (usec): min=95, max=89745, avg=19831.73, stdev=4192.86
@nay-kang
nay-kang / opensource_auth.md
Created March 25, 2025 09:12
Open source auth project simple investigation
  • Supabase: Self-hosting Supabase can indeed be quite resource-intensive, requiring significant server resources. While it comes with built-in PostgreSQL, this might not be ideal for all users who might prefer other databases or already have existing PostgreSQL clusters. Additionally, querying and managing error logs in Supabase might not be as convenient as with some other dedicated solutions.
  • Keycloak: Keycloak does not inherently offer a clear, out-of-the-box passwordless login feature. Although it's highly customizable and passwordless login might be achievable through custom configurations or extensions, it's not a directly supported option.
  • SuperTokens: The documentation for SuperTokens has some errors and lacks comprehensiveness, potentially missing detailed explanations for certain configurations or features. A significant drawback is that the Python SDK's source code lacks comments, making it very difficult for developers to understand the code logic and troubleshoot issues.
  • Casdoor: Casdoor u
@nay-kang
nay-kang / CDN_comparison.md
Created March 18, 2025 08:42
Dynamic CDN Comparison and Benchmark

Dynamic CDN Comparison and Benchmark

This document presents a comparative benchmark of different Content Delivery Networks (CDNs) based on tests conducted from Silicon Valley (SV), USA, and Shanghai (SHA), China, to Guangzhou (GZ), China, and Seoul (SEL), South Korea. The tests were performed using both direct connections and several CDN providers.

Test Setup

  • Tool: Playwright with default settings.
  • Procedure: Each test was executed five times to provide each CDN ample opportunity to cache content.
  • Test Website: Generated from the Flutter game template
    (flutter/samples/game_template) with the following modifications:
@nay-kang
nay-kang / expose_openwrt_ipv6_server.md
Last active August 27, 2024 08:00
Expose Server Behind Openwrt by IPv6 with OopenClash installed

typically when we want to allow internet connection from internet with IPv6. we need do some trick.

  • add firewall traffic rule
  • select protocol as you wish.typically TCP
  • source zone select wan6 or wan
  • source address empty since we want to allow from anywhere on the internet
  • destination zone is lan
  • destination address ::aaaa:bbbb:cccc:dddd/::ffff:fffff:ffff:ffff.here is the trick.the ISP usually give our an dynamic IPv6 prefix.but the suffix of our machine can be static.so we tell firewall filter by suffix.
  • action select accept.then we done.

but Openwrt will hijack all packet.so the incoming packet is straight into machine,but the reply packet are hijecking by openwrt.so there is no response to that incomming packet.

sudo ufw allow from 173.245.48.0/20 comment 'cloudflare'
sudo ufw allow from 103.21.244.0/22 comment 'cloudflare'
sudo ufw allow from 103.22.200.0/22 comment 'cloudflare'
sudo ufw allow from 103.31.4.0/22 comment 'cloudflare'
sudo ufw allow from 141.101.64.0/18 comment 'cloudflare'
sudo ufw allow from 108.162.192.0/18 comment 'cloudflare'
sudo ufw allow from 190.93.240.0/20 comment 'cloudflare'
sudo ufw allow from 188.114.96.0/20 comment 'cloudflare'
sudo ufw allow from 197.234.240.0/22 comment 'cloudflare'
sudo ufw allow from 198.41.128.0/17 comment 'cloudflare'
@nay-kang
nay-kang / qemu_guest_ipv6_retrieve.md
Created August 15, 2024 08:54
qemu guest ipv6 retrieve

I used ubuntu as Host OS for my virtual machines.and One of them is my openwrt router server. One day after I update the system and rebooted.I can not obtian publc IPv6 address In my router.

  • first I suspect ISP made some changes to my modem, so I try different settings of the modem,but nothing changed except I barely lost connect to the modem.
  • during try the modem I used another computer instead of my server,the later computer can get IPv6 address.
  • then I give up try to tweak settings and using backup plan. use a physical AP as main router instead the virtual soft router.
  • other devices outside the server can get IPv6 successfully. but the vms still can not obtian IPv6 address.
  • after change to physical router the server left a spare ethernet port.I use that ethernet port as physical port to one vm instead of bridge network. that vm can successfully obtian IPv6 address.
  • so the problem become more clear.something between libvirt and vm prevent guest obtian IPv6 address.so I googled about "libvirt