CenterOS下安装jenkins
1.安装 jenkins 通过下载镜像安装
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
yum --disablerepo=pgdg94 install epel-release # repository that provides 'daemonize'
yum --disablerepo=pgdg94 install java-11-openjdk-devel
# 在线安装
yum --disablerepo=pgdg94 install -y jenkins
# 或 离线rpm安装
https://github.com/jenkinsci/jenkins/releases
rpm -ivh jenkins-2.313-1.1.noarch.rpm
2. 配置端口
vi /etc/sysconfig/jenkins
---- ...
搭建maven私库
前言
有三种比较流行的 Maven 仓库管理软件可以创建私服,Apache基金会的 Archiva,JFrog 的 Artifactory ,Sonatypec 的 Nexus
下载Nexus
下载
启动命令
./nexus start
默认账号密码
帐号:admin,密码:位于登录页面提示文件夹
添加新的代理源
Cache统一设置为200天 288000
常用代理添加
1. aliyun
http://maven.aliyun.com/nexus/content/groups/public
2. apache_snapshot
https://repository.apache.org/content/repositories/snapshots/
3. apache_release
https://repository.apache.org/content/repositories/releases/
4. atlassian
https://maven.atlassian.com/content/repositories/atlassian-public/
5. central ...
在CenterOS中安装minio文件服务器
下载与启动
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x minio
./minio server /home/data
启动后会打印出AccessKey和SecretKey等信息
后台运行
nohup /usr/local/bin/minio server /home/minio/data > /home/minio/data/minio.log 2>&1 &
自定义MINIO_ACCESS_KEY和MINIO_SECRET_KEY
export MINIO_ACCESS_KEY=miniouser
export MINIO_SECRET_KEY=123456789
./minio server /home/data
自定义端口号
# 启动
./minio server --address IP:PORT /home/data
# 文件夹路径
export MINIO_VOLUMES="/home/minio/data"
# 后台启动
nohup ./ ...
java8 lamdba使用示例
使用示例
首先将下方附录中json数据转换为List,使用的是hutool中的JSONUtil工具类
List<Demo> personList = JSONUtil.toList(JSONUtil.parseArray(json), Demo.class);
主键
姓名
分数
课程名称
教师名称
1
张三
56
语文
语教一
2
张三
78
数学
数教一
3
李四
99
语文
语教一
4
李四
23
数学
数教二
5
王五
87
语文
语教一
6
王五
59
数学
数教一
7
王五
65
英语
英教一
条件过滤
// 过滤分数大于60的学生
List<Demo> filterPersonList = personList.stream().filter(a -> a.getScore() > 60).collect(Collectors.toList());
主键
姓名
分数
课程名称
教师名称
2
张三
78
数学
数教一
3
李四
99
语文
语教一
5
王五
87
语文
语教 ...
使用mac制作linux启动盘
查看u盘
diskutil list
解挂u盘
diskutil unmountDisk /dev/disk3
写系统到u盘
sudo dd if=/Users/chenqi/Downloads/CentOS-7-x86_64-DVD-2009.iso of=/dev/rdisk3 bs=32m
在CenterOS中安装java
下载JDK
Java SE 8的官方网址
jdk下载路径 点击下载
解压文件
tar -xvf jdk-8u65-linux-x64.tar.gz
添加环境变量
echo " ">>/etc/profile
echo "# Made for java env by chenqi on $(date +%F)">>/etc/profile
echo 'export JAVA_HOME=/usr/local/java'>>/etc/profile
echo 'export JRE_HOME=${JAVA_HOME}/jre'>>/etc/profile
echo 'export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib'>>/etc/profile
echo 'export PATH=${JAVA_HOME}/bin:$PATH'>>/etc/profile
tail -4 /etc/profile
source /etc/profile
echo $PATH
环境变量 ...