Friday, September 28, 2007

Cron job in Linux

Tonight a wrote a one-line shell script to copy my GNUcash files from venus to longstreet everynight. The script is as follows:

scp /admin/"Gnucash files"/*.* root@192.168.47.3:/admin/GNUcash

Translated into English it means:

Securely copy all the files in /admin/"Gnucash files" on my linux server named venus to /admin/GNUcash on my linux server named longstreet.

GNUcash is a financial program like Quickbooks, but it's not near as slick as Quickbooks. But the price is good :) For this script to work, I had to generate a public key for root on venus and then copy it over to the /root/.ssh/authorized_keys file on longstreet. If I had not generated the public key, then every time I ran the script, it would stop and ask for a password. I want this baby to run unattended at night, so there's not going to be any entering-of-passwords.

Then I had to add the script to the cron table on venus using:

crontab -e

and then typing in the name of the script which is /admin/GNUcash-to-longstreet.

It works great. Another step up the admin ladder.....

I know I'm not really supposed to be doing this as root, but it was just a learning experience. Once I know it's working every night, I'll change it to run as some user like "Backup guy" or something like that. Maybe....

Tuesday, September 25, 2007

More fun in Networkland......ghost computer!

Today I was packing up my LaCie Ethernet Mini network drive to send back to Newegg. It died on me a few days ago, so I got an RMA # from Newegg and planned to return it. As I was unplugging the drive, I noticed the RJ45 plug seemed awfully tight, so I decided to use another cord just to make sure that wasn't the problem. I got another cord and fired it up. The little green LED was blinking on the RJ45 plug on the back of the LaCie just like it did back when it was working.....but I still could not access the drive at 192.168.47.49 which is where it's supposed to be.

So I did a scan of my network (192.168.47.x)and rather than clear up the LaCie mystery, I discovered another one. The scanner report showed a computer named "quick" (because that's the computer on which we use Quickbooks ) on my network. The trouble is, this computer died 3 weeks ago. It is in the back warehouse ready to be thrown away. It is unplugged from the network and from keyboard and mouse too. So how could it be there? I pinged it at 192.168.47.45 and got a prompt reply. I pinged it by name and got another prompt reply. I was freaked out about this ghost computer on my network and forgot all about the LaCie drive. And then it hit me......It was the LaCie drive that was answering my pings!! Apparently, it had at some point been given a new IP address by the DHCP server so when I tried to access it at the old address, it would not work. But how could it be answering to the name quick?

Well, I looked in my Win 2003 server DNS and there was an old manual entry (by me no doubt) that identifies 192.168.47.45 as "quick". So when I pang "quick", the DNS server returned 192.168.47.45 and the LaCie drive answered the ping!! But it didn't say "Hey by the way, I'm the LaCie drive, not your old accounting computer". It just said "I'm here dude". It took a brilliant flash of incite to realize how stupid I had been.

So the LaCie drive now lives at the IP address that quick used to have. And I'll be sending a humble email to Newegg saying that their LaCie drive didn't die after all. And it wasn't a bad ethernet cord, it was a bad network administrator.

I shouldn't get so confused so easily, but hey, it's been awhile since that CCNA exam.....

Sunday, September 23, 2007

Webcam improved and Mozy fixed!!!

Well, it looks like I've got Mozy working again on my home network. It mysteriously stopped backing up my computer a couple of weeks ago. I was all set to email Mozy tech support when I discovered a checkbox on the options tab of the config screen called "Attempt automatic backups even if network connection is not detected". I checked this and now it backs up regular just like it's supposed to. I still don't know why it claims it can't detect the network connection....So I'm going to send an email to Mozy. But at least it's working!

Similar story on Axis 207w webcam. I emailed tech support at Axis to tell them that the camera always freezes after it's been on only a short while. They tell me to update the camera's firmware. I was very skeptical that it would work, but I tried it. Updating firmware sounds a little scary, but it was very easy. After I did it, the camera stopped freezing. It's now been running continuously for over 24 hours and stills works perfectly. Another victory!

Wednesday, September 12, 2007

Webcam works but Mozy won't Moze

Today I tried for the first time to view the webcam at my house from my office. I put into Firefox the IP address of my house and there it was! A hazy picture of the desk in my bedroom! I must say I was surprised. A lot of this stuff doesn't work until you've spent hours trying to figure out what little thing you did wrong........
So that's a victory.

Two lines from my config are below. The 2nd nat command forwards the webcam to the outside world. The first nat statement is what makes nat work in general on my home network. It seems like they would interfere with each other, but apparently they don't....

ip nat inside source list 23 interface FastEthernet4 overload
ip nat inside source static tcp 10.10.10.5 80 75.66.88.84 80 extendable

But of course not everything on my home network works. Right now Mozy won't backup every 2 hours or so like it's supposed to. In the little Mozy popup screen it says "No network connection found" or something ominous like that. It used to work fine. According to the firewall help at the Mozy website, you have to open port 443 in the outbound direction on your firewall. I use the Commodo firewall on the computer that Mozy's on. Also I have a Cisco 871 wireless router with kick-ass access lists on it as the gateway to my Comcast cable Internet service. So I've got to figure out which firewall is stopping Mozy.... The weird thing is that if I click "Backup now" on the Mozy popup screen, it works fine. So why won't it work when I'm not there......

Win2003 server - changing names and changing the clock

Yesterday I (not me really) fixed a couple of problems that have been bugging me with my Windows 2003 server. First, my clock has been off by exactly 2 hours. I put in Central Standard Time (which is what we run on here in Memphis) and Windows displays the time as if I were in California. I had no idea why, so I put the problem up on Experts-Exchange.com. A guy there instantly told me to check the BIOS clock. That indeed was the problem. Who knew? Not me.

Here's a link that the Experts-Exchange guy sent me that explains how to get Win 2003 server to get its time from an ntp server. I haven't tried it yet. http://support.microsoft.com/kb/816042.

Also I was having trouble changing a user name on Win 2003 server. This is in what is called ADUC (Active Directory Users and Computers). I would right click on the user to be changed, go to properties, change the name, and click OK. But the name would never be changed. So I put THAT problem up on Experts-Exchange too. Again the experts at the exchange immediately solved my problem. There is a specific choice called "Rename" on the context menu if you right click on a user. Go to that and enter the changes and it works fine. Well....... I'm the Win2003 admin, but I don't admin it too often. I'm so used to going to the properties tab in Windows that I just didn't notice the "rename" choice..... My bad. I have to wonder why Microsoft displays the user name in "Properties" in an apparently editable box when you can't edit it there at all........

Good thing I'm a premium member of Experts-Exchange.com (which means I have to actually pay money!). Well worth it.

Thursday, September 6, 2007

Axis 207w wireless camera now up and running...

Tonight (on my mother's birthday no less) I got my new Axis wireless network camera working. Another networking triumph........

First I had to wrestle with the usual bad and/or incomplete instructions, but I managed to get it working wired (using standard ethernet cable). Then after much ado, I got it working wirelessly.

The instructions DO NOT make clear that there is a standard web based interface that you can use by pointing browser to the IP address of the camera, which out of the box is 192.168.0.90. Then I had to set a user name and password, which I set to "root" and "arbie" (come on...nobody's reading this). The instructions are also ambiguous about whether or not the camera can get its IP address from a dhcp server. The instructions say "A network DHCP server is optional". What the hell does that mean exactly? It should say "The 207w camera is capable of getting its IP address from your dhcp server if you have one. If not, all is not lost; you can set the IP address manually."

After some scuffling with my 871 wireless router, I got the 871 to give the 207w an IP address (by dhcp). Then using the camera's web config interface, I added a 26 hex digit wep key and then unplugged the ethernet cord and expected to be disappointed. But no! I saw myself clearly in my Coco Beach T shirt...wireless!!

The scuffling with the 871 wireless router involved me not knowing that if you delete the vlan 1 interface (which I did because I thought it wasn't necessary and why not simplify the config?) from the 871 config, the built in RJ45 jacks quit working. The wirelessly connected computers still work, but anything plugged into the RJ45 jacks go south. I'm confused about why, but then I'm confused about a lot of things in networking.....

Anyway, after I re-added the vlan 1 interface to the 871 config, the RJ45 jacks instantly started working again and so the 207w camera was issued an IP address by dhcp. Then I could surf to its IP address and enter the wireless ssid and hex wep key and get going wirelessly.