Skip to content

Instantly share code, notes, and snippets.

@qifei
qifei / nginx-basic-authentication.md
Created December 6, 2024 08:08
Nginx Basic Authentication on OpenWrt

Install Nginx and password generator

opkg update
opkg install nginx openssl-util

Create a file to store password

touch /etc/nginx/.htpasswd

Generate password for user

@qifei
qifei / replace-uhttpd-with-nginx-on-openwrt.md
Last active December 6, 2024 05:45
用 nginx 替換 uhttpd

SSH root@openwrt

service uhttpd stop && service uhttpd disable

opkg update && opkg install luci-nginx luci-ssl-nginx
@qifei
qifei / expand-root-partition-of-openwrt.md
Created December 4, 2024 17:51
該死的 NanoPi 安裝 OpenWrt 後,主分區空間極其有限(≈100MB),基本上裝不了幾個軟件包。儘管你的 eMMC / SD 容量很大,但是刷入 OpenWrt 後,系統只能利用到其中不到 2GB 的空間,其餘容量都被摒棄。

Log into your OpenWrt instance via SSH and install these prerequisites:

opkg update
opkg install parted losetup resize2fs

Now you can download and execute a helper script which will add the expansion to 100% free space on next boot:

wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
. ./expand-root.sh

MP4

ffmpeg -i input.mp4 -crf 28 -r 25 -c:v libx264 -s 1280x720 -c:a aac output.mp4

via https://www.jianshu.com/p/7d126e328da9

你觉自己手贱吧!为什要点这个东西?WC!!

不要相信换HDMI,不要信换DP线,屌丝的钱也不是好挣的。

你还在尝试安全模式,我日NM win10安全模式怎么进??!

记住

best quality and small size

yt-dlp -f 'bestvideo[height=720]+bestaudio[ext=m4a]/best' --merge-output-format mp4 https://www.youtube.com/watch?v=lVrJ4y1gTwk

best compatibility (h264)

yt-dlp -f 'bestvideo[vcodec~="^((he|a)vc|h26[45])"][height=1080]+bestaudio[ext=m4a]/best' --merge-output-format mp4 https://www.youtube.com/watch?v=ouf06bPx_hY
@qifei
qifei / no-negative-in-calc.md
Last active August 23, 2024 03:51
module build failed (from ./node_modules/postcss-loader/src/index.js)

change this

margin: 0 calc(var(--gap-x) * -0.5);

to

margin: 0 -1rem;
@qifei
qifei / webkit-autofill.md
Last active August 23, 2024 03:50
Google Chrome form autofill styles trick
/* Change "white" to any color you want, or transparent. */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
}

/* transparent background */
input:-webkit-autofill {
    -webkit-transition-delay: 9999s;
 -webkit-transition: color 9999s ease-out, background-color 9999s ease-out;