2017年4月2日 星期日

Start VirtualBox VM from CLI

http://askubuntu.com/questions/445284/how-to-start-a-virtualbox-machine-via-command-line-without-gui

Only needed:
VBoxManage startvm "VM name" --type headless
For example:
VBoxManage startvm ubuservloc --type headless
Additionally, if your VM uses 3D acceleration, it makes sense to (temporarily) disable it, as it'll prevent the VM from starting in headless mode.

2017年3月9日 星期四

VSFTP

yum install vsftpd


--anon
anonymous_enable=NO
-- chroot
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list  --在這裡面加上需要的帳號 --注意deny 有沒有開

-- Iptables

iptables -I INPUT -s {IP}/32 -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT

-- SELINUX
setsebool -P allow_ftpd_full_access=1
setsebool -P ftp_home_dir=1

ref
http://shaocian.blogspot.tw/2012/07/centos-vsftpd.html
http://download.ithome.com.tw/article/index/id/2389

----
http://blog.xuite.net/jbass0805/blog/68277061-CentOS+6+FTP+Server+(vsftpd)+and+Secure
編輯/etc/vsftpd/vsftpd.conf新增以下幾條

pasv_enable=YES
pasv_min_port=3000
pasv_max_port=3005

3000~3005是我設定的port range
當然設定完成iptables也要新增一條
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000:3005 -j ACCEPT
然後重啟iptables

vsftpd passive設定完成
----
http://wuhaoshu.blog.51cto.com/845270/489292

被动模式 下,客户连接 TCP/21,客户再通过其他端口连接服务器的随机端口,卡住的原因,是因为服务器在被动模式下没有打开临时端口让 client 连过来。
临时打洞的方法:
优点:不影响ftp配置;缺点: 客户会感觉到连接有些延迟。原因参见ip_conntract的实现原理
在/etc/modprobe.conf中添加
alias ip_conntrack ip_conntract_ftp ip_nat_ftp
在/etc/rc.local中添加
/sbin/modprobe ip_conntract
/sbin/modprobe  ip_conntrack_ftp
/sbin/modprobe  ip_nat_ftp

限制被动模式连接端口的方法:
  • 优点:对连接速度没有影响。缺点: 限制了客户端并发连接的数量。
在/etc/vsftpd/vsftpd.conf中添加
pasv_enable=YES
pasv_min_port=2222
pasv_max_port=2225
iptables中开放这段端口
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp --dport 2222:2225 -j ACCEPT

2017年2月8日 星期三

AIX5.3 rlwrap



參考 http://blog.csdn.net/lqx0405/article/details/5817769

1、首先安装gcc环境
下载gcc相关包

gcc-4.2.0-3.aix6.1.ppc.rpm, 
gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm, 
libgcc-4.2.0-3.aix6.1.ppc.rpm, 
libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm, 
libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm 

(1)用ftp将上述五个rpm文件上传到/usr/opt/freeware/src /packages/SOURCES目录下 

(2)以root身份在/usr/opt/freeware/src/packages/SOURCES执行命令 
# rpm -ivh gcc-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh libgcc-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm 
# rpm -ivh gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm

2、安装readline 库文件
1)      解压: gunzip  readline-6.1.tar.gz
2)      解包: tar  -xvf  readline-6.1.tar
3)      安装: cd  readline-6.1
       ./configure ; make ; make install
4)      安装完毕后,readline的库文件,安装在/usr/local/lib 目录下
5)      将相关库文件拷贝到/lib 和 /usr/lib 下

3、安装 rlwrap
 下载  rlwrap-0.37.tar.gz
1)    解压 gunzip  rlwrap-0.37.tar.gz
2)    解包:tar  -xvf  rlwrap-0.37.tar
3)    安装: cd rlwrap-0.37
       ./configure ;  make ; make check ; make install
4、配置
  在/home/oracle/.profile 下建立别名:
 alias   sqlplus=‘rlwrap  sqlplus’
 alias   rman=‘rlwrap  rman’



另外 在
http://www.perzl.org/aix/index.php?n=Main.Rlwrap
好像有編好的版本
http://www.perzl.org/aix/index.php?n=Main.Readline
要先裝 readline

AIX create Oracle instance 問題(AIO未開)

ORA-12547: TNS:lost contact

根據 sqlnet.log

Fatal NI connect error 12547, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/oracle/10g/product/10.2.0/db/bin/oracle)(ARGV0=oraclehisspu)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus@f7n4)(HOST=f7n4)(USER=oracle10))))

  VERSION INFORMATION:
        TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
        TCP/IP NT Protocol Adapter for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
        Oracle Bequeath NT Protocol Adapter for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production
  Time: 07-FEB-2017 12:01:33
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12547
    TNS-12547: TNS:lost contact
    ns secondary err code: 12560
    nt main err code: 517
    TNS-00517: Lost contact
    nt secondary err code: 32


然後使用 sqlplus 時出現

exec(): 0509-036 Cannot load program oraclenam because of the following errors:
        0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o] because:
        0509-136   Symbol kaio_rdwr64 (number 1) is not exported from
                   dependent module /unix.
        0509-136   Symbol listio64 (number 2) is not exported from
                   dependent module /unix.
        0509-136   Symbol acancel64 (number 3) is not exported from
                   dependent module /unix.
        0509-136   Symbol iosuspend64 (number 4) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait (number 5) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait64 (number 6) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout (number 7) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout64 (number 8) is not exported from
                   dependent module /unix.
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.

根據
Symbol resolution failed for /usr/lib/libc.a[aio_64.o] 
問題是出在AIX 的 AIO 沒有啟用 (在跑 LDAP時沒有用到所以沒有問題 ORACLE需要)

根據

0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o]
This error occurs because the Asynchronous I/O are not available.
# lsattr -El aio0
autoconfig defined STATE to be configured at system restart True
fastpath enable State of fast path True
kprocprio 39 Server PRIORITY True
maxreqs 4096 Maximum number of REQUESTS True
maxservers
10 MAXIMUM number of servers per cpu True
minservers 1 MINIMUM number of servers True
You must make the Asynchronous I/O available using smitty
# smitty chgaio
Change this item
STATE to be configured at system restart available
IMPORTANT: Changes will become effective at next system restart
For configure Asynchronous I/O now use:
# smitty aio
Configure Defined Asynchronous I/O
Checking aio0 again
# lsattr -El aio0
autoconfig available STATE to be configured at system restart True
fastpath   enable    State of fast path                       True
kprocprio  39        Server PRIORITY                          True
maxreqs    4096      Maximum number of REQUESTS               True
maxservers
10        MAXIMUM number of servers per cpu        True
minservers 1         MINIMUM number of servers                True
 
另外 依據

使用操作系统命令开启异步I/O(1)确认所需的bos.rte.aio是否安装妥当
# lslpp -l bos.rte.aio
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.rte.aio               5.3.0.62  COMMITTED  Asynchronous I/O Extension

(2)使用如下命令开启AIX操作系统的异步I/O
# mkdev -l aio0
aio0 Available

# chdev -P -l aio0 -a autoconfig='available'
aio0 changed

依據

The ‘minservers’ setting (10) is the total number of aioserver kernel threads that start at boot – this is not a per CPU or per logical CPU value.
The ‘maxservers’ setting (20) is the maximum number of aioserver  per CPU or per logical CPU value.
The ‘maxreqs’ setting (4096) is the maximum number of outstanding or pending requests that the kernel will allow at any one time.
The default value for the minimum number of servers is 1. The default value for the maximum number of servers is 10. These values are usually too low to run Oracle Database on large systems with 4 CPUs or more, if you are not using kernelized AIO( for raw devices).

2017年2月7日 星期二

Xming

下載 Xming


port: 6000
啟動 x launch , no access controll
-screen 0 1024x768

然後

對方 
export DISPLAY={IP}:0.0


錯誤訊息:
Warning: Cannot convert string "-*-lucida-medium-r-*-*-*-*-*-*-*-*-iso8859-1" to type FontStruct

If the font packages are not installed, install them.
Restart the X server.

安裝 font package