Lastupdated:
2010-12-07
各种配置
安装了Cygwin以后,如果想cd到不同的驱动器,可以使用以下的方法。
1
2
3
4
5
6
7
8
9
10
11
12
|
$cd /cygdrive/c
or
$mount c:\home /home/yang
$mount c:\opt /opt
$mount -c /
or
$mount --change-cygdrive-prefix /
|
|
TOP服务器名称,hostPC名称,网络设置
1
2
3
4
5
|
$vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.11.2 www.********.co.jp
|
|
TOPnetwork
1
2
3
4
5
6
7
|
$vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=xxxxxxx
GATEWAY=192.168.0.1
HOSTNAME=www.********.co.jp
DOMAINNAME=********.co.jp
GATEWAY=192.168.11.1
|
|
TOPresolv.conf
1
2
3
4
5
|
$vi /etc/resolv.conf
domain ********.co.jp
search ********.co.jp
nameserver 219.***.***.** プライマリDNSサーバIPアドレス
nameserver 203.***.***.** セカンダリDNSサーバIPアドレス
|
|
TOPdhcpd.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
$cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
host emma2th {
hardware ethernet 00:E0:C3:06:05:FF;
fixed-address 192.168.0.2;
option routers 192.168.0.1;
option root-path "192.168.0.1:/home/xxxx/rootfs";
}
}
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
$mkdir /tftpboot
$chown nobody:nobody /tftpboot
$cat /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot -c
per_source = 11
cps = 100 2
flags = IPv4
}
$/etc/rc.d/init.d/xinetd reload
tftp [-i] computer [get | put] source [destination]
/sbin/chkconfig --level 345 xinetd on
/sbin/chkconfig --level 345 tftp on
|
|
1
2
3
4
5
6
|
$cat /etc/exports
/home/public client1 (rw,no_root_squash)
/home/xxxx/rootfs 192.168.0.0/255.255.255.0(rw,no_root_squash)
$service portmap start
$service nfs start
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
$route add -net 192.168.1.0 -netmask 255.255.255.0 gw 192.168.0.100 dev eth1
表示到192.168.1.0/255.255.255.0这个网络的信息通过你的第二块网卡发送,
下一跳(网关): 192.168.0.100
目的IP: 192.168.1.0
子网掩码: 255.255.255.0
下一跳路由的IP地址肯定要跟这个路由器的某个接口是在同一个网段的。
$service iptables stop
$ifconfig eth0 down
$ifconfig eth0 hw ether 00:11:AA:BB:CC:DD
$ifconfig eth0 up
|
|
参考这里。
TOPbash profile的例子
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
export EDITOR="nano"
export LANG=ja_JP.UTF-8
export LESSCHARSET=utf-8
if [ $machine = linux ];
then
export BD=/usr/local/te
export GNUs=/usr
export GNU_BD=$BD/tool/Linux-i686
export GNUmips=$GNU_BD/mips64el-unknown-tkernel
export GCC_EXEC_PREFIX=$GNU_BD/lib/gcc-lib/
export PATH=$PATH:${GNU_BD}/etc
fi
if [ $machine = macintosh ];
then
export BD=/usr/local/te
export GNUs=/usr
export GNU_BD=$BD/tool/unknown
export GNUmips=$GNU_BD/mips64el-unknown-tkernel
export GCC_EXEC_PREFIX=$GNU_BD/lib/gcc-lib/
export PATH=$PATH:${GNU_BD}/etc
alias spca="screen /dev/tty.usbserial-000012FD 115200"
alias spcb="screen /dev/tty.I-O\ DATA\ USB-RSAQ5 115200"
alias gmake=make
fi
export GROOVY_HOME=~/bin/groovy-1.5.3
export PATH=$GROOVY_HOME/bin:$PATH
if [ $machine = macintosh ];
then
export MAGICK_HOME="/usr/local/ImageMagick-6.4.5"
export PATH="$MAGICK_HOME/bin:$PATH"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"
fi
alias up="cd .."
alias upup="cd ../.."
alias "cd..."="cd ../.."
alias "cd.."="cd .."
alias sl="ls"
alias la="ls -lah"
alias lsl="ls -lah"
alias l="ls -lh"
alias lsla="ls -lah"
alias ll="ls -lh"
alias lpa="ls -a |less"
alias lp="ls |less"
alias ks="ls"
alias sk="ls"
alias lsd="ls -d */"
alias lsdir="ls -d */"
alias l2="ls 2*"
alias lss="ls |less"
alias lsc="ls |cat"
alias grep='grep --color'
alias exho="echo"
alias h=head
alias t=tail
alias nano="nano -w -i"
alias n="nano"
alias n="nano -wi"
alias nn="nano -wi"
alias nanao="nano -wi"
alias p="cat"
alias sshtp="ssh teampanda.net"
alias sshc="ssh yuasa@ceres.phys.s.u-tokyo.ac.jp -Y"
alias sshp="ssh yuasa@phobos -Y"
alias sshj="ssh yuasa@janus -Y"
alias sshd="ssh -Y yuasa@deimos.phys.s.u-tokyo.ac.jp"
alias sshhy="ssh yuasa@hyperion -Y"
alias sshr="ssh yuasa@rhea -Y"
alias ssht="ssh yuasa@tethys -Y"
alias ssh="ssh yuasa@hyperion -Y"
alias ssha="ssh yuasa@amalthea.phys.s.u-tokyo.ac.jp -Y"
alias sshpod="ssh pod@teampanda.net"
alias sshae="ssh -Y hxd@aelnx2.astro.isas.jaxa.jp"
alias gt="gnome-terminal&"
alias gter="gt"
alias gt4="gnome-terminal --geometry 80x20+10+0 & gnome-terminal --geometry
80x20+10+450 & gnome-terminal --geometry 80x20+720+0 &
gnome-terminal --geometry 80x20+720+450 &"
alias gt3="gnome-terminal --geometry 80x20+10+450 &
gnome-terminal --geometry 80x20+720+0 & gnome-terminal --geometry
80x20+720+450 &"
alias gt2="gnome-terminal --geometry 80x20+720+0 & gnome-terminal --geometry
80x20+720+450 &"
alias gp="gnuplot"
alias pasjps="ps2eps --ignoreBB -R + -f"
alias ciao="source /users/yuasa/work/chandra/cxc/bin/ciao.bash -o"
alias fh="fhelp"
alias xsel="xselect"
alias xse="xselect"
alias ds=ds9
alias ge="gedit "
alias dis45="/adsoft/dis45/2.04/linux/dis45x"
alias dis="dis45"
alias evo="evolution $> /dev/null &"
alias quit="exit"
alias rep="source ~/.bash_profile"
alias pur="rm *~;ls"
export PS1='\u@\[\033[1;31m\]\H\[\033[0m\][\W]\$ '
function lsdir() { ll $1 | grep '^d'; }
|
|
- Cygwin 的.bashrc配置::
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias df='df -h'
alias du='du -h'
alias less='less -r' alias grep='grep --color'
alias ls='ls -hF --color=tty' alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias ll='ls -l' alias la='ls -A' alias l='ls -CF'
function lsdir() { ll $1 | grep '^d'; }
function svnadd() { svn st|grep '^?'|awk '{print $2}'|xargs svn add; }
function svndel() { svn st|grep '^!'|awk '{print $2}'|xargs svn del; }
function delsvn() { find ./ -name ".svn" -exec rm -fr {} \;; }
function gstyle() { find ./ -type f -name "*.[ch]pp" | xargs -n1 astyle -A2 -N -z1 -j -c -q -p -w -x -k1 && find ./ -type f -name "*.orig" -exec rm -fr {} \;; }
export PATH=$PATH:/c/emacs-lisp/global_win32_exe/bin
mount --change-cygdrive-prefix /
|
|
TOPLinux操作系统的头文件和库文件搜索路径
TOPGCC的环境变量
CPLUS_INCLUDE_PATH --> Gcc编译时查找的头文件路径(for c++)
C_INCLUDE_PATH --> Gcc编译时查找的头文件路径(for c)
OBJC_INCLUDE_PATH --> Gcc编译时查找的头文件路径(for objective-c)
PKG_CONFIG_PATH --> Gcc编译时查找的库的metadata信息路径
内定目录
/usr/include
/usr/local/include
LIBRARY_PATH --> Gcc编译/链接时用到的库路径
内定目录
/lib
/usr/lib
/usr/local/lib
TOP运行时动态库的搜索路径
1、在配置文件/etc/ld.so.conf中指定动态库搜索路径
2、通过环境变量LD_LIBRARY_PATH
3、/lib
4、/usr/lib