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

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

使用echo $XDG_SESSION_TYPE即可得知是x11還是wayland

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

KDE Plasma 6後已預設使用Wayland,登入畫面SDDM左下角有Plasama (Wayland)Plasma (X11)的選項。

如果覺得Wayland問題過多,嘗試切換回X11工作階段。

@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 February 28, 2025 05:46
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 January 9, 2025 01:45
Docker Container Logging using Promtail
@sergiks
sergiks / README.md
Last active November 19, 2024 12:20
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
Last active February 27, 2025 20:07
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@dvf
dvf / change-codec.md
Last active February 19, 2025 06:56
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='[email protected]'
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.