PIXNET Logo登入

強哥的部落格

跳到主文

歡迎光臨強哥在痞客邦的小天地

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 9月 19 週二 201717:26
  • CentOS 開啟 XDMCP


 
Step 1. 安裝gdm 桌面系統。
[root@localhost ~]# yum -y install gdm
 
Step 2. 修改桌面系統設定檔開放XDMCP 遠端連線。
[root@localhost ~]# vim /etc/gdm/custom.conf
 
在檔案中請修改幾個部分。
# GDM configuration storage
 
[daemon]
 
[security]
AllowRemoteRoot=true /*同意使用root 使用者權限遠端XDMCP 連線主機*/
 
[xdmcp]
Enable=1 /*啓用XDMCP 的桌面連線*/
Port=177 /*設定開放連結的通訊port 177*/
 
[greeter]
 
[chooser]
 
[debug]
 
Step 3. 設定開啓防火牆。
[root@localhost ~]# vim /etc/sysconfig/iptables
 
加入允許UDP 177 Port 的通訊協定。
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 177 -j ACCEPT
 
完成設定後重新啓動iptables 服務生效。
[root@localhost ~]# /etc/init.d/iptables restart
 
Step 4. 重新 gdm 或啓動主機。
 
[root@localhost ~]# killall gdm-binary
 
[root@localhost ~]# reboot
 
Step 5. 重新啓動後再繼續安裝其他需要的套件組。
 
安裝XWindosw 的視窗套件。
yum -y groupinstall "X Window System"
 
安裝桌面工具的套件。
yum -y groupinstall "Desktop"
 
安裝中文化支援套件。
yum -y groupinstall "Chinese Support"
 
安裝支援多點開啓套件。
yum -y install nautilus-open-terminal
 
 
Step 6. 設定runlevel 到5。
[root@localhost ~]# init 5
 
Step 7. 確定XDMCP 177 port 服務有正確啓動。
 
[root@localhost ~]# netstat -tulnp |grep 177
udp 0 0 0.0.0.0:177 0.0.0.0:* 1651/gdm-binary
(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(1,434)

  • 個人分類:
▲top
  • 9月 19 週二 201717:23
  • nmap TCP ping & UDP ping

 
for TCP pings it is :
watch -n 5 "nmap -P0 -sT -p5666 somehostname.dyndns.org"
for UDP pings it is almost the same:
watch -n 5 "nmap -P0 -sU -p5666 somehostname.dyndns.org"
(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(533)

  • 個人分類:
▲top
  • 9月 19 週二 201716:15
  • Linux 讓 history 紀錄命令時間


 
linux 讓 history 紀錄命令時間
 

history命令默認是不會顯示命令執行時間的,要想能出現執行時間可以按如下方法操作:
##ubuntu下是bash.bashrc centos系列是bashrc
cp /etc/bash.bashrc /etc/bash.bashrc .bak (ubuntu)
cp /etc/bashrc /etcbashrc.bak (centos)
vim /etc/bash.bashrc (ubuntu)
vim /etc/bashrc (centos)
 #在文件最後面加上下列三行
#讓系統記錄每條歷史命令的執行時間。注意最後的 " 前面要放個空格
export HISTTIMEFORMAT="%y-%m-%d_%H:%M:%S "
 #設置保存歷史命令的文件大小
 export HISTFILESIZE=1000000
#保存歷史命令條數
 export HISTSIZE=2000
# 執行命令使配置立即生效 
source /etc/bash.bashrc  (ubuntu)
source /etc/bashrc (centos)
 
 
export HISTTIMEFORMAT='%F %T '
HISTTIMEFORMAT='<%F %T>:'
export HISTTIMEFORMAT
(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(815)

  • 個人分類:
▲top
  • 9月 19 週二 201716:10
  • Windows 遠端桌面到 CentOS


 


先安裝XRDP







1.必須軟體


yum install gcc pam-devel openssl-devel 


yum install autoconf automake libtool 


yum install libX11-devel libXfixes-devel


yum install xrdp


2.安裝xrdp


wget http://sourceforge.net/projects/xrdp/files/xrdp/0.6.0/xrdp-v0.6.0.tar.gz/download


tar zxvf xrdp-v0.6.0.tar.gz


cd xrdp-v0.6.0


./bootstrap


./configure


make


make install


 


3.啟動指令


/etc/xrdp/xrdp.sh start


/etc/xrdp/xrdp.sh stop


 


4. 防火牆設定


iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3389 -j ACCEPT


 


5.可以在window上試用了,打上IP



(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(667)

  • 個人分類:
▲top
  • 9月 19 週二 201716:02
  • Windows 透過 snmp 監控系統資源的方法


 
找出 CPU loading 的方法
[root@opsview libexec]# snmpwalk -v2c -c voicevmware 172.30.1.63  .1.3.6.1.2.1.25.3.3.1.2
HOST-RESOURCES-MIB::hrProcessorLoad.1 = INTEGER: 5
HOST-RESOURCES-MIB::hrProcessorLoad.2 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.3 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.4 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.5 = INTEGER: 1
HOST-RESOURCES-MIB::hrProcessorLoad.6 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.7 = INTEGER: 0
HOST-RESOURCES-MIB::hrProcessorLoad.8 = INTEGER: 0
 
找出 Disk usage 的方法

[root@opsview libexec]# snmpwalk -v2c -c voicevmware 172.30.1.63 .1.3.6.1.2.1.25.2

HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 16775112 KBytes

HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1

HOST-RESOURCES-MIB::hrStorageIndex.2 = INTEGER: 2

HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3

HOST-RESOURCES-MIB::hrStorageIndex.4 = INTEGER: 4

HOST-RESOURCES-MIB::hrStorageType.1 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk

HOST-RESOURCES-MIB::hrStorageType.2 = OID: HOST-RESOURCES-TYPES::hrStorageCompactDisc

HOST-RESOURCES-MIB::hrStorageType.3 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory

HOST-RESOURCES-MIB::hrStorageType.4 = OID: HOST-RESOURCES-TYPES::hrStorageRam

HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: C:\ Label:  Serial Number 16e0854

HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: D:\

HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual Memory

HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: Physical Memory

HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 4096 Bytes

HOST-RESOURCES-MIB::hrStorageAllocationUnits.2 = INTEGER: 0 Bytes

HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 65536 Bytes

HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 65536 Bytes

HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 35834383  >> 總空間

HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 0

HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 524192

HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 262111

HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 12722541 >> 已使用空間

HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 0

HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 228676

HOST-RESOURCES-MIB::hrStorageUsed.4 = INTEGER: 216444

HOST-RESOURCES-MIB::hrStorageAllocationFailures.1 = Counter32: 0

HOST-RESOURCES-MIB::hrStorageAllocationFailures.2 = Counter32: 0

HOST-RESOURCES-MIB::hrStorageAllocationFailures.3 = Counter32: 0

HOST-RESOURCES-MIB::hrStorageAllocationFailures.4 = Counter32: 0

 


35834383 * 4096 / 1024 (K) / 1024 (M) / 1024 (G) = 136.697 (G)

12721658 * 4096 / 1024 (K) / 1024 (M) / 1024 (G) = 48.529   (G)
 
 
找出特定程式的方法
[root@opsview libexec]# snmpwalk -v2c -c voicevmware 172.30.1.63 HOST-RESOURCES-MIB::hrSWRunName | grep snmp

HOST-RESOURCES-MIB::hrSWRunName.1764 = STRING: "snmp.exe"

HOST-RESOURCES-MIB::hrSWRunName.5144 = STRING: "snmptrap.exe"

(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(1,496)

  • 個人分類:
▲top
  • 9月 19 週二 201716:00
  • 匯出匯入特定 user 的所有資料表和資料 (Datapump)


 

expdp system/xxxx SCHEMAS=john DIRECTORY=test_expdp DUMPFILE=expjohn.dmp job_name=john_expdp parallel=4


 


impdp system/xxxx SCHEMAS=john DIRECTORY=test_expdp DUMPFILE=expjohn.dmp;


(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(2)

  • 個人分類:
▲top
  • 9月 19 週二 201716:00
  • 匯出匯入特定 user 的所有資料表和資料 (Datapump)


 

expdp system/xxxx SCHEMAS=john DIRECTORY=test_expdp DUMPFILE=expjohn.dmp job_name=john_expdp parallel=4


 


impdp system/xxxx SCHEMAS=john DIRECTORY=test_expdp DUMPFILE=expjohn.dmp;


(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(53)

  • 個人分類:
▲top
  • 9月 19 週二 201715:59
  • 匯出匯入特定 user 的所有資料表和資料 (export import)


 

exp system/xxxx owner=john file=export_john.dmp log=john_exp.log


 


imp system/xxxx fromuser=john touser=john file=john.dmp log=john_imp.log


(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(85)

  • 個人分類:
▲top
  • 9月 19 週二 201715:58
  • 匯出 / 匯入 特定使用者的 schema


 

匯出 voip 的 schema


exp \'/ as sysdba\' owner=VOIP file=VOIP.dmp rows=n statistics=none log=exp_VOIP.log


 


匯入 voip 的 schema


imp \'/ as sysdba\' fromuser=VOIP touser=VOIP file=VOIP.dmp ignore=y log=Imp_VOIP.log


(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(58)

  • 個人分類:
▲top
  • 9月 19 週二 201715:54
  • CentOS 6.2 安裝 Oracle 11gR2


1. 安裝 OS rpm
 

yum -y install binutils "compat-libstdc++" elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++ make "pdksh" sysstat unixODBC unixODBC-devel compat-libstdc++-33 ksh libio.i686 glibc.i686 compat-libstdc++-33.i686 libaio-devel.i686 libgcc.i686 libstdc++.i686 unixODBC.i686 unixODBC-devel.i686


 


2. 建立 oracle 帳號


groupadd oinstall


groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle


 


3. 更改 /etc/sysctl.conf


vi /etc/sysctl.conf


在 /etc/sysctl.conf 後面增加如下参數


 


fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500 
net.core.rmem_default=262144 
net.core.rmem_max=4194304 
net.core.wmem_default=262144 
net.core.wmem_max=1048586


 


輸入  /sbin/sysctl -p  確認更改


 


4. 更改 oracle 帳號的 shell 限制


vi /etc/security/limits.conf
在 /etc/security/limits.conf 後面增加如下行



oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536


 


在 /etc/pam.d/login 後面增加如下行  



session    required    pam_limits.so


 


5. 更改 /etc/profile 


 


vi /etc/profile


在 /etc/profile 後面增加如下行


 


if [ $USER = "oracle" ]; then 
        if [ $SHELL = "/bin/ksh" ]; then 
                ulimit -p 16384 
                ulimit -n 65536 
        else 
                ulimit -u 16384 -n 65536 
        fi 
fi


 


6. 建立 Oracle 安裝目錄  


 


mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01


 


7. 更改 oracle 帳號的 profile


umask 022


export ORACLE_BASH ORACLE_SID
#unset ORACLE_HOME
#unset TNS_ADMIN


ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE


ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID


#ORACLE_TERM=xterm;


#export ORACLE_TERM


PATH=$ORACLE_HOME/bin:$PATH;
export PATH


 


8. 安裝 oracle 軟體


unzip linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
cd database/
./runInstaller


(繼續閱讀...)
文章標籤

johnchen6927 發表在 痞客邦 留言(0) 人氣(13)

  • 個人分類:Oracle
▲top
«1234...10»

個人資訊

johnchen6927
暱稱:
johnchen6927
分類:
不設分類
好友:
累積中
地區:

熱門文章

  • (7,972)Windows Server 2008 刪除檔案的紀錄
  • (6,525)Oracle - 查 Table 資料表筆數和大小的方法
  • (4,417)Linux 查看那些 dm-N 對應到的設備
  • (227)成功三要素
  • (198)Linux 2TB 以上硬碟分割法
  • (884)nginx reverse proxy 的設定方法

文章分類

  • Nagios (1)
  • AWS (4)
  • Elasticsearch (1)
  • Git (2)
  • Oracle (1)
  • Docker (3)
  • Linux (5)
  • 讀書心得 (3)
  • Kubernetes (3)
  • Jenkins (2)
  • Puppet (4)
  • 工作心得 (47)
  • 未分類文章 (1)

最新文章

  • Jenkins 排除特定 branch build
  • ssh 登入時需要兩階段驗證 (ssh private key 驗證和密碼驗證)
  • 如何從 Datadog 觸發 Jenkins job
  • 在 AWS 上的 kubernetes 建立不同配置和用途的 EC2
  • AWS ELB 筆記
  • Orphaned pod found, but volume paths are still present on disk.
  • 在 Kubernetes 中的 MongoDB 設定 replica + auth 機制
  • ssh 連不同的主機用不同 ssh key 的方法
  • Postfix 透過 阿里企業郵箱 發送 Nagios 通知信
  • 當 build docker image 出現 "no space left on device"

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: