Skip to content

Instantly share code, notes, and snippets.

View ParinLL's full-sized avatar

Parin Lai ParinLL

  • Taiwan
View GitHub Profile
@kode54
kode54 / zsync2.patch
Created May 17, 2024 00:38
Patch to get zsync2 building with GCC14, likely no less functional than it was before, considering it doesn't try to use off64_t instead of off_t
diff --git a/lib/libzsync/zsync.c b/lib/libzsync/zsync.c
index b425db9..02c47ad 100644
--- a/lib/libzsync/zsync.c
+++ b/lib/libzsync/zsync.c
@@ -40,6 +40,8 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
+
+#define __USE_XOPEN 1

Wayland桌面工作階段會帶來許多問題,其中最常見的就是瀏覽器效能下降的問題。因為有些瀏覽器預設跑在XWayland模式,所以看起來會卡卡的。所以要手動啟用Wayland模式。但是有的瀏覽器啟用Wayland模式反而出現了其他問題,下面就要來討論如何解決這些問題。

下列操作適用Ubuntu 24.04 LTS以上版本的系統。

1. 如何確認自己是使用Wayland工作階段

使用echo $XDG_SESSION_TYPE指令即可得知是目前桌面工作階段x11還是wayland

GNOME 42以上版本預設使用Wayland,登入畫面GDM右下角齒輪會有GNOMEGNOME on Xorg的選項。

@xmlking
xmlking / curl-with-http3-macos.md
Created December 4, 2021 20:09
Installing curl with http3 on MacOS

Work-in-pogress

Ref: cloudflare/homebrew-cloudflare#21

 # Clean up any old version of curl you may have already tried to install
brew remove -f curl

# Download the curl ruby install script provided by cloudflare
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active December 10, 2025 18:14
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active September 27, 2025 23:41
Docker Container Logging using Promtail
@sergiks
sergiks / README.md
Last active July 18, 2025 23:27
Let's Encrypt wildcard certificates in docker

NGINX and Certbot example with CloudFlare API in Docker

Sample config files to demonstrate seup that creates and updates free SSL certificates from Let's Encrypt given that the domains are maintained at CloudFlare service.

How it works

Certbot verifies domains ownership by accessing CloudFlare API that adds temporary TXT DNS records. To enable it You must provide your CloudFlare API token. More details in documentation for dns-cloudflare Certbot plugin.

Certbot saves created certificates in Docker volume certbot_etc. Pay attention to output of the certbot run - it mentions path to the created certificates.

@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active December 9, 2025 16:00
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@dvf
dvf / change-codec.md
Last active December 5, 2025 20:23
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@SmileyMan
SmileyMan / update_Cloudflare_DNS.sh
Last active July 8, 2023 00:05
Update Cloudflare DNS for both IPv4 and IPv6 Bash Script
#!/bin/bash
## Account details
auth_email='fred@blogs.com'
auth_key='00000000000000000000000000000000'
## Record to update
zone_name='domain.com'
record_name='domain.com'
@marwein
marwein / Microsoft Office 2019 RTM GVLK Keys
Created January 7, 2019 09:30
Microsoft Office 2019 RTM default #GVLK (Generic Volume License Key)
GVLKs for KMS and Active Directory-based activation of Office 2019 and Office 2016
Applies to: Volume licensed versions of Office 2019 and Office 2016, including Project and Visio
By default, volume licensed versions of Office 2019 and Office 2016 are installed with a Generic Volume License Key (GVLK).
The GVLK enables Office to automatically discover and activate against your KMS host computer or Active Directory infrastructure.
Important
These license keys can't be used to activate your personal copy of Office.