常用命令:
2>&1| tee um.log //生成编译日志
//打印文件目录
find -type d > ../dir.txt
samba配置:
sudo apt-get install samba samba-common
sudo mkdir /home/XXX/share
sudo chmod 777 /home/XXX/share
sudo smbpasswd -a XXX
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo vim /etc/samba/smb.conf
testparm //samba报错
[XXX]
comment = xxx guest share
path = /home/ssd4/xxx
public = yes
writable = yes
browseable = yes
read only = no
directory mask = 0777
create mask = 0777
valid users = xxx
write list = xxx
available = yes
security=share
配置jdk
1.安装Java 11
sudo apt install openjdk-11-jdk
2.添加jdk版本到切换列表
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-11-openjdk-amd64/bin/java1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1
//注意:/usr/lib/jvm/java-11-openjdk-amd64/bin/java表示jdk安装路径,1表示优先级,可以为任意数字
3.运行以下命令列出所有jdk可选版本
sudo update-alternatives --config java
sudo update-alternatives --config javac
键入数字以选择默认JDK,*标识当前默认jdk版本
4.vim /etc/profile 将JAVA_HOME地址改成新选择的jdk安装路径
5.终端执行命令:source /etc/profile,使文件生效
6.终端输入运行java -version和javac -version命令来检查默认的JDK
服务器挂载磁盘
sudo fdisk -l 查看磁盘
sudo mkfs -t ext4 /dev/* 格式化磁盘
sudo blkid //查看uuid
复制UUID:***值
eab9ef36-857e-4fb1-9b70-f7efaf10619f
sudo mkdir 在home目录下创建挂载的目录 如ssd1
sudo mount -t ext4 /dev/nvme0n1 ssd1/ 挂载
sudo vim /etc/fstab
/dev/disk/by-uuid/eab9ef36-857e-4fb1-9b70-f7efaf10619f /home/ssd1 auto nosuid,nodev,nofail 0 0
UUID=261453a5-c071-47cc-83ef-7a45a241868f / ext4 errors=remount-ro 0 1
gerrit服务器管理:
ssh -p 29418 192.168.8.*** gerrit show-queue -w
服务器线程
cat /proc/cpuinfo | grep -i 'processor' | wc -l
Ubuntu 18.04环境配置
sudo apt-get install openjdk-8-jdk
sudo apt-get install libtool openssh-server samba git-core g++ make gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev lib32z1 lib32ncurses5 x11proto-core-dev libx11-dev libreadline-gplv2-dev lib32z1-dev libgl1-mesa-dev g++-multilib binutils-mingw-w64 tofrodos python-markdown libxml2-utils xsltproc genisoimage python-pil bc
另外,还需要把下面这些环境变量加到相应的profile中
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
sudo apt-get install libssl-dev //最后需要添加的一句话