diff --git a/content/blog/script-php-cek-double-entry-dari-setiap-line-dalam-1-file/index.id.md b/content/blog/script-php-cek-double-entry-dari-setiap-line-dalam-1-file/index.id.md index e2430ac..6ba9f9c 100644 --- a/content/blog/script-php-cek-double-entry-dari-setiap-line-dalam-1-file/index.id.md +++ b/content/blog/script-php-cek-double-entry-dari-setiap-line-dalam-1-file/index.id.md @@ -25,7 +25,7 @@ images: # name: book # color: '#e24d0e' authors: -# - ditatompel + - ditatompel --- Jadi ceritanya kemarin ada **NOC** yang bertanya, bisa ga sih klo kita ngecek entri konfigurasi yang *double* menggunakan script. Terus ane dikasi contoh file yang namanya `nice.rsc`. Setelah saya buka, ternyata file tersebut digunakan untuk menambahkan alamat IP yang terdaftar di **OpenIXP** ke **MikroTik RouterOS**. diff --git a/content/blog/spysdotru-proxy-checker-php/feature-spysruproxy.png b/content/blog/spysdotru-proxy-checker-php/feature-spysruproxy.png new file mode 100644 index 0000000..5bcf77a Binary files /dev/null and b/content/blog/spysdotru-proxy-checker-php/feature-spysruproxy.png differ diff --git a/content/blog/spysdotru-proxy-checker-php/index.id.md b/content/blog/spysdotru-proxy-checker-php/index.id.md new file mode 100644 index 0000000..99dd94d --- /dev/null +++ b/content/blog/spysdotru-proxy-checker-php/index.id.md @@ -0,0 +1,171 @@ +--- +title: "spys[dot]ru Proxy Checker [PHP]" +description: "Script untuk cek list proxy dari spys.ru dengan fitur pengecekan proxy tersebut cukup cepat atau tidak sesuai dengan koneksi internet yang digunakan." +date: 2013-02-21T21:31:51+07:00 +lastmod: +draft: false +noindex: false +featured: false +pinned: false +# comments: false +series: +# - +categories: + - Programming +tags: + - PHP + - Proxy +images: +# - +# menu: +# main: +# weight: 100 +# params: +# icon: +# vendor: bs +# name: book +# color: '#e24d0e' +authors: + - ditatompel +--- + +Script untuk cek *list proxy* dari `spys.ru` dengan fitur pengecekan *proxy* tersebut cukup cepat atau tidak sesuai dengan koneksi internet yang digunakan. Caranya melalui *respond* dari *proxy server* / *timeout*-nya (*default*nya saya buat 3 detik). + + +```php + + * + * Example usage : + * $proxy = new spysRU(); + * $proxy->goodProxy(); // show proxies fits your current internet connection. + * [or] + * $proxy->goodProxy(1); // show debug for error connection from proxy server. + * [or] + * $proxy->showProxy(); // show any available free proxy from spys.ru + * + * + * LICENSE : + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +class spysRU { + + protected $url = 'http://spys.ru/en/free-proxy-list/'; + protected $defaultTimeOut = 3; // in seconds + private $data = ''; + private $ports = array(); + private $proxyData; + private $userAgent = array( + 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5', + 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11', + 'Opera/9.25 (Windows NT 5.1; U; en)', + 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', + 'Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko) (Kubuntu)', + 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070731 Ubuntu/dapper-security Firefox/1.5.0.12', + 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:50', + 'Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+2011-10-16 20:21:10', + 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.0', + 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6' + ); + + function __construct() { + $postValue = array('sto' => 'View 150 per page'); + $eva = curl_init(); + curl_setopt($eva, CURLOPT_URL, $this->url); + curl_setopt($eva, CURLOPT_USERAGENT, $this->userAgent[array_rand($this->userAgent)]); + curl_setopt($eva, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($eva, CURLOPT_POST, 1); + curl_setopt($eva, CURLOPT_POSTFIELDS, $postValue); + $this->data = curl_exec($eva); + + preg_match('/<\/table>