helloworld

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

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

owasp zap
openvas
測試結果後埔

文章標籤

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

在bind 9.9以後,slave的zone file格式預設為raw, 不再是text格式
所以無法直接檢視

如果要檢視的話,可以透過bind工具來轉換格式
example
named-compilezone -f raw -F text -o mybox.tw.zone.txt mybox.tw mybox.tw.zone

usage: named-compilezone [-djqvD] [-c class] [-f inputformat] [-F outputformat] [-t directory] [-w directory] [-k (ignore|warn|fail)] [-n (ignore|warn|fail)] [-m (ignore|warn|fail)] [-r (ignore|warn|fail)] [-i (full|full-sibling|local|local-sibling|none)] [-M (ignore|warn|fail)] [-S (ignore|warn|fail)] [-W (ignore|warn)] -o filename zonename filename

undefined

文章標籤

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

ntp server 重開機後,會需要一段時間跟internet同步時間
這段期間如果client跟ntp server校時時會出現以下的錯誤
[root@zap ~]# ntpdate ntp.mybox.tw
25 Feb 10:27:23 ntpdate[26362]: no server suitable for synchronization found

加上 -d 參數可以看到詳細的debug內容
ntp.mybox.tw: Server dropped: strata too high

[root@zap ~]# ntpdate -d ntp.mybox.tw
25 Feb 10:30:49 ntpdate[26443]: ntpdate 4.2.2p1@1.1570-o Sat Dec 20 02:52:11 UTC 2014 (1)
Looking for host ntp.mybox.tw and service ntp
host found : ntp.mybox.tw
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
ntp.mybox.tw: Server dropped: strata too high
server ntp.mybox.tw, port 123
stratum 16, precision -19, leap 11, trust 000
refid [ntp.mybox.tw], delay 0.02626, dispersion 0.00002
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036 14:28:16.000
originate timestamp: d897b259.6921672c  Wed, Feb 25 2015 10:30:49.410
transmit timestamp:  d897b259.66759ab6  Wed, Feb 25 2015 10:30:49.400
filter delay:  0.02725  0.02666  0.02646  0.02626
         0.00000  0.00000  0.00000  0.00000
filter offset: 0.010067 0.009981 0.010047 0.010051
         0.000000 0.000000 0.000000 0.000000
delay 0.02626, dispersion 0.00002
offset 0.010051

25 Feb 10:30:49 ntpdate[26443]: no server suitable for synchronization found

過幾分鐘後,等ntp server同步完時間後即可正常運作


[root@zap ~]# ntpdate -d ntp.mybox.tw
25 Feb 10:33:04 ntpdate[26472]: ntpdate 4.2.2p1@1.1570-o Sat Dec 20 02:52:11 UTC 2014 (1)
Looking for host ntp.mybox.tw and service ntp
host found : ntp.mybox.tw
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
server ntp.mybox.tw, port 123
stratum 2, precision -19, leap 00, trust 000
refid [ntp.mybox.tw], delay 0.02618, dispersion 0.00000
transmitted 4, in filter 4
reference time:    d897b2df.147be8ab  Wed, Feb 25 2015 10:33:03.080
originate timestamp: d897b2e0.56b48642  Wed, Feb 25 2015 10:33:04.338
transmit timestamp:  d897b2e0.537d0f1f  Wed, Feb 25 2015 10:33:04.326
filter delay:  0.02733  0.02660  0.02625  0.02618
         0.00000  0.00000  0.00000  0.00000
filter offset: 0.012223 0.012172 0.012194 0.012217
         0.000000 0.000000 0.000000 0.000000
delay 0.02618, dispersion 0.00000
offset 0.012217

25 Feb 10:33:04 ntpdate[26472]: adjust time server ntp.mybox.tw offset 0.012217 sec

文章標籤

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

#調整成台北時間 +0800
vi /etc/sysconfig/clock
ZONE="Asia/Taipei"

cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime

#手動校時
ntpdate time.stdtime.gov.tw

#寫入bios
hwclock -w

文章標籤

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

如果mail server是postfix,mua寄信時出現這個警告訊息
Must issue a STARTTLS command first.

Solution:
modify etc/postfix/master.cf
#smtpd_tls_security_level=encrypt
smtpd_tls_security_level=may

Must issue a STARTTLS command first  

文章標籤

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

現在的MUA一般都會預設pop3收信時可以在server中保留幾天的信件
但,MUA又是怎麼判斷上一次已經收到哪一封,下次要從哪一封開始收咧?

pop3收信時,每一封信都會有一封單一的ID,來區別每一封信件
這個ID就叫做UIDL
以下是dovecot 2.x 的預設值
設定檔為 dovecot/conf.d/20-pop3.conf
  # POP3 UIDL (unique mail identifier) format to use. You can use following
  # variables, along with the variable modifiers described in
  # doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase)
  #
  #  %v - Mailbox's IMAP UIDVALIDITY
  #  %u - Mail's IMAP UID
  #  %m - MD5 sum of the mailbox headers in hex (mbox only)
  #  %f - filename (maildir only)
  #  %g - Mail's GUID
  #
  # If you want UIDL compatibility with other POP3 servers, use:
  #  UW's ipop3d         : %08Xv%08Xu
  #  Courier             : %f or %v-%u (both might be used simultaneosly)
  #  Cyrus (<= 2.1.3)    : %u
  #  Cyrus (>= 2.1.4)    : %v.%u
  #  Dovecot v0.99.x     : %v.%u
  #  tpop3d              : %Mf
  #
  # Note that Outlook 2003 seems to have problems with %v.%u format which was
  # Dovecot's default, so if you're building a new server it would be a good
  # idea to change this. %08Xu%08Xv should be pretty fail-safe.
  #
  #pop3_uidl_format = %08Xu%08Xv

server端可以用telnet mailserver 110 指令測試
登入後打uidl 就可以show出每一封信的uidl

驗證客戶端的收信log以thunderbird為例
可以在%appdata%\Roaming\Thunderbird\Profiles\ 下面搜尋popstate.dat 檔案
裡面就記載了,thunderbird上次的收信紀錄,下次才不會收到重複的信件

文章標籤

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

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) 人氣()

Close

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

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

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

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

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼