美文网首页
常用命令(自用)

常用命令(自用)

作者: 雨邪 | 来源:发表于2024-12-25 01:37 被阅读0次

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

//PowerShell->运行invoke-webrequest报错:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
[Net.ServicePointManager]::SecurityProtocol

//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命令

//安装redis
brew install redis
//查看安装路径
brew info redis
//允许任何主机连接、访问
bind 127.0.0.1 改为 bind 0.0.0.0
//关闭保护模式
protected-mode yes 改为 protected-mode no
//设置密码
requirepass 123456
//停止redis
brew services stop redis
//启动redis
brew services start redis
//测试远程访问
redis-cli -h 192.168.1.2  -p 6379 -a 123456
//查看使用情况
info

//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 //链接
或者
adb tcpip 5555
adb connect 192.168.88.33:5555

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);
                        }
                    });

相关文章

  • 常用命令(自用)

    1.mac启动redis 2.adb 启动远程接口 3. 查看关闭端口 5.mac 搜索文件快捷键 6.小米手机无...

  • git常用命令(自用)

    1、首先需要安装好git,这个百度就搞定了 2、进入到需要git管理代码的路径 3、开始git命令 到达指定路径之...

  • (搬运+自用) Ubuntu常用命令

    1. 文件/文件夹管理 ls列出当前目录文件(不包括隐含文件)ls -a列出当前目录文件(包括隐含文件)ls -l...

  • Screen常用命令小结【自用版】

    关于Linux下Screen命令的小结,网上举不胜举。但用起来都不是很方便,因为大多数都永不到。这里只列举一些最能...

  • 其他

    Git常用命令mac常用命令Linux 常用命令汇总Linux 常用命令0Linux 常用命令1--ls命令

  • Docker

    目录 常用命令 常用命令

  • Linux CentOS基础知识和常用命令

    常用命令1 常用命令2 常用命令3 常用命令4 Linux 目录配置 1、根目录(/)根目录(/)所在分区应该越小...

  • svn提交代码简单操作

    自用:

  • Shell命令汇总

    1、一般常用命令 (1)Shell 常用命令总结 (2)Shell的18条常用命令整理 2、文件操作常用命令 (1...

  • Flutter - 常用命令

    Flutter 常用命令 Flutter 常用命令: Flutter 常用命令说明flutter列出所有的命令fl...

网友评论

      本文标题:常用命令(自用)

      本文链接:https://www.haomeiwen.com/subject/dievejtx.html