上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 55 下一页
摘要: function中的变量默认是global,必须显式加关键字 local 才能定义为局部变量 #!/bin/bash function f1() { b=88888 } function f2() { echo $b } f1 f2 #!/bin/bash function f1() { local 阅读全文
posted @ 2020-12-10 11:05 ascertain 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 要与Linux交互,脚本获取键盘输入的结果是必不可少的,read可以读取键盘输入的字符。 read [-rs] [-a ARRAY] [-d delim] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [var_name1 var_name2 .. 阅读全文
posted @ 2020-12-09 18:18 ascertain 阅读(622) 评论(0) 推荐(0) 编辑
摘要: : 是shell 内建命令,等同于 true type -at : 返回值 为 NULL , exit code 为 0 作为分隔符PATH /etc/passwd 清空文本内容 :>file 原理为先运行 :,返回值为NULL,redirect至 file等同于 true>file >file 占 阅读全文
posted @ 2020-12-09 11:47 ascertain 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 关闭二进制日志并导入sql mysql -e 'set session sql_log_bin=0;\. ~/b.sql' \. 不能替换成source 阅读全文
posted @ 2020-12-06 23:22 ascertain 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 开机,新增加硬盘后,系统内并不会查看到新增硬盘,在不重启的情况下,就需要出发内核重新扫描总线来识别新增硬盘了 VMware新添加一块5G硬盘 查看现有硬盘挂载的适配器 ll /sys/block/sda 可以根据连接路径查看sda硬盘的相关信息 ll /sys/devices/pci0000:00/ 阅读全文
posted @ 2020-12-06 14:12 ascertain 阅读(1922) 评论(0) 推荐(0) 编辑
摘要: proxy_pass可以实现URL路径的替换,跟alias很像proxy_pass,不带 "/" 时,只代理域名,URI(包括query_string)不改变,URI直接附加到proxy_pass指定的域名proxy_pass,后跟 "/" 时,会把location匹配的部分完全删除后,附加于pro 阅读全文
posted @ 2020-12-06 13:30 ascertain 阅读(95) 评论(0) 推荐(0) 编辑
摘要: printf %s作为字符串打印时, %4.2s "."前面表示宽度,后面表示显示几个字符 阅读全文
posted @ 2020-12-06 12:25 ascertain 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 路径和密码等相关变量根据实际情况修改,经过验证,数据量不大可用 全量脚本 #!/bin/env bash full_dir=/opt incremental_dir=/opt log_file=/opt/full_backup.log commence=$(date +%s) mysqldump - 阅读全文
posted @ 2020-12-06 01:52 ascertain 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 数据目录文件解释 -rw-r . 1 mysql mysql 56 11月 16 16:56 auto.cnf -rw-r . 1 mysql mysql 0 11月 16 17:00 binlog.index -rw . 1 mysql mysql 1680 11月 16 16:56 ca-key 阅读全文
posted @ 2020-12-05 21:19 ascertain 阅读(796) 评论(0) 推荐(0) 编辑
摘要: 数据字典(Data Dictionary)中存储了诸多数据库的元数据信息如图1所示,包括基本Database, table, index, column, function, trigger, procedure,privilege等;以及与存储引擎相关的元数据,如InnoDB的tablespace 阅读全文
posted @ 2020-12-05 21:13 ascertain 阅读(1140) 评论(0) 推荐(1) 编辑
摘要: ### 大坑 VIP 要设置成32位掩码,否则BACKUP无法ping通 ### broadcast 也不一样 man keepalived man keepalived.conf keepalived vrrp 虚拟路由器冗余协议 ( Virtual Router Redundancy Proto 阅读全文
posted @ 2020-12-05 15:48 ascertain 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 现象:通过VPN client基于 L2TP/IPSEC 连接到内网后,访问内网服务器网页延迟很大solution:通过在防火墙进行报文分析,每次从WEB服务器过来的数据包大小为1500,再叠加L2TP/IPSEC包头后数据部均大于1500,而网络设备MTU几乎都为1500,因此需要对数据包进行分包 阅读全文
posted @ 2020-12-04 15:51 ascertain 阅读(850) 评论(0) 推荐(0) 编辑
摘要: rewrite模块即ngx_http_rewrite_module模块,主要功能是改写请求URI,是Nginx默认安装的模块。rewrite模块会根据PCRE正则匹配重写URI,然后发起内部跳转再匹配location,或者直接做30x重定向返回客户端。 指令执行顺序 首先顺序执行server块中的r 阅读全文
posted @ 2020-12-04 14:33 ascertain 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 在开始处理一个http请求时,nginx会取出header头中的host,与nginx.conf中每个server的server_name进行匹配,以此决定到底由哪一个server块来处理这个请求。 server_name与host匹配优先级如下: 1、完全匹配 2、通配符在前的,如*.test.c 阅读全文
posted @ 2020-12-02 19:19 ascertain 阅读(330) 评论(0) 推荐(0) 编辑
摘要: Usage函数 function Usage() { cat <<-delimiter Usage: command [-x] [-v] [-z] [files] A short explanation of the operation goese here It might be a few li 阅读全文
posted @ 2020-12-02 15:24 ascertain 阅读(94) 评论(0) 推荐(0) 编辑
摘要: RANDOM 0-32767 2^15-1 $((RANDOM%91+10)) $[$RANDOM%91+10] /etc/rc.d/rc.local 设置全局开机启动选项 四种过滤空格和注释方法: grep -v '^#\|^$' sudo.conf grep -v -e '^#' -e '^$' 阅读全文
posted @ 2020-12-02 01:29 ascertain 阅读(870) 评论(0) 推荐(0) 编辑
摘要: $ echo $- himBH 1、himBH这个结果又是什么意思? 2、看不懂,求第69行详解。多谢++ for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" els 阅读全文
posted @ 2020-12-01 14:59 ascertain 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 1、bash的POSIX标准 在一般的linux系统当中(如redhat), 使用sh调用执行脚本相当于打开了bash的POSIX标准模式 (等效于bash的 --posix 参数) 一般的,sh是bash的“子集” (不是子集的部分,具体区别见下的“Things sh has that bash 阅读全文
posted @ 2020-12-01 14:46 ascertain 阅读(403) 评论(0) 推荐(0) 编辑
摘要: https://github.com/datacharmer/test_db 阅读全文
posted @ 2020-11-30 18:07 ascertain 阅读(652) 评论(0) 推荐(0) 编辑
摘要: httpd 2.4.9 + mysql-5.5.33 + php-5.4.26编译安装过程: 一、编译安装apache 1、解决依赖关系 httpd-2.4.9需要较新版本的apr和apr-util,因此需要事先对其进行升级。升级方式有两种,一种是通过源代码编译安装,一种是直接升级rpm包。这里选择 阅读全文
posted @ 2020-11-29 12:57 ascertain 阅读(291) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 55 下一页