my $ip = ’1.2.3.4′; my $block1 = ’1.2.3.0/27′; if(checkip($ip, $block1)) { print STDOUT “$ip is in $block1\n”; } else { print STDOUT “$ip is not in $block1\n”; } sub checkip() { my $ip = shift; my $block = shift; @ip1 = split(/\./, $ip); $ip1 = $ip1[0] * 2**24 + $ip1[1] * 2**16 + $ip1[2] * [...]
Entries Tagged as 'Programming'
Perl code to find an IP A in subnet B/C
June 5th, 2007 · No Comments
Tags: How Tos · ip addressing · ipv4 · networking · perl · Programming
PHP Header injection
May 21st, 2007 · No Comments
I regularly shut down web sites that use the PHP mail() function. While the users of the sites mean well, they generally don’t do any checking before sending data to mail(). I’m not going to weigh in mail(). Enough has been said about it. Just remember to take your code and code security seriously. Remember, [...]
Tags: How Tos · Mail Post · php · Programming
Panic Releases Coda, and I can’t use it
May 17th, 2007 · No Comments
http://www.panic.com/ released Coda a web-oriented IDE that contains a terminal, FTP, SSH, etc. all rolled in to one. It looks great and I want it, but it’s Mac only. Some day…
Tags: IDE · Programming · Software