 |
WebProWorld Dev Forum | MS SQL troubles Okay, I am looking for a way to get a database out of MSSQL server(Ithink). I have asked three times in the ticket system, how to access the database so I can export it, or see it at least.
The Data from MySQL can't show up at browser I have been learning for pHP in few days and I have problem. And the problem make me very confuse. I want to show some data from MySQL into my browser Internet Explorer 6.0. But it can't make it.
ASP.Net retrieve records from Access DB that start with A Hi I'm new to ASP.Net and I need to build a ASP.Net page that connects to an Access database, pulls records that have the ItemName field value starting with the letter "A" and then displaying those results.
|
 |
| Recent Articles | Record Year for MySQL MySQL AB announced that 2004 has been another year of record sales, partnerships, technical achievement and adoption of its open source database.
Text::Autoformat: Smart Text Reformatting with Perl It's convenient for me because of my nomadic life style where I have different ISP's and often different machines with varying OSes.
How Old is That File? Sometimes you want to know the age of a file. Perl has a "-M" test that gives you age in days, but this customer needed it in minutes. That's easy:
ActiveState's Perl Dev Kit 6.0 ActiveState announced the release of Perl Dev Kit 6.0, the newest version of its industry-standard toolkit for easily creating, building and deploying applications with Perl.
Handling Missing Data in Inputs Missing data can be very annoying to a programmer. In fact, it is so annoying that very often we'll write separate programs to clean up data and eliminate unpleasant conditions so that the main program doesn't have to deal with it.
PERL Extensibility Enhancements OpenService announced the availability of NerveCenter 4.0, Open's network fault management and real-time correlation technology. This release adds the first major platform addition to the NerveCenter product line in years...
New Updated Perl Book Commonly used for CGI programming and extracting and translating data, Perl is the workhouse of the Internet.
|
| |
| 12.30.04
Dynamic DNS Services Update Scripts
By A.P. Lawrence
Strangely enough, I never had any need for a dynamic DNS service until this week. In retrospect, it really does seem odd that I've never needed such a service before now, but so be it.
My problem this week was that I wanted to set up a Kerio Mail Server in my office as a demo. My router could redirect the various ports I'd need, but I wanted to be able to send it real mail from the outside world, and although my cable assigned ip stays constant for months or even years, I needed a domain to send to.
Well, that's easy. Visit http://www.dyndns.org, sign up for a free account, and it's done. I assigned my current cable dynamic ip address to the hostname I chose, and now "xyz.dyndns.info" points to my cable modem.
In my case, I could have stopped there. The only time the dynamic ip changes is when I change routers. While that is something I do fairly frequently in the course of testing things, I certainly didn't need to do it during the run of this demo, and even if I did, I could pop back to dyndns.org and update myself.
But what if I needed this for a longer term or if my dynamic ip address were more dynamic than it is now? Well, there are hundreds and hundreds of clients that will update dynamic dns services. Many home-use routers even have a client built into them (though the services warn against using these because most update too often for no reason).
Well, as usual, I don't want to use someone else's code. I'd rather understand how the thing works and do it myself. I might use someone else's code after that, but almost always I want to get my own hands dirty first.
So, first problem: how to find the current ip address? If you are behind a firewall, there may be some way to get the device or computer to tell you. It might be as simple as an "ifconfig eth1" if you are using a Linux router. But I change firewalls frequently, so I can't depend on that.
There are places on the net that can help. For example, you can use http://checkip.dyndns.org/. At the command line,
lynx --dump http://checkip.dyndns.org/ > myip
will put your current ip into "myip". That's handy, and I'll use that in the Perl script later in this article, but what if you don't want to depend on things like that? If you have your own server hosted somewhere, you can use it to find out. It's not hard to write a Perl server that listens for connections on a certain port and just logs the connecting machines ip, but you don't even need to go that far if you have a web server. On a machine behind the firewall, have a script that does something like this every now and then:
lynx --dump http://yourserver.com/whatsmyip.html?564312 > /dev/null
The "whatsmyip.html" doesn't exist, and the extra "?563412" is just a number you make up. These accesses will be logged, so on the server we'll find these in our access_log:
66.31.38.153 - - [18/Sep/2004:10:01:01 +0000] "GET /whatsmyip.html?564312 HTTP/1
.0" 404 2240 "-" "Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7"
66.31.38.153 - - [18/Sep/2004:11:01:01 +0000] "GET /whatsmyip.html?564312 HTTP/1
.0" 404 2240 "-" "Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7"
66.31.38.153 - - [18/Sep/2004:12:01:01 +0000] "GET /whatsmyip.html?564312 HTTP/1
.0" 404 2240 "-" "Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7"
66.31.38.153 - - [18/Sep/2004:13:01:16 +0000] "GET /whatsmyip.html?564312 HTTP/1
.0" 404 2240 "-" "Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7"
66.31.38.153 - - [18/Sep/2004:14:01:01 +0000] "GET /whatsmyip.html?564312 HTTP/1
.0" 404 2240 "-" "Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7"
A simple shell script can extract "66.31.38.153" which is what we need to know. That script could continue on to update the dynamic dns service.
So how do you update the service? Every service has their own method, but we'll just look at dyndns.org. You can find the full details at http://www.dyndns.org/developers/, but the short version is that it updates by accessing a web page. You could do this with a shell script and lynx, but I'll show a sample Perl program here. There are some rules we have to observe if we don't want them to cancel our free account for abuse. First, they don't want us to use the "checkip" more often than every 10 minutes. Second, if the ip hasn't changed, we shouldn't update more often than once every 28 days. Finally, if we get a problem response, we shouldn't try again until we know why the problem happened.
These rules are complicated enough that we'll probably screw up our code at least a few times, so dyndns.org provides test accounts you can work against. The code below uses such an account, so is safe for you to play with. It is intended to be run from cron at regular intervals, but it makes sure that it doesn't run more often.
Read the Rest of the Article.
*Originally published at APLawrence.com
About the Author: A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com |