杂项笔记汇总
974 字
5 分钟
杂项笔记汇总
这是一个零散的笔记汇总
好记性不如烂笔头,记一些杂乱的东西,避免了每次都要去百度的尴尬境地
地址收集(避免每次都要去搜一下,恼火Ï)
设置淘宝镜像(不建议,建议使用下面的方式)
# 已经废弃npm config set registry https://registry.npm.taobao.org# 最新的taobao镜像地址npm config set registry http://registry.npmmirror.com# 恢复到npm官方镜像地址npm config set registry https://registry.npmjs.orgNRM(牛肉面)设置NPM的镜像地址
npm i nrm -g# 列出镜像地址nrm ls# 使用镜像地址nrm use taobao删除整个依赖库node_modules
# 如果没有安装需要先安装这个npm install rimraf -g
# 执行删除rimraf node_modules
# 清空npm缓存npm cache clean --forceVMware 虚拟机固定IP
1.先将虚拟机网络连接模式改为NAT 2.设置NAT网关 3.设置DHCP 4.将虚拟机系统设置为静态ip,ip要对应前边设置的网关
centos示例:
vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=1f6d2414-12b7-40ef-8fb1-d2e6db9c739bDEVICE=ens33ONBOOT=yesIPADDR=192.168.13.130NETMASK=255.255.255.0GATEWAY=192.168.13.254DNS1=114.114.114.114ubuntu22.04换源
cd /etc/apt/cp sources.list sources.list_bakvim sources.list #用下边内容覆盖
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
apt updateapt upgradedebian换阿里云源
deb http://mirrors.aliyun.com/debian/ stretch main non-free contribdeb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contribdeb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contribdeb-src http://mirrors.aliyun.com/debian/ stretch main non-free contribdeb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contribdeb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contribdeb http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contribdeb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contribLinux将目录设置为所有人都能读写
# <!-- 用chmod命令, 先进入要修改权限的目录abc的上一级目录 , --># <!-- 然后运行 -->chmod -R o+r+w abc# <!-- 再运行 -->chmod o+x+w abc乌班图防火墙开关
# 开启ufw enable# 关闭ufw disable生成ssh key
ssh-keygen -t rsa -C "919401990@qq.com"debian11 一些常见的编译环境
sudo apt install pkg-config make libpng-dev gcc patch -y创建react typescript项目
pnpm dlx create-react-app pd-project --template typescript解决NPM下载二进制巨慢的问题
在.npmrc文件内加入以下内容,从antfu博客上看来的,经过测试过相当快~
原文链接:https://antfu.me/posts/npm-binary-mirrors
NODEJS_ORG_MIRROR=https://cdn.npmmirror.com/binaries/nodeNVM_NODEJS_ORG_MIRROR=https://cdn.npmmirror.com/binaries/nodePHANTOMJS_CDNURL=https://cdn.npmmirror.com/binaries/phantomjsCHROMEDRIVER_CDNURL=https://cdn.npmmirror.com/binaries/chromedriverOPERADRIVER_CDNURL=https://cdn.npmmirror.com/binaries/operadriverELECTRON_MIRROR=https://cdn.npmmirror.com/binaries/electron/ELECTRON_BUILDER_BINARIES_MIRROR=https://cdn.npmmirror.com/binaries/electron-builder-binaries/SASS_BINARY_SITE=https://cdn.npmmirror.com/binaries/node-sassSWC_BINARY_SITE=https://cdn.npmmirror.com/binaries/node-swcNWJS_URLBASE=https://cdn.npmmirror.com/binaries/nwjs/vPUPPETEER_DOWNLOAD_HOST=https://cdn.npmmirror.com/binariesSENTRYCLI_CDNURL=https://cdn.npmmirror.com/binaries/sentry-cliSAUCECTL_INSTALL_BINARY_MIRROR=https://cdn.npmmirror.com/binaries/saucectlnpm_config_sharp_binary_host=https://cdn.npmmirror.com/binaries/sharpnpm_config_sharp_libvips_binary_host=https://cdn.npmmirror.com/binaries/sharp-libvipsnpm_config_robotjs_binary_host=https://cdn.npmmirror.com/binaries/robotjwin ltsc激活
slmgr -ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D
slmgr -skms kms.03k.org
slmgr -ato
slmgr -dlvgit相关的
git一次性拉去所有分支更新组合拳
一次性采集所有分支,并进行pull更新
git fetch --all# 项目git pull --all追踪文件名大小写
由于默认的git不会追踪文件大小写,这会导致一些问题,白白浪费我们的时间来排查问题,我们可以防患于未然,执行以下命令在未来杜绝这个问题
# 全局git config --global core.ignorecase false# 项目git config core.ignorecase false给linux文件添加可执行权限
chmod u+x xxx.sh
./xxx.shgit 只拉取最新的提交,git clone速度拉满
git clone -b develop git@xxx.org:username/repo.git --depth=1禁用ts检查
单行忽略(添加到特定行的行前来忽略这一行的错误)// @ts-ignore
跳过对某些文件的检查 (添加到该文件的首行才起作用)// @ts-nocheck
对某些文件的检查// @ts-checkadb连接设备
adb connect [ip]:[port]# 比如adb connect 100.78.252.21:5555# 断开adb disconnect [ip]:[port]# 使用adb远程控制手机scrcpy配置bash终端代理
# 端口一般指向你本地的代理服务器export http_proxy=http://127.0.0.1:7890;export https_proxy=http://127.0.0.1:7890;收集到的测试资源
视频链接
3秒https://www.w3school.com.cn/i/movie.oggmp4
10秒https://www.runoob.com/try/demo_source/mov_bbb.mp4
10秒https://www.runoob.com/try/demo_source/movie.mp4
1分钟http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
46秒http://vjs.zencdn.net/v/oceans.mp4
52秒http://vjs.zencdn.net/v/oceans.mp4
小米 mix fold3https://cdn.cnbj1.fds.api.mi-img.com/product-images/xiaomimixfold3k3zux1/video-1-1.mp4图片上传接口url
none;直播流
http://live-uat.nrbvc.com/chicken/main.flvvscode 备忘录
代码注释折叠标志 #region #endregion
它可以让你把相关的代码折叠到一起,而无需和语法挂钩.
// #region xxx功能区域// ...code// #endregion文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!














