Skip to content

Instantly share code, notes, and snippets.

View aoaim's full-sized avatar
🤯
I'm all tied up!

Michael Clark aoaim

🤯
I'm all tied up!
  • Hong Kong SAR, China
  • 22:01 (UTC +08:00)
View GitHub Profile
@aoaim
aoaim / pubmed-title-translator.user.js
Created October 3, 2025 11:00
文献标题翻译 | Academic Paper Title Translator
// ==UserScript==
// @name 文献标题翻译 | Academic Paper Title Translator
// @namespace http://tampermonkey.net/
// @version 1.0.1
// @description 自动翻译 PubMed、Europe PMC、Semantic Scholar、Google Scholar 等学术网站上的论文标题和摘要为中文 | Auto-translate academic paper titles and abstracts to Chinese
// @description:zh-CN 自动翻译学术网站上的论文标题和摘要为中文,支持多种翻译 API,智能并发控制
// @description:en Auto-translate academic paper titles and abstracts to Chinese with multiple translation APIs and intelligent concurrency control
// @author Miao & Claude Sonnet 4.5
// @homepage https://github.com/yourusername/academic-translator
// @supportURL https://github.com/yourusername/academic-translator/issues
@aoaim
aoaim / autoupdate_setup.sh
Created November 21, 2024 06:21
设置debian自动更新
#!/bin/bash
# 1. 创建脚本文件 /root/apt-update.sh
echo '#!/bin/bash' | sudo tee /root/apt-update.sh > /dev/null
echo 'apt update && apt upgrade -y && apt autoremove -y' | sudo tee -a /root/apt-update.sh > /dev/null
# 2. 自动在 crontab 最后添加任务
(crontab -l; echo '0 */12 * * * /root/apt-update.sh') | sort - | uniq - | crontab -
# 3. 赋予权限
@aoaim
aoaim / sources.list
Created May 13, 2024 07:22
Ubuntu 22.04 LTS /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu jammy main restricted
# deb-src http://archive.ubuntu.com/ubuntu jammy main restricted
deb http://ubuntu.mirror.constant.com jammy main restricted
# deb-src http://ubuntu.mirror.constant.com jammy main restricted
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu jammy-updates main restricted
deb http://ubuntu.mirror.constant.com jammy-updates main restricted

If you want to SSH to a VPS which is running openVPN do the following:
source: https://serverfault.com/questions/659955/allowing-ssh-on-a-server-with-an-active-openvpn-client

Enable

The problem is that the default gateway gets changed by OpenVPN, and that breaks your current SSH connection unless you set up appropriate routes before you start OpenVPN.

What follows works for me. It uses iptables and ip (iproute2). Below, it is assumed that the default gateway interface before OpenVPN is started is "eth0". The idea is to ensure that when a connection to eth0 is made, even if eth0 is not the default gateway interface anymore, response packets for the connection go back on eth0 again.

You could use the same number for the connection mark, firewall mark and routing table. I used distinct numbers to make the diffences between them more apparent.

@aoaim
aoaim / UFW_ban_country.md
Created March 10, 2023 08:39 — forked from jasonruyle/UFW_ban_country.md
UFW to block countries