开发资料大全(个人整理,长期维护)

访问地址:传送门

Handy Note

DB

Use navicat11 client to connect localhost mysql database and get Client does not support authentication protocol requested by server; consider upgrading MySQL client

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpass';
复制代码

IDE

idea2018 active code

http://idea.lanyus.com/
复制代码

use zsh as the default shell in vscode

  1. Open User Settings and search terminal.integrated.shell.osx

  2. Set it to /bin/zsh

use code command to open a project with vscode quickly in shell

  1. Command+Shift+P and search shell command

  2. Choose Install 'code' command in PATH

preview markdown file real time in vscode

  1. Command+Shift+P and search markdown

  2. Choose Open locked preview to the side

Maven

环境变量

vim ~/.bash_profile
export M2_HOME=/Users/username/Documents/maven #这里是你maven的路径
export PATH=$PATH:$M2_HOME/bin
source ~/.bash_profile

mvn -v
复制代码

插件使用

插件问题

Linux

查看Linux系统版本

lsb_release -a
复制代码

lsb = Linux Standard Base

CPU使用情况

top
复制代码

CPU信息

cat /proc/cpuinfo |more
复制代码

查看内存

free -m
复制代码

查看磁盘

df -h
复制代码
fdisk -l
复制代码

命令解读

which&where
/usr/bin和/usr/local/bin区别

MacOS

use zsh as the default shell

  1. See the shells you already installed with the command
cat /etc/shells
复制代码
  1. Set zsh as the default shell
chsh -s /usr/local/bin/zsh
复制代码
  1. (Optional)If you want to configure zsh mannually, use
vim ~/.zshrc
复制代码
  1. After change .zshrc, do remember to source it to make it work
source ~/.zshrc
复制代码
  1. (Restore default shell)
chsh -s /bin/bash
复制代码

Git

初始化git

  1. 查看配置
git config --list
复制代码
  1. 初始化用户和邮箱
git config --global user.name "your name"
git config --global user.email your email
复制代码

本地生成ssh key并放在远端以实现SSH访问

  1. Generate a ssh key locally
ssh-keygen -o
复制代码
  1. Catch your key just generated before
cat ~/.ssh/id_rsa.pub
复制代码
  1. Put it into your ssh keys in your romote repository

解决使用vs code打开从github上git clone下来的项目,修改后并做git remote关联,在git push时每次都要输入账号和密码

存储全局账号
git config --global credential.helper wincred
复制代码

git全局配置用户名,因误操作产生多条配置,导致无法修改

产生背景

使用如下错误命令及参数修改配置

git config --global user.name = "M1kewang"
复制代码

首先修改配置项user.name并不需要等号,也不需要引号

这样配置的结果就是产生了两条user.name,如下

git config -l

user.name=magi
user.name==
复制代码

即产生了一条user.name值为一个等号的记录

此时再去对user.name这个属性操作即会报错,因为存在两条同属性名的属性,git会混乱,而不知道你要操作的是哪个属性配置

具体报错
warning: user.name has multiple values
error: cannot overwrite multiple values with a single value
       Use a regexp, --add or --replace-all to change user.name.
复制代码
解决方案

先看一下git存在哪些配置参数

git config
复制代码

发现里面有个--unset参数,用于remove一个variable(在git中,配置被当做全局变量被存储,这和MySQL很像)

但是尝试这样修改,并不理想,会提示你要修改的属性存在多条记录

warning: user.name has multiple values
复制代码

正确的方法应该是对这个属性进行批量操作,即对所有同名的属性值进行修改

git config --global --replace-all user.name M1kewang
复制代码

这样就git会把修改后的两条相同属性合并为一条,恢复正常

Github

上传本地项目到github

  1. Get into your project folder and git init, then a .git folder was created.

  2. Add your files to git.

git add .
复制代码
  1. Commit your added files to the stage area.
git commit -m "write your comment"
复制代码
  1. Link your local git project with your GitHub repository.
git remote add origin https://github.com/youraccount/yourrepository.git
复制代码
  1. Pull the existed files of your current GitHub repository.
git pull origin master
复制代码
  1. Fix the conflicts if there exist.

  2. Push your local project managed by git to your remote GitHub repository.

git push -u origin master
复制代码
  1. Done.

Gitlab

Terminal

  • nslookup 域名相关

TODO

  • [ ] nslookup
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值