访问地址:传送门
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
-
Open
User Settings
and searchterminal.integrated.shell.osx
-
Set it to
/bin/zsh
use code
command to open a project with vscode quickly in shell
-
Command+Shift+P
and searchshell command
-
Choose
Install 'code' command in PATH
preview markdown file real time in vscode
-
Command+Shift+P
and searchmarkdown
-
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
- See the shells you already installed with the command
cat /etc/shells
复制代码
- Set zsh as the default shell
chsh -s /usr/local/bin/zsh
复制代码
- (Optional)If you want to configure zsh mannually, use
vim ~/.zshrc
复制代码
- After change
.zshrc
, do remember tosource
it to make it work
source ~/.zshrc
复制代码
- (Restore default shell)
chsh -s /bin/bash
复制代码
Git
初始化git
- 查看配置
git config --list
复制代码
- 初始化用户和邮箱
git config --global user.name "your name"
git config --global user.email your email
复制代码
本地生成ssh key并放在远端以实现SSH访问
- Generate a ssh key locally
ssh-keygen -o
复制代码
- Catch your key just generated before
cat ~/.ssh/id_rsa.pub
复制代码
- 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并不需要等号,也不需要引号
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
-
Get into your project folder and
git init
, then a.git
folder was created. -
Add your files to git.
git add .
复制代码
- Commit your added files to the stage area.
git commit -m "write your comment"
复制代码
- Link your local git project with your GitHub repository.
git remote add origin https://github.com/youraccount/yourrepository.git
复制代码
- Pull the existed files of your current GitHub repository.
git pull origin master
复制代码
-
Fix the conflicts if there exist.
-
Push your local project managed by git to your remote GitHub repository.
git push -u origin master
复制代码
- Done.
Gitlab
Terminal
- nslookup 域名相关
TODO
- [ ] nslookup