Resolve IP Addresses to DNS Names
Submitted by johnk on Sun, 05/11/2008 - 11:19.Sometimes, you have textual data, like log files, with IP addresses. You sometimes want this data to show hostnames instead.
This script converts IP addresses in the standard input to hostnames. (Script is based on one I found in perlmonks.org.)
#!/usr/bin/perl -w
#
# Resolve IP addresses in web logs.
# Diego Zamboni, Feb 7, 2000
# John Kawakami, May 12, 2008
use Socket;
# Local domain mame
$localdomain = 'slaptech.net';
while (my $l = <>) {
if ($l =~ /^(.*?)(\d+\.\d+\.\d+\.\d+)(.*?)$/) {
$pre = $1;
$address = $2;
$post = $3;
if ($cache{$address}) {
$addr = $cache{$address};
}
else {
$addr=inet_aton($address);
if ($addr) {
$name=gethostbyaddr($addr, AF_INET);
if ($name) {Routers Hacked via Browser
Submitted by johnk on Thu, 05/08/2008 - 23:36.This is uncool: Router hacked through a web browser.
A page will log into your router and force an update with a bad firmware. The only fix would be to reload good firmware, and then fix your router to be less hackable.
I just started on a network where the router had been hacked, but only inasmuch as the DNS was pointing to a nameserver that resolved bad addresses to a Ukrainian search engine.
j_oocms - an excessively object-oriented cms
Submitted by johnk on Wed, 05/07/2008 - 02:13.They say it's bad to use extend too much. This is a *bad* cms.
It's a simple image gallery, suitable for things like personal image hosting.
This was written to study how extend works, and to try out some ideas. At this time, there are six (6) classes. These include text data, html data, form data, multimedia, and photos.
One feature is that there's no relational database. The data fields are defined by the data that's POSTed to the server. This is probably a security hole, but, the idea was to see how it would "feel" to hack in such an environment. It was pretty cool.
Another feature is support for attached multimedia. At this time, that's only photos and html files. Still, it's something.
No Eval? Variable Interpolation on PHP Code
Submitted by johnk on Wed, 05/07/2008 - 01:53.We recently turned off the websites' ability to use the eval() or related functions. In a small CMS I'd written a while back, I was using eval to interpolate variable names in strings. This was a simple way to do "lazy evaluation" on strings I was using as templates. With eval, there was no need to use a special templating syntax - the syntax was PHP's.
Now, with eval turned off, I needed a function to interpolate variables in a string. Here it is:
function interpolate( $string )
{
foreach ($GLOBALS as $name => $value)
{
$string = str_replace( '$'.$name, $value, $string );
}
$string = preg_replace( '/[$]\\w+/', '', $string );
return $string;
}
TXTMOB for Web Hosts (project)
Submitted by johnk on Wed, 04/02/2008 - 03:01.This is a hack of txtmob that's being developed to run on cheap web hosts.
So far, it'll let you send to the group via the web form, so it's suitable for a one-way, moderated list. Good for news.
The sms forwarding feature doesn't work, so, it's not able to do "real" txtmob yet. Maybe it will one day... This code is very alpha, and based on code from SourceForge, that was at version 0.14, so you know what you're getting :-)
I'm not forking the project. This is just a personal fork for personal use.
Fun Details, and Some Roadmapping
Code Generation, Frameworks, App Servers (not only PHP)
Submitted by johnk on Sat, 03/22/2008 - 00:03.Changing Windows 2000 Professional to Windows 2000 Server
Submitted by johnk on Thu, 03/20/2008 - 15:13.The main reason to do this is to allow more than 10 clients to connect to your computer. Aside from that, Win2k Pro doesn't come with all the applications and services that Win 2k Server includes.
Info stolen from: http://www.commodore.ca/news/2002/mar30_02.htm
Week Ending March 30, 2002
Change Windows 2000 Pro To Windows 2000 Server with Freeware Util
NTSwitch is a small freeware program that allows you to turn an existing NT Workstation or Windows 2000 Professional installation into an NT Server or a Windows 2000 Server environment.
It's well-known that Workstation and Server environments are virtually identical. The operating system decides which "flavor" to run in based on two registry values:
Angels. Are they Space Aliens? // International Cuisine
Submitted by johnk on Thu, 03/13/2008 - 12:50.--------------------
Us folks in Los Angeles, or even America, like to think that we're king turd of shit hill when it comes to international cuisine at fair prices. Because we are. But, we can't sit still, because other cities are catching up.
Quetzaltenango, Guatemala has a range of cuisines.
I don't feel so special anymore.
A classic clip:

