2017年11月17日 星期五

CentOS 7 Template



/etc/sysconfig/network-scripts/ifcfg-ens192

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens192
UUID=def51bb3-2ad1-4f29-b82f-44d8f9417a19
DEVICE=ens192
ONBOOT=yes



/etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

好像要把IPV6抓掉還要改別的地方
https://www.linuxquestions.org/questions/linux-software-2/cenos-7-3-rpcbind-4175596401/

In CentOS 7 it appears you cannot successfully disable IPv6 via sysctl; the INET6 AF is still leaking somehow and applications will attempt to use it. The correct way to disable IPv6 and avoid this issue with rpcbind is the following:


edit /etc/default/grub

add ipv6.disable=1 to GRUB_CMDLINE_LINUX

sudo /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg

reboot

RPCBIND 爛了的話會讓 NFS 一直開不起來


改IP的工具 ( NetworkManager 的 文字版本) 
yum install NetworkManager-tui

nmtui


-------------------------------------

https://www.phpini.com/linux/centos-7-network-interface-name


CentOS 7 修改網卡名稱 Eno* 成 Eth0

在 RHEL 及 CentOS 7 開始, 網卡的預設名稱由以往的 Ethx 改成 Enox, 以下文章會介紹將 CentOS 7 網卡名稱修改, 用回 Eth0 的方法。
首先開啟檔案 “/etc/sysconfig/grub” 修改設定:
# vi /etc/sysconfig/grub
內容大概是這樣:
裡面其中一行是 GRUB_CMDLINE_LINUX, 在這行結尾的雙引號前加上這句:
net.ifnames=0 biosdevname=0
要留意, 加上以上一行資料前, 要先加上一個空格, 整行修改後是這樣:

然後用 grub2-mkconfig 指令重新建立 GRUB 的設定檔:
# grub2-mkconfig -o /boot/grub2/grub.cfg
接著要將 Eno 網卡的設定檔用 mv 改名為 eth0:
# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0
編輯 /etc/sysconfig/network-scripts/ifcfg-eth0 檔案, 找到 “Name” 的一行, 改成 eth0, 全句是這樣:
NAME=eth0
​最後重新啟動系統便會生效, 要確認修改成功, 可以用 ifconfig 指令確認。
--------------------------------


Firewalld 相關路徑
/etc/firewalld:設定檔路徑
/usr/bin/:firewall-cmd 指令所在的位置
/usr/lib/firewalld/:firewalld 預設的設定資料 (xml 格式),例如 nfs.xml 就定義了 <port protocol="tcp" port="2049"/>
-------------------------------


------------------------------

2017年11月15日 星期三

ldconfig


**ldconfig 去找/libx32 的問題

linux:/ # grep -r '/libx32' /
linux:/ # grep -r 'libx32' /etc/
linux:/ # grep -r 'libx32' /lib
linux:/ # grep -r 'libx32' /lib64/
linux:/ # grep -r 'libx32' /usr/lib
linux:/ # grep -r 'libx32' /usr

找找看在哪裡用到


http://man.linuxde.net/ldconfig

ldconfig几个需要注意的地方: 往/lib和/usr/lib里面加东西,是不用修改/etc/ld.so.conf的,但是完了之后要调一下ldconfig,不然这个library会找不到。

 想往上面两个目录以外加东西的时候,一定要修改/etc/ld.so.conf,然后再调用ldconfig,不然也会找不到。

 比如安装了一个mysql到/usr/local/mysql,mysql有一大堆library在/usr/local/mysql/lib下面,这时就需要在/etc/ld.so.conf下面加一行/usr/local/mysql/lib,

保存过后ldconfig一下,新的library才能在程序运行时被找到。 

如果想在这两个目录以外放lib,但是又不想在/etc/ld.so.conf中加东西(或者是没有权限加东西)。那也可以,就是export一个全局变量LD_LIBRARY_PATH,然后运行程序的时候就会去这个目录中找library。一般来讲这只是一种临时的解决方案,在没有权限或临时需要的时候使用。 

ldconfig做的这些东西都与运行程序时有关,跟编译时一点关系都没有。编译的时候还是该加-L就得加,不要混淆了。

 总之,就是不管做了什么关于library的变动后,最好都ldconfig一下,不然会出现一些意想不到的结果。不会花太多的时间,但是会省很多的事。 

再有,诸如libdb-4.3.so文件头中是会含有库名相关的信息的(即含“libdb-4.3.so”,可用strings命令察看),因此仅通过修改文件名以冒充某已被识别的库(如libdb-4.8.so)是行不通的。为此可在编译库的Makefile中直接修改配置信息,指定特别的库名。

来自: http://man.linuxde.net/ldconfig



2017年11月13日 星期一

ksh


KSH Basic

http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html


Parameter

http://osr600doc.sco.com/en/SHL_automate/_Passing_to_shell_script.html

$*
Returns a single string (``$1, $2 ... $n'') comprising all of the positional parameters separated by the internal field separator character (defined by the IFSenvironment variable).

$@
Returns a sequence of strings (``$1'', ``$2'', ... ``$n'') wherein each positional parameter remains separate from the others.

$1, $2 ... $n
Refers to a numbered argument to the script, where n is the position of the argument on the command line. In the Korn shell you can refer directly to arguments where n is greater than 9 using braces. For example, to refer to the 57th positional parameter, use the notation ${57}. In the other shells, to refer to parameters with numbers greater than 9, use the shift command; this shifts the parameter list to the left. $1 is lost, while $2 becomes $1, $3 becomes $2, and so on. The inaccessible tenth parameter becomes $9 and can then be referred to.

$0
Refers to the name of the script itself.

$#
Refers to the number of arguments specified on a command line.




2017年11月10日 星期五

AIX LinuxTools 相關問題

下載點

https://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html


用 Gnuls

可是原生的 more 處理色碼會有問題

可以用 GNULS 裡的 less 處理

裝在 /opt/freeware/bin/less

https://major.io/2013/05/21/handling-terminal-color-escape-sequences-in-less/

可以用 -R 處理色碼

~/.profile 
/etc/csh.cshrc

alias ls '/usr/linux/bin/ls --color'
alias less='/opt/freeware/bin/less -R'
alias more='less'

2017年11月8日 星期三

RedHAt Directory server

https://access.redhat.com/documentation/en-us/red_hat_directory_server/10/html/administration_guide/common_usage#System_Requirements