Hi there

This is Ke Wang, a software engineer from Mainland China. I share my thoughts and ideas here.

Custom domain email solution

A custom domain email is quite valuable: it is memorable and professional, and it prevents cases where being banned from an email provider locks you out of services where you used that email address to sign up. It took me quite some trial and error to get everything set up. So I’m writing a blog to share my setup. This blog will address the following issues: How to use your custom domain email address to receive emails and get notified in China How to use your custom domain email address to send emails How to send emails from your custom domain email address programmatically in China Receiving emails Sure, you can get a dedicated mailbox, but for me, a better solution is to use services such as https://forwardmx....

July 9, 2023 · Ke Wang

Setting up a Jupyter Notebook server

I owned an RTX3090, but I have been using Google Colab for some time for fear of the complexities of setting up an environment (especially in China, due to the GFW problem). I finally made it, and here is the Docker compose file (running this in Win10 WSL2 docker): services: jupyter: container_name: jupyter image: tensorflow/tensorflow:latest-gpu-jupyter shm_size: '8gb' deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] ports: - 8888:8888 restart: always volumes: - type: bind source: /c/notebooks/jupyter target: /tf environment: - HTTP_PROXY=http://proxy:7890 - HTTPS_PROXY=http://proxy:7890 - JUPYTER_TOKEN=your-token proxy: container_name: proxy image: kevinwang15/convert-subscription-to-http-proxy:latest restart: always environment: - SUB_URL=your-ss-sub-url filebrowser: container_name: filebrowser image: hurlenko/filebrowser restart: always ports: - 3546:8080 volumes: - type: bind source: /c/notebooks/jupyter target: /data - type: bind source: /c/notebooks/filebrowser/config target: /config environment: - FB_BASEURL=/filebrowser

June 28, 2023 · Ke Wang

Setting up a ChatGPT server

Setting up a ChatGPT server I used to use the method described in my other blog to set up a ChatGPT server. It worked fantastically until April 16th when OpenAI decided that even Plus users must go through Cloudflare. (then my reverse proxy instantly died.) Now the latest trend to bypass Cloudflare is to use undetected_chromedriver. So here is my configuration. (many thanks to @linweiyuan) docker compose services: web: container_name: web image: kevinwang15/chatgpt-web:20230420 ports: - 127....

April 21, 2023 · Ke Wang

A cool way to add simple authentication to websites - with nginx config (based on cookies)

When we want to add authentication to a website really quick, the first solution that comes to mind is Basic access authentication. However, in my experience, basic auth doesn’t work well in some cases, especially when you are using http instead of https, or your frontend is sending a lot of XHRs. For some reasons, either the browser basic auth dialog pops up multiple times, disrupting the user experience, or XHRs will fail with 401....

April 20, 2023 · Ke Wang

Sharing account by injecting cookies

Intro (This blog contains potentially risky solutions which may violate a site’s EULA, viewer discretion advised) Netflix famously said “love is sharing a password”.. No, actually, we can do better than that. We can set up a reverse proxy for our friends to use, that reverse proxy will forward requests to the upstream site and return the responses. In the forwarding process, the reverse proxy will inject cookies to the request, so that the request will pass the authentication....

April 12, 2023 · Ke Wang

调试微信公众号网页

(This blog is written in Chinese as it’s about WeChat and its intended readers are mostly Chinese. Please feel free to use Google Translate if you don’t understand Chinese.) 有时我们会想要调试一个微信公众号网页项目(例如,用户在微信中打开了某网页,授权登入完成后,能以已登入状态看到一些信息;我们想打开DevTools来调试这个登入后的网页)。 官方给出的调试方法是:微信开发者工具。这个工具其实不错,可以在电脑端模拟微信浏览器的环境,微信授权登入接口也有自己的实现。唯一的问题是,如果你想调试一个别人开发的网页,这个工具会报错: 无法获取用户身份 登录的微信号未绑定为公众号 (…) 的网页开发者,无法使用 Oauth 授权登录获取用户身 份,请查看文档并完成绑定 文档写道: 出于以下两点原因,我们要求调试微信网页授权,必须开发者微信号与公众号建立绑定关系: … 避免被有心人士利用开发者工具作为自动化工具对任意的公众号网页 “薅羊毛” 那我们真的没有办法了吗?实际上不是的。本文介绍一种调试微信网页的方法:手机设置代理服务器到电脑 → 使用CharlesProxy做中间人攻击 → 注入Vorlon.JS。 安装CharlesProxy CharlesProxy 是一款老牌"Web Debugging Proxy"。 它是收费的,但我推荐使用它,如果不想付费,也有不少其它不用付费的方案。 我们用CharlesProxy的目的是为了做"中间人攻击",修改网页内容,来让我们注入调试相关代码变得可能。 CharlesProxy可以简单地给手机安装CA证书,然后解密、篡改SSL保护的网页内容。 CharlesProxy有Rewrite功能,可以自动做内容篡改。 总结:CharlesProxy很方便可靠,这是我推荐CharlesProxy的原因。 手机设置代理服务器到电脑 在手机上设置代理服务器到电脑,这样手机上的所有流量都会经过电脑。 设置方法不再赘述,不同操作系统手机设置方式不一样。 把代理设置到电脑IP的8888端口(CharlesProxy的默认端口)。 手机安装CA证书 现在要调试的网页大多是https的,有SSL保护,Charles无法直接解密/篡改其内容,所以我们需要安装CharlesProxy的CA证书到手机上。 信任了CA证书之后,就可以完成对SSL的解密和篡改,俗称中间人攻击了。 在CharlesProxy中,Enable SSL Proxying CharlesProxy并不是对所有SSL网页都默认开启中间人攻击,默认是关闭的,意味着CharlesProxy会走CONNECT请求,让客户端和对面SSL服务器建立透明的TCP连接。 我们在CharlesProxy的请求列表里,找到要调试的网站域名,右键,选择"Enable SSL Proxying"。在手机端刷新网页,就能够看见,CharlesProxy可以解密网页内容了。...

April 12, 2023 · Ke Wang

NAS and file backup

I have got a Synology DS720+ NAS, but to be honest I don’t really like Synology. Its software may appeal to amateurs, but as a professional, I feel that their software is very awkward to use. They don’t do things the way it is normally done in Linux, you have to follow their rules, and their hardware offers very poor value for the money. (I guess they want to be like “Apple”, but they just don’t have the same level of technical prowess and design sense to make great products....

March 18, 2023 · Ke Wang

My Photography Workflow

Plan the photoshoot: pick the best equipment, see how others are doing it, try to draw inspiration from them. Take the photos in RAW format with Burst mode on (5+ FPS), so that the best moments are more likely to be captured, and even when some photos are a little blurry, I could usually find a photo in that batch that is sharp enough. (Tips 1: long-focus lens with large aperture makes it very easy to take good photos....

March 17, 2023 · Ke Wang

Services that I pay for

JetBrains All Products Pack: Worth every penny, it makes me a better coder and makes my work much more enjoyable. I use JetBrains products every day (have been using this for almost 10 years), and I am extremely satisfied, they continue to amaze me with what an intelligent IDE can do. 3 years onwards and the annual fee is only $149, feels like a steal. GitHub Copilot: I hugely underestimated what GitHub copilot was capable of....

February 5, 2023 · Ke Wang

A more efficient way to do presentations

I’m very tired of making slides. I figured out that writing markdown and converting it to a well-formatted web page is more efficient than making slides, with the following advantages: less time spent on adjusting format familiar shortcuts in a familiar IDE easy and seamless code highlighting ability to use web annotation tools to highlight portions of the text when giving a presentation (check out notelix which is a web annotation plugin I’m working on) (to be continued)...

June 28, 2022 · Ke Wang