bash

Linux运维之shell脚本

倖福魔咒の 提交于 2021-02-15 13:05:27
一、bash漏洞 1)bash漏洞 bash漏洞是控制Linux计算机命令提示符的软件中存在的漏洞。 bash是一个为GNU计划编写的Unix shell。它的名字是一系列缩写:Bourne-Again SHell ,Bourne shell是一个早期的重要shell, 由史蒂夫·伯恩在1978年前后编写,并同Version 7 Unix一起发布。 网络安全专家警告称,开源软件Linux中一个频繁使用的片段"Bash",发现存在安全漏洞, 其对计算机用户造成的威胁可能要超过2014年4月爆出的"心脏出血"(Heartbleed)漏洞 2)漏洞原理 Bash是用于控制Linux计算机命令提示符的软件。网络安全专家表示,黑客可以利用Bash中的一个安全漏洞,对目标计算机系统进行完全控制。 网络安全公司Trail of Bits的首席执行官丹·吉多(Dan Guido)指出:"与Heartbleed"相比,后者只允许黑客窥探计算机, 但不会让黑客获得计算机的控制权。"他说:"利用Bash漏洞的方法也简单得多,你可以直接剪切和粘贴一行软件代码,就能取得很好的效果。" 吉多还表示,他正考虑将自己公司非必要的服务器断网,以保护他们不会受到Bash漏洞的攻击,直到他能够修补这一漏洞为止。 网络安全公司Rapid7的工程经理托德·比尔兹利(Tod Beardsley)则警告称

[oracle]linux oracle rac 搭建全过程

孤街醉人 提交于 2021-02-15 12:31:01
Step by step Deploy Oracle 11gR2 RAC+Active Dataguard QQ:908601287 Http://www.cnblogs.com/flymaster500.cn p Step y by p step l Install e Oracle 11gR2(11.2.0.3.0) RAC e +Active d Dataguard n on Oracle e Enterprise Linux(OEL 5 5.5 X86_64) 1 1 1 概述和说明 1 1.1 概述 本文档用于详细记录在 OEL 5.5 X86_64 位系统上 安装配置 e Oracle 11gR2(11.2.0.3.0) RAC 的步骤、 RAC 数据库的基本维护、为 RAC 创建单实例 e Active l Physical Dataguard、 验证 e Active Dataguard 的功能、 RAC 主库同单实例物理备库的角色转换等内容。 安装平台选择 VMware 公司的VMware ESXi Version 4.0 的虚拟主机,通过在该虚拟机 上配置两台 OEL 5.5 X86_64 位 Linux 系统的机器,然后在这两台 Linux 机器上配置 Oracle 11gR2 RAC 系统。其中,操作系统选择Oracle 公司的 OEL 5.5 X86_64

“${0%/*}” and “${0##*/}” in sh [duplicate]

大憨熊 提交于 2021-02-15 11:56:15
问题 This question already has answers here : Bash: manipulating with strings (percent sign) (1 answer) What is the meaning of the ${0##…} syntax with variable, braces and hash character in bash? (3 answers) Closed 15 days ago . These are excerpts from a brew command. BREW_FILE_DIRECTORY=$(chdir "${0%/*}" && pwd -P) export HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/${0##*/}" What do ${0%/*} and ${0##*/} mean in shell? 回答1: These are shell parameter expansions: ${var%/*} - remove everything after the

docker搭建elk

房东的猫 提交于 2021-02-15 11:05:32
docker run -d -p 5601:5601 -p 9200:9200 -p 5044:5044 -v /opt/data/elk-data:/var/lib/elasticsearch --name elk sebp/elk 1.运行完后报错: max virtual memory areas vm.max_map_count [26214] is too low, increase to at least [262144] 这是因为elasticsearch用户拥有的内存权限太小,至少需要262144。 执行 sysctl -a|grep vm.max_map_count 显示: vm.max_map_count = 26214 使用命令修改: sysctl -w vm.max_map_count=262144 然后在 /etc/sysctl.conf文件最后添加一行 vm.max_map_count=262144。 使用docker ps 查看是否在运行,使用docker images找到本地镜像,使用 docker start [imageId] 运行已存在的镜像。(docker run 生成镜像) 2. 访问elk。(我的虚拟机ip是192.168.1.90) 2.1 5601端口查看Kibana: http://192.168.1.90:5601/ 2.2 es

bash removing part of a file name

和自甴很熟 提交于 2021-02-15 11:01:24
问题 I have the following files in the following format: $ ls CombinedReports_LLL-*'('*.csv CombinedReports_LLL-20140211144020(Untitled_1).csv CombinedReports_LLL-20140211144020(Untitled_11).csv CombinedReports_LLL-20140211144020(Untitled_110).csv CombinedReports_LLL-20140211144020(Untitled_111).csv CombinedReports_LLL-20140211144020(Untitled_12).csv CombinedReports_LLL-20140211144020(Untitled_13).csv CombinedReports_LLL-20140211144020(Untitled_14).csv CombinedReports_LLL-20140211144020(Untitled

bash removing part of a file name

眉间皱痕 提交于 2021-02-15 11:01:11
问题 I have the following files in the following format: $ ls CombinedReports_LLL-*'('*.csv CombinedReports_LLL-20140211144020(Untitled_1).csv CombinedReports_LLL-20140211144020(Untitled_11).csv CombinedReports_LLL-20140211144020(Untitled_110).csv CombinedReports_LLL-20140211144020(Untitled_111).csv CombinedReports_LLL-20140211144020(Untitled_12).csv CombinedReports_LLL-20140211144020(Untitled_13).csv CombinedReports_LLL-20140211144020(Untitled_14).csv CombinedReports_LLL-20140211144020(Untitled

Add Column to end of CSV file using 'awk' in BASH script

我们两清 提交于 2021-02-15 10:49:15
问题 How do you add a column to the end of a CSV file with using a string in a variable? input.csv 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 output.csv 2012-02-29,01:00:00,Manhattan,New York,234,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhattan,New York,843,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhattan,New York,472,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhattan

How can I run bash in a new container of a docker image?

て烟熏妆下的殇ゞ 提交于 2021-02-15 08:38:04
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

雨燕双飞 提交于 2021-02-15 08:37:14
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

北城以北 提交于 2021-02-15 08:36:13
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root