ubuntu升级gcc
0.查看gcc版本12gcc --versiong++ --version
1. 先安装工具源1sudo add-apt-repository ppa:ubuntu-toolchain-r/test
2. 更新源1sudo apt update
3. 安装gcc和g+1apt install gcc-11 g++-11
查看已经安装的版本
1ls /usr/bin/gcc*
4. 设置gcc-11 g++-11为搞优先级(优先使用版本11)1234sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 1sudo update-alternatives --install /us ...
Python包管理不再头疼:uv工具快速上手
Python 包管理生态中存在多种工具,如 pip、pip-tools、poetry、conda 等,各自具备一定功能。
而今天介绍的uv 是 Astral 公司推出的一款基于 Rust 编写的 Python 包管理工具,旨在成为 “Python 的 Cargo”。
它提供了快速、可靠且易用的包管理体验,在性能、兼容性和功能上都有出色表现,为 Python 项目的开发和管理带来了新的选择。
1. 为什么用uv与其他Python中的包管理工具相比,uv更像是一个全能选手,它的优势在于:
速度快:得益于Rust,uv工具的速度让人惊艳,比如安装依赖,速度比其他工具快很多
功能全面:uv 是“一站式服务”的工具,从安装 Python、管理虚拟环境,到安装和管理包,再到管理项目依赖,它统统都能处理得很好
前景光明:背后有风投公司Astral支持,且采用了MIT许可,即使未来出现问题,社区也有应对 ...
python打包成exe
PyInstaller:1pyinstaller your_script.py --onefile
生成一个 your_script.exe,简单快捷。
Nuitka:1nuitka --onefile --standalone your_script.py
会调用系统 C 编译器(比如 MSVC 或 gcc),生成优化过的本地二进制。
p2p下载
推荐的Tracker网站XIU2/TrackersListCollection
trackerlisthttps://cf.trackerslist.com/best.txt
推荐客户端Releases · c0re100/qBittorrent-Enhanced-Edition
B站教程BT文件的正确下载方法,自动更新Tracker Lists,BT下载也能跑满带宽_哔哩哔哩_bilibili
自己电脑测试
应该限制到50Mbps内也就是 5MB/s
qBittorrent设置PT下载必读 |qBittorrent参数详细设置教程(保护硬盘、拒绝卡IO) | PT邀请码网
mac播放器
mac播放器推荐
blu-ray player
zfuse
vlc
Infuse Pro!!
IINA !!推荐目前在用很好用
git代理
如何为 Git 设置代理1. 连接情况总览如果在克隆或从远程仓库获取数据时遇到很慢甚至超时的情况,那么此时可能需要配置 Git 的代理。这里讲讲两种情况的代理方法:使用 HTTP/HTTPS 协议和使用 SSH 协议。
如果远程仓库的格式像下面那样,这种就是使用 HTTP/HTTPS 协议连接到 Git 仓库的情况
12http://github.com/cms-sw/cmssw.githttps://github.com/cms-sw/cmssw.git
如果远程仓库的格式像下面那样,这种就是使用 SSH 协议连接到 Git 仓库的情况
[email protected]:cms-sw/cmssw.gitssh://[email protected]/cms-sw/cmssw.git
2. 使用 HTTP 或 HTTPS 协议连接到 Git 仓库的代理方法2.1 针对所有域名的 Git ...
vcpkg使用其他编译器
默认的选项默认使用的是msvc进行编译动态库。
1vcpkg install zlib
安装别的版本需要有对应编译器,否则报错。
12error: while detecting compiler information:The log file content at "D:\d_files\vcpkg-master\buildtrees\detect_compiler\stdout-x64-android.log" is:
可以安装mingw版本
1vcpkg install zlib:x64-mingw-dynamic
编译其他的类型
1vcpkg install zlib:x64-windows-static-md-release
12cmake -S . -B build-clang -DCMAKE_TOOLCHAIN_FILE="windows-cl ...
linux小技巧
查看程序编译器file1file ./ffmpeg.exe
strings1strings ./ffmpeg.exe | grep -i "GCC\|clang\|LLVM\|Microsoft"
清空github仓库
1.Remove the history from
1rm -rf .git
2.recreate the repos from the current content only
123git initgit add .git commit -m "Initial commit"
3.push to the github remote repos ensuring you overwrite history
12git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.gitgit push -u --force origin master
python虚拟环境使用
一、使用virtualenv1. 使用pip1pip install virtualenv
2. 创建运行环境virtualenv mlep-w1-lab
12345virtualenv [虚拟环境名称] virtualenv venv#如果不想使用系统的包,加上–no-site-packeages参数virtualenv --no-site-packages 创建路径名
3. 激活环境linux:
12$ cd venv$ source ./bin/activate
Windows 10:
12> cd venv> .\Scripts\activate.bat
4. 退出环境linux:
1$ deactivate
Windows 10:
123> .\Scripts\deactivate.bat或者> deactivate
5. 删除环境没有使用virtual ...