使用 shell script 刪除 cloudflare 上的快取

1.先取得 domain name 的 ID

curl -X GET "https://api.cloudflare.com/client/v4/zones?name=網址" \
# -H "X-Auth-Email: test@gmail.com" \
# -H "X-Auth-Key: 7b9fb4xxxxxxxxxxxxxxxxxxxxxxxxxx" \
# -H "Content-Type: application/json" \

X-Auth-Email: 使用帳號
X-Auth-Key: API KEY 在 My settings 裡面可以查看

2.執行後會取得一連串的 json 字串、可以用線上 JSON檢視工具 直接看

3.取得後寫成shell script執行就好了

curl -X DELETE "https://api.cloudflare.com/client/v4/zones/e74b73xxxxxxxxxxxxxxxxxxxxxxxxxx/purge_cache" \
-H "X-Auth-Email: test@gmail.com" \
-H "X-Auth-Key: 7b9fb4xxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'

linux error . : backlog limit exceeded

此文完整連結 http://n.zipko.info/601.html
文章歡迎轉載,請尊重版權註明連結來源。

linux 的 audit 服務

Linux 的 audit (in Redhat, Suse) 服務是什麼?以前我也不會去注意,直到有一天系統 crash,不知道為什麼,打開 Monitor,只出現一堆這樣的訊息:

audit: audit_backlog=326 > audit_backlog_limit=320
audit: audit_lost=39095317 audit_rate_limit=0 audit_backlog_limit=320
audit: backlog limit exceeded

這也許不是 crash 的主因,不過先解決吧,下面是 FedoraForum 的建議:

It means that you are getting flooded with audit events. You can increase the audit daemon’s priority to make sure it has enough run time to empty its
queue or lengthen the backlog.

才引起我的注意,因此來研究一下 audit。

1. 什麼是 audit ?

Linux 系統中已經 syslog 了,syslog 會記錄系統狀態、如硬體的警告或應用軟體的記錄等。但是syslog屬於應用層,且僅只於此一應用而已,沒辦法記錄太多資訊。因此,audit 誕生以取代 syslog 的責任,來記錄核心層的事件:檔案的讀寫、系統呼叫、權限的狀態等。

2. 來看看 audit 運作的流程(圖片取自參考資料4)

Audit Daemon 運作和一般的daemon 一樣,運作後會引入selinux的系統。

3. audit 有三個操作的工具

audit 可用的三個指令:

=> auditctl – 控制 kernel audit system,能取得狀態,增或刪除rules、設定某個檔案的「檢視」(watch)。

=> ausearch – 用來查詢 audit logs 的工具。

=> aureport – 產生 audit 系統簡報的工具。

4. 設定檔

audit 的設定檔為 /etc/audit/audit.rules,主要分為三種類別:

• Basic audit system parameters
• File and directory watches
• System call audits

# basic audit system parameters
-D    (刪除舊記錄,預設-D)
-b 8192  (buffer大小,預設256,改為8192)
-f 1  (失敗控制旗標,可設為 0 (silent), 1 (印出錯誤,預設), and 2 (panic, 把系統關閉—非正常關閉,所以會有資料遺失的風險).
-e 1 (生失效,0為失效,1為生效(預設)
# some file and directory watches
-w /var/log/audit/   (觀查目錄 /var/log/audit/)
-w /etc/auditd.conf -p rxwa    (觀查檔案 /etc/auditd.conf,-p 設定權限為rxw及a屬性變更)
-w /etc/audit.rules -p rxwa
-w /etc/passwd -p rwxa
-w /etc/sysconfig/
# an example system call rule
-a entry,always -S umask

對於設定檔有幾點要說明:
• 目錄觀察的詳細度比檔案觀察低
• 無法使用任何的pathname globbing,如?或*
• 只能設定已存在的檔案,若設定觀察目錄而有新增檔案,新檔案只會在下次 audit 重啟後才會加入

利用 -k 產生 key string,以供ausearch 直接索引
-w /etc/var/log/audit/ -k LOG_audit

5. 操作實務

重啟 auditd
# service auditd restart

更新 auditd
# yum update audit

檢查檔案及系統的更動狀態
# aureport –start today –event –summary -i

查詢單一檔案
# ausearch -f filename

利用 -ts 指定日期 -k 指定 key string,其中password-file 使用 auditctl -k 來產生。
# ausearch -ts today -k password-file
# ausearch -ts 3/12/07 -k password-file

-ui 來指定 user name (UID),例如找出  (uid 506) 的操作
# ausearch -ts today -k password-file -x rm -ui 506
# ausearch -k password-file -ui 506

[參考資料]

1. FedoraForum.org http://forums.fedoraforum.org/showthread.php?t=213680

2. 檢查誰修改檔的動作 http://www.cyberciti.biz/tips/linux-audit-files-to-see-who-made-changes-to-a-file.html

3. Linux Audit Quick Start SUSE Linux Enterprise 10 SP1 http://www.novell.com/documentation/sled10/pdfdoc/auditqs_sp2/auditqs_sp2.pdf

4. The Linux Audit Subsystem Deep Dive http://linuxvm.org/present/SHARE113/S9203sw.pdf

 

http://note-end.zipko.info/601.html

YUM错误:ERROR: XZ COMPRESSION NOT AVAILABLE

今天在一台新的CentOS6服务器上配置PHP环境,用yum的方式安装,碰到问题了:

Error: xz compression not available

问题是这样来的,我参照我之前的博文安装步骤执行:《CentOS7下yum安装PHP5.6》,直到出现错误,才想起原来我当前的系统是CentOS6的!都是粗心惹的祸:-(

网上找到了解决的方法,即移除新版的epelrelease:

最好执行clean,有一次就是没执行,留有了缓存,被摆了一道。然后重新再安装6.x版本的epelrelease

 

IPdeny country block downloads

IPdeny country block downloads

All country IP block files are provided in CIDR format, at this time. Please note that we compile these lists from regional IP space providers. To correct any errors please contact your local IP space provider e.g. for Europe it’s Ripe, for North America it’s Arin.

IPv6 blocks are available. Please access IPv6 IP address blocks and we recommend using aggregated IPv6 country IP address blocks for best performance.

Note: You may NOW re-distribute our zone files and you can freely use our generated IP zone files in your commercial or freeware solutions or services, please read our Copyright policy and please comply with our Usage limits policy.

NEW! We offer aggregated country IP zone files downloads below. It means fewer rules and higher performance for firewalls, routers and custom solutions! DB ready table formats are coming soon!

Zone files last updated: Tue Sep 26 12:07:25 UTC 2017

Download compressed tar archive with all country zone files: IPv4: all-zones.tar.gz (Size: 565.18 KB) , IPv6: ipv6-all-zones.tar.gz (Size: 111.98 KB)

AFGHANISTAN (AF) [download zone file] Size: 1.30 KB (84 IP blocks) [aggregated zone file] (83 IP blocks)
LAND ISLANDS (AX) [download zone file] Size: 0.01 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
ALBANIA (AL) [download zone file] Size: 1.45 KB (95 IP blocks) [aggregated zone file] (95 IP blocks)
ALGERIA (DZ) [download zone file] Size: 0.55 KB (37 IP blocks) [aggregated zone file] (37 IP blocks)
AMERICAN SAMOA (AS) [download zone file] Size: 0.03 KB (2 IP blocks) [aggregated zone file] (2 IP blocks)
ANDORRA (AD) [download zone file] Size: 0.18 KB (12 IP blocks) [aggregated zone file] (11 IP blocks)
ANGOLA (AO) [download zone file] Size: 1.15 KB (75 IP blocks) [aggregated zone file] (75 IP blocks)
ANGUILLA (AI) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
ANTIGUA AND BARBUDA (AG) [download zone file] Size: 0.25 KB (16 IP blocks) [aggregated zone file] (16 IP blocks)
ARGENTINA (AR) [download zone file] Size: 20.96 KB (1360 IP blocks) [aggregated zone file] (1087 IP blocks)
ARMENIA (AM) [download zone file] Size: 1.59 KB (105 IP blocks) [aggregated zone file] (104 IP blocks)
ARUBA (AW) [download zone file] Size: 0.09 KB (6 IP blocks) [aggregated zone file] (5 IP blocks)
AUSTRALIA (AU) [download zone file] Size: 114.14 KB (7505 IP blocks) [aggregated zone file] (5198 IP blocks)
AUSTRIA (AT) [download zone file] Size: 22.06 KB (1430 IP blocks) [aggregated zone file] (1280 IP blocks)
AZERBAIJAN (AZ) [download zone file] Size: 1.93 KB (128 IP blocks) [aggregated zone file] (126 IP blocks)
BAHAMAS (BS) [download zone file] Size: 0.25 KB (17 IP blocks) [aggregated zone file] (17 IP blocks)
BAHRAIN (BH) [download zone file] Size: 0.78 KB (52 IP blocks) [aggregated zone file] (51 IP blocks)
BANGLADESH (BD) [download zone file] Size: 12.00 KB (776 IP blocks) [aggregated zone file] (738 IP blocks)
BARBADOS (BB) [download zone file] Size: 0.48 KB (31 IP blocks) [aggregated zone file] (31 IP blocks)
BELARUS (BY) [download zone file] Size: 1.36 KB (90 IP blocks) [aggregated zone file] (87 IP blocks)
BELGIUM (BE) [download zone file] Size: 11.95 KB (786 IP blocks) [aggregated zone file] (744 IP blocks)
BELIZE (BZ) [download zone file] Size: 0.99 KB (64 IP blocks) [aggregated zone file] (62 IP blocks)
BENIN (BJ) [download zone file] Size: 0.41 KB (27 IP blocks) [aggregated zone file] (27 IP blocks)
BERMUDA (BM) [download zone file] Size: 0.67 KB (43 IP blocks) [aggregated zone file] (43 IP blocks)
BHUTAN (BT) [download zone file] Size: 0.27 KB (17 IP blocks) [aggregated zone file] (17 IP blocks)
BOLIVIA (BO) [download zone file] Size: 1.54 KB (100 IP blocks) [aggregated zone file] (84 IP blocks)
BOSNIA AND HERZEGOVINA (BA) [download zone file] Size: 2.07 KB (138 IP blocks) [aggregated zone file] (129 IP blocks)
BOTSWANA (BW) [download zone file] Size: 0.54 KB (36 IP blocks) [aggregated zone file] (36 IP blocks)
BRAZIL (BR) [download zone file] Size: 124.60 KB (8018 IP blocks) [aggregated zone file] (2725 IP blocks)
BRITISH INDIAN OCEAN TERRITORY (IO) [download zone file] Size: 0.03 KB (2 IP blocks) [aggregated zone file] (2 IP blocks)
BRUNEI DARUSSALAM (BN) [download zone file] Size: 0.43 KB (28 IP blocks) [aggregated zone file] (26 IP blocks)
BULGARIA (BG) [download zone file] Size: 15.97 KB (1054 IP blocks) [aggregated zone file] (824 IP blocks)
BURKINA FASO (BF) [download zone file] Size: 0.38 KB (25 IP blocks) [aggregated zone file] (23 IP blocks)
BURUNDI (BI) [download zone file] Size: 0.21 KB (14 IP blocks) [aggregated zone file] (14 IP blocks)
CAMBODIA (KH) [download zone file] Size: 2.42 KB (156 IP blocks) [aggregated zone file] (153 IP blocks)
CAMEROON (CM) [download zone file] Size: 0.60 KB (40 IP blocks) [aggregated zone file] (39 IP blocks)
CANADA (CA) [download zone file] Size: 119.53 KB (7658 IP blocks) [aggregated zone file] (4244 IP blocks)
CAPE VERDE (CV) [download zone file] Size: 0.12 KB (8 IP blocks) [aggregated zone file] (8 IP blocks)
CAYMAN ISLANDS (KY) [download zone file] Size: 0.29 KB (19 IP blocks) [aggregated zone file] (19 IP blocks)
CENTRAL AFRICAN REPUBLIC (CF) [download zone file] Size: 0.09 KB (6 IP blocks) [aggregated zone file] (6 IP blocks)
CHAD (TD) [download zone file] Size: 0.16 KB (10 IP blocks) [aggregated zone file] (10 IP blocks)
CHILE (CL) [download zone file] Size: 10.34 KB (683 IP blocks) [aggregated zone file] (505 IP blocks)
CHINA (CN) [download zone file] Size: 121.11 KB (8007 IP blocks) [aggregated zone file] (4864 IP blocks)
COLOMBIA (CO) [download zone file] Size: 6.68 KB (443 IP blocks) [aggregated zone file] (333 IP blocks)
COMOROS (KM) [download zone file] Size: 0.03 KB (2 IP blocks) [aggregated zone file] (2 IP blocks)
CONGO (CG) [download zone file] Size: 0.25 KB (16 IP blocks) [aggregated zone file] (16 IP blocks)
CONGO, THE DEMOCRATIC REPUBLIC OF THE (CD) [download zone file] Size: 0.62 KB (40 IP blocks) [aggregated zone file] (39 IP blocks)
COOK ISLANDS (CK) [download zone file] Size: 0.01 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
COSTA RICA (CR) [download zone file] Size: 3.05 KB (197 IP blocks) [aggregated zone file] (162 IP blocks)
COTE D’IVOIRE (CI) [download zone file] Size: 0.50 KB (33 IP blocks) [aggregated zone file] (32 IP blocks)
CROATIA (HR) [download zone file] Size: 2.88 KB (189 IP blocks) [aggregated zone file] (183 IP blocks)
CUBA (CU) [download zone file] Size: 0.31 KB (21 IP blocks) [aggregated zone file] (17 IP blocks)
CYPRUS (CY) [download zone file] Size: 2.96 KB (191 IP blocks) [aggregated zone file] (190 IP blocks)
CZECH REPUBLIC (CZ) [download zone file] Size: 18.10 KB (1186 IP blocks) [aggregated zone file] (1126 IP blocks)
DENMARK (DK) [download zone file] Size: 17.11 KB (1118 IP blocks) [aggregated zone file] (895 IP blocks)
DJIBOUTI (DJ) [download zone file] Size: 0.09 KB (6 IP blocks) [aggregated zone file] (6 IP blocks)
DOMINICA (DM) [download zone file] Size: 0.14 KB (9 IP blocks) [aggregated zone file] (9 IP blocks)
DOMINICAN REPUBLIC (DO) [download zone file] Size: 1.62 KB (107 IP blocks) [aggregated zone file] (86 IP blocks)
ECUADOR (EC) [download zone file] Size: 4.29 KB (286 IP blocks) [aggregated zone file] (184 IP blocks)
EGYPT (EG) [download zone file] Size: 2.43 KB (164 IP blocks) [aggregated zone file] (156 IP blocks)
EL SALVADOR (SV) [download zone file] Size: 1.01 KB (66 IP blocks) [aggregated zone file] (58 IP blocks)
EQUATORIAL GUINEA (GQ) [download zone file] Size: 0.14 KB (9 IP blocks) [aggregated zone file] (9 IP blocks)
ERITREA (ER) [download zone file] Size: 0.02 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
ESTONIA (EE) [download zone file] Size: 3.21 KB (211 IP blocks) [aggregated zone file] (208 IP blocks)
ETHIOPIA (ET) [download zone file] Size: 0.08 KB (5 IP blocks) [aggregated zone file] (5 IP blocks)
FAROE ISLANDS (FO) [download zone file] Size: 0.18 KB (12 IP blocks) [aggregated zone file] (12 IP blocks)
FIJI (FJ) [download zone file] Size: 0.49 KB (32 IP blocks) [aggregated zone file] (30 IP blocks)
FINLAND (FI) [download zone file] Size: 14.17 KB (929 IP blocks) [aggregated zone file] (802 IP blocks)
FRANCE (FR) [download zone file] Size: 49.52 KB (3244 IP blocks) [aggregated zone file] (2821 IP blocks)
FRENCH GUIANA (GF) [download zone file] Size: 0.08 KB (5 IP blocks) [aggregated zone file] (5 IP blocks)
FRENCH POLYNESIA (PF) [download zone file] Size: 0.22 KB (14 IP blocks) [aggregated zone file] (14 IP blocks)
GABON (GA) [download zone file] Size: 0.51 KB (33 IP blocks) [aggregated zone file] (33 IP blocks)
GAMBIA (GM) [download zone file] Size: 0.23 KB (15 IP blocks) [aggregated zone file] (15 IP blocks)
GEORGIA (GE) [download zone file] Size: 2.49 KB (163 IP blocks) [aggregated zone file] (148 IP blocks)
GERMANY (DE) [download zone file] Size: 102.33 KB (6683 IP blocks) [aggregated zone file] (5723 IP blocks)
GHANA (GH) [download zone file] Size: 1.53 KB (101 IP blocks) [aggregated zone file] (99 IP blocks)
GIBRALTAR (GI) [download zone file] Size: 0.46 KB (30 IP blocks) [aggregated zone file] (30 IP blocks)
GREECE (GR) [download zone file] Size: 5.44 KB (359 IP blocks) [aggregated zone file] (348 IP blocks)
GREENLAND (GL) [download zone file] Size: 0.14 KB (9 IP blocks) [aggregated zone file] (9 IP blocks)
GRENADA (GD) [download zone file] Size: 0.14 KB (9 IP blocks) [aggregated zone file] (9 IP blocks)
GUADELOUPE (GP) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
GUAM (GU) [download zone file] Size: 0.43 KB (28 IP blocks) [aggregated zone file] (26 IP blocks)
GUATEMALA (GT) [download zone file] Size: 1.16 KB (74 IP blocks) [aggregated zone file] (59 IP blocks)
GUINEA (GN) [download zone file] Size: 0.18 KB (12 IP blocks) [aggregated zone file] (12 IP blocks)
GUINEA-BISSAU (GW) [download zone file] Size: 0.04 KB (3 IP blocks) [aggregated zone file] (3 IP blocks)
GUYANA (GY) [download zone file] Size: 0.19 KB (12 IP blocks) [aggregated zone file] (11 IP blocks)
HAITI (HT) [download zone file] Size: 0.41 KB (26 IP blocks) [aggregated zone file] (21 IP blocks)
HOLY SEE (VATICAN CITY STATE) (VA) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
HONDURAS (HN) [download zone file] Size: 2.72 KB (176 IP blocks) [aggregated zone file] (171 IP blocks)
HONG KONG (HK) [download zone file] Size: 33.50 KB (2181 IP blocks) [aggregated zone file] (1872 IP blocks)
HUNGARY (HU) [download zone file] Size: 7.79 KB (513 IP blocks) [aggregated zone file] (476 IP blocks)
ICELAND (IS) [download zone file] Size: 1.90 KB (123 IP blocks) [aggregated zone file] (121 IP blocks)
INDIA (IN) [download zone file] Size: 81.18 KB (5252 IP blocks) [aggregated zone file] (3953 IP blocks)
INDONESIA (ID) [download zone file] Size: 29.75 KB (1928 IP blocks) [aggregated zone file] (1688 IP blocks)
IRAN, ISLAMIC REPUBLIC OF (IR) [download zone file] Size: 19.51 KB (1278 IP blocks) [aggregated zone file] (1171 IP blocks)
IRAQ (IQ) [download zone file] Size: 2.28 KB (148 IP blocks) [aggregated zone file] (147 IP blocks)
IRELAND (IE) [download zone file] Size: 8.03 KB (527 IP blocks) [aggregated zone file] (504 IP blocks)
ISLE OF MAN (IM) [download zone file] Size: 0.25 KB (17 IP blocks) [aggregated zone file] (17 IP blocks)
ISRAEL (IL) [download zone file] Size: 7.87 KB (511 IP blocks) [aggregated zone file] (432 IP blocks)
ITALY (IT) [download zone file] Size: 34.93 KB (2294 IP blocks) [aggregated zone file] (2136 IP blocks)
JAMAICA (JM) [download zone file] Size: 0.66 KB (44 IP blocks) [aggregated zone file] (43 IP blocks)
JAPAN (JP) [download zone file] Size: 62.97 KB (4146 IP blocks) [aggregated zone file] (2752 IP blocks)
JERSEY (JE) [download zone file] Size: 0.21 KB (14 IP blocks) [aggregated zone file] (14 IP blocks)
JORDAN (JO) [download zone file] Size: 1.66 KB (108 IP blocks) [aggregated zone file] (108 IP blocks)
KAZAKHSTAN (KZ) [download zone file] Size: 4.42 KB (292 IP blocks) [aggregated zone file] (283 IP blocks)
KENYA (KE) [download zone file] Size: 2.42 KB (160 IP blocks) [aggregated zone file] (157 IP blocks)
KIRIBATI (KI) [download zone file] Size: 0.08 KB (5 IP blocks) [aggregated zone file] (5 IP blocks)
KOREA, DEMOCRATIC PEOPLE’S REPUBLIC OF (KP) [download zone file] Size: 0.02 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
KOREA, REPUBLIC OF (KR) [download zone file] Size: 16.83 KB (1121 IP blocks) [aggregated zone file] (895 IP blocks)
KUWAIT (KW) [download zone file] Size: 1.85 KB (121 IP blocks) [aggregated zone file] (119 IP blocks)
KYRGYZSTAN (KG) [download zone file] Size: 1.07 KB (70 IP blocks) [aggregated zone file] (70 IP blocks)
LAO PEOPLE’S DEMOCRATIC REPUBLIC (LA) [download zone file] Size: 0.49 KB (32 IP blocks) [aggregated zone file] (32 IP blocks)
LATVIA (LV) [download zone file] Size: 5.11 KB (338 IP blocks) [aggregated zone file] (322 IP blocks)
LEBANON (LB) [download zone file] Size: 2.95 KB (190 IP blocks) [aggregated zone file] (189 IP blocks)
LESOTHO (LS) [download zone file] Size: 0.27 KB (17 IP blocks) [aggregated zone file] (17 IP blocks)
LIBERIA (LR) [download zone file] Size: 0.18 KB (12 IP blocks) [aggregated zone file] (12 IP blocks)
LIBYAN ARAB JAMAHIRIYA (LY) [download zone file] Size: 0.36 KB (24 IP blocks) [aggregated zone file] (24 IP blocks)
LIECHTENSTEIN (LI) [download zone file] Size: 0.71 KB (46 IP blocks) [aggregated zone file] (46 IP blocks)
LITHUANIA (LT) [download zone file] Size: 4.42 KB (292 IP blocks) [aggregated zone file] (276 IP blocks)
LUXEMBOURG (LU) [download zone file] Size: 2.98 KB (195 IP blocks) [aggregated zone file] (188 IP blocks)
MACAO (MO) [download zone file] Size: 0.51 KB (33 IP blocks) [aggregated zone file] (25 IP blocks)
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF (MK) [download zone file] Size: 1.83 KB (122 IP blocks) [aggregated zone file] (84 IP blocks)
MADAGASCAR (MG) [download zone file] Size: 0.30 KB (20 IP blocks) [aggregated zone file] (20 IP blocks)
MALAWI (MW) [download zone file] Size: 0.43 KB (29 IP blocks) [aggregated zone file] (29 IP blocks)
MALAYSIA (MY) [download zone file] Size: 10.17 KB (659 IP blocks) [aggregated zone file] (544 IP blocks)
MALDIVES (MV) [download zone file] Size: 0.35 KB (23 IP blocks) [aggregated zone file] (21 IP blocks)
MALI (ML) [download zone file] Size: 0.25 KB (16 IP blocks) [aggregated zone file] (16 IP blocks)
MALTA (MT) [download zone file] Size: 1.37 KB (91 IP blocks) [aggregated zone file] (91 IP blocks)
MARSHALL ISLANDS (MH) [download zone file] Size: 0.05 KB (3 IP blocks) [aggregated zone file] (3 IP blocks)
MARTINIQUE (MQ) [download zone file] Size: 0.06 KB (4 IP blocks) [aggregated zone file] (4 IP blocks)
MAURITANIA (MR) [download zone file] Size: 0.10 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
MAURITIUS (MU) [download zone file] Size: 1.37 KB (90 IP blocks) [aggregated zone file] (87 IP blocks)
MAYOTTE (YT) [download zone file] Size: 0.02 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
MEXICO (MX) [download zone file] Size: 17.31 KB (1127 IP blocks) [aggregated zone file] (551 IP blocks)
MICRONESIA, FEDERATED STATES OF (FM) [download zone file] Size: 0.06 KB (4 IP blocks) [aggregated zone file] (4 IP blocks)
MOLDOVA, REPUBLIC OF (MD) [download zone file] Size: 5.19 KB (340 IP blocks) [aggregated zone file] (328 IP blocks)
MONACO (MC) [download zone file] Size: 0.17 KB (11 IP blocks) [aggregated zone file] (11 IP blocks)
MONGOLIA (MN) [download zone file] Size: 1.17 KB (76 IP blocks) [aggregated zone file] (75 IP blocks)
MONTENEGRO (ME) [download zone file] Size: 0.60 KB (40 IP blocks) [aggregated zone file] (40 IP blocks)
MONTSERRAT (MS) [download zone file] Size: 0.03 KB (2 IP blocks) [aggregated zone file] (2 IP blocks)
MOROCCO (MA) [download zone file] Size: 0.80 KB (54 IP blocks) [aggregated zone file] (52 IP blocks)
MOZAMBIQUE (MZ) [download zone file] Size: 0.70 KB (46 IP blocks) [aggregated zone file] (46 IP blocks)
MYANMAR (MM) [download zone file] Size: 1.36 KB (88 IP blocks) [aggregated zone file] (87 IP blocks)
NAMIBIA (NA) [download zone file] Size: 0.45 KB (30 IP blocks) [aggregated zone file] (30 IP blocks)
NAURU (NR) [download zone file] Size: 0.09 KB (6 IP blocks) [aggregated zone file] (6 IP blocks)
NEPAL (NP) [download zone file] Size: 1.68 KB (110 IP blocks) [aggregated zone file] (106 IP blocks)
NETHERLANDS (NL) [download zone file] Size: 55.94 KB (3648 IP blocks) [aggregated zone file] (3175 IP blocks)
NEW CALEDONIA (NC) [download zone file] Size: 0.63 KB (41 IP blocks) [aggregated zone file] (37 IP blocks)
NEW ZEALAND (NZ) [download zone file] Size: 24.68 KB (1610 IP blocks) [aggregated zone file] (941 IP blocks)
NICARAGUA (NI) [download zone file] Size: 0.69 KB (45 IP blocks) [aggregated zone file] (41 IP blocks)
NIGER (NE) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
NIGERIA (NG) [download zone file] Size: 3.38 KB (223 IP blocks) [aggregated zone file] (215 IP blocks)
NIUE (NU) [download zone file] Size: 0.03 KB (2 IP blocks) [aggregated zone file] (2 IP blocks)
NORFOLK ISLAND (NF) [download zone file] Size: 0.06 KB (4 IP blocks) [aggregated zone file] (4 IP blocks)
NORTHERN MARIANA ISLANDS (MP) [download zone file] Size: 0.09 KB (6 IP blocks) [aggregated zone file] (5 IP blocks)
NORWAY (NO) [download zone file] Size: 16.63 KB (1093 IP blocks) [aggregated zone file] (1008 IP blocks)
OMAN (OM) [download zone file] Size: 0.54 KB (37 IP blocks) [aggregated zone file] (37 IP blocks)
PAKISTAN (PK) [download zone file] Size: 5.66 KB (368 IP blocks) [aggregated zone file] (339 IP blocks)
PALAU (PW) [download zone file] Size: 0.05 KB (3 IP blocks) [aggregated zone file] (3 IP blocks)
PALESTINIAN TERRITORY, OCCUPIED (PS) [download zone file] Size: 1.90 KB (127 IP blocks) [aggregated zone file] (123 IP blocks)
PANAMA (PA) [download zone file] Size: 2.37 KB (154 IP blocks) [aggregated zone file] (119 IP blocks)
PAPUA NEW GUINEA (PG) [download zone file] Size: 0.58 KB (38 IP blocks) [aggregated zone file] (38 IP blocks)
PARAGUAY (PY) [download zone file] Size: 1.14 KB (73 IP blocks) [aggregated zone file] (64 IP blocks)
PERU (PE) [download zone file] Size: 2.62 KB (172 IP blocks) [aggregated zone file] (137 IP blocks)
PHILIPPINES (PH) [download zone file] Size: 7.70 KB (503 IP blocks) [aggregated zone file] (450 IP blocks)
POLAND (PL) [download zone file] Size: 53.44 KB (3474 IP blocks) [aggregated zone file] (3242 IP blocks)
PORTUGAL (PT) [download zone file] Size: 5.80 KB (381 IP blocks) [aggregated zone file] (343 IP blocks)
PUERTO RICO (PR) [download zone file] Size: 2.12 KB (139 IP blocks) [aggregated zone file] (136 IP blocks)
QATAR (QA) [download zone file] Size: 0.40 KB (27 IP blocks) [aggregated zone file] (27 IP blocks)
REUNION (RE) [download zone file] Size: 0.18 KB (12 IP blocks) [aggregated zone file] (11 IP blocks)
ROMANIA (RO) [download zone file] Size: 46.20 KB (3051 IP blocks) [aggregated zone file] (2300 IP blocks)
RUSSIAN FEDERATION (RU) [download zone file] Size: 123.30 KB (8076 IP blocks) [aggregated zone file] (6874 IP blocks)
RWANDA (RW) [download zone file] Size: 0.29 KB (19 IP blocks) [aggregated zone file] (19 IP blocks)
SAINT KITTS AND NEVIS (KN) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
SAINT LUCIA (LC) [download zone file] Size: 0.22 KB (14 IP blocks) [aggregated zone file] (14 IP blocks)
SAINT PIERRE AND MIQUELON (PM) [download zone file] Size: 0.01 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
SAINT VINCENT AND THE GRENADINES (VC) [download zone file] Size: 0.13 KB (8 IP blocks) [aggregated zone file] (8 IP blocks)
SAMOA (WS) [download zone file] Size: 0.17 KB (11 IP blocks) [aggregated zone file] (11 IP blocks)
SAN MARINO (SM) [download zone file] Size: 0.23 KB (15 IP blocks) [aggregated zone file] (15 IP blocks)
SAO TOME AND PRINCIPE (ST) [download zone file] Size: 0.03 KB (2 IP blocks) [aggregated zone file] (2 IP blocks)
SAUDI ARABIA (SA) [download zone file] Size: 5.53 KB (369 IP blocks) [aggregated zone file] (357 IP blocks)
SENEGAL (SN) [download zone file] Size: 0.36 KB (25 IP blocks) [aggregated zone file] (19 IP blocks)
SERBIA (RS) [download zone file] Size: 4.86 KB (317 IP blocks) [aggregated zone file] (306 IP blocks)
SEYCHELLES (SC) [download zone file] Size: 1.04 KB (69 IP blocks) [aggregated zone file] (59 IP blocks)
SIERRA LEONE (SL) [download zone file] Size: 0.25 KB (16 IP blocks) [aggregated zone file] (16 IP blocks)
SINGAPORE (SG) [download zone file] Size: 18.94 KB (1228 IP blocks) [aggregated zone file] (1117 IP blocks)
SLOVAKIA (SK) [download zone file] Size: 5.28 KB (345 IP blocks) [aggregated zone file] (326 IP blocks)
SLOVENIA (SI) [download zone file] Size: 6.58 KB (430 IP blocks) [aggregated zone file] (421 IP blocks)
SOLOMON ISLANDS (SB) [download zone file] Size: 0.09 KB (6 IP blocks) [aggregated zone file] (6 IP blocks)
SOMALIA (SO) [download zone file] Size: 0.23 KB (15 IP blocks) [aggregated zone file] (15 IP blocks)
SOUTH AFRICA (ZA) [download zone file] Size: 22.91 KB (1523 IP blocks) [aggregated zone file] (986 IP blocks)
SPAIN (ES) [download zone file] Size: 30.98 KB (2024 IP blocks) [aggregated zone file] (1869 IP blocks)
SRI LANKA (LK) [download zone file] Size: 0.89 KB (58 IP blocks) [aggregated zone file] (51 IP blocks)
SUDAN (SD) [download zone file] Size: 0.40 KB (27 IP blocks) [aggregated zone file] (26 IP blocks)
SURINAME (SR) [download zone file] Size: 0.17 KB (11 IP blocks) [aggregated zone file] (8 IP blocks)
SWAZILAND (SZ) [download zone file] Size: 0.22 KB (15 IP blocks) [aggregated zone file] (15 IP blocks)
SWEDEN (SE) [download zone file] Size: 26.65 KB (1754 IP blocks) [aggregated zone file] (1630 IP blocks)
SWITZERLAND (CH) [download zone file] Size: 31.18 KB (2031 IP blocks) [aggregated zone file] (1861 IP blocks)
SYRIAN ARAB REPUBLIC (SY) [download zone file] Size: 2.96 KB (191 IP blocks) [aggregated zone file] (173 IP blocks)
TAIWAN (TW) [download zone file] Size: 9.50 KB (632 IP blocks) [aggregated zone file] (447 IP blocks)
TAJIKISTAN (TJ) [download zone file] Size: 0.39 KB (26 IP blocks) [aggregated zone file] (26 IP blocks)
TANZANIA, UNITED REPUBLIC OF (TZ) [download zone file] Size: 1.60 KB (106 IP blocks) [aggregated zone file] (104 IP blocks)
THAILAND (TH) [download zone file] Size: 9.27 KB (609 IP blocks) [aggregated zone file] (484 IP blocks)
TIMOR-LESTE (TL) [download zone file] Size: 0.20 KB (13 IP blocks) [aggregated zone file] (13 IP blocks)
TOGO (TG) [download zone file] Size: 0.15 KB (10 IP blocks) [aggregated zone file] (10 IP blocks)
TOKELAU (TK) [download zone file] Size: 0.01 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
TONGA (TO) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
TRINIDAD AND TOBAGO (TT) [download zone file] Size: 0.78 KB (52 IP blocks) [aggregated zone file] (47 IP blocks)
TUNISIA (TN) [download zone file] Size: 0.30 KB (20 IP blocks) [aggregated zone file] (20 IP blocks)
TURKEY (TR) [download zone file] Size: 14.09 KB (923 IP blocks) [aggregated zone file] (849 IP blocks)
TURKMENISTAN (TM) [download zone file] Size: 0.08 KB (5 IP blocks) [aggregated zone file] (5 IP blocks)
TURKS AND CAICOS ISLANDS (TC) [download zone file] Size: 0.11 KB (7 IP blocks) [aggregated zone file] (7 IP blocks)
TUVALU (TV) [download zone file] Size: 0.01 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
UGANDA (UG) [download zone file] Size: 0.81 KB (53 IP blocks) [aggregated zone file] (53 IP blocks)
UKRAINE (UA) [download zone file] Size: 45.97 KB (2978 IP blocks) [aggregated zone file] (2742 IP blocks)
UNITED ARAB EMIRATES (AE) [download zone file] Size: 2.14 KB (143 IP blocks) [aggregated zone file] (134 IP blocks)
UNITED KINGDOM (GB) [download zone file] Size: 102.30 KB (6707 IP blocks) [aggregated zone file] (5937 IP blocks)
UNITED STATES (US) [download zone file] Size: 793.47 KB (51490 IP blocks) [aggregated zone file] (16647 IP blocks)
UNITED STATES MINOR OUTLYING ISLANDS (UM) [download zone file] Size: 0.02 KB (1 IP blocks) [aggregated zone file] (1 IP blocks)
URUGUAY (UY) [download zone file] Size: 1.22 KB (81 IP blocks) [aggregated zone file] (49 IP blocks)
UZBEKISTAN (UZ) [download zone file] Size: 1.03 KB (67 IP blocks) [aggregated zone file] (66 IP blocks)
VANUATU (VU) [download zone file] Size: 0.28 KB (18 IP blocks) [aggregated zone file] (18 IP blocks)
VENEZUELA (VE) [download zone file] Size: 3.02 KB (201 IP blocks) [aggregated zone file] (158 IP blocks)
VIET NAM (VN) [download zone file] Size: 8.93 KB (584 IP blocks) [aggregated zone file] (475 IP blocks)
VIRGIN ISLANDS, BRITISH (VG) [download zone file] Size: 1.21 KB (80 IP blocks) [aggregated zone file] (80 IP blocks)
VIRGIN ISLANDS, U.S. (VI) [download zone file] Size: 0.23 KB (15 IP blocks) [aggregated zone file] (15 IP blocks)
WALLIS AND FUTUNA (WF) [download zone file] Size: 0.05 KB (3 IP blocks) [aggregated zone file] (3 IP blocks)
YEMEN (YE) [download zone file] Size: 0.25 KB (17 IP blocks) [aggregated zone file] (17 IP blocks)
ZAMBIA (ZM) [download zone file] Size: 0.46 KB (31 IP blocks) [aggregated zone file] (31 IP blocks)
ZIMBABWE (ZW) [download zone file] Size: 0.39 KB (26 IP blocks) [aggregated zone file] (26 IP blocks)

You can also directly access country IP block files directory here.
md5 check sum file is also provided. For agreggated data please download MD5SUM here.

refer from http://www.ipdeny.com/ipblocks/

海康、大华RTSP地址格式

RTSP常用地址格式

RTSP协议介绍

常见厂家RTSP地址格式

海康

旧版本协议格式:
rtsp://[username]:[password]@<ip>:<port>/<videoType>/<channelNumber>/<streamType>
协议说明:
  • username : 用户名。默认:admin。
  • password : 密码。例如12345。
  • ip : 为设备IP。例如 192.0.0.64。
  • port : 端口号默认为554,若为默认可不填写。
  • videoType : 有h264、MPEG-4、mpeg4这几种。
  • channelNumber : 通道号,起始为1。例如通道1,则为ch1。
  • streamType : 码流类型,主码流为main/av_stream,辅码流为sub/av_stream。
使用举例
  • 主码流 :
    rtsp://admin:dfd28ddfs24@183.62.243.173:30001/h264/1/main/av_stream
  • 子码流:
    rtsp://admin:dfd28ddfs24@183.62.243.173:30001/h264/1/sub/av_stream
新版协议格式:
rtsp://user:pass@ip:port/streaming/channels/<id>[?parm1=value1&parm2=vlaue2]
协议说明:
  • user:监控用户名,默认:admin
  • pass:监控密码,默认:admin
  • ip:监控IP地址
  • port:流媒体端口,默认为:554
  • id:
    101:通道1主码流、102:通道1子码、103:通道1第三码流…1701:通道17主码流、1702:通道17子码流、1703:通道17第三码流
使用举例
rtsp://admin:hk123f@222.161.231.2:554/Streaming/Channels/101?transportmode=unicast

大华

协议地址格式
rtsp://username:password@ip:port/cam/realmonitor?channel=1&subtype=0
协议说明
  • username: 用户名。例如admin。
  • password: 密码。例如admin。
  • ip: 为设备IP。例如 10.7.8.122。
  • port: 端口号默认为554,若为默认可不填写。
  • channel: 通道号,起始为1。例如通道2,则为channel=2。
  • subtype: 码流类型,主码流为0(即subtype=0),辅码流为1(即subtype=1)。
使用举例
rtsp://admin:admin@10.12.4.84:554/cam/realmonitor?channel=2&subtype=1

作者:daogg
鏈接:http://www.jianshu.com/p/da50565e7c70
來源:簡書
著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。

申請 Let’s Encrypt 免費憑證讓網站支援 HTTP2

Letsencrypt

寫這篇最主要推廣讓網站都支援 HTTPS 加密連線及 HTTP2 協定,對於網站為什麼要支援 HTTP2,可以直接參考 ihower 寫的說明文章,最近在玩 Facebook, Line, Telegram Bot 時,填寫 Webhook URL,都強制要填寫 https:// 開頭,所以更不能忽略 HTTPS 了。,去年底寫了一篇 Let’s Encrypt 開放申請免費 SSL 憑證 推廣 Let’s Encrypt 的貢獻,讓買不起憑證,又想玩看看 HTTP2 的開發者可以用很簡單的方式來安裝及自動更新憑證,而 gslin 大為了推廣 HTTPS 也做了一個網站教學,文章寫得相當清楚,支援 Apache 及 Nginx 設定。

安裝方式

如果主機是使用 Amazone EC2,可以直接用 AWS Certificate Manager,用 AWS 的好處就是只要透過後台介面搭配 ELB 就可以直接設定好 HTTPS 對應到 EC2 主機,壞處就是直接被綁死,將來如果不要使用 AWS,要轉移機器會相當痛苦。所以本篇會紀錄如何用 Nginx 搭配 Let’s Encrypt。為了方便部署機器,我們選用 dehydrated 來設定 Let’s Encrypt,好處就是不用安裝 Python 套件,官方網站提供的安裝方式需要安裝 Python 相關環境。透過 wget 將 dehydrated 安裝到 /etc/dehydrated/ 底下

01
02
03
$ mkdir -p /etc/dehydrated/
$ wget https://raw.githubusercontent.com/lukas2511/dehydrated/master/dehydrated -O /etc/dehydrated/dehydrated
$ chmod 755 /etc/dehydrated/dehydrated

建立設定檔

建立 dehydrated config 設定檔

01
02
$ echo "WELLKNOWN=/var/www/dehydrated" > /etc/dehydrated/config
$ mkdir -p /var/www/dehydrated

Nginx 設定,先在 80 port 的 Server section 內寫入底下設定:

01
02
03
location /.well-known/acme-challenge/ {
  alias /var/www/dehydrated/;
}

可以先丟個檔案到 /var/www/dehydrated/ 確定網站可以正常讀取檔案,接著透過 dehydrated 指令產生 SSL 設定檔

01
$ /etc/dehydrated/dehydrated -c -d fbbot.wu-boy.com

執行上述指令會看到底下結果

01
02
03
04
05
06
07
08
09
10
11
12
13
# INFO: Using main config file /etc/dehydrated/config
Processing fbbot.wu-boy.com
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting challenge for fbbot.wu-boy.com...
 + Responding to challenge for fbbot.wu-boy.com...
 + Challenge is valid!
 + Requesting certificate...
 + Checking certificate...
 + Done!
 + Creating fullchain.pem...
 + Done!

最後在設定一次 nginx

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
server {
  # don't forget to tell on which port this server listens
  listen 80;
  # listen on the www host
  server_name fbbot.wu-boy.com;
  # and redirect to the non-www host (declared below)
  return 301 https://fbbot.wu-boy.com$request_uri;
}
server {
  listen 0.0.0.0:443 ssl http2;
  server_name fbbot.wu-boy.com;
  location /.well-known/acme-challenge/ {
    alias /var/www/dehydrated/;
  }
  ssl_certificate /etc/dehydrated/certs/fbbot.wu-boy.com//fullchain.pem;
  ssl_certificate_key /etc/dehydrated/certs/fbbot.wu-boy.com/privkey.pem;
  location / {
    proxy_pass http://localhost:8081;
  }
}

上面是將 80 port 自動轉到 https,如果下次要重新 renew 的時候才不會又要打開 80 port 一次。

加入 Cron 設定

每天半夜可以自動 renew 一次,請參考 https://letsencrypt.tw/ 最後章節

01
0 0 * * * root sleep $(expr $(printf "\%d" "0x$(hostname | md5sum | cut -c 1-8)") \% 86400); ( /etc/dehydrated/dehydrated -c -d fbbot.wu-boy.com; /usr/sbin/service nginx reload ) > /tmp/dehydrated-fbbot.wu-boy.com.log 2>&1

後記

除了這方法之外,也可以使用 Certbot 來自動更新憑證,但是這方式就是要安裝 Python 環境,不過也不是很難就是了,可以直接參考這篇『NGINX 使用 Let’s Encrypt 免費 SSL 憑證設定 HTTPS 安全加密網頁教學』。結論就是你可以在網路上找到超多種方法來申請 Let’s Encrypt 憑證,就找到自己覺得不錯的方法即可,而我是認為不用安裝 Python 環境的方式最適合部署了。

 

refer by https://blog.wu-boy.com/2016/10/website-support-http2-using-letsencrypt/

澳洲打工渡假 傑瑞斯特派記者C妮雪梨跨年日記

C妮為了慶祝2012仍然有太陽溫暖大地,月亮、星星照明夜晚,毅然決定到澳洲雪梨與百萬人一起迎接2013。

 

雪梨跨年

(久違的雪梨歌劇院)

雪梨跨年

(當然要帶著台灣傘參加)

 

12月31日一早先到離市區不遠且相當著名的FISH MASRKET覓食,Fish Market外型簡約地以淺藍色呈現,這裡頭聚集了好多海鮮餐廳,不像是台灣那樣的熱炒氛圍,他只是簡單分成熟食區和炸食區兩種類型供食客選擇喔! 我們一早就以生猛海鮮拼盤為2013暖身,其中有大龍蝦、新鮮生蠔、鮮味虎蝦,以及炸魷魚、炸花枝、薯條、焗烤生蠔等;價位不斐,但CP值夠高喔!

 

雪梨跨年

(Fish Market)

雪梨跨年

(Peter’s)

雪梨跨年

(生蠔)

雪梨跨年

(蝦)

雪梨跨年

(澳洲龍蝦)

雪梨跨年

(敗了敗了)

雪梨跨年

(海鮮拼盤)

雪梨跨年

(搶食中)

 

因為每年雪梨跨年煙火吸引數百萬遊客慕名而來,感謝朋友一早六點就到現場卡位,我們幾位下午兩點才到現場交接~但南半球的烈陽太熱情了,令我難以消受啊! 等待期間,我們玩起撲克牌大老二,籌碼是:丟掉洋傘,在烈陽下完全曝曬5秒鐘。文章前的你或許不了解5秒完整曝曬多殘忍,但請相信這是現場極度慘忍的懲罰喔! 請瞧瞧我當天早上才買的香蕉,經過一天的曝曬成了黑炭蕉(尖叫)!

 

雪梨跨年

(太陽好大啊!!!)

雪梨跨年

(打牌消磨時間)

雪梨跨年

(黑炭蕉)

 

雪梨的夜景搭配微微涼風,真的是經驗過火煉後的天堂~

 

雪梨跨年

(終於等到太陽要下山了)

雪梨跨年

(好美的夜景)

 

這次雪梨跨年煙火,澳洲邀請歌手凱莉‧米洛點亮海港大橋五彩斑斕的彩燈裝飾,在雪梨港灣大橋上還有凱莉‧米洛的紅唇印耶;據說,今年的煙火樣式有手印、腳印、蜜蜂、飛鳥和章魚等圖案;另外,值得一提的是,這次煙火使用生物可分解、再生水等可再生能源的材料,讓我們享受浪漫絢麗的跨年煙火的同時,還能不造成環境的負擔。

 

雪梨跨年

(凱莉‧米洛紅脣 啾咪~)

雪梨跨年

(哇~~~)

雪梨跨年

(尖叫!!!!)

 

參加百萬人共襄盛舉的跨年真的讓我大開眼界~ 你的must visit口袋名單是否也將雪梨跨年的選項哩? 請提早規劃唷!

 

雪梨跨年

(完~ 2013新年快樂!!!)

就是igofun