文章目录
Windows
1. WSL2 与 VMWare虚拟机 冲突问题(Win10)
WSL2需要启动 hyper-v 功能,VMWare需要禁用,重启生效
echo "禁用 hyper-v"
bcdedit /set hypervisorlaunchtype off
echo "启用 hyper-v"
bcdedit /set hypervisorlaunchtype auto
2. 刷新 DNS 缓存
ipconfig /flushdns
3. 刷新桌面图标缓存(Win7+)
ie4uinit -show
4. 可以通过 git bash 支持 linux 下常用工具
Linux
1. 查看内核版本
uname -sr
2. 查看发行版本
lsb_release -d
3. 查看cpu架构
uname -m
4. 免密登录
参考链接 https://www.cnblogs.com/tq03/p/4990149.html
; 生成密钥, 可以使用默认配置一直点确认, 生成公钥文件 id_rsa.pub
ssh-keygen -t rsa
; 拷贝到远程机器, 以 user@192.168.1.11 为例
; 方式 1
ssh-copy-id user@192.168.1.11
; 方式 2
cat id_rsa.pub | ssh user@192.168.1.11 'cat >> ~/.ssh/authorized_keys'
5. 查看文件elf头信息
readelf -h xxx.o
6. 拷贝依赖文件
#!/bin/sh
bin=$1 # 源程序
desDir="./lib" # 输出路径
if [ ! -d $desDir ];then
#echo "makedir $desDir"
mkdir $desDir
fi
libList=$(ldd $bin | awk '{if (match($3,"/")){ printf("%s "),$3 } }')
cp $libList $desDir