2012年3月21日 星期三

CENTOS 6 Samba

 yum -y install samba samba-client samba-common

/etc/samba/smb.conf


[global]
        # 與主機名稱有關的設定資訊
        workgroup     = workgroup
        netbios name  = wasap12
        server string = wasap12

        # 與語系方面有關的設定項目喔,為何如此設定請參考前面的說明
        unix charset    = utf8
        display charset = utf8
        dos charset     = cp950

        # 與登錄檔有關的設定項目,注意變數 (%m)
        log file = /var/log/samba/log.%m
        max log size = 50

        # 這裡才是與密碼有關的設定項目哩!
        security = share

        # 修改一下印表機的載入方式,不要載入啦!
        load printers = no
        hosts allow = 172.22.93., 172.22.94.

# 2. 分享的資源設定方面:主要得將舊的註解,新的加入!
#    先取消 [homes], [printers] 的項目,然後針對 /tmp 的設定,可瀏覽且可寫入喔
[ADMISSION]                                  
#分享資源名稱
        comment    = ADMISSION_LOG
#簡單的解釋此資源
        path       = /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/admission_server/              
#實際 Linux 分享的目錄
        writable   = no                
#是否可寫入?在此例為是的
        browseable = yes                
#能不能被瀏覽到資源名稱
        guest ok   = yes                
#單純分享時,讓用戶隨意登入的設定


#################################################################


#!/bin/sh
chkconfig smb on
chkconfig nmb on
/etc/rc.d/init.d/smb restart
/etc/rc.d/init.d/nmb restart


##################################################################
原版的 smb.conf 有寫怎樣調整 SELinux

setsebool -P samba_domain_controller on
setsebool -P samba_enable_home_dirs on

setsebool -P samba_export_all_rw on
setsebool -P samba_export_all_rw ro


2012年1月15日 星期日

TOAD 一直出現 ORA-01775 looping chain of synonyms

Go to the menu View | Toad Options. In the node Oracle - General there is a frame named Explain Plan, next to the textbox labeled Table: TOAD_PLAN_TABLE there is a button (...), press it. In the displayed window you have to uncheck the option Grant to public and create public synonym, and the problem is solved.




ref :http://dbaforums.org/oracle/index.php?showtopic=15796

2012年1月6日 星期五

Oracle Listener Hang

f5:oracle:/oracle > id
uid=205(oracle) gid=205(dba) groups=1(staff)
f5:oracle:/oracle > svrmgrl
SVRMGR> connect internal;
Connected.
SVRMGR> shutdown abort;
ORACLE instance shut down.

=================================================================================
ps -ef | grep LIS
kill
=================================================================================

SVRMGR> startup
ORACLE instance started.
Total System Global Area                       2401083284 bytes
Fixed Size                                          73620 bytes
Variable Size                                   352837632 bytes
Database Buffers                               2048000000 bytes
Redo Buffers                                       172032 bytes
Database mounted.
Database opened.
SVRMGR>

2012年1月4日 星期三

VIM / VI



關閉 hightlight
set noh

tab:
set ts=4
http://softsmith.blogspot.tw/2008/12/vim-tab.html

切換 big5 / utf8  :e ++enc=big5
更改設定 :set encoding=big5
ref : http://newtoypia.blogspot.com/2011/06/vim-big5-gb2312-1.html

行號
set nu
set nu!



JSON

在 Perl 下產生 JSon 的方式

my $json = ($userID) ?
  qq{{"success" : "login is successful", "userid" : "$userID"}} :
  qq{{"error" : "username or password is wrong"}};
# return JSON string
print $cgi->header(-type => "application/json", -charset => "utf-8");
print $json;

Ref :  http://www.ibm.com/developerworks/cn/webservices/ws-simplelogin/

在 Java 底下 parse JSON 的方式 :

WebClient client = new WebClient();
Page page = client.getPage("http://stackoverflow.com/users/flair/97901.json");
WebResponse response = page.getWebResponse();
if (response.getContentType().equals("application/json")) {
    String json = response.getContentAsString();
    Map<String, String> map = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
    System.out.println(map.get("displayName")); // Benju
}
Ref :
http://stackoverflow.com/questions/2932857/html-handling-a-json-response
http://stackoverflow.com/questions/1688099/converting-json-to-java/1688182#1688182