Skip to content

birkhoff.me

Setting up a WireGuard server on OpenWRT

Sometimes it can be useful to be able to connect back to your home network to access some internal resources. I’ll share how I set up a WireGuard server on OpenWRT. First install some WireGuard packages. $ opkg update $ opkg install kmod-wireguard luci-app-wireguard luci-proto-wireguard wireguard wireguard-tools Next go to https://openwrt/cgi-bin/luci/admin/network/iface_add, name the VPN interface wg0, select WireGuard VPN for Protocol of the new interface and press submit. We need to generate some keypairs for the server and clients.

Read more »

Running Clash on OpenWrt as a transparent proxy

I will revamp this post soon as Clash is going to have major changes. As you would have been aware of that I live in China where internet is under strict censorship. I’ve been discovering ways to access the blocked internet resources. So recently I switched to a x86 mini computer that runs Proxmox VE, which has an OpenWRT VM running as a router. In this blog post, I’m using Clash, a new software that is quite the same to Surge.

Read more »

Change GRUB timeout in OpenWrt to speed up boot process

Recently I’m playing with my OpenWrt router on a PVE machine, and I noticed that there’s a 5 second timeout in the boot procedure. It’s important to have a router boot up fast. So I searched online how to change the timeout setting. Unfortunately OpenWrt isn’t Debian, while most tutorials I found online is Debian or RHEL. So stuff works quite differently. After some digging I found that you can actually override /boot/grub/grub.

Read more »

Build tmux on CentOS 7

So I have been recently annoyed with some super strange display issues that tmux 2.7 on my server produces. After some digging I decided to re-build version 2.8 (which is the latest release as of time of writing) of tmux. We’ll be grabbing the official tmux repo from https://github.com/tmux/tmux, build version 2.8 and install it. Note that you’ll need root privileges to install tmux. $ sudo yum remove tmux # remove old version of tmux $ git clone https://github.

Read more »

Solve "The Firebase CLI login request was rejected or an error occurred" when using a proxy on macOS

TL;DR: Use Proxifier if you’re using a HTTP/SOCKS proxy Today I tried to login to Firebase CLI I ran into an issue that stopped me from logging in. After approving the login request on Google’s login page, the page kept loading something (a page served on localhost) and eventually it went to this page: In CLI: ▶ firebase login --debug [2018-04-13T01:44:43.513Z] ---------------------------------------------------------------------- [2018-04-13T01:44:43.518Z] Command: /Users/birkhoff/.nvm/versions/node/v6.9.4/bin/node /usr/local/bin/firebase login --debug [2018-04-13T01:44:43.

Read more »

Redirect domains to specific URLs with Traefik v2

Rewritten on Jan 7, 2020. This enables Traefik to redirect for example, foo.birkhoff.me to https://www.google.com. The TLS section is required for a full HTTPS setup. The below is a dynamic configuration, refer to the Traefik docs for the info. http:routers:redirections:service:dummyservicetls:certResolver:acmemiddlewares:- "foo-redirectregex"- "bar-redirectregex"rule:"Host(`foo.birkhoff.me`) || Host(`bar.birkhoff.me`)"middlewares:foo-redirectregex:redirectRegex:regex:"^https?://foo.birkhoff.me"replacement:"https://www.google.com"permanent:truebar-redirectregex:redirectRegex:regex:"^https?://bar.birkhoff.me"replacement:"https://www.twitter.com"permanent:trueservices:dummyservice:loadBalancer:servers:- url:"http://1.

Read more »

Forza Horizon 4 PC won't launch, or says sign-in needed

So today I excitedly opened up my pre-ordered Forza Horizon 4 and seems that the splash screen shows up for 4 seconds, disappears and the game won’t launch. I’ve searched on Internet and found out you need to download a random app from the Microsoft Store app and the game launches. It wasn’t the end. When the beautiful music started, the awesome graphics showed up, I immediately pressed Y on my Xbox One controller.

Read more »

macOS Mojave: Continuity Camera

Today Apple pushed the new major update of macOS, Mojave. One of its most important new feature is Continuity Camera. In short terms, your Mac gets the photo file immediately from your iPhone/iPad when you take one. Here’s how it works: You right-click on a supported App, or simply your Mac desktop Choose Import from iPhone > Take Photo Your iPhone automatically opens Camera app You set the Flashlight, focus, brightness or something else, and you press the shoot button You click on Use Photo on your iPhone Your Mac immediately gets the photo file, to where your initial import request came from, for example, saving to your desktop.

Read more »

Improve your CLI experience

I recently saw this awesome blog post and I’m desperate to share it to you :) https://remysharp.com/2018/08/23/cli-improved This blog post mainly introduces: bat: cat super-powered. Built-in syntax highlighting & scrolling. prettyping: Beautified ping. You can also alias this to the default ping. $ curl -O https://raw.githubusercontent.com/denilsonsa/prettyping/master/prettyping && chmod +x prettyping && sudo mv prettyping /usr/local/bin fzf: A fuzzy search against the terminal history, with a fully interactive preview of the possible matches.

Read more »

Make sudo authenticate with Touch ID in a tmux session

After the recent switch to https://github.com/samoshkin/tmux-config, I have been fully working under tmux sessions. Recently I found that the Touch ID authentication for sudo haven’t been working. I searched over the Internet and found out pam_tid.so itself is kinda incompatible with tmux. To solve this, I had to use a simple hack (someone made the solution for us, thanks!). I use https://github.com/fabianishere/pam_reattach, a PAM module for reattaching to the authenticating user’s per-session bootstrap namespace on macOS, and it’s updated just 18 days ago as the time of writing!

Read more »