Posts

Master AI-Driven UI Development: How to Give Crystal-Clear Context to Your AI Assistant

 When building or debugging a User Interface (UI) with AI assistants like ChatGPT, Claude, or Gemini, we often run into a common frustrating bottleneck: "AI just doesn't know the current state of my screen." You try to describe what's wrong: "The dropdown menu on the settings page isn't working under certain conditions." But without knowing the exact state, variables, and user permissions currently active in your app, the AI is essentially guessing in the dark. Today, I’m sharing a game-changing workflow to solve this: Building a "Copy UI State for AI" Debugging Tool directly into your application. By implementing a simple debugging toggle, you can copy the entire application state to your clipboard with one click and feed it directly to your AI. Here is how it works and the exact prompt you can use to build it. The Concept: The "Extract Screen Info" Debugging Tool Instead of manually explaining your UI state to the AI, we will crea...

sanitize on in CMakeLists.txt

1. CMakeLists.txt set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") add_compile_options(-fsanitize=address) If a subdir is set with add_subdirectory and a module that does not support sanitize is imported from the path and needs to be removed, add -fno-sanitize=address to add_compile_options in CMakeLists.txt of the subdir to remove it. Basically, if you enable sanitize, sanitize will adjust ulimit's core to 0, so core will not occur. You can do this by putting the following part as an environment variable. (Below is the part you put in systemd's service) 2. service file in systemd [Service] LimitCORE=infinity Environment="ASAN_OPTIONS=handle_segv=0:handle_abort=1:abort_on_error=1:disable_coredump=0"

e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang

 make a file: /usr/local/etc/ethtool.sh (eno1 is your mgmt i/f, vmbr0 is your bridge i/f.) #!/bin/bash ethtool -K eno1 gso off gro on tso off tx on rx on rxvlan on txvlan on sg on && ethtool -K vmbr0 gso off gro on tso off tx on rx on rxvlan on txvlan on sg on ethtool -G eno1 rx 4096 if you want to activate on reboot. /etc/systemd/system/ethtool.service [Unit] Description=ethtool script [Service] WorkingDirectory=/usr/local/etc/ ExecStart=/usr/local/etc/ethtool.sh [Install] WantedBy=multi-user.target then systemctl enable ethtool.service && systemctl start ethtool.service refs: https://forum.proxmox.com/threads/e1000-driver-hang.58284/page-8#post-390709

Set up VNC login without console login in Ubuntu Gnome environment

 It is said that GNOME does not support VNC connection without logging in by default. So you have to do the following annoying task. 1) gnome-remote-desktop settings Open "Settings" in gnome-remote-desktop, select "Sharing", Find "Remote Desktop" or "Screen Sharing" and disable it.  2) Install x11vnc sudo apt update sudo apt install x11vnc 3) Set x11vnc password x11vnc -storepasswd 4) Set auto-start at boot (create x11vnc.service file) sudo nano /etc/systemd/system/x11vnc.service Contents

Setting ubuntu grub timeout when using efi

 # 1) Edit grub with vi sudo vi /etc/default/grub # 2) Add or modify the following part GRUB_RECORDFAIL_TIMEOUT="5" # 3) Update sudo update-grub The reason is If you look at "/etc/grub.d/00_header" if [ \$grub_platform = efi ]; then set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30} if [ x\$feature_timeout_style = xy ] ; then set timeout_style=menu fi fi Because it's like this.

How to print only the previous 5th and 6th lines using the 'grep' command

How to print only the previous 5th and 6th lines using the 'grep' command grep total -B 5 -w my.test | awk '( ((NR%7) == 1) || ((NR%7) == 6 )) { print $0 } ' | more

[WordPress] Change https redirect in DB.

If you make an https redirect without thinking about SSL configuration: Check DB SELECT * from wp_options where option_name IN ('siteurl', 'home'); Update UPDATE wp_options SET option_value = REPLACE(option_value, 'https://your_domain', 'http://your_domain') WHERE option_name IN ('siteurl', 'home');