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

2017年11月6日 星期一

CVS安裝


apt-get install cvs

apt-get install xinetd

mkdir /cvs

cvs -d /cvs init

cd /etc/xinetd.d/

vim cvspserver

service cvspserver
 {
 port = 2401
 socket_type = stream
 protocol = tcp
 user = root
 wait = no
 type = UNLISTED
 server = /usr/bin/cvs
 server_args = -f --allow-root /cvs pserver
 disable = no
 }


/etc/init.d/xinetd restart

 netstat -tap | grep cvs

cd /cvs/CVSROOT

vim passwd

vim writer

groupadd cvs

useradd -g cvs -s /sbin/nologin cvsroot

chown -R cvsroot:cvs /cvs

chmod -R 775 /cvs

--

passwd.pl
#!/usr/bin/perl
rand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);
print "${crypttext} \n";

----
client 端抓中文檔名會炸掉

https://timyau18.blogspot.tw/2015/05/tortoisecvs.html

要把 CVSNT 換回 2.5.0.3 以前版本

https://github.com/todace/G-CVSNT/blob/master/cvsnt/tortoiseCVS/TortoiseCVS/src/CvsNt/cvsnt-2.5.03.2382.msi