How to Dynamically Update DNS Records for Namesilo

Dynamically Updating DNS Records The purpose of dynamic updates is pretty simple. As a long-term user of China Unicom’s broadband, although Unicom provides a public address, it is essentially a dynamic address, not a fixed one. If you want to access your home devices using an IP address from outside, you need to use dynamic DNS (DDNS). Many routers come with built-in DDNS functionality, but they mostly wrap the interfaces of the commonly used service providers. These providers generally have a few characteristics: 1. Blocked by the Great Firewall; 2. Not cheap; 3. Domestic providers may have security issues; 4. The company might have gone out of business. Rather than relying on these unreliable services, it’s better to write your own script for updating. ...

February 1, 2020 · 3 min · 438 words · Jack Yu

How to Start a PowerShell Script in the Background at Windows Startup

Create a script and place it in C:\Users\name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\` Fill the script with: Start-Process -FilePath "C:\Users\name\bin\gost-windows-amd64.exe" -ArgumentList "-L=", "-F=" -RedirectStandardOutput "C:\Users\name\bin\gost-windows-amd64.log" -RedirectStandardError "C:\Users\name\bin\gost-windows-amd64.err" -WindowStyle Hidden Note: Start-Process seems to perform a fork-like action, and by default, it opens a new PowerShell window to execute. That’s why -WindowStyle Hidden is added at the end. You can’t use -NoNewWindow here because it only prevents the creation of a new window for executing Start-Process, but the old window will not exit. Note 2: After the old window exits, the forked process seems to become an orphan and is managed elsewhere, so permissions, such as network connection permissions, might need to be requested again. ...

January 14, 2020 · 1 min · 110 words · Jack Yu

How to Deploy an HTTPS Proxy Service

Preface One day, I came across an article by Chen Hao on Twitter. Having benefited from several of his blog posts, I instinctively felt it was reliable, so I read it and decided to write this practical guide. Why Use an HTTPS Proxy In the guide, it’s clearly explained why, plus my own experiences of several shadowsocks being banned, I felt it was necessary to switch to a more secure proxy method. ...

January 12, 2020 · 4 min · 737 words · Jack Yu

Using delve to Debug Golang Programs

Background When I first started writing Golang, I was always looking for a convenient debugging tool. Back then, I came across documentation about using gdb to debug and also tried delve, but neither felt easy to use. Later, on someone’s advice, I went back to the good old print statements… Over the past couple of days, I was debugging go test and found that tests would always hang when run per package. I couldn’t think of a suitable method at first, so I thought of delve again. After giving it a try, I found it has become much more mature than before. ...

September 16, 2019 · 3 min · 613 words · Jack Yu

How to Deploy a Shadowsocks Server

There are multiple versions of the Shadowsocks server side implementation. The original version was written in Python, and later, enthusiasts implemented it in various programming languages of their liking. Among all these implementations, I personally think the most reliable and stable one is the original Python version. The reason is simple - it has the most users. The Golang version is said to have the most features and also performs very well, making it quite powerful. This might be due to Golang’s inherent high performance and ease of implementation. There’s also an implementation using libev, a pure C implementation, which also offers good performance and is very lightweight. ...

September 27, 2018 · 2 min · 305 words · Jack Yu