
分类: 隨筆

服务器增加虚拟内存
JavaScriptfree -h df -h / fallocate -l 4G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo '/swapfile none swap sw 0 0' >> /etc/fstab sysctl vm.swappiness=20 echo 'vm.swappiness=20' >> /etc/sysctl.conf free -h swapon --show
安卓手机公网监控摄像头推流
安全问题:目前仅仅通过随机 Stream Key 防止未授权推流。

用安卓手机作为摄像头,通过 RTMP 推流到 remoooo.com,并通过 https://remoooo.com/webcam 加密码观看。
Android Phone 通过 RTMP 推流到 Public Server。
Server 端接入 MediaMTX ,转换为 HLS 监听本机地址。
localhost reverse proxy 到 nginx ,用 HTTPS + Basic Auth 最终在 Browser Viewer 查看。观看入口 rtmp://example.com:1935/
简单的说,服务器端使用 MediaMTX 作为媒体网关。MediaMTX 负责接收手机端 RTMP 推流,并将其转换为浏览器可播放的 HLS 流。
RTMP App:
BashProtocol: RTMP Server URL: rtmp://example.com:1935 Stream Key: <stream-key> Video Codec: H.264 Audio Codec: AAC Resolution: 1280x720 FPS: 30 Video Bitrate: 2000-3000 kbps Audio Bitrate: 96-128 kbps Keyframe Interval: 2s
Ghostty 美化配置 config

JavaScript# ========================= # Ghostty aesthetic config # ========================= # ---------- Font ---------- font-family = JetBrainsMono Nerd Font font-family = Maple Mono NF CN font-family = Noto Sans CJK SC font-family = Symbols Nerd Font Mono font-size = 14 font-thicken = true font-thicken-strength = 64 # ---------- Theme ---------- theme = dark:Catppuccin Frappe,light:Catppuccin Latte # ---------- Window ---------- window-padding-x = 12 window-padding-y = 10 window-padding-balance = true window-padding-color = background window-save-state = always # ---------- Transparency / Blur ---------- background-opacity = 0.58 background-blur = macos-glass-regular background-opacity-cells = false # ---------- Cursor ---------- cursor-style = bar cursor-style-blink = false cursor-color = #e78284 cursor-text = #303446 cursor-click-to-move = true mouse-hide-while-typing = true adjust-cursor-thickness = 2 # ---------- Selection ---------- selection-background = #626880 selection-foreground = #c6d0f5 # ---------- macOS titlebar ---------- macos-titlebar-style = transparent macos-titlebar-proxy-icon = hidden macos-window-buttons = visible macos-option-as-alt = true # ---------- Shell integration ---------- shell-integration = detect shell-integration-features = cursor,title,sudo,ssh-env,ssh-terminfo # ---------- Notifications ---------- notify-on-command-finish = unfocused # ---------- Quick terminal ---------- keybind = global:ctrl+grave_accent=toggle_quick_terminal quick-terminal-position = top quick-terminal-size = 42% quick-terminal-autohide = true # ---------- Keybinds ---------- keybind = cmd+shift+r=reload_config keybind = cmd+d=new_split:right keybind = cmd+shift+d=new_split:down keybind = cmd+t=new_tab keybind = cmd+w=close_surface keybind = cmd+shift+up=jump_to_prompt:-1 keybind = cmd+shift+down=jump_to_prompt:1 keybind = cmd+shift+b=toggle_background_opacity
Chrome 侧栏功能
go to chrome://flags (in url bar)
search for vertical tabs and set it to enabled
right click on the horizontal tab bar (empty space)
Click “show tabs on the side”


ROG 魔霸9 9955hx3d 5070ti 更换显卡液金为霍尼韦尔7958SP
省流:用时约40分钟,更换前后温度基本不变。
新买的电脑,使用约一周。
更换硅脂前,125w CPU功耗下一直会顶功耗墙95°。双烤CPU约50w功耗释放,CPU约75°左右,GPU在x0甜甜圈下功耗约100w约68-70°。

开始更换 霍尼韦尔7958SP 。全部螺丝卸下后小幅度扭动两侧上方把手,用点劲即可拆下散热模组。此时需要额外注意残留在散热模组上的液态金属。

拆下后可以明显观察到不少液金溢出,但是大概是拆的时候挪动的。

散热模组上有海绵垫隔绝液金溢出,保护性还不错。

用酒精和棉条将液金擦除,这个过程需要耐心,弄了大概20分钟。

最终清理干净。

然后更换散热硅脂。合盖结束。


最终烤机温度与更换前基本一致。是的你没看错,是基本一致。
并且可以通过垫高获得额外接近4°的提升。因此何乐而不为呢?


Prevent ‘Zone.Identifier’ Files from Appearing in WSL2
When using Windows Subsystem for Linux 2, we access our Linux file system using Windows Explorer. When we copying and pasting files, might notice addition files like ‘
xxx Zone.Identifier‘.The ‘
Zone.Identifier‘ file is a Windows Attachment Manager feature that stores security information about files. However, since WSL2 uses an ext4 file system, Windows cannot store ADS natively. Instead, it creates a visible ‘Zone.Identifier‘ file in the same directory.1. Delete Existing Files
If you already have ‘
Zone.Identifier‘ files in your WSL2 directories, use one of the following methods to remove them.
Bashfind ~/[Your Path] -name "*:Zone.Identifier" -delete2. Disable Windows from Generating ‘
Zone.Identifier’If you frequently access WSL2 files from Windows and want to permanently stop Windows from attaching ‘
Zone.Identifier’, you can disable this feature via Group Policy or Registry Editor.Press Win + R, type
gpedit.msc, and hit Enter.Configuration → Administrative Templates → Windows Components → Attachment Manager
用户配置 → 管理模板 → Windows 组件 → 附件管理器(In Chinese)Enable “Do not preserve zone information in file attachments”
[Leetcode]4 Mar. 2025. Count Trailing Zeros in Factorial
Description:
Given an integer $n$ , return the number of trailing zeros in $n!$ (n factorial).
Factorial is defined as:
$$
n! = n \times (n – 1) \times (n – 2) \times \dots \times 3 \times 2 \times 1
$$Examples:
Example 1:
Input:n = 3
Output:0
Explanation:3! = 6, which has no trailing zeros.Example 2:
Input:n = 5
Output:1
Explanation:5! = 120, which has one trailing zero.Example 3:
Input:n = 0
Output:0Constraints:
- $0 \leq n \leq 10^4$
C++class Solution { public: int trailingZeroes(int n) { int count; while(n >= 5){ n = n / 5; count += n; } return count; } }; /* ## Counting 5 as a factor. We Need To Determine how many times "10" appears as a factor in the product. 10 is formed by multiplying 2 & 5, we can only count 5 as a factor. eg: - 3! = 3*2*1 = 6 -> +0 - 5! = 5*4*3*2*1 = 120 -> +1 - 10! = 10*9*...*3*2*1 = 3628800 -> +2 */







