. // // Alexey A.Znayev, znaeff@mail.ru, http://xbsoft.org, http://xbsoft.ru // /////////////////////////////////////////////////////////////////////////// // This file contains public class DNSBL // This class performs IP address check in spam blocking lists as described // on http://ru.wikipedia.org/wiki/RBL class DNSBL { private $_aCheckers = array( // list of checkers available for individual checking 'spamhaus' => array('.zen.spamhaus.org', true), //available for group checking with 'all' key 'spamcop' => array('.bl.spamcop.net', true), //available for group checking with 'all' key 'dsbl' => array('.list.dsbl.org', false), //not available for group checking with 'all' key 'ordb' => array('.relays.ordb.org', false), //not available for group checking with 'all' key 'sorbs' => array('.dnsbl.sorbs.net', false), //not available for group checking with 'all' key 'njabl' => array('.dnsbl.njabl.org', false) //not available for group checking with 'all' key ); // AZ - 1. Key 'all' is illegal // AZ - 2. Most of spammer IP addresses is covered by 'spamhaus' & 'spamcop' (and they are fast), // some of the rest may not work sometimes, you can make them group checking available after individual testing private $_sDefaultChecker = 'spamhaus'; /////////////////////////////////////////////////////////////////////////// // CheckSpamIP - check IP for spam in checkers : given, default or all available for group checking (may be slow) // parameters: // string $ip - ip address // string $checker - checker name or 'all' or nothing // returns: // true when IP exitsts in spam-lists of $checker or at least one of all checkers // false when not or when ip address is local or not correct public function CheckSpamIP($ip, $checker = ''){ if(empty($ip)) return false; if(preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $ip) != 1) return false; $octets = explode('.', $ip); if($octets[0] == '127') return false; if($octets[0] == '10') return false; if($octets[0] == '192' && $octets[0] == '168') return false; if($octets[0] == '169' && $octets[0] == '254') return false; // ms windows if((int)$octets[0] > 255 || (int)$octets[1] > 255 || (int)$octets[2] > 255 || (int)$octets[3] > 255 ) return false; $ret_val = false; $PTR = implode(array_reverse($octets), '.'); if($checker === 'all'){ foreach(array_values($this->_aCheckers) as $c){ if($c[1]){ $ret_val = $ret_val || $this->_CheckDNSAnswer(dns_get_record($PTR . $c[0], DNS_A)); } if($ret_val) break; } }else if(array_key_exists($checker, $this->_aCheckers)){ $ret_val = $this->_CheckDNSAnswer(dns_get_record($PTR . $this->_aCheckers[$checker][0], DNS_A)); }else{ $ret_val = $this->_CheckDNSAnswer(dns_get_record($PTR . $this->_aCheckers[$this->_sDefaultChecker][0], DNS_A)); } return $ret_val; } /////////////////////////////////////////////////////////////////////////// // GetCheckers - gets list of available checker names // returns: // array of strings public function GetCheckers(){ return array_keys($this->_aCheckers); } /////////////////////////////////////////////////////////////////////////// // GetGroupCheckers - gets list of checker names available for group checking with 'all' key // returns: // array of strings public function GetGroupCheckers(){ $ret_val = array(); foreach(array_keys($this->_aCheckers) as $k) if($this->_aCheckers[$k][1]) array_push($ret_val, $k); return $ret_val; } /////////////////////////////////////////////////////////////////////////// // GetDefaultChecker - gets default checker name // returns: // string public function GetDefaultChecker(){ return $this->_sDefaultChecker; } /////////////////////////////////////////////////////////////////////////// // SetDefaultChecker - sets default checker name // parameters: // string $new_checker - new default checker name // returns: // true when success // false when failed ($new_checker is not in the list of available checker names) public function SetDefaultChecker($new_checker){ if(array_key_exists($new_checker, $this->_aCheckers)){ $this->_sDefaultChecker = $new_checker; return true; }else{ return false; } } /////////////////////////////////////////////////////////////////////////// // EnableGroupChecking - sets checker available for group checking // parameters: // string $checker - checker name // returns: // true when success ($checker is included) // false when failed ($checker is not in the list of available checker names) public function EnableGroupChecking($checker){ if(array_key_exists($checker, $this->_aCheckers)){ $this->_aCheckers[$checker][1] = true; return true; }else{ return false; } } /////////////////////////////////////////////////////////////////////////// // DisableGroupChecking - sets checker not available for group checking // parameters: // string $checker - checker name // returns: // true when success ($checker is excluded) // false when failed ($checker is not in the list of available checker names) public function DisableGroupChecking($checker){ if(array_key_exists($checker, $this->_aCheckers)){ $this->_aCheckers[$checker][1] = false; return true; }else{ return false; } } // private methods /////////////////////////////////////////////////////////////////////////// // _CheckDNSAnswer - checks DNS-server answer for 127.0.0.* values // returns: // true when success // false when failed private function _CheckDNSAnswer($dns_answer){ if(!is_array($dns_answer)) return false; $len = count($dns_answer); if($len <= 0) return false; for($i=0; $i<$len; $i++){ $obj = $dns_answer[$i]; if(!(is_object($obj) || is_array($obj))) return false; $ip_str = $obj['ip']; if(!is_string($ip_str)) return false; $pos = strpos($ip_str, '127.0.0.'); if($pos !== false) return true; } return false; } } // end of class DNSBL ?> internet – Christian Aurich http://c-aurich.de/wordpress all about my personal interests Wed, 15 Jun 2016 20:21:23 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.28 Fixed Issue in SpringerlinkBatchCreator http://c-aurich.de/wordpress/2011/11/fixed-issue-in-springerlinkbatchcreator/ http://c-aurich.de/wordpress/2011/11/fixed-issue-in-springerlinkbatchcreator/#respond Fri, 04 Nov 2011 19:40:59 +0000 http://c-aurich.de/wordpress/?p=349 Continue reading "Fixed Issue in SpringerlinkBatchCreator"

]]>
Springerlink updated their website causing my userscript “SpringerlinkBatchCreator” to not display the “add book” link. Thus today I searched for a solution to fix this issue and found it. It is now working again.

I also added chromium and chrome support. To support these I had to include some third party code that reimplements GM_setValue and GM_getValue.

]]>
http://c-aurich.de/wordpress/2011/11/fixed-issue-in-springerlinkbatchcreator/feed/ 0
AI online class http://c-aurich.de/wordpress/2011/09/ai-online-class/ http://c-aurich.de/wordpress/2011/09/ai-online-class/#respond Mon, 12 Sep 2011 09:39:01 +0000 http://c-aurich.de/wordpress/?p=331 Continue reading "AI online class"

]]>
I just read about an online course at stanford university in the last couple of days. This is meant to be a full university course called introduction to Artificial Intelligence and includes homework assignments each week as well as midterm end final exams (only for the advanced track, basic track only requires watching the lecture material). You will get a statement of accomplishment at the end.

I will try to take this class, lets see if I can manage to finish the advanced track.

]]>
http://c-aurich.de/wordpress/2011/09/ai-online-class/feed/ 0
integration to facebook http://c-aurich.de/wordpress/2011/01/integration-to-facebook/ http://c-aurich.de/wordpress/2011/01/integration-to-facebook/#respond Sun, 16 Jan 2011 13:09:16 +0000 http://c-aurich.de/wordpress/?p=175 Continue reading "integration to facebook"

]]>
as I am quite unmotivated to study for the exam tomorrow, I played a little with my website.

First of all I moved it to another server that finally supports php5, because most plugins for wordpress do not work with php4.

After that I installed a plugin named SFC – simple facebook connect. This is not only one plugin, it is a whole bunch of them.

First of all I had to create a new application on facebook to use it, thats an easy step and now there is an application called “c-aurich.de”.

After creating the application you get some kes that are saved to the settings of SFC. Now you can enable several functions of it. Most important to me was the possibility to automatically publish my posts on facebook. This post ist the first try to do that, but as you see on facebook it already works for manually publishing previous posts.

Other nice features are the share button and the function that lets facebook users post comments to my website with using the fb-account.

I will play further on that topic and report, but I should start studying now 😉

]]>
http://c-aurich.de/wordpress/2011/01/integration-to-facebook/feed/ 0
Downloading Springer books easier http://c-aurich.de/wordpress/2010/10/downloading-springer-books-more-easy/ http://c-aurich.de/wordpress/2010/10/downloading-springer-books-more-easy/#respond Tue, 05 Oct 2010 23:40:28 +0000 http://c-aurich.de/wordpress/?p=68 Continue reading "Downloading Springer books easier"

]]>
I am very glad to have free access to a lot of great books at springerlink.com, and to be able to download them as PDF. But the bad thing about it is that you get every chapter of a book as a single pdf file.

One day I had the idea to make a shell-skript that gets all these files for me and merges them to a single file. But first step was to check google if there was no such skript. Fortunately there already has been a piece of great software that was better then I expected.
This skript is written in python and is named springer_download.py from Milian

After some month I wanted a couple of new books for the new semester. And there was also a new version of the software that was now also able to take the ISBN of the books. Unfortunately I had a lot of books to download. I was lucky again: a friendly guy from my university gave me a skript that calls springer_download.py in batch to download multiple books without taking care about it too much.
You can find it here.

But to use this batch download more efficiently I wanted to have a small greasemonkey plugin. There was nothing like that before, so I programmed it the last days. It adds some links to springerlink.com book pages that allow you to make a list of ISBN numbers. These numbers can be copied to the file batchlist.txt that is needed for the batchdownload.
You can find it an Github as well: SpringerlinkBatchCreator
I will add some features sometimes, but that should be ok for the moment. Feel free to change it and to say something about it.

]]>
http://c-aurich.de/wordpress/2010/10/downloading-springer-books-more-easy/feed/ 0
Mobook update http://c-aurich.de/wordpress/2010/09/mobook-update/ http://c-aurich.de/wordpress/2010/09/mobook-update/#respond Tue, 07 Sep 2010 19:54:34 +0000 http://c-aurich.de/wordpress/?p=49 Continue reading "Mobook update"

]]>
Nachdem ich grad hier gesehen habe, dass die ersten per Google-Suche nach Mobook hier hergekommen sind, möchte ich doch mal ein update dazu schreiben.

Generell haben wir keinerlei Einschränkungen festgestellt. Sämtliche Kommunikation klappte bisher. ICQ, Jabber, Google-Talk. Morgen ist ein Voicechat test per Google-Talk dran.

Zu SIP kann ich leider nichts sagen. Wir haben keinen SIP-Client installiert. Ich erwarte allerdings, dass es wie bei vielen anderen UMTS Tarifen gesperrt sein wird. Hat dazu jemand Erfahrungen?

Problematisch ist allerdings nur das Wetter. Sobald Wolken aufziehen, ist die Geschwindigkeit begrenzt. Sobald dann auch noch Regen dazu kommt, wird mit GPRS weitergesurft. Die Netzabdeckung im Haupteinsatzgebiet wird von Vodafone allerdings als bestens angezeigt.

Über Feedback würd ich mich sehr freuen. Kann jemand die Wettereinflüsse bestätigen, oder ist das nur ein lokaler Effekt?

]]>
http://c-aurich.de/wordpress/2010/09/mobook-update/feed/ 0
ICQ über Telekom Netz nicht erreichbar http://c-aurich.de/wordpress/2010/08/icq-uber-telekom-netz-nicht-erreichbar/ http://c-aurich.de/wordpress/2010/08/icq-uber-telekom-netz-nicht-erreichbar/#respond Mon, 09 Aug 2010 16:25:00 +0000 http://c-aurich.de/wordpress/?p=37 Continue reading "ICQ über Telekom Netz nicht erreichbar"

]]>
Da ich das ganze Wochenende unterwegs war, und vor allem nicht über einen Telekomzugang im Netz war, hab ich es erst heute mitbekommen. ICQ ist aus Telekomnetzen derzeit nicht erreichbar. Laut Heise Online sollen wohl Routingprobleme schuld sein.
Irgendwie ist das grad nervig… ich bin schon seit langem über Jabber erreichbar, aber einige Unbelehrbare sind nicht von ICQ abzubringen… ist ja alles so schön bunt und einfach. Und es benutzen ja eh die meisten. :-/

Ich hoffe, dass sowas endlich mal ein paar Leute zum Umdenken bringt.

]]>
http://c-aurich.de/wordpress/2010/08/icq-uber-telekom-netz-nicht-erreichbar/feed/ 0