Category: 未分类
SVN迁移到git服务器
SimApp Maker 指令
centos初始化安装无网络处理
1.将/etc/sysconfig/network-scripts/ifcfg-ens33 文件中的ONBOOT改为yes保存并退出
vi /etc/sysconfig/network-scripts/ifcfg-ens33
按下insert
修改后按下esc
输入 :wq
2.service network restart
3.查看IP信息
ip addr
4.NetworkService 自动启动
systemctl enable NetworkManager-wait-online.service
Lombok 常用的注解
此文用于介绍lombok的常用用法,例如@NonNull,@Cleanup等等。
Centos 服务器Nginx优化
1.查看当前centos的cpu 信息及内存信息
[root@localhost ~]# cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c
8 Intel(R) Xeon(R) CPU E7-4809 v4 @ 2.10GHz
[root@localhost ~]# cat /proc/cpuinfo | grep "physical"| sort |uniq -c
8 address sizes : 42 bits physical, 48 bits virtual
4 physical id : 0
4 physical id : 1
[root@localhost ~]# getconf LONG_BIT
64
[root@localhost ~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E7-4809 v4 @ 2.10GHz
stepping : 1
microcode : 0xb00001f
cpu MHz : 2094.952
cache size : 20480 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 20
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb invpcid_single fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt dtherm arat pln pts
bogomips : 4189.90
clflush size : 64
cache_alignment : 64
address sizes : 42 bits physical, 48 bits virtual
power management:
2.nginx CPU优化
服务器四核配置如下:
worker_processes 4;
worker_cpu_affinity 0001 0010 0100 1000;
八核如下:
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 1000000;
重启服务:
systemctl restart nginx
查看状态
systemctl status nginx.service
3.nginx 文件数优化 见 ulimit优化
worker_rlimit_nofile 65535;
4.Nginx事件处理模型
events {
use epoll;
worker_connections 65535;
multi_accept on;
}
世界,您好!
欢迎使用WordPress。这是您的第一篇文章。编辑或删除它,然后开始写作吧!
maven项目多模块打包
1.打包指定的模块
打包该模块,同步打包该模块的引用模块
mvn package -pl module_name -Pproduct -am
2.打包基类模块
打包该模块,同步打包引用该模块的模块
mvn package -pl module_name -Pproduct -amd
Linux 下替换”r “
在win下编辑的时候,换行结尾是rn ,而在linux下是n.
sed -i 's/r$//' XXXXX.sh
String 字符串替换’*’
/** * 实际替换动作 * * @param str str * @return */ public static String replaceAction(String str) { if(isEmpty(str)){ return ""; } String afterReplaced = ""; int nameLength = str.length(); if (nameLength < 3 && nameLength > 0) { if (nameLength == 1) { afterReplaced = "*"; } else { afterReplaced = str.substring(0,1)+"*"; } } else { Integer num1, num2, num3; num2 = (new Double(Math.ceil(new Double(nameLength) / 3))).intValue(); num1 = (new Double(Math.floor(new Double(nameLength) / 3))).intValue(); num3 = nameLength - num1 - num2; String star = org.apache.commons.lang3.StringUtils.repeat("*", num2); afterReplaced = str.replaceAll("(.{" + num1 + "})(.{" + num2 + "})(.{" + num3 + "})", "$1" + star + "$3"); } return afterReplaced; }