About databases…

OK, I was thinking about databases.

What am I thinking about now?

I’ve been coding my brains out lately, but in a very helter-skelter way that (occasionally) dovetails nicely.

The following is a list of what I’ve been working on lately:

  • Littleghost.com: Revamping my littleghost.com Web site for the first time since launch. See earlier entry.
  • HTML 4.01/XHTML: Now that Netscrape is finally standards complient, it’s time to really knuckle down and figure out how to use the tools the W3C has given us over the years that we just could not use effectively. This is a large part of the Littleghost.com redesign. (Note: A recent survey [by who?] said that IE 5-6 have 95% of the market. Fortunately, Netscape’s offerings were strongest with their new offerings, NOT v4.x).
  • Perl & PHP: For various reasons for various tasks, I have been doing a lot of Perl and PHP. I like both a great deal. I have been working with both languages for about 2-3 years, but never really got a lot of time to use them. I’m making time now. I wish my providers supported PHP (one does, but have to code them with a she-bang like Perl scripts and put in the CGI-BIN, which makes them fairly non-portable)
  • Web services: As mentioned in an earlier entry, this is something that I got into because Amazon and Google are opening their APIs to a degree, and use of XML tools make both sites accessible. No linking; no frame-out. Import the raw data and knock yourself out…
  • Javascript/DHTML/CSS: As part of my “standards” search/pursuit, I’ve been doing a lot of this, and making sure it works in IE and Netscape. For the last year or so I’ve been designing for IE solely, and there are still some quirks required to make anything the same in Netscape, even the new versions. So — OK — the true “standards-complient” browsers are not here yet, but they are getting damn close. Thank god the damn LAYER tag is gone….

I’ve been doing a little XML, some Cold Fusion, some stored procs and messing with three different databases (mySQL and Postgres on Linux; MS SQL Server on Win2000), as well. Probably not as much as I should, but there is only so much time.

=======================

One other thing I have been getting into lately is shell scripting. I finally found a book (PDF, on the Web, free) on BASH scripting (I use Bash on my Linux box; to be honest I don’t know if I have the Korn or Bourne shell on there. Doesn’t look like it).

Shell scripts are a pain in the ass, but excellent coding practice. They are difficult because they are so precise. With HTML, you can get away with almost anything (no close TR? the browser understands). With Cold Fusion, you get away with a lot (not case sensative, loosely typed etc). With Perl, it’ll slap you for case, but other matters are handled transparently (variable $num not exist? Then “$myNum = $num + 7” will equal 7. No error).

Shell scripts require all sorts of rule-following, the most difficult — to me — is the space issue:


I like writing: $c = $b + 4;

Shell scripts require no spaces: $c=$b+4;

Yeah, same thing, but …. just not my usual coding practice.

But good — you HAVE to be precise with shell scripts, which is a good thing. (However painful)

In a case of my “learnings” dovetailing, what I’m doing with the shell scripts is writing scripts to back up important files/directories on my Linux box to the Win2000 box and vice versa. This required the following tools/skills:

  • Shell scripts to do all the work, which includes FTP get/puts and so on
  • Installation/administration of an FTP server on my Win2000 box (freeware)
  • Installing the command line tool for WinZip, so I could write batch files to zip up selected directories
  • Scheduling — on the Win2000 box — the Zip batch files
  • Scheduling — via CRON — the jobs on the Linux box (all jobs run off the Linux box except the Win2000 directory zip, which are batch jobs. Linux is much better for scheduling and scripting [have tar, gzip, permission handlers etc all at your fingertips] )

It’s been an eye-opener.

I currently have eight CRON jobs running every night; before the crons run, I have two scheduled batch jobs on the Win2000 box zip things up.

Pretty cool.

And the best part is that I wrote these a month or so ago, and I just let them go. And they keep working. (Yes, I do check that they ran, and occasionally try to “restore” from a backup: never failed yet).

This was a lot of work — simply because a lot wasn’t in place (FTP server etc), but because I do have at least passing familiarity with the crontab, scheduler and so on, it was pretty straight-forward. Lot of work; lot of time — but no “deal breaker” dead ends. Just busy work, to some extent. I would figure I’d need this or that; I’d do it. No biggee.

Sometimes being an inquisitive geek pays off.