目前分類:系統管理 (432)

瀏覽方式: 標題列表 簡短摘要

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/

文章標籤

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

將原來的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

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

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

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

開始 -> 控制台 -> 硬體和音效 -> 聲音
把喇叭設定成預設即可

lenovo x220 speaker not work  

文章標籤

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

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

文章標籤

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

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/

文章標籤

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

lenovo x220i系列除了7mm的sata硬碟外,另外提供一個msata的介面可以使用,醬子就可以用msata開機,另外再裝一顆比較大容量的硬碟來放資料
可惜目前薄型硬碟最大似乎只到1TB

lenovo x220i msata ssd  

安裝步驟

1. 關閉notebook電源,翻到背面,移除電源線及電池

2. 卸下兩顆鍵盤螺絲
lenovo x220i msata ssd  

3. 翻到正面,先把鍵盤往前推,再把鍵盤拿起來,如果還是不好拿,可以找支一字起子輕輕撬起來,注意不要傷到排線
lenovo x220i msata ssd  

4. 翻到背面,移除五顆螺絲
lenovo x220i msata ssd  

5. 翻到正面,拿起觸碰版的上蓋,一樣注意不要傷到排線
  lenovo x220i msata ssd  

6. 標註地方為msata的插槽,小心把上面的線移到旁邊並插入ssd硬碟,將剛剛撥開的線移回去
lenovo x220i msata ssd  

7. 最後基本上就是怎麼拆,就怎麼裝回去


undefined
PC DIY! 2月號/2017 第240期
雜誌名稱:PC DIY!  
刊別:月刊
出版地區:台灣
語言:繁體中文
出版日期:2017/02/22

文章標籤

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

1. 開啟 https://reportaproblem.apple.com/
登入apple id及密碼

2. 在你購買的app右手邊選擇"回報問題"

3. 下拉選擇"項目可開啟,但運作效果不如預期",並在textarea中輸入"您好,這個程式不符合需求,請協助退費" 之類的文字並送出

4. 下一頁就可以選擇要退費

5. 最後這個app會顯示"待退款"

我不是奧客,但是真的不如預期啊...

undefined

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

覺得很奇怪,為什麼放著就會自動suspend
原來是我自己豬頭,讓他睡著了
修改電源設定不要讓他自動睡眠即可
win7電源管理  

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

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的進度,建議重建完後再上線

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

find: 用來搜尋目錄下面的特定檔案
grep: 用來搜尋該檔案是否有包含特定關鍵字
如果要配合運作可以用xargs

example :
//從根目錄搜尋所有index.php的檔名,裡面是否有包含helloworld關鍵字
find / -name index.php | xargs grep helloworld

undefined

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

在 sendmail/postfix 的mail server
aliases 的forward 工能常用在部門群組信、專案成員、或是員工離職後要把信件轉給哪個代理人
當然還有很多應用就看使用者如何去發揮他的強大功能
如果想在microsoft exchange 2010 中實現類似群組信功能的話
可以用設定exchange的通訊群組

以下是簡單的操作步驟

1. 打開EMC
2. 新增一個通訊群組,如sales01
exchange aliases forward

3. 接下來選擇這個通訊群組真正的收信者是誰
group2  

undefined

文章標籤

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

拿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是個神奇的東西,有空再研究

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

esx usb device  

編輯guest 設定,點選add ...
依序新增 usb controller 及 usb device 即可

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

使用php計算某日是幾天後

<?php
//未來日期的時間戳記
$exp = @strtotime($argv[1]);

//今天的時間戳記
$today = @strtotime(@date("Ymd"));

//相差的時間戳記除以86400
$days = (($exp-$today)/86400);

//即可得到未來的時間是幾天後
echo $days;

?>

文章標籤

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

conf t
int gi0/1

 switchport mode access
 switchport port-security
 switchport port-security violation protect
 switchport port-security mac-address xxxx.xxxx.xxxx

 

文章標籤

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

如果出現這個錯誤訊息,試著把你的網址從原本的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.



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

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
vmware Automatic Startup  

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

[testuser@ms122] ~> sftp testuser@127.0.0.1
Password:
Received message too long 825373450

可以查看一下 .cshrc 下面是不是有類似 echo xxx 輸入螢幕的關鍵字
把這幾行移除即可

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

編輯 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>


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

Close

您尚未登入,將以訪客身份留言。亦可以上方服務帳號登入留言

請輸入暱稱 ( 最多顯示 6 個中文字元 )

請輸入標題 ( 最多顯示 9 個中文字元 )

請輸入內容 ( 最多 140 個中文字元 )

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼