Skip to content

Instantly share code, notes, and snippets.

View wpyoga's full-sized avatar

William Poetra Yoga wpyoga

View GitHub Profile
@wpyoga
wpyoga / mwsmart-cycle.ahk
Created August 25, 2026 14:27
AutoHotkey v2 script for Micro/WIN SMART v2
;Tested with AHK v2.0.26
#Requires AutoHotkey v2.0
;Download UIA-v2 from here: https://github.com/Descolada/UIA-v2
;Tested with UIA-v2 v1.1.3
#include "UIA.ahk"
mw_exe := "ahk_exe MWSmart.exe"
;Wait until the main code editor is available
loop {
@wpyoga
wpyoga / normalize_svg.py
Created August 18, 2026 14:34
Vibe-coded script to normalize an SVG file
import argparse
import math
import xml.etree.ElementTree as ET
from svgelements import SVG
def calculate_bbox(svg):
"""
Calculate the bounding box of drawable SVG content.
@wpyoga
wpyoga / luna_pinyin_simp.custom.yaml
Created August 15, 2026 15:07
Custom full width punctuation for Rime
# Save this file as ~/.config/ibus/rime/luna_pinyin_simp.custom.yaml
# Execute `ibus restart`, then switch window focus (Alt-Tab) to refresh ibus state
# Configure half-width mode (半角) and full width punctuation (。,)
# The following overrides specific punctuation keys for full-width characters
patch:
reverse_lookup: {} # to override "`"
recognizer: {} # to override "`"
punctuator:
half_shape:
# Number row
@wpyoga
wpyoga / gist:179912d6ab45f0721bc7527243c3a4d9
Last active August 25, 2026 14:36
VirtualBox Appliance VM
# Shorten boot time
VBoxManage modifyvm <vmname> --biosbootmenu disabled --bioslogodisplaytime 1 --bioslogofadein off --bioslogofadeout off
# Boot straight to virtual hard disk
VBoxManage modifyvm <vmname> --boot1 disk --boot2 none --boot3 none --boot4 none
# Disable audio
VBoxManage modifyvm <vmname> --audio-enabled off
# Clipboard sharing
# recompress pictures inside pdf
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -q -o out.pdf in.pdf
@wpyoga
wpyoga / proxmox-9-no-nag.sh
Created January 17, 2026 04:49
Proxmox VE 9 -- remove subscription nag screen
sudo sed \
-i.orig /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js \
-e 's#\(^ *checked_command: *function *(orig_cmd) *{$\)#\1orig_cmd();},orig_checked_command:function(orig_cmd){#'
sudo sed \
-i.orig /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js \
-e 's#\(checked_command:function(a){\)\(Proxmox.Utils.API2Request\)#\1a();},orig_checked_command:function(a){\2#'
@wpyoga
wpyoga / chatgpt.md
Created October 2, 2025 14:43
GTR vs IGBT drives (chatgpt)

Quick summary

  • IGBTs are the modern default for most motor/inverter/drive applications: faster switching, simpler gate drive, higher switching frequency capability, easier paralleling and better overall efficiency at typical inverter frequencies.
  • GTOs (GTRs) are older high-power devices that can carry large currents and block high voltages, but require complex gate drives, large snubber networks, and run at much lower switching frequencies. They were common in traction/HVDC historically but have largely been replaced by IGBTs (and now SiC) in new designs.

1) Fundamental technology and how they switch

GTO (Gate Turn-Off Thyristor / sometimes called GTR in older texts):

  • Thyristor family device: a four-layer (p-n-p-n) semiconductor that latches on when forward current flows.
@wpyoga
wpyoga / deepseek.md
Last active October 2, 2025 14:35
IGBT vs GTR drives

Here is a detailed technical comparison between IGBT-based and GTR-based drives.

Executive Summary

The IGBT (Insulated Gate Bipolar Transistor) drive is a superior technology in every significant aspect compared to the obsolete GTR (Giant Transistor) drive. For 24/7 continuous operation, IGBT drives are unequivocally more durable, stable, and efficient. GTR drives have been completely phased out of new equipment since the late 1990s.


Detailed Technical Comparison

@wpyoga
wpyoga / gist:94ab9a6865e72de881266341af4306e6
Created August 11, 2025 05:13
Xorg grab problem (usually VirtualBox)
https://gist.github.com/CyberShadow/6412d11aea64144f8905cc0b8196f38e
$ xdotool key XF86LogGrabInfo
/var/log/Xorg.0.log:
```
[146599.664] (II) Printing all currently active device grabs:
[146599.664] Active grab 0x42a001f7 (core) on device 'Virtual core pointer' (2):
[146599.664] client pid 91115 /usr/lib/virtualbox/VirtualBoxVM --comment wintpc-2 --startvm {0d02dc3f-7a59-47a8-b72d-6a4ab49ff93d}
[146599.664] at 146394073 (from passive grab) (device frozen, state 6)
@wpyoga
wpyoga / gist:cbe73696760b24aae0aa0677b4200791
Created April 25, 2025 08:59
dnsmasq test dhcp server
sudo dnsmasq -kd -i enp0s31f6 -F 10.1.5.10,10.1.5.20 -K