目录

日常学习速记[置顶]

常用网站

Name Link
*drive直链提取 https://onedrive.gimhoy.com/
图片AI放大 https://bigjpg.com/
MSDN https://msdn.itellyou.cn/

windows安装时手动分区

1
2
3
4
5
6
7
8
diskpart
list disk
select disk 0
clean
convert gpt
create partition efi size=500
create partition msr size=300
create partition primary size=61440

size的单位是MB

pip清华源

1
2
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

python2安装opencv出错

pip install opencv-python==4.2.0.32 参考连接

ssh算法弃用导致错误

https://wiki.archlinux.org/title/OpenSSH_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#OpenSSH_7.0_%E7%9A%84_%22No_matching_key_exchange_method_found%22_%E9%94%99%E8%AF%AF

ssh连接报错no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

解决方法:需要在/etc/ssh/ssh_config中添加KexAlgorithms +diffie-hellman-group1-sha1然后执行sudo ssh-keygen -A

VMware桥接网卡

在使用虚拟机的过程中,出现了桥接网络无法获取IP的情况,现记录解决方法

1.在菜单栏中选择Edit→Virtual Network Editor

https://cdn.jsdelivr.net/gh/AMDyesIntelno/PicGoImg@master/20210730211046.png

2.点击Change Settings,使用管理员权限修改

https://cdn.jsdelivr.net/gh/AMDyesIntelno/PicGoImg@master/20210730211044.png

3.在桥接模式的设定中,选择桥接到本机的无线网卡

https://cdn.jsdelivr.net/gh/AMDyesIntelno/PicGoImg@master/20210730211045.png

开启wsl2或hyperv后Jetbrains的IDE无法启动

PyCharm Pro 2021.3 suddenly cannot start IDE

WSL2, Hyper-V & Reserved Ports

原因:IDE需要绑定的端口6942-6991被系统占用

netsh int ipv4 show excludedportrange protocol=tcp可以查看被系统占用的端口

netsh int ipv4 set dynamic tcp start=40000 num=5000将端口占用的范围修改到40000-45000

reg add HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f禁止HNS占用

https://cdn.jsdelivr.net/gh/AMDyesIntelno/PicGoImg@master/202201191808700.png

bash/zsh配置代理

.bashrc或者.zshrc中添加如下内容

1
2
3
4
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*');
export https_proxy="http://${hostip}:7890";
export http_proxy="http://${hostip}:7890";
export all_proxy="socks5://${hostip}:7890";

完成后,输入source .bashrc或者source .zshrc

oh-my-zsh配置

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

编辑~/.zshrcZSH_THEME的值改为ys或保持默认(个人喜好

隐藏用户名DEFAULT_USER=$USER

安装syntax-highlightingzsh-autosuggestions

1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && chmod -R 555 ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && chmod -R 555 ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

编辑~/.zshrc

plugins=(git z colored-man-pages zsh-autosuggestions zsh-syntax-highlighting extract)

在切换shell后,.bashrc中的代理设置要复制到.zshrc

使zsh配置生效source ~/.zshrc

tar命令

https://www.cnblogs.com/jyaray/archive/2011/04/30/2033362.html

  • 压缩

tar –cvf jpg.tar *.jpg 将目录里所有jpg文件打包成tar.jpg

tar –czf jpg.tar.gz *.jpg 将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gz

tar –cjf jpg.tar.bz2 *.jpg 将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2

tar –cZf jpg.tar.Z *.jpg 将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Z

  • 解压

tar –xvf file.tar 解压 tar包

tar -xzvf file.tar.gz 解压tar.gz

tar -xjvf file.tar.bz2 解压tar.bz2

tar –xZvf file.tar.Z 解压tar.Z

  • 排除目录

--exclude=xxx 排除xxx文件夹

tshark权限不足

1
2
3
4
pi@raspberrypi:~ $ sudo tshark -i wlan0 -w out.pcap
Running as user "root" and group "root". This could be dangerous.
Capturing on 'wlan0'
tshark: The file to which the capture would be saved ("out.pcap") could not be opened: Permission denied.

解决方法sudo tshark -i wlan0 -w /tmp/out.pcap

hackthebox连接

https://app.hackthebox.com/home

注意事项

  1. 选择vpn连接方式时,选择tcp/443

  2. 为了保证vpn连接的稳定,请在.ovpn文件中添加指向宿主机的代理

https://cdn.jsdelivr.net/gh/AMDyesIntelno/PicGoImg@master/202201140006711.png

  1. 使用openvpn时需要root权限,连接后先用ping检测能否连接题目