Skip to content

Commit

Permalink
修改语法高亮语言shell为bash
Browse files Browse the repository at this point in the history
  • Loading branch information
bajins committed May 31, 2019
1 parent 705ff15 commit 3503fae
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 12,139 deletions.
4 changes: 2 additions & 2 deletions JAVA/JVM.md
Expand Up @@ -79,7 +79,7 @@ export JAVA_OPTS="

### windows
#### 添加JAVA_HOME和JRE_HOME
```sehll
```bash
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_191
set JRE_HOME=C:\Program Files\Java\jre1.8.0_201
```
Expand Down Expand Up @@ -210,7 +210,7 @@ lsof -i:1099
```

#### 二、(推荐)新建一个配置文件 jstatd.all.policy
```sehll
```bash
cd $JAVA_HOME/bin/
vi jstatd.all.policy
```
Expand Down
2 changes: 1 addition & 1 deletion Python/README.md
Expand Up @@ -3,7 +3,7 @@
## [Centos7安装Python3.7](./install.md)

# 解决pip安装模块提示已经安装更高版本问题
```sell
```bash
pip3 install --ignore-installed 模块名
```

Expand Down
2 changes: 1 addition & 1 deletion SQL/MySQL/MySQL-binlog2sql恢复数据.md
Expand Up @@ -17,7 +17,7 @@ cd binlog2sql/
pip install -r requirements.txt
```
### MySQL server必须设置以下参数:
```sehll
```bash
[mysqld]
server_id = 1
log_bin = /var/log/mysql/mysql-bin.log
Expand Down
2 changes: 1 addition & 1 deletion SQL/MySQL/MySQL用户管理.md
Expand Up @@ -99,7 +99,7 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTI
FLUSH PRIVILEGES;
```
#### 重启服务,再用新密码登录即可:
```sell
```bash
systemctl restart mysqld
```
#### [放开MySQL防火墙端口](/VPS/linux命令.md#防火墙)
Expand Down
46 changes: 23 additions & 23 deletions VPS/CentOS7.x内核升级.md
Expand Up @@ -45,42 +45,42 @@ yum update
```

在 CentOS 7.x 上启用 ELRepo 仓库
```sehll
```bash
# 首先导入elrepo的key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# 安装elrepo的yum
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
```
仓库启用后,你可以使用下面的命令列出可用的系统内核相关包,查看内核相关包
```sell
```bash
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
```
接下来,安装最新的主线稳定内核
```sehll
```bash
yum --enablerepo=elrepo-kernel install kernel-ml
```
或者以下命令安装最新的主线稳定内核
```bash
yum -y --enablerepo=elrepo-kernel install kernel-ml.x86_64 kernel-ml-devel.x86_64
```
查看可用内核
```sehll
```bash
cat /boot/grub2/grub.cfg |grep menuentry
```
设置内核启动项,替换刚刚查看出来的内核名字执行,比如:grub2-set-default 'CentOS Linux (4.15.13-1.el7.elrepo.x86_64) 7 (Core)'
grub2-set-default '内核名字'

查看内核启动项是否设置成功查看内核启动项是否设置成功
```sehll
```bash
grub2-editenv list
```
查看内核的启动项
```sehll
```bash
grub2-editenv list
```

重启机器
```sehll
```bash
reboot
```

Expand All @@ -90,30 +90,30 @@ uname -sr
```

查看多余的内核
```sehll
```bash
rpm -qa | grep kernel
```

删除多余的内核
```sehll
```bash
yum remove 内核名字
```

----------------------------------------------------
#####
# 使用[秋水逸冰](https://github.com/teddysun/across)的一键安装脚本
### 使用root用户登录,运行以下命令:
```sehll
```bash
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh
```
##### 安装完成后,脚本会提示需要重启 VPS,输入 y 并回车后重启。
### 重启完成后,进入 VPS,验证一下是否成功安装最新内核并开启 TCP BBR,输入以下命令:
```sehll
```bash
uname -r
```
### 查看内核版本,显示为最新版就表示 OK 了
### 一:
```sehll
```bash
sysctl net.ipv4.tcp_available_congestion_control
```
#### 返回值一般为:
Expand All @@ -123,31 +123,31 @@ sysctl net.ipv4.tcp_available_congestion_control
+net.ipv4.tcp_available_congestion_control = reno cubic bbr
```
### 二:
```sehll
```bash
sysctl net.ipv4.tcp_congestion_control
```
#### 返回值一般为:
```diff
+net.ipv4.tcp_congestion_control = bbr
```
### 三:
```sehll
```bash
sysctl net.core.default_qdisc
```
#### 返回值一般为:
```diff
+net.core.default_qdisc = fq
```
### 四:
```sehll
```bash
lsmod | grep bbr
```
##### 返回值有 tcp_bbr 模块即说明 bbr 已启动。注意:并不是所有的 VPS 都会有此返回值,若没有也属正常。

## CentOS 下最新版内核 headers 安装方法
##### 本来打算在脚本里直接安装 kernel-ml-headers,但会出现和原版内核 headers 冲突的问题。因此在这里添加一个脚本执行完后,手动安装最新版内核 headers 之教程。
### 执行以下命令
```sehll
```bash
yum --enablerepo=elrepo-kernel -y install kernel-ml-headers
```
#### 根据 CentOS 版本的不同,此时一般会出现类似于以下的错误提示:
Expand All @@ -156,12 +156,12 @@ yum --enablerepo=elrepo-kernel -y install kernel-ml-headers
-Error: kernel-ml-headers conflicts with kernel-headers-3.10.0-693.17.1.el7.x86_64
```
### 因此需要先卸载原版内核 headers ,然后再安装最新版内核 headers。执行命令:
```sehll
```bash
yum remove kernel-headers
```
##### 确认无误后,输入 y,回车开始卸载。注意,有时候这么操作还会卸载一些对内核 headers 依赖的安装包,比如 gcc、gcc-c++ 之类的。不过不要紧,我们可以在安装完最新版内核 headers 后再重新安装回来即可。
### 卸载完成后,再次执行上面给出的安装命令。
```sehll
```bash
yum --enablerepo=elrepo-kernel -y install kernel-ml-headers
```
#### 成功安装后,再把那些之前对内核 headers 依赖的安装包,比如 gcc、gcc-c++ 之类的再安装一次即可。
Expand All @@ -171,31 +171,31 @@ yum --enablerepo=elrepo-kernel -y install kernel-ml-headers

## 内核升级方法
#### 如果是 CentOS 系统,执行如下命令即可升级内核:
```sehll
```bash
yum -y install kernel-ml kernel-ml-devel
```
#### 如果你还手动安装了新版内核 headers ,那么还需要以下命令来升级 headers :
```bash
yum -y install kernel-ml-headers
```
#### CentOS 6 的话,执行命令:
```sehll
```bash
sed -i 's/^default=.*/default=0/g' /boot/grub/grub.conf
```
#### CentOS 7 的话,执行命令:
```sehll
```bash
grub2-set-default 0
```
#### 如果是 Debian/Ubuntu 系统,则需要手动下载最新版内核来安装升级。
#### 去这里下载最新版的内核 deb 安装包。
##### 如果系统是 64 位,则下载 amd64 的 linux-image 中含有 generic 这个 deb 包;
##### 如果系统是 32 位,则下载 i386 的 linux-image 中含有 generic 这个 deb 包;
##### 安装的命令如下(以最新版的 64 位 4.12.4 举例而已,请替换为下载好的 deb 包):
```sehll
```bash
dpkg -i linux-image-4.12.4-041204-generic_4.12.4-041204.201707271932_amd64.deb
```
#### 安装完成后,再执行命令:
```sehll
```bash
/usr/sbin/update-grub
```
最后,重启 VPS 即可。
2 changes: 1 addition & 1 deletion VPS/linux命令.md
Expand Up @@ -393,7 +393,7 @@ tar -zcvf tomcat.tar.gz --exclude=tomcat/logs --exclude=tomcat/libs --exclude=to
>> 在使用tar的--exclude命令排除打包时,末尾不能加“/”或者路径为绝对路径,否则还是会把排除目录以及其下的文件打包进去。
#### 7zip
```sehll
```bash
# 安装7zip
yum –y install p7zip
# 解压到当前目录下,不保留原来的目录结构
Expand Down
2 changes: 1 addition & 1 deletion VPS/路由跟踪.md
Expand Up @@ -179,7 +179,7 @@ mtr -r www.woytu.com
## tracert
#### Tracert(跟踪路由)是一个简单的网络诊断工具,可以列出分组经过的路由节点,以及它在IP 网络中每一跳的延迟。(这里的延迟是指:分组从信息源发送到目的地所需的时间,延迟也分为许多的种类——传播延迟、传输延迟、处理延迟、排队延迟等,是大多数网站性能的瓶颈之一).
### tracert命令的格式:
```sehll
```bash
tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name
```
```
Expand Down
2 changes: 1 addition & 1 deletion WEB/WebSSH.md
Expand Up @@ -24,7 +24,7 @@ node -v && npm -v


## 下载 Webssh2
```sehll
```bash
git clone https://github.com/billchurch/WebSSH2
cd WebSSH2
npm install --production
Expand Down

0 comments on commit 3503fae

Please sign in to comment.