1. 開啟vSphere Client
2. 選guestos , 點右鍵,Guest -> install/upgrade vmware tools
3. mkdir /mnt/cdrom ; mount_cd9660 /dev/cd0 /mnt/cdrom
4. mkdir /tmp/workdir ; cp /mnt/cdrom/vmware-freebsd-tools.tar.gz /tmp/workdir
5. cd /tmp/workdir ; tar -zxpBvf vmware-freebsd-tools.tar.gz
6. cd vmware-tools-distrib ; ./vmware-install.pl ; 如果出現對話視窗直接用預設值就好
7. 正常來說裝完會直接啟動/usr/local/lib/vmware-tools/sbin/vmtoolsd
如果沒有出現,檢查一下有沒有安裝/usr/ports/misc/compat6x/
目前分類:系統管理 (432)
- Jan 14 Wed 2015 17:48
FreeBSD 9.x 安裝vmware-tools
- Jan 12 Mon 2015 15:37
apache allow/deny ip 參考 X-Forwarded-For
將原來的allow from ,修改成以下的格式
vi .htaccess
order deny,allow
deny from all
#allow from 10.1.1.100
SetEnvIF X-Forwarded-For "10.1.1.100" AllowIP
Allow from env=AllowIP
- Jan 12 Mon 2015 12:17
centos 6.x 安裝postfix + sasl + dovecot + openwebmail
postfix troubleshooting工具
postconf -n
postfix check
netstat -tap
/etc/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
dovecot troubleshooting
$ telnet mailserver 110
Trying mailserver...
Connected to mailserver (1.1.1.1).
Escape character is '^]'.
+OK Dovecot ready.
user ethanlee
-ERR Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
-ERR Disconnected for inactivity.
Connection closed by foreign host.
solution:
vi /etc/dovecot/conf.d/10-auth.conf
#disable_plaintext_auth = yes
disable_plaintext_auth = no
/etc/init.d/dovecot restart
[安裝openwebmail]
cd /etc/yum.repos.d
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo
安裝套件
yum install openwebmail perl-CGI httpd
啟動httpd
/etc/init.d/httpd start
第一次執行以下指令,如果有錯誤會提醒你修改設定檔
/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
預設登入網址為
http://ip/cgi-bin/openwebmail/openwebmail.pl
登入後,如果發現預設icon是英文的話,要改成正體中文修改以下設定檔
/var/www/cgi-bin/openwebmail/etc/openwebmail.conf
#default_iconset Cool3D.English
default_iconset Cool3D.Chinese.Traditional
- Jan 09 Fri 2015 18:35
notebook 接上hdmi螢幕後,喇叭沒聲音?
開始 -> 控制台 -> 硬體和音效 -> 聲音
把喇叭設定成預設即可
- Jan 07 Wed 2015 17:36
bash history to syslog
vi /etc/profile
PROMPT_COMMAND='history -a >(tee -a ~/.bash_history | logger -p local2.notice -t "$USER[$$]")'
vi /etc/syslog.conf
local2.notice /var/log/history.log
vi /etc/logrotate.conf
/var/log/history.log {
daily
rotate 100
}
重啟syslog
/etc/init.d/syslog restart
logrotate每天會排程執行,如果要手動執行的話
logrotate -d -f /etc/logrotate.conf
- Jan 06 Tue 2015 14:49
rsync 應用
rsync 是unix link系統間常用的檔案同步工具
用起來很方便,但相對的,資安的問題也要考量
最單純的作法當然是有防火牆的話,就讓防火牆開開心心做他想做的事
[查看server端有哪些module可供同步]
client 端
rsync -av server_ip::
可以列出遠端server提供那些module可供同步
如果server端不想讓別人知道有哪些mofule可供同步
可以在rsyncd.conf 設定
list = no
如此一來可以隱藏設定的模組
[略過不用同步的檔案]
rsync -av --exclude '特徵' server_ip::/module/ /dest/
[完整同步,如果server有把檔案移除的話,client端的檔案也一併移除]
rsync -av --delete server_ip::/module/ /dest/
- Dec 24 Wed 2014 15:08
lenovo x220i安裝msata ssd硬碟
lenovo x220i系列除了7mm的sata硬碟外,另外提供一個msata的介面可以使用,醬子就可以用msata開機,另外再裝一顆比較大容量的硬碟來放資料
可惜目前薄型硬碟最大似乎只到1TB
安裝步驟
1. 關閉notebook電源,翻到背面,移除電源線及電池
2. 卸下兩顆鍵盤螺絲
3. 翻到正面,先把鍵盤往前推,再把鍵盤拿起來,如果還是不好拿,可以找支一字起子輕輕撬起來,注意不要傷到排線
4. 翻到背面,移除五顆螺絲
5. 翻到正面,拿起觸碰版的上蓋,一樣注意不要傷到排線
6. 標註地方為msata的插槽,小心把上面的線移到旁邊並插入ssd硬碟,將剛剛撥開的線移回去
7. 最後基本上就是怎麼拆,就怎麼裝回去
PC DIY! 2月號/2017 第240期
雜誌名稱:PC DIY!
刊別:月刊
出版地區:台灣
語言:繁體中文
出版日期:2017/02/22
- Dec 24 Wed 2014 13:31
買錯apple app如何退款
- Nov 25 Tue 2014 18:46
安裝在vmware esx的win7 guest os會自動suspend
覺得很奇怪,為什麼放著就會自動suspend
原來是我自己豬頭,讓他睡著了
修改電源設定不要讓他自動睡眠即可
- Oct 30 Thu 2014 14:43
Promise SUPER TRAK raid rebuild
1. 開機時按ctrl+s進入raid bios
2. 點選disk array management
3 選擇進入有異常的raid
4. 點選physical drives in the disk array,記錄下正常的硬碟代號
如果線上是1,3,4 異常的id就是2
5 點選Start Manual Rebuild
Source Sequence Number 填入其中一個正常的硬碟id, 如1
Target Physical Drive ID 填入新裝上去的硬碟id, 這個例子應該要填2
6. Start Manual Rebuild 按enter, 開始rebuild
7. 回到主選單,點選background activity看目前rebuild的進度,建議重建完後再上線
- Oct 27 Mon 2014 13:32
在linux/unix下搜尋某些特定檔案是否包含關鍵字
- Oct 21 Tue 2014 17:50
exchange 2010 郵件自動轉寄功能
- Oct 14 Tue 2014 17:24
掛載nfs權限全部變成4294967294
拿centos 6.x來當nfs server
當nfs client 掛載起來的時候,檔案owner全部變成4294967294
網路上很多解法
/etc/default/nfs-common
NEED_IDMAPD=yes
及修改 /etc/idmapd.conf
但目前還沒試成功
偷雞解法就讓client強迫用nfsv3來掛載nfs了
mount -t nfs -o nfsvers=3 nfsserver:/export /mnt/remote
開機時自動掛載
vi /etc/fstab
nfsserver:/exports /mnt/remote nfs nfsvers=3
nfs4是個神奇的東西,有空再研究
- Sep 26 Fri 2014 18:04
讓guestos可以讀取usb儲存裝置
編輯guest 設定,點選add ...
依序新增 usb controller 及 usb device 即可
- Aug 25 Mon 2014 18:32
使用php計算某日是幾天後
使用php計算某日是幾天後
<?php
//未來日期的時間戳記
$exp = @strtotime($argv[1]);
//今天的時間戳記
$today = @strtotime(@date("Ymd"));
//相差的時間戳記除以86400
$days = (($exp-$today)/86400);
//即可得到未來的時間是幾天後
echo $days;
?>
- Aug 17 Sun 2014 13:13
在cisco switch 限制可以上網的clinet mac address
conf t
int gi0/1
switchport mode access
switchport port-security
switchport port-security violation protect
switchport port-security mac-address xxxx.xxxx.xxxx
- Jun 23 Mon 2014 17:24
Nessus出現Your client sent a request this server does not understand
如果出現這個錯誤訊息,試著把你的網址從原本的http://hostname:8834/ 換成 https://hostname:8834/ 看看
HTTP/1.1 400 Bad Request
Date: Mon, 23 Jun 2014 09:23:58 GMT
Server: NessusWWW
Connection: close
Expires: Mon, 23 Jun 2014 09:23:58 GMT
Content-Length: 208
Content-Type: text/html
X-Frame-Options: DENY
Cache-Control:
Expires: 0
Pragma :
400 Bad Request
Bad Request
Your client sent a request this server does not understand
Connection closed by foreign host.
- Jun 20 Fri 2014 17:19
設定vmware esx 開機後 自動啟動 guest os
1. 登入 vSphere Client
2. Configuration -> Virtual Machine Startup/Shutdown -> Properties
3. Allow virtual machines to start and stop automatically with the system 打勾
4. 將要自動開機的guest os從Manual Startup 往上移到 Automatic Startup
5. OK
- Jun 09 Mon 2014 16:10
sftp出現Received message too long 825373450錯誤訊息
[testuser@ms122] ~> sftp testuser@127.0.0.1
Password:
Received message too long 825373450
可以查看一下 .cshrc 下面是不是有類似 echo xxx 輸入螢幕的關鍵字
把這幾行移除即可
- Jun 03 Tue 2014 14:53
postfix查不到寄件者網域時->退信
編輯 main.cf
找到這一段,在最後補上reject_unknown_sender_domain
smtpd_sender_restrictions =
XXXXX
,XXXXX
,XXXXX
,XXXXX
,reject_unknown_sender_domain
配合以下的參數可以回應450或是550,建議改成450,如果當下DNS查詢不到時,對方還會繼續retry
unknown_address_reject_code = 450
重新啟動postfix
收到郵件的時候會去查詢DNS,如果查不到紀錄會出現下列的maillog
Jun 3 14:31:20 <mail.info> ms122 postfix/smtpd[89899]: NOQUEUE: reject: RCPT from unknown[219.xx.xx.253]: 550 5.1.8 <sjdhfjshjfj@huufehguerg.tw>: Sender address rejected: Domain not found; from=<sjdhfjshjfj@huufehguerg.tw> to=<test@example.com> proto=ESMTP helo=<om91.example.com>