file

spring boot 2.0特性之profile与日志

01-01
profile 简介 profile提供了应用的隔离,使其在某种特定的环境下才能生效,任何的@Component与@Configuration能够被@Profile标记限制其何时加载,如下代码所示: @Configuration @Profile("production") public class ProductionConfiguration { // ... } 通常情况下,spring可以使用spring.profiles.active Environment 去指定哪一个pr

spring boot 2.0特性之外部化配置

01-01
简介 spring boot允许你外部化其配置以便你能够在不同的环境中使用相同的代码.可以通过使用properties,YAML 文件,环境变量,以及命名行参数等形式外部化其配置.属性值可以通过@value的形式直接注入到bean中去(其通过spring 的抽象或者是通过使用@ConfigurationProperties绑定其结构化对象) spring boot使用了一种特别的 PropertySource允许你覆盖其值,其覆盖顺序如下: 1. devtools的环境变量被设置,则优先使用(其

21.4. logstash 配置项

01-01
21.4.1. input 21.4.1.1. 标准输入输出 [email protected] ~ % /usr/share/logstash/bin/logstash -e "input {stdin{}} output {stdout{}}" Helloworld ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the c

18.3. zabbix-java-gateway - Zabbix java gateway

01-01
yum install -y zabbix-java-gateway zabbix-java-gateway 包所含内容如下 # rpm -ql zabbix-java-gateway /etc/zabbix/zabbix_java_gateway.conf /usr/lib/systemd/system/zabbix-java-gateway.service /usr/sbin/zabbix_java_gateway /usr/share/zabbix-java-gateway /usr/sh

12.2. mcelog - Decode kernel machine check log on x86 machines

01-01
$ sudo apt-get install mcelog Decode machine check ASCII output from kernel logs Options: --cpu CPU Set CPU type CPU to decode (see below for valid types) --cpumhz MHZ Set CPU Mhz to decode time (output unreliable, not needed on new kernels) --raw (w

第 8 章 Service

01-01
目录 8.1. NFS 8.1.1. nfsstat 8.1.2. nfswatch 8.2. apachetop 8.1. NFS 8.1.1. nfsstat [email protected]:~$ nfsstat Client rpc stats: calls retrans authrefrsh 1453045225 19702 744 Client nfs v3: null getattr setattr lookup access readlink 0 0% 114943957 8% 3486

第 5 章 lsof - list open files 文件监控

01-01
lsof - list open files 目录 5.1. $$ 5.2. 监控文件系统 5.3. 设备文件 5.4. 用户监控 5.5. 监控进程 5.6. 监控网络 5.7. lsof 高级用法 5.8. 根据文件描述列出对应的文件信息 Command.PID 和 User 列分别表示进程的名称 进程标识符 (PID) 和所有者名称. FD: 文件描述符,应用程序通过文件描述符识别该文件.如cwd txt等 (1) cwd : current working directory 应用程序的

8.3. log file

01-01
log file $ sudo vim /etc/default/varnishlog VARNISHLOG_ENABLED=1 $ sudo /etc/init.d/varnishlog start * Starting HTTP accelerator log deamon [ OK ] $ sudo vim /etc/default/varnishncsa VARNISHNCSA_ENABLED=1 $ sudo /etc/init.d/varnishncsa start * Starti

7.3. php.ini

01-01
7.3.1. Resource Limits Resource Limits ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing

第 7 章 Web Server Optimization

01-01
目录 7.1. ulimit 7.1.1. open files 7.2. khttpd 7.3. php.ini 7.3.1. Resource Limits 7.3.2. File Uploads 7.3.3. Session Shared 7.3.4. PATHINFO 7.4. APC Cache (php-apc - APC (Alternative PHP Cache) module for PHP 5) 7.5. Zend Optimizer 7.6. eaccelerator 系

5.3. resin.conf

01-01
5.3.1. Maximum number of threads Maximum number of threads. <thread-max>4096</thread-max> thread-max数值需要使用ab命令做压力测试,逐步调整. 5.3.2. Configures the keepalive <!-- Configures the keepalive --> <keepalive-max>128</keepalive-max> &l

第 3 章 sqlmap - automatic SQL injection and database takeover tool

01-01
目录 3.1. Installation 3.2. 开始入住实验 3.2.1. 测试脚本 3.2.2. sqlmap.ini 3.3. Request参数 3.3.1. --method, --data 3.3.2. --cookie 3.3.3. --referer 3.3.4. --user-agent 3.3.4.1. -a 3.3.5. --headers 3.3.6. --referer 3.3.7. auth 3.3.7.1. --auth-type 3.3.7.2. --auth-

2.5. ngrep - Network layer grep tool

01-01
安装 yum install -y ngrep 帮助信息 # ngrep -help usage: ngrep <-hNXViwqpevxlDtTRM> <-IO pcap_dump> <-n num> <-d dev> <-A num> <-s snaplen> <-S limitlen> <-W normal|byline|single|none> <-c cols> <-P char&g

8.2. tput

01-01
为输出着色 tput Color Capabilities: tput setab [1-7] – Set a background color using ANSI escape tput setb [1-7] – Set a background color tput setaf [1-7] – Set a foreground color using ANSI escape tput setf [1-7] – Set a foreground color tput Text Mode Ca

5.9. sort - sort lines of text files

01-01
$ du -s * | sort -k1,1rn $ rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n $ dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n 5.9.1. 对列排序 sort -k 具体说来, 你可以使用 -k1,1 来对第一列排序, -k1来对全行排序 # sort -t ':' -k 1 /etc/passwd ort -n -t ' '

5.8. grep, egrep, fgrep, rgrep - print lines matching a pattern

01-01
5.8.1. 删除空行 $ cat file | grep '.' 5.8.2. -v, --invert-match grep -v "grep" [[email protected] ~]# ps ax | grep httpd 6284 ? Ss 0:10 /usr/local/httpd-2.2.14/bin/httpd -k start 8372 ? S 0:00 perl ./wrapper.pl -chdir -name httpd -class com.caucho.se

5.4. package / compress and decompress

01-01
5.4.1. tar - The GNU version of the tar archiving utility 5.4.1.1. tar examples tar tar -cvf foo.tar foo/ tar contents of folder foo in foo.tar tar -xvf foo.tar extract foo.tar 5.4.1.2. gunzip tar -zcvf foo.tar foo/ tar contents of folder foo in foo.

5.3. Directory and File System Related

01-01
5.3.1. dirname $ dirname /usr/bin/find /usr/bin 5.3.2. filename $ basename /usr/bin/find find 5.3.2.1. 排除扩展名 file=test.txt b=${file%.*} echo $b $ for file in *.JPG;do mv $file ${file%.*}.jpg;done 5.3.2.2. 取扩展名 file=test.txt b=${file##*.} echo $b 5.3.

2.3. Starting file

01-01
2.3.1. ~/.zshrc [email protected]:~$ cat .zshrc # Created by newuser for 4.3.9 PROMPT='%[email protected]%M:%~$ ' # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then eval "`dircolors -b`" alias ls='ls --color=auto' alias dir=

1.5. Loops for, while and until

01-01
1.5.1. for #!/bin/bash for i in 1 2 3 4 5 do echo "Welcome $i times" done for i in $( ls ); do echo item: $i done for i in `seq 1 10`; do echo $i done for i in {1..5} do echo "Welcome $i times" done for (( c=1; c<=5; c++ )) do echo