PIXNET Logo登入

495884965

跳到主文

XXX

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 9月 27 週六 201413:58
  • Apache rewrite 啟用

參考:
apache RewriteRule RewriteCond介紹
Rewrite Flag介紹
#a2enmod rewrite 
#service apache2 restart
#vi /etc/apache2/apache2.conf
===================
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 26 週五 201417:39
  • HTTP VS HTTPS

參考
$ curl -w "TCP handshake: %{time_connect}, SSL handshake: %{time_appconnect}\n" -so /dev/null https://www.alipay.com
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 26 週五 201412:14
  • nginx proxy_next_upstream

參考
偵測到錯誤會往下個upsteam server送
upstream serverA {
 server 168.95.1.1:80;
 server 168.95.1.2:80;
}
location / {
   proxy_pass http://serverA;
   proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
}
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 24 週三 201417:13
  • Linux 刪除大量檔案

參考1:
有大量檔案要刪除要多時間
有時候還會遇到檔案名稱過長的問題
網路上有找到用find perl rsync來刪除大量檔案的方法
假設要刪除/home/ftp下的所有檔案
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 23 週二 201415:06
  • sudo without password

參考
#vi /etc/sudoers
[Username] ALL=NOPASSWD:/usr/sbin/service memcached restart
save and work!!!
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 19 週五 201415:28
  • 快速查IP位置

參考
查IP的來源
1.用nslookup 或 dig -x [IP]
判斷準度普通
2.Linux可以裝geoiplookup
geoiplookup [ IP ]
3.透過ipinfo.ip去查
配合curl
ex:
#curl ipinfo.io/203.71.84.1
{
"ip": "203.71.84.1",
"hostname": "No Hostname",
"city": null,
"region": null,
"country": "TW",
"loc": "23.5000,121.0000",
"org": "AS1659 Tiawan Academic Network (TANet) Information Center"
}
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 19 週五 201414:17
  • nginx proxy status

http://wiki.nginx.org/NginxHttpUpstreamModule#.24upstream_response_time
https://rtcamp.com/tutorials/nginx/upstream-cache-status-in-access-log/
https://rtcamp.com/tutorials/nginx/log-parsing/
log_format rt_cache '$remote_addr - $upstream_cache_status [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"';
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 19 週五 201411:03
  • nginx rotate log file hourly

http://nginx.org/en/docs/control.html#logs
http://www.jeffmould.com/2013/10/24/rotate-nginx-log-files/
 
#vi rotate_log.sh
DATE=$(date +%Y-%m-%d-%H%M)
mv "/var/log/nginx/access.log" "/var/log/nginx/access.log.$DATE"
mv "/var/log/nginx/error.log" "/var/log/nginx/error.log.$DATE"
kill -USR1 `cat /var/run/nginx.pid`
sleep 1
gzip /var/log/nginx/access.log.$DATE
gzip /var/log/nginx/error.log.$DATE
#vi /etc/crontab 
1 */1 * * * root rotate_log.sh > /var/log/backup.log 2>&1
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 17 週三 201409:44
  • AWS RDS Replication error

參考
Read Replica Replication Error - SQLError: 1062, reason: Error 'Duplicate entry '312626' for key 'PRIMARY'' on query. Default database: 'urstylecomtw_search'. Query: '-- MarsZ: insert into cosme_review ( crv_seq,crv_fid,crv_sid,crv_pseq,crv_memid,crv_member_active_exp,crv_skin,crv_age,crv_evalues,crv_evalues_weighted,crv_comment,crv_comment0,crv_date,crv_situation1,crv_situation2,crv_situation3,crv_situation4,crv_situation5,crv_situation6,crv_situation7,crv_situation8,crv_situation9,crv_situation10,crv_situation11,crv_situation12,crv_poll_1,crv_poll_2,crv_accuse,crv_product_type,crv_product_obtain,crv_used_repeat,crv_poll,crv_ip,pics_count,crv_unverify_num,crv_reply_num,crv_prevreplydate,crv_lastreplydate,review_pageview_final,cosme_reviewcol,crv_product_weather) value( ' 312626 ' , ' 37 ' , ' 5899 ' , ' 13971 ' , ' 49102 ' , ' 61 ' , ' 4 ' , ' 18 ' , ' 4 ' , ' 4 ' , ' ?????????\r\n?????????\r\n\r\n????????\r\n\r\n????????r\n??????????????\r\n??????O??
 主鍵重複,只能跳過這筆的備份
mysql> call mysql.rds_skip_repl_error;
+-------------------------------------------------+
| Message                                            |
+-------------------------------------------------+
| Statement in error has been skipped   |
+-------------------------------------------------+
1 row in set (0.28 sec)
+-----------------------------------+
| Message                            |
+-----------------------------------+
| Slave is running normally    |
+-----------------------------------+
1 row in set (2.28 sec)
Query OK, 0 rows affected (2.34 sec)
mysql>
有些網路上要start slave;
不過在RDS上不用,他會自己啟動服務
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 9月 16 週二 201417:16
  • SSH採用公鑰認証

情況:A SSH 到B不要輸入帳號密碼
先在B上把/etc/ssh/sshd_config中
PasswordAuthentication no
#service sshd restart
在A上產生一對key(Public & Private)
#ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/MA19/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): <輸入密碼>
Enter same passphrase again: <輸入密碼>
Your identification has been saved in /home/MA19/.ssh/id_rsa.
Your public key has been saved in /home/MA19/.ssh/id_rsa.pub.
The key fingerprint is:
fd:cf:02:69:fb:a1:e7:d7:f0:af:94:75:49:0c:a8:1e MA19@19
The key's randomart image is:
+--[ RSA 2048]----+
| .. |
| . o |
| . o |
| E . .|
| S o. .o|
| .+. .o.|
| . oo o+ |
| ..o=. o|
| .+oo+.o|
+-----------------+
(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
«1...67821»

個人資訊

slinbody
暱稱:
slinbody
分類:
心情日記
好友:
累積中
地區:

熱門文章

  • (3,365)Traceroute原理
  • (2,411)Freeradius筆記
  • (2,387)ZFS raidz以上擴充容量
  • (1,956)Mail error
  • (1,635)SENDMAIL 相關問題
  • (1,074)Outlook 無法寄出信
  • (1,067)FreeBSD + 無線網卡 組 無線AP
  • (1,009)Juniper EX2200 Switch snmp
  • (445)[Freebsd] ipfw 限速
  • (356)newsyslog.conf 設定

文章分類

toggle Window (2)
  • Outlook (2)
  • Window (5)
toggle Freebsd (2)
  • FreeBSD (21)
  • FreeBSD-IPFW (3)
toggle linux (4)
  • Linux-sendmail (6)
  • Linux-Proxy (1)
  • Linux-NIS (1)
  • Linux-dovecot (1)
  • [Script] (9)
  • SNMP (5)
  • 網路 (9)
  • 電子郵件 (1)
  • LINUX (62)
  • 未分類文章 (1)

最新文章

  • Mysql utf8 to utf8mb4
  • curl upload file
  • fisa vim on rasbian
  • Amazon cloud drive
  • tcpdump 觀察 http header
  • telegram python api
  • find before after some time
  • vim diff mode color
  • diff 檔案內容比對
  • HC-05 vs HC-06

最新留言

  • [24/11/21] 訪客 於文章「TinTin++...」留言:
    歡迎來大陸玩 《北大俠客行》...
  • [19/09/18] 路過的肥宅 於文章「確認筆電是否支援Wifi 5GHz訊號...」留言:
    感謝分享,很實用的資訊!...
  • [19/08/09] 于誠濠 於文章「確認筆電是否支援Wifi 5GHz訊號...」留言:
    謝謝分享!!...
  • [13/12/19] 訪客 於文章「[NIS] binding to YP ...」留言:
    謝謝你!!設定檔都對, 真的是沒有做ypinit -m ...

文章精選

文章搜尋

誰來我家

參觀人氣

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