继续备份一下其他Blog的内容。
1. SSH TUNNELING
使用Putty的时候,有事可以设置一下SSH Tunnels穿越防火墙的设置,只要有权限访问防火墙内某台机器的SSH服务,就可以访问防火墙内其他Server的端口了。原理图如下:
Putty本地设置为L29492 + 10.170.30.161:29492,这样访问127.0.0.1:29492就可以连接到防火墙内部的10.170.30.161:29492端口了。
2. A Shell Programming Error
Last Friday, I made a mistake in a shell script which function is install license. I wrote following code to compare input parameter with a string:
if [ $1 = “-blabla” ]
If the input parameter is empty, it will cause a disaster. because it will be if [ = “-blabla” ] for shell.
So the correct code should be:
if [ “$1” = "-blabla” ]
or
if [ x$1 = “x-blabla” ]
3. How to change the permissions mode of a file in Clear Case
The default permission mode is read only after we add a new file to clearcase. But sometimes we need it to be an executable mode. Following command will be helpful when you want change the file’s permission mode.
cleartool protect –chmod filename
4. Make WinMerge looks similar to Beyond Compare
Since Beyond Compare Software is not free, we need use WinMerge instead of it. But it is a little hard to adapt the style from BC to WinMerge at the beginning. By changing some configuration in the ‘Options’, it can make WinMerge looks more similar to BC now.
1. Change the font to ‘Consolas’, Regular, 10
2. Ignore all whitespace
3. Change the color style. Difference and Word Difference’s Background to pink, and change Word Difference’s Text to Red.
4. View line numbers and view margins
Currently, I feel the life is more goodly than before.