0.高频命令
//创建环境
conda create -n test python=3.10
//切换环境
conda activate test
//修改权限
chmod u+x *.sh
//淘宝镜像
npm config set registry http://registry.npm.taobao.org
//阿里云镜像
npm config set registry http://registry.npmmirror.com
//还原镜像地址
npm config set registry https://registry.npmjs.org/
//python pip 设置阿里云镜像
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
//.npmrc
registry=https://registry.npmmirror.com
electron_mirror=https://npmmirror.com/mirrors/electron/
electron_custom_dir={{ version }}
//.npmrc 华为源
registry=https://mirrors.huaweicloud.com/repository/npm/
electron_mirror=https://mirrors.huaweicloud.com/electron/
electron_custom_dir={{ version }}
//git代理
git config --global --list
git config --global --add http.proxy http://127.0.0.1:7897
git config --global --add https.proxy https://127.0.0.1:7897
git config --global --unset http.proxy http://127.0.0.1:7897
git config --global --unset https.proxy https://127.0.0.1:7897
//git移除对某个文件或文件夹的版本控制
git rm -r --cached ".idea"
//windows 开机自启路径
C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
//1.下载 NVM for Windows:
https://github.com/coreybutler/nvm-windows/releases
//2.列出所有可用的 Node.js 版本:
https://nodejs.org/en/about/previous-releases
nvm list available
//安装node
nvm install 18.5.0
//查看安装版本
nvm list
//切换版本
nvm use 18.5.0
//设置默认
nvm use 20.18.1
//卸载
nvm uninstall 18.5.0
//pkg支持最高node版本 18.5.0
npm install -g pkg
pkg index.js
pkg my-app.js --target win
1.mac命令
//mac 启动redis
/usr/local/bin/redis-server
//mac 搜索文件快捷键
shift+command+G
2.adb 命令
adb forward tcp:36668 tcp:36668
//多设备选择
adb devices
adb -s 设备名 forward tcp:36668 tcp:36668
//小米手机无线调试,使用配对码配对设备
adb pair 192.168.2.27:38323
//输入6位验证码即可
//如果已配对 但是断开了
adb connect 192.168.2.27:38323
3. 查看关闭端口
//mac查看端口:
sudo lsof -i :8080
//mac杀死端口(6228需要换成具体 kid):
sudo kill -9 6228
//windows查看端口:
netstat -ano | findstr 8080
//windows杀死端口(6228需要换成具体 kid):
taskkill /F /pid 9544
//windows
echo 获取管理员权限...
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
echo 延时
timeout /t 180
echo 正在关闭ToDesk服务和进程...
net stop "ToDesk Service"
taskkill /f /t /im ToDesk.exe
rem 切换到utf-8编码,解决中文乱码
chcp 65001
rem 切换目录
cd %~d0
rem 无窗口启动
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("%~nx0"^&" h",0)^&(window.close) && exit
:begin
start "" cmd /c start.cmd
4.Idea setget方法无法识别,添加lombok插件
5.接口请求案列
RetrofitUtils.getInfoByKey("tribe_info")
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
// .flatMap((Function<List<MyInfoBean>, ObservableSource<List<MyInfoBean>>>) infoBeans -> {
// if (infoBeans.size() > 0) {
// return RetrofitUtils.getInfoByKey("tribe_info");
// }
// return Observable.error(new NullObservableSourceException());
// })
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
.subscribe(new MyObserver<List<MyInfoBean>>() {
@Override
protected void onSuccess(List<MyInfoBean> item) {
LogUtils.i(JSONObject.toJSONString(item));
}
@Override
protected void onError(int code, String message) {
ToastUtils.showShort(message);
}
});