Shell的炫酷效果peace for all
写在前面
在 xhs 看到了一个有意思的图片, 想试试能不能把内容反解出来. (后来还是求助了大模型 hh)
shell 源码
Linux/MacOS 下运行良好.
#!/bin/bash
text=" PEACE FOR ALL PEACE FOR ALL "
# 获取终端尺寸
cols=$(tput cols)
lines=$(tput lines)
text_length=${#text}
# 频率和幅度控制
freq=0.3
amplitude=10
# 隐藏光标,恢复时清屏
tput civis
trap "tput cnorm; clear; exit" SIGINT
# 无限动画循环
for (( t = 0; ; t++ )); ...
Macos Virtual Machine Benchmark
写在前面
环境
macOS 15.5
xcode 26beta
M2 16GB
container run -it --arch amd64 --name fedora_amd fedora
container start fedora_amd
container exec -it fedora_amd bash
测试命令
==> sysbench --version
sysbench 1.0.20
# 单核性能
sysbench cpu --cpu-max-prime=20000 --threads=1 run
# 多核性能
sysbench cpu --cpu-max-prime=20000 --threads=4 run
指标
CPU spee...
Macos下c,c++编译器llvm gcc路径与源码位置
写在前面
在下面的位置中写入(先mkdir bits)
stdc++.h文件内容:
参考 gcc 源码 gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/precompiled/stdc%2B%2B.h;
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2023 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redis...
编译 llvm 10
写在前面
cmake -G "Ninja" \
-B build \
-S llvm \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_INSTALL_PREFIX=$HOME/local/opt/llvm10
ninja -C build -j23
ninja -C build install
Macos缺少字体的一种解决方案
方法
如果安装了 Word, 那么就可以有个比较取巧的方法
/Applications/Microsoft Word.app/Contents/Resources/DFonts
在这个目录下, 有你需要的字体~
Linux 发行版换源
写在前面
在 docker 使用 Linux 发行版, 想要安装包需要换国内镜像源, 而换源需要编辑镜像列表文件, 但是编辑的话需要vim或者 nano, 这俩编辑器又得换源之后才能安装…..
解决死锁的办法: 用 sed 啊!
下面的命令都运行在 sudo 权限下
archlinux
sed -i '1s/^/Server = https:\/\/mirrors.tuna.tsinghua.edu.cn\/archlinux\/$repo\/os\/$arch\n/' /etc/pacman.d/mirrorlist
ubuntu
对 Intel 架构
sed -i 's|http://archive.ubuntu.com/ubuntu|https:...
Macos Orbstack安装配置x86_64版centos
写在前面
基本信息
$ cat /etc/redhat-release
CentOS Stream release 9
$ uname -r
6.12.9-orbstack-00297-gaa9b46293ea3
安装常用的包
dev toolchain
## for gcc-14
sudo yum install epel-release
## optional: for latest gcc
#sudo yum install gcc-toolset-14 gdb
## for gcc(11) llvm and clang
sudo yum install llvm-toolset
# [optional]
# sudo dnf debuginfo-instal...
共计 464 篇文章,58 页。
您是Zorch的第 个小伙伴
Hits