MAC环境装机

一、ohmyz.sh

1.官网下载安装iterm2
2.安装ohmyz.sh
curl 安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

或者wget 安装

sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

3.将zsh设置为默认shell
3.1检查是否是默认
若下面命令输出/bin/zsh则zsh是默认/若是brew安装则输出/usr/local/bin/zsh

echo $SHELL

3.2设为默认

chsh -s /bin/zsh

若路径是/usr/local/bin/zsh则下面路径改为对应的
若不知道路径which zsh
3.3自动补全插件
下载该插件到.oh-my-zsh的插件目录

cd ~/.oh-my-zsh/plugins
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

open ~/.zshrc
找到plugins=(git)这一行,如果没有添加。更改为如下
plugins=(git zsh-autosuggestions),并执行
source ~/.zshrc
如有遗漏参见
https://hustyichi.github.io/2018/09/19/oh-my-zsh/
4.idea使用zsh
在这里插入图片描述

二、go

官网https://golang.google.cn/dl/
一键安装

which go
/usr/local/go/bin/go

http://medeming.com/
http://idea.medeming.com/jets/

三、java

1.官网
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
sudo vi /etc/profile
修改环境变量

四、Git安装

1.检查git是否安装
输入git会提示安装x-code

git

2.安装git
3.配置用户
git config --list 查看用户信息
git config --global user.name xxx

五、Redis

1.官网下载
https://redis.io/download
2.把解压文件copy到/usr/local/
3.进入文件

$ sudo make test 
$ sudo make install 

若sudo make test有报错就再执行一遍sudo make test就ok了
启动redis

redis-server

可视化工具
Redis Desktop Manager

六、Ngrok安装

1.官网下载
https://ngrok.com/download
在这里插入图片描述
2.解压
3…/ngrok http localhost:8080
其他人访问https://2220a1ce.ngrok.io便会自动映射到本地的http://localhost:8080
在这里插入图片描述

七、lrzsz 远程文件上传下载

1.安装iTerm2
第一条有官网下载地址
2.brew安装
先安装brew,再用brew安装lrzsz

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install lrzsz

3.配置lrzsz
(1)在cd /usr/local/bin创建两个文件

cd /usr/local/bin
vim iterm2-recv-zmodem.sh
vim iterm2-send-zmodem.sh

iterm2-recv-zmodem.sh内容如下

#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain

osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
   FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
else
   FILE=`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "iTerm2" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
fi

if [[ $FILE = "" ]]; then
   echo Cancelled.
   # Send ZModem cancel
   echo -e \\x18\\x18\\x18\\x18\\x18
   sleep 1
   echo
   echo \# Cancelled transfer
else
   cd "$FILE"
   /usr/local/bin/rz -E -e -b
   sleep 1
   echo
   echo
   echo \# Sent \-\> $FILE
fi

iterm2-send-zmodem.sh内容

#!/bin/bash
# Author: Matt Mastracci (matthew@mastracci.com)
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script
# licensed under cc-wiki with attribution required
# Remainder of script public domain

osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm
if [[ $NAME = "iTerm" ]]; then
    FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
else
    FILE=`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "iTerm2" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"`
fi
if [[ $FILE = "" ]]; then
    echo Cancelled.
    # Send ZModem cancel
    echo -e \\x18\\x18\\x18\\x18\\x18
    sleep 1
    echo
    echo \# Cancelled transfer
else
    /usr/local/bin/sz "$FILE" -e -b
    sleep 1
    echo
    echo \# Received $FILE
fi

(2)给刚刚的配置文件授权

 chmod +x iterm2-recv-zmodem.sh
 chmod +x iterm2-send-zmodem.sh

(3)配置iterm2
点击 iTerm2 的设置界面 Perference-> Profiles -> Default -> Advanced -> Triggers 的 Edit
新加两条

Regular expression: rz waiting to receive.\*\*B0100
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-send-zmodem.sh
 
Regular expression: \*\*B00000000000000
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-recv-zmodem.sh

4.使用
rz 上传功能
在bash中,也就是iTerm2终端输入rz 就会弹出文件选择框,选择文件 choose 就开始上传,会上传到当前目录
sz 下载功能
sz fileName(你要下载的文件的名字) 回车
会弹出窗体 我们选择要保存的地方即可

八、常用工具

8.1.goland远程编程
1.Tool->deployment->configuration
按照图示走到步骤2,配置连接信息,注意rootpath不用填,否则会报错

[2020/8/31, 5:53 下午] No files or folders found to process 

在这里插入图片描述

2.填写ip端口和用户名,并选择授权方式,点击ok
在这里插入图片描述
3.配置文件映射路径mappings
在这里插入图片描述
4.选择你配置的链接,并勾上,勾上后是粗体,点击ok
在这里插入图片描述
5.拉取文件
选中文件目录->Tool->deployment->downfrom 144(你的server 名)

九、 常用指令备注

ssh远程登录跳板机
ssh -p[端口] zora.xiao@[ip]
open ~/.zshrc
https://blog.csdn.net/u011886447/article/details/73268407

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值