. // // 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 ?> leipzig – 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 Some random updates http://c-aurich.de/wordpress/2012/02/some-random-updates/ http://c-aurich.de/wordpress/2012/02/some-random-updates/#respond Sun, 26 Feb 2012 19:27:16 +0000 http://c-aurich.de/wordpress/?p=370 Continue reading "Some random updates"

]]>
Some of you might know it already: I stop to participate at the students project Leobots at my university. There were some disagreements in the team over the last weeks that led to my decision to leave the team as of now. I just finish the documentation of my work as far as I got and support the team at the trade fair “embedded world” next week.

As I still like to play around with robotics I bought a small rc car, a wifi-router and some electronics. I hope to get it somehow self driving and self navigating in unknown terrain.

RC Buggy

I think my other new toy, the 3d printer will be a good help for my modifications… at least for adding backets for the distance sensor that is scanning the sourrounding of the car it will be superb to have a costum made part that really fits my needs 😉

]]>
http://c-aurich.de/wordpress/2012/02/some-random-updates/feed/ 0
Greek Letters in Inkscape http://c-aurich.de/wordpress/2011/12/greek-letters-in-inkscape/ http://c-aurich.de/wordpress/2011/12/greek-letters-in-inkscape/#respond Wed, 21 Dec 2011 21:22:13 +0000 http://c-aurich.de/wordpress/?p=355 Continue reading "Greek Letters in Inkscape"

]]>
I am currently writing a report for a university project. In this report I’d like to illustrate the eurobot playing field, because I work on the absolute positioning system for the robot of the team leobots. To visualize what angle definitions I used I wanted to label them in an vector image which I already created in Inkscape.

First I tried copying the greek letters from wikipedia… for alpha and beta it looked quite nice, but not for gamma. So I searched the web for it and found that (german) discussion about it: http://www.inkscape-forum.de/index.php?p=/discussion/1359/griechische-buchstaben/p1.

In short: you can do:

  1. create a text element
  2. switch the font to any font that supports unicode (Times New Roman does)
  3. CTRL + U
  4. enter the unicode (03B1 for alpha, 03B2 for beta, 03B3 for gamma)
  5. press enter
This is how my result now looks:

 

 

 

 

 

 

 

 

]]>
http://c-aurich.de/wordpress/2011/12/greek-letters-in-inkscape/feed/ 0
Heutige MTB Tour http://c-aurich.de/wordpress/2011/11/heutige-mtb-tour/ http://c-aurich.de/wordpress/2011/11/heutige-mtb-tour/#respond Wed, 02 Nov 2011 18:16:58 +0000 http://c-aurich.de/wordpress/?p=344  

Heute ging es zu dritt erst auf den Zschocherschen Scherbelberg um anschließend neue Wege in Richtung Cossi zu erkunden. Es hat sehr viel Spaß gemacht – ich kann die Runde nur Jedem empfehlen, der gern MTB fährt! Große Teile davon machen aber auch mit Tourenrädern Spaß.

http://www.gps-tour.info/en/tracks/detail.92498.html

]]>
http://c-aurich.de/wordpress/2011/11/heutige-mtb-tour/feed/ 0
Erstes Foto in Presse http://c-aurich.de/wordpress/2011/11/erstes-foto-in-presse/ http://c-aurich.de/wordpress/2011/11/erstes-foto-in-presse/#respond Wed, 02 Nov 2011 14:13:01 +0000 http://c-aurich.de/wordpress/?p=337 Continue reading "Erstes Foto in Presse"

]]>
Tödlicher Unfall - Specks Hof, 4.9.11
Tödlicher Unfall - Specks Hof, 4.9.11

Ich bin grad beim durchsehen der Suchergebnisse mit denen die Leute so auf meine Webseite kommen darauf aufmerksam geworden, dass eins meiner Fotos, dass ich der DPA geschickt hatte auch in der Presse veröffentlicht wurde.

Es war zwar mehr ein Schnappschuss, mit dem ich nicht zufrieden war, aber da die Artikel sonst keine Fotos besseren Fotos enthielten, habe ich meins einfach mal hingeschickt.

Das Foto ist (schon seit einiger Zeit) unter anderem beim Spiegel zu finden.

]]>
http://c-aurich.de/wordpress/2011/11/erstes-foto-in-presse/feed/ 0
HTWK Mountainbike Treff http://c-aurich.de/wordpress/2011/11/htwk-mountainbike-treff/ http://c-aurich.de/wordpress/2011/11/htwk-mountainbike-treff/#comments Wed, 02 Nov 2011 12:44:40 +0000 http://c-aurich.de/wordpress/?p=334 Continue reading "HTWK Mountainbike Treff"

]]>
wie viele wissen, leite ich auch dieses Semester wieder den HTWK Mountainbiketreff. Diesmal nicht alleine sondern mit Jens, aber an dem Treff wird sich dadurch nicht viel ändern.

Ich habe vom letzten Treff im Oktober mal den Track hochgeladen: http://www.gps-tour.info/en/tracks/detail.92482.html Ich hoffe dann auch alle weiteren Tracks dort zu veröffentlichen. Damit ist dann für die Teilnehmer schön zu sehen, wo wir lang gefahren sind.

Falls noch jemand mitfahren möchte: es sind noch einige Plätze frei! MTB mit Licht und ein Helm reichen zum teilnehmen schon aus. Treff ist in den geraden Wochen Mittwoch 16:00 und in ungeraden Wochen 18:30 an der HTWK Sporthalle (Hintereingang).

]]>
http://c-aurich.de/wordpress/2011/11/htwk-mountainbike-treff/feed/ 2
Goodbye Leipzig – Auf nach Glasgow http://c-aurich.de/wordpress/2010/09/goodbye-leipzig-auf-nach-glasgow/ http://c-aurich.de/wordpress/2010/09/goodbye-leipzig-auf-nach-glasgow/#respond Thu, 02 Sep 2010 21:06:28 +0000 http://c-aurich.de/wordpress/?p=44 Continue reading "Goodbye Leipzig – Auf nach Glasgow"

]]>
Am Dienstag (31.08.) war es nun so weit. Ich war das vorerst letzte Mal in Leipzig. Die Wohnung ist nun übergeben.

Irgendwie freue ich mich zwar, endlich alles geschafft zu haben, doch es bleibt ein trauriges Gefühl übrig. Die bisherige Zeit in Leipzig war richtig schön und ich werde wohl so schnell nicht wieder den Luxus einer so tollen Wohnung haben. Zwar war das Haus in der Wächterstraße nicht das ansehnlichste, aber wir hatten uns sehr viel Mühe gegeben die Platte wohnlich zu machen. Viele kleine Details, die auch nach wie vor noch in der Wohnung sind, werde ich vermissen und sicher noch in ein paar Jahren daran denken. Außerdem war der Platz richtig genial. Da werde ich mich die nächsten Jahre in Wohnheimen und WG-Zimmern etwas einschränken müssen…

Auf mich warten nun noch 2 Wochen Vorbereitung und dann gehts endlich nach Glasgow. Vom 15. bis 18. hab ich mich mit ein paar Kommilitonen erstmal in einem Etap Hotel einquartiert. Danach können wir ins Wohnheim. Mal sehen, wann ich mit den ersten Bildern von dort berichten kann. Ich werde zu diesen Themen ab dem nächsten Eintrag in englisch schreiben, da die Texte sicher auch andere internationale Austauschstudenten interessieren werden.

]]>
http://c-aurich.de/wordpress/2010/09/goodbye-leipzig-auf-nach-glasgow/feed/ 0