作者: remo

  • 升级服务器系统

    升级服务器系统

    把系统升级为了 Debian 13 x86_64 。

    仅开放 SSH 。基础组件 Nginx 1.26.3、PHP 8.4.23、MariaDB 11.8.6、Docker 26.1.5、Compose 2.26.1,Swap 4 GB。

    应用 SSH、nftables、Fail2ban、PHP-FPM、MariaDB 和 Docker 的资源/日志限制。

    SSH 禁用密码登录、root 只允许密钥;nftables 默认拒绝并允许 22/80/443/1935

    https Certbot 定时续签已启用。

  • 尝试使用MkDocs给实验室编写公开文档

    尝试使用MkDocs给实验室编写公开文档

    https://remyuu.github.io/VIS_Hiroshima

    给实验室写了一些关于新人如何使用SSH连接学校机房服务器的文档。覆盖中文、英语和日语。并且支持提交修改等。

  • 服务器增加虚拟内存

    服务器增加虚拟内存

    free -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
    
    JavaScript
  • 安卓手机公网监控摄像头推流

    安卓手机公网监控摄像头推流

    安全问题:目前仅仅通过随机 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:

    Protocol: 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
    Bash
  • Ghostty 美化配置 config

    Ghostty 美化配置 config

    # =========================
    # 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
    JavaScript
  • 快捷查看服务器基本信息

    快捷查看服务器基本信息

    printf "CPU:\n" && LC_ALL=C lscpu | grep -E '^[[:space:]]*(Model name|CPU\(s\)|Thread\(s\) per core|Core\(s\) per socket|Socket\(s\)|CPU max MHz|CPU min MHz):' && \
    printf "\nMEM:\n" && free -h && \
    printf "\nDISK:\n" && lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS,MODEL,ROTA && \
    printf "\nFILESYSTEM:\n" && df -hT && \
    printf "\nGPU:\n" && nvidia-smi -L
    Bash
  • 做了一个硬件监控软件

    做了一个硬件监控软件

    最近闲来无事,做了一个硬件检测软件。

    目前的想法也基本实现了:在同一个紧凑的页面查看CPU的负载、温度、功耗和频率,内存的占用和温度,显卡的负载、温度和功耗。设计语言贴近win11,并且所有组件都开源。

    技术栈是 Avalonia 和 .NET 8 ,数据采集后端用的是LibreHardwareMonitor ,ring0 使用 PawnIO 得到支持。

    同时做了一个简单的排行榜功能,排行榜服务器也用了很简单但是安全的方法。由于 PDO 直连 MariaDB ,并且采用分页等常见的优化手段,设计容量在十万条数据这样的量级。

    排行榜查看网页端:https://remoooo.com/remo-benchmark/

    软件更新读取的是 GitHub 的 Release 页面。

    项目完全开源:

    https://github.com/Remyuu/RemoSystemProfiler