Skip to content

Instantly share code, notes, and snippets.

View jiacai2050's full-sized avatar
:shipit:

Jiacai Liu jiacai2050

:shipit:
View GitHub Profile
@jiacai2050
jiacai2050 / desktop.md
Last active June 13, 2026 11:33
Ubuntu 24.04 升级 26.04 后 Chrome 无法弹出文件选择框(上传文件卡死)排查与完美解决

终极指南:解决 Ubuntu 从 24 升级到 26 后壁纸变黑与 Chrome 无法上传文件的问题

当 Linux 系统跨大版本升级时,底层的安全框架往往会发生剧烈的变动。一个典型的例子就是从 Ubuntu 24.04 升级到 26.04 (开发/预览版)。升级后,用户经常会遇到两个表面上毫无关联、但极为恶心的 Bug:

  1. 桌面壁纸变纯黑:在系统设置里选择任何 JPG/PNG 图片,桌面都会瞬间变黑。
  2. 浏览器无法上传文件:在 Google Chrome 或 Brave 浏览器中点击“上传文件”或“选择文件”按钮,没有任何反应,文件选择弹窗死活出不来。

本文将深入分析其背后的核心原因,并提供**“快速权宜方案”“官方原生高安全方案”**两种完整的修复教程。


1. Introduction (Highlighting Leadership)

I am Jiacai Liu (@jiacai2050), a core maintainer and contributor deeply embedded in the Zig and Systems Programming ecosystems. My work spans from building high-performance databases to curating the foundational learning resources for the Zig language.

2. Key Open Source Impact

My contribution to the open-source community is focused on three pillars:

  • Community Infrastructure (ZigCC): As a core maintainer of the zigcc organization, I lead the curation of Awesome Zig and the development of Zig Cookbook. These are the primary entry points for developers worldwide to discover libraries and learn best practices for the Zig programming language.
@jiacai2050
jiacai2050 / bash_aliases
Last active February 18, 2026 11:21
bashrc for ubuntu
export PATH=$PATH:~/bin:~/.asdf/shims
export PS1="\n[\u@\H] \t \w \n\${all_proxy}\$(__git_ps1)$ "
alias ls='ls -FG'
alias ll='ls -lh'
alias lla='ls -lah'
alias cd.='cd ..'
alias cd..='cd ../..'
alias cd...='cd ../../..'
alias cd....='cd ../../../..'
@jiacai2050
jiacai2050 / git-patch.sh
Created February 9, 2026 09:56
基于当前的修改(staged/unstaged)生成 patch 文件
#!/usr/bin/env bash
set -Eeuo pipefail
# 获取当前分支和时间
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
INCLUDE_UNSTAGED=false
# 处理输入参数
@jiacai2050
jiacai2050 / cpp-example.md
Last active January 30, 2026 01:02
C/C++ history

C++各版本核心特性快速使用指南(附极简示例)

结合C++演进路径,聚焦各版本最实用、工业界高频使用的核心特性,每个特性配可直接运行的极简示例,兼顾语法理解和快速上手,从基础到现代C++逐步推进,适配开发实践需求。

一、探索期(C with Classes/Early C++):C++基础核心(1980-1985)

这一阶段的特性是C++的底层基础,后续所有版本均完全兼容,是入门和开发的必备核心,无编译器版本限制。

1. 类(class)+ 封装 + 构造/析构函数(C with Classes 1980)

核心作用:C++面向对象的基础,将数据和操作数据的函数封装为一个整体,解决C语言无面向对象能力的问题。 示例

#include 
@jiacai2050
jiacai2050 / rocksdb-demo.zig
Created January 17, 2025 02:41
Use rocksdb in Zig!
const std = @import("std");
pub const c = @cImport({
@cInclude("rocksdb/c.h");
});
const key = "hello";
const value = "world";
pub fn main() !void {
const opts = c.rocksdb_options_create();
@jiacai2050
jiacai2050 / ruts_meetup_[1].md
Created December 12, 2024 23:56 — forked from humb1t/ruts_meetup_[1].md
Rust Users Team Samara Meetup

Rust User Team Samara - &Meetup[1]

How to and why you need to learn Rust

Rust learning curve

  • Evolution
  • Competition
  • Are you insane? Rust is awesome!!!
@jiacai2050
jiacai2050 / macOS Internals.md
Created December 1, 2024 14:58 — forked from kconner/macOS Internals.md
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

const std = @import("std");
const BIND_HOST: []const u8 = "0.0.0.0";
const BIND_PORT: u16 = 8090;
const NUM_WORKER_THREADS: u32 = 16;
const DOWNLOAD_DIR: []const u8 = "/tmp";
const MAX_FILE_SIZE: usize = 1024 * 1024 * 500; // 500M
// const UPSTREAM_URL: []const u8 = "https://fs.liujiacai.net/zigbuilds";
const UPSTREAM_URL: []const u8 = "https://ziglang.org";
wget 'https://github.com/google/flatbuffers/archive/refs/tags/v24.3.25.tar.gz'
tar xzf flatbuffers-24.3.25.tar.gz
pushd flatbuffers-24.3.25
cmake -G "Unix Makefiles"
make
make install
ldconfig
flatc --version
rm -rf flatbuffers-24.3.25