Archive for the ‘linux solaris shell eda 以及工作相关’ Category

用x服务终端模拟软件(比如xmanager,HummingBird Exceed,WRQ Reflection x)登陆linux别忘了去掉.cshrc里的set DISPLAY相关语句

星期二, 八月 19th, 2008

用x服务终端模拟软件(比如xmanager,HummingBird Exceed,WRQ Reflection x)登陆linux别忘了去掉.cshrc里的set DISPLAY相关语句

比如 setenv  DISPLAY  192.168.1.6:0

若是设置了图形只会在那个ip的机器上显示.其他机器用软件登录会自动退出

阅读(20 次)

Bash 参数和参数扩展–$1($2,$3等)$*,$@,$#

星期五, 八月 15th, 2008

清单 3. 一个探究参数处理差别的函数

[ian@pinguino ~]$ type testfunc2
testfunc2 is a function
testfunc2 ()
{
echo “$# parameters”;
echo Using ‘$*’;
for p in $*;
do
echo “[$p]”;
done;
echo Using ‘”$*”‘;
for p in “$*”;
do
echo “[$p]”;
done;
echo Using ‘$@’;
for p in $@;
do
echo “[$p]”;
done;
echo Using ‘”$@”‘;
for p in “$@”;
do
echo “[$p]”;
done
}

使用 testfunc2 打印参数信息

[ian@pinguino ~]$ IFS=”|${IFS}” testfunc2 abc “a bc” “1 2
> 3″
3 parameters
Using $*
[abc]
[a]
[bc]
[1]
[2]
[3]
Using “$*”
[abc|a bc|1 2
3]
Using $@
[abc]
[a]
[bc]
[1]
[2]
[3]
Using “$@”
[abc]
[a bc]
[1 2
3]

$* 和 $@都是直接展开 参数中若有空格for就会隔开

“$*”是所有参数算一个词,比如像”123 sdfsdf asad tftf”,

“$@”是把所有参数一个个隔开, 比如”123 adsfdf” “asad tftf”

阅读(21 次)

我们这rhel4为了让windows用WRQ Reflection或xmanager通过x服务图形化登录,对/etc/X11/gdm/gdm.conf做的修改

星期四, 八月 14th, 2008

#AlwaysRestartServer=false   to       AlwaysRestartServer=true

AllowRemoteAutoLogin=false   to       AllowRemoteAutoLogin=true

#RetryDelay=1                to       RetryDelay=1

#UserMaxFile=65536           to       UserMaxFile=65536

#DisallowTCP=true            to       DisallowTCP=false

[xdmcp]
Enable=false            to     Enable=true
#HonorIndirect=true     to     HonorIndirect=true
#MaxPending=4           to     MaxPending=4
#MaxPendingIndirect=4   to     MaxPendingIndirect=4
#MaxSessions=16         to     MaxSessions=16
#MaxWait=15             to     MaxWait=15
#MaxWaitIndirect=15     to     MaxWaitIndirect=15
#DisplaysPerHost=2      to     DisplaysPerHost=4

阅读(33 次)

bash case 用法

星期四, 八月 14th, 2008

case “$j” in
“”)
echo “null”
exit 1
;;
a|b|c)
echo “a or b or c”
;;
d|e|f)
echo “d or e or f”
;;
*)
echo “other”
;;
esac

阅读(41 次)

别人用来检测solaris的脚本

星期四, 八月 14th, 2008

#!/bin/sh
DATE=`date ‘+%Y%m%d’`
mkdir -p /export/${DATE}
cd /export/${DATE}
format </dev/null > format.out
hostid > hostid.out
hostname > hostname.out
ifconfig -a > ifconfig.out
cat /etc/release > release.out
uname -a > uname.out
/usr/platform/sun4u/sbin/prtdiag -v > prtdiag.out
vmstat 2 5 > vmstat.out
egrep -i “warn|error|panic” /var/adm/messages.* >messages.out
iostat -xnd 2  5 >iostat.out
metadb -i > metadb.out
metastat > metastat.out
df -k > df.out
cat /etc/vfstab >vfsta.out
netstat -i >netstat.out

阅读(33 次)

rdesktop可以在命令里加入用户名和密码而不用远程登录后再输入

星期三, 八月 6th, 2008

rdesktop -u 用户名 -p 密码

阅读(24 次)

Ubuntu中启用root用户登录及相关问题的解决

星期六, 七月 19th, 2008

Ubuntu安 装后,root用户默认是被锁定了的,不允许登录,也不允许“su”到 root。有人说这是个不好的实践,特别是对于服务器来说。我觉得对于桌面用户来说,这样安全性更高一些,是应该的;但对于服务器可以设置成“允许 su 到root,但不允许root用户直接登录”。而我为了开发时的方便,则在桌面和服务器上都采用这种方式。

允许 su 到 root
非常简单,下面是设置的方法:
me@tipfoo:~$ sudo passwd
Password: <— 输入安装时那个用户的密码
Enter new UNIX password:  <— 新的Root用户密码
Retype new UNIX password:  <— 重复新的Root用户密码
passwd:已成功更新密码

允许root登录
如果要允许root登录(不推荐),则这样操作:
me@tipfoo:~$ gksu /usr/sbin/gdmsetup
(或者使用桌面菜单:系统>系统管理>登录窗口)
点“安全”选项页,选择“允许本地管理员登录”。
注:这一步依赖上一步

不输入密码直接登录
在论坛上也看见有人抱怨,家中的Ubuntu不能像Window$那样──不用输入密码就能登录。其实同样能做到:
就在上一步的“安全”选项页中,勾选:
“启用自动登录”,“用户”选择(如:“me”);
注意:公共用的计算机千万不能这么设置!

SSH登录远程服务器
如果远程服务器只允许root用户SSH到服务器时,在Ubuntu下,必须“su 到root”用户才能登录成功(具体是看服务器端的配置)。

首先,复制密钥到“/root/.ssh/”目录,
me@tipfoo:~$ su
Password:
root@tipfoo:/home/me# chmod 600 -R /root/.ssh/
root@tipfoo:/home/me# ssh -p 27482 11.22.33.44
Enter passphrase for key ‘/root/.ssh/id_rsa’:
Last login: Thu Jun 21 14:29:00 2007 from 11.22.33.45

http://www.linuxidc.com/Linux/2007-11/9159.htm 

阅读(56 次)

nbu我最常用的两个命令

星期四, 七月 10th, 2008

C:\Program Files\VERITAS\NetBackup\bin\admincmd 下的

bpmedialist和bpexpdate

bpmedialist查看磁带过期情况

bpexpdate -ev <MEDIAID>; -d 0 让太老或没用的磁带手动过期

阅读(70 次)

rsh到其他redhat机器如何防止auto-logout

星期四, 七月 3rd, 2008

如果用户是csh  在.cshrc里加unset autologout或set autologout = 0

如果用户是bash 在.bashrc或profile文件里加 export TMOUT=0

阅读(53 次)

redhat enterprise linux改Virtual Desktop名字

星期一, 六月 30th, 2008

在Virtual Desktop点右键configure virtual desktop改名字  然后在configure virtual desktop上面的show里选择name(原来一般是number)

阅读(70 次)