///////////////////////////////////////////////////////////////////////////
//
// DNSBL - Spam IP address checker.
// Copyright (C) 2011 Alexey A.Znayev
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// 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
?>
derzeit Student der Elektro- und Informationstechnik an der HTWK Leipzig (Vertiefung Kommunikationstechnik), ab Sept. 2010 an der Strathclyde University in Glasgow
Today was the start of the exhibition embedded world. I’ve met a lot of interesting people and got some offers for the practical semester starting this september. I will visit some other halls tomorrow.
Because I’m at the exhibition with the leobots team, I was also going around the halls with the robot and talking to some of the sponsors and companies who might become sponsors.
Today I travelled to Nuremberg with the other participants of our exhibition stand. We arrived really early about 4pm and equipped our stand for the tomorrow starting show.
Afterwards I went to my hostel room. I took a bed at A&O Hostel in the city center of nuremberg. It is next to the main station. As far as I can judge until now it is great.
After unpacking my stuff into the tiny locker in the room, I went to buy some food. On the way to the supermarket I came along a shop that was selling used stuff. I noticed a tripod in the shop windows. They sold a really nice looking one for only 29€, so it had to buy it at this bargain 😉 Just a picture with my crappy mobile phone cam:
my new tripod
When I came back to the Hostel I tried to connect to the internet. Seems that simyo delays the booking of the umts flatrates by some hours, so that I started whatching a movie. Some minutes later a roommate arrived – he came directly from india. He is going to visit the same exhibition, so we talked a while until we decided to go to a bar and have a beer and talk about the different cultures…
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 😉
Since a long time I wanted to have one of these fancy 3d printers like makerbot or reprap. I was spending quite a time searching for one that I could afford. Some weeks ago I heard of Makibox, which is quite exactly what I was looking for. It is affordable (350US$) for a student and on top of this it is a neat box that keeps your desktop clean.
Unfortunately it is sold by company like “kickstarter”, that is much less known and does only show a few projects hosted there that are all much cheaper than this 3d printer. Additionaly they seem to not be very open minded. I could not find any manuals or documentation regarding their printer. This was why I decided to ignore this great sounding offer, as I trust them less then for 350 US$.
Dissapointed about that I can not afford a 3d printer for quite a time I had some weeks not thinking about this as I had to write this semesters exams. The written exams were over last week, so I was looking for 3d printers again 😀 This time I found another great deal. It is the SeeMeCNC H1 printer, which is a reprap like machine. It looks like they did a great job in redesigning the printers to make them cost less. Still their machine looks solid and long-lasting compared to other constructions I’ve seen so far. The company manufaturing these bots put much more effort in the documentation and to build a community around the bot, which made me really happy as I saw what type of problems people had with this printers and how good they were helped.
The H1 can be shipped in 3 different combinations: only the Hardware, Hardware and Motors, Hardware and Motors and Electronics. I decided to not take their electronics as they use parallel port for printing. Instead I use the reprap generation 6 electronics. This is a massively compressed pcb, that holds all components you need on it. Unfortunately it is one of the most expensive parts of the printer with about 150€ for what I show in the picture below. The cost of the complete printer will be around 350-400€ – not including a power supply as I have one already.
Gen6 Electronics from cubic-print.com
I ordered this PCB at cubic-print.com (a germany based company) and they shipped it within 3 days, which I found surprisingly fast compared to some other orders I made in the last time. Thumbs up to the owner Wen Li. Now I am waiting for the printer itself coming from the US and the plastic coming from the UK. I will give a new update on this as soon as it arrives.
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.
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.
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ß.
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.
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).
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.