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!
  • Mars
  • 07:21 (UTC +08:00)
View GitHub Profile
@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 / docker-compose.yaml
Created August 14, 2023 05:08
Miniflux docker-compose config. Refer https://www.v2ex.com/t/963837
version: '3.4'
services:
miniflux:
image: ${MINIFLUX_IMAGE:-miniflux/miniflux:latest}
container_name: miniflux
depends_on:
- db
environment:
- DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable
- RUN_MIGRATIONS=1
@aoaim
aoaim / UFW_ban_country.md
Created March 10, 2023 08:39 — forked from jasonruyle/UFW_ban_country.md
UFW to block countries
@aoaim
aoaim / Caddyfile
Created January 20, 2023 08:37 — forked from phlinhng/Caddyfile
caddy 簡單反代谷歌學術
scholar.example.com {
timeouts 5m
proxy / https://scholar.google.com.hk {
except /robots.txt /usercontent
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream User-Agent {>User-Agent}
# header_upstream X-Real-IP {>CF-Connecting-IP}
# header_upstream X-Forwarded-For {>CF-Connecting-IP}
header_upstream Accept-Language zh-HK