Skip to content

Commit 7e0a81e

Browse files
committed
update scriptes
1 parent b617a8f commit 7e0a81e

8 files changed

Lines changed: 82 additions & 12 deletions

File tree

codes/linux/soft/docker-install.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
###################################################################################
4+
# 控制台颜色
5+
BLACK="\033[1;30m"
6+
RED="\033[1;31m"
7+
GREEN="\033[1;32m"
8+
YELLOW="\033[1;33m"
9+
BLUE="\033[1;34m"
10+
PURPLE="\033[1;35m"
11+
CYAN="\033[1;36m"
12+
RESET="$(tput sgr0)"
13+
###################################################################################
14+
15+
printf "${BLUE}"
16+
cat << EOF
17+
18+
###################################################################################
19+
# 安装 Jenkins 脚本
20+
# 适用于所有 linux 发行版本。
21+
# @author: Zhang Peng
22+
###################################################################################
23+
24+
EOF
25+
printf "${RESET}"
26+
27+
printf "${BLUE}>>>>>>>> install jenkins\n${RESET}"
28+
29+
# 下载并解压 jenkins
30+
mkdir -p /opt/jenkins
31+
wget -O /opt/jenkins/jenkins.war http://mirrors.jenkins.io/war-stable/latest/jenkins.war
32+
33+
printf "${GREEN}<<<<<<<< install jenkins\n${RESET}"

codes/linux/soft/jdk8-install.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/usr/bin/env bash
22

3+
###################################################################################
4+
# 控制台颜色
5+
BLACK="\033[1;30m"
6+
RED="\033[1;31m"
7+
GREEN="\033[1;32m"
8+
YELLOW="\033[1;33m"
9+
BLUE="\033[1;34m"
10+
PURPLE="\033[1;35m"
11+
CYAN="\033[1;36m"
12+
RESET="$(tput sgr0)"
13+
###################################################################################
14+
15+
printf "${BLUE}"
316
cat << EOF
417
518
###################################################################################
@@ -10,11 +23,17 @@ cat << EOF
1023
###################################################################################
1124
1225
EOF
26+
printf "${RESET}"
1327

14-
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; }
28+
printf "${BLUE}>>>>>>>> install jdk8\n${RESET}"
1529

16-
echo -e "\n>>>>>>>>> install jdk8"
30+
command -v yum >/dev/null 2>&1 || {
31+
printf "${RED}Require yum but it's not installed. Aborting.\n${RESET}"
32+
echo >&2 "Require yum but it's not installed. Aborting.";
33+
exit 1;
34+
}
1735

18-
yum -y install java-1.8.0-openjdk.x86_64
1936
yum -y install java-1.8.0-openjdk-devel.x86_64
2037
java -version
38+
39+
printf "${GREEN}<<<<<<<< install jdk8 finished\n${RESET}"

codes/linux/soft/mysql-install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
4+
5+
sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
6+
sudo yum install mysql-community-server

codes/linux/soft/redis-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ if [[ -n $3 ]]; then
3232
port=$3
3333
fi
3434

35-
password=123456
35+
password=
3636
if [[ -n $4 ]]; then
37-
path=$4
37+
password=$4
3838
fi
3939

4040
echo "Current execution: install redis ${version} to ${root}, service port = ${port}, password = ${password}"

codes/linux/soft/zsh-install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O -
2121
# 替换 oh-my-zsh 主题
2222
sed -i "s#^ZSH_THEME=.*#ZSH_THEME=\"ys\"#g" ~/.zshrc
2323
# 下载 incr.zsh 补全插件
24-
wget http://mimosa-pudica.net/src/incr-0.2.zsh
24+
wget http://mimosa-pudica.net/src/incr-0.2cd.zsh
25+
mkdir ~/.oh-my-zsh/plugins/incr/
2526
mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/
2627
echo "source ~/.oh-my-zsh/plugins/incr/incr*.zsh" >> ~/.zshrc
2728

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,14 @@ EOF
242242
# 获取CPU/内存占用TOP10
243243
get_process_top_info() {
244244

245-
top_title=$(top -b n1|head -7|tail -1)
246-
cpu_top10=$(top b -n1 | head -17 | tail -11)
247-
mem_top10=$(top -b n1|head -17|tail -10|sort -k10 -r)
245+
top_title=$(top -b n1 | head -7 | tail -1)
246+
cpu_top10=$(top -b n1 | head -17 | tail -11)
247+
mem_top10=$(top -b n1 | head -17 | tail -10 | sort -k10 -r)
248248

249249
cat << EOF
250250
【TOP10】
251251
CPU占用TOP10:
252252
253-
${top_title}
254253
${cpu_top10}
255254
256255
内存占用TOP10:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
user='root'
4+
password='xxxxxx'
5+
database='test'
6+
7+
for f in `ls */*.sql`
8+
do
9+
echo ${f};
10+
mysql -u${user} -p${password} -f ${database} -e "source $f";
11+
done
12+
echo 'OK!'

scripts/gitpush.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
22

33
cd ..
4-
git push origin master
5-
git push second master
4+
git push github master
5+
git push gitee master

0 commit comments

Comments
 (0)