Category Archives: Tips for computer

Router Woe – Can’t access my own website

We have not been able to access my own hosted webiste for a couple of days and yet no problem at work or other websites. After complaining to Comcast and trying a couple of tricks from Comcast that didn’t work. I’ve decided to do my own experiment.

I found two issues:
The Comcast modem seems to have a problem hooking up to the Vonage modem or the Airlink router. I’ve tried different network cables to no avail. The only trick that works consistently is to power off the modem and power it up *last*. This seems to do the trick. This trick is not needed if I hook up my laptop directly to the modem. I suspect some kind of electrical ground loop problem.

Another problem I discovered was that the Vonage router/phone adapter (V-portal) was the root cause of the problem. If I connect the Airlink Router directly to the Comcast (Motorola) modem, all is well. For some reasons, the Vonage router seems to have developed a network issue when connected to a certain website but OK to others. Very strange. Perhaps, it’s on its last leg – not likely since it’s only a few months old.

So now, I have the Vonage modem connected to the Internet through the Airlink Router. There may be choppy voice quality issue if there is heavy network traffic. But it’ll have to do, as this Vonage modem can no longer perform the “gateway” job. Let’s see how long this configuration is going to work for me.

Enabling Hibernate on Vista Windows 64-bit

My dad’s new computer with Windows Vista 64-bit for some reasons does not have the “hibernate” mode on the menu. After some Google search, I found that you may need to turn it on manually. Well, this wasn’t easy. I had to type “cmd” and run the cmd first. But you don’t want to type the command on that cmd window because it’s not the “administrator” cmd.

Click on the start menu, the “cmd” should now show up as the “recent” application. Right click “cmd” on the recent application, and then select “Run as Administrator”. When the cmd window pops up, it has the “Administrator Command” window. Now type on this window “powercfg -h on”. This enables the hibernation mode. However, the “hibernate” item still doesn’t show up on the list of the command.

I discovered that you need to go to the Control Panel and select “Hibernate” when Power Button is pushed and click “Apply.” Now click on the “I/O” on the menu of the Start menu, the windows show go to “hibernate.” From here forward, the hibernate mode will show up as one of the options, in addition to Sleep, Re-start and etc.

Definitely, this is a bug on Windows Vista 64-bit. Who would know how to do this except by accident?

Thinkpad T43 Freezes Upon Undock from the Docking Station

Two months ago, my IBM ThinkPad T43 started to exhibited a very annoying failure mode. It freezes 50% of the time when I popped it out of the docking station. I had to shut down the system by force (hold the On/off button for a long time) and then reboot to put it out of misery. So what happened? What did I do? Could it be software/driver issues or hardware issues?

Several things have changed: I changed the graphic monitor from a 19″ to a Sun 24″ monitor. This could cause the device driver to act weird or the device driver may not like the new monitor. One other thing I had done was to upgrade the SO-DIMM from 512MB to 1GB. I googled to find many people have similar problems. I ended up downloaded a new ATI driver and a special eject software. Neither of them made any difference to resolve this problem.

Being a hardware guy, I just couldn’t believe the DIMM memory should be remotely associated with this problem since the act of undocking simply switch from AC input to battery input. If the CPU didn’t choke, why would memory make any difference? On the other hand, I have solved enough DIMM problems at work to know how fragile DIMM can be – it could be a vibration issue or the memory got put into a different power-down mode that may corrupt the DIMM. Besides, the DIMM I bought was a cheap DIMM from Fry’s. The problem was so excruciatingly annoying that I finally bit the bullet and switched out the new DIMM and put in the old DIMM. Sure enough, the laptop no longer exhibit the freeze problem again. I don’t know what the new DIMM is doing to wreak havoc with my computer but I’m NOT going to be find out and my wife’s laptop now has an additional 768MB (replacing her original 256MB).

Once again, it proves that when it comes to upgrading a computer – make one upgrade at a time. It’s much easier to back out of it. Also, note the changes you make to the computer so you know how to undo. This applies to hardware as well as software.

Creating Ramdisk on Solaris

Creating RAMdisk is a way to create a temporary file cache for fast access.
I found the following information from Sun’s BigAdmin site:

# create the ramdisk
#
[Mon Mar 17 22:15:03 root@sol9 /]
# ramdiskadm -a mydisk 40m
/dev/ramdisk/mydisk

# check the result
#
[Mon Mar 17 22:15:21 root@sol9 /]
# ls -l /dev/ramdisk/mydisk
lrwxrwxrwx 1 root root 40 Mar 17 22:15 /dev/ramdisk/mydisk -> ../../devices/pseudo/ramdisk@1024:mydisk

[Mon Mar 17 22:16:04 root@sol9 /]
# ls -l /dev/rramdisk/mydisk
lrwxrwxrwx 1 root root 44 Mar 17 22:15 /dev/rramdisk/mydisk -> ../../devices/pseudo/ramdisk@1024:mydisk,raw

# check the fstype
#
[Mon Mar 17 22:16:07 root@sol9 /]
# fstyp /dev/rramdisk/mydisk
unknown_fstyp (no matches)

# create a filesystem on the ramdisk
#
[Mon Mar 17 22:16:22 root@sol9 /]
# newfs /dev/rramdisk/mydisk
/dev/rramdisk/mydisk: Unable to find Media type. Proceeding with system determined parameters.
newfs: construct a new file system /dev/rramdisk/mydisk: (y/n)? y
/dev/rramdisk/mydisk: 81872 sectors in 136 cylinders of 1 tracks, 602 sectors
40.0MB in 9 cyl groups (16 c/g, 4.70MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 9664, 19296, 28928, 38560, 48192, 57824, 67456, 77088,

# mount the ramdisk
#
[Mon Mar 17 22:16:44 root@sol9 /]
# mkdir /myramdisk

[Mon Mar 17 22:16:51 root@sol9 /]
# mount /dev/ramdisk/mydisk /myramdisk

[Mon Mar 17 22:17:01 root@sol9 /]
# df -k /myramdisk
Filesystem kbytes used avail capacity Mounted on
/dev/ramdisk/mydisk 38255 1041 33389 4% /myramdisk

[Mon Mar 17 22:17:06 root@sol9 /]

Recovering from a Windows XP Disk Crash

Yesterday, I had an unfortunate incidence of a disk crash on my Windows XP Pro. The symptom was very weird. Normally a disk crash is preceded by some disk errors and system sluggishness. In my case, the system just froze and refused to reboot afterward. Later I found out that Windows XP just couldn’t find the kernel, probably some bad sectors on the disk where the system files reside or the systems files were corrupted for some reasons. Upon reboot, I noticed that some times the disks didn’t get recognized. I tried to repair the drive using the Windows CD. It didn’t help. Something hideous was going on in my Sun Ultra 20 system and I didn’t know exactly what.

Fortunately, I had a couple of disk back ups (backed up by g4u), which I had backed up verbatim (sector by sector) in August of last year. And II am glad I had two – more on that later.

Well, the question is how I can get all my data for the last 9 months. A couple of ways to retrieve my data files. 1) Restore my files using my regular back up on Mozy server, or 2) Trying to copy the files from the bad disk (perhaps still readable in some areas of the disk). I first tried the Mozy method, but the data transfer took a long time, and I still didn’t get all the files I was looking for. I didn’t know that you need to submit a request to have the Mozy prepare the data files for restore. Also, I think the Mozy client may be outdated. I downloaded a new one. Meanwhile, while trying to restore the files, I damaged one of my verbatim backup disk. I didn’t know why, for some reason, the disk refused to boot Windows, similar to the original disk. Now I began to suspect something is wrong with the SATA port bridge chip (normally called the South Bridge) or I happened to have two consecutive bad disks. That’s very unusual. I decided to switch the boot disk to connect to SATA port 3 instead of SATA port 1. My suspicion was that SATA port 1 may be bad; I tried to avoid using this port.

To make the long story short. Here are the lessons learned:

1. Back up the entire system boot disk once a month. (This effort normally takes 2 hrs or so @ ~40MB/s if I use the the internal SATA ports. It could be days if I had to use USB ports.) Don’t be lazy. My task would have been an easy one if I had done this once a month. Now I need to figure out how to install/uninstall all of the software I installed for the last 9 months.

2. Don’t assume hard drive is the only thing that can go bad. The SATA port or some other chips on the board may. Protecting/backing up the data is a discipline that’s worth the time and efforts. Create a log and use calendar reminder to keep track of and remind yourself of this task.

3. Keep the majority of the data online or on-server with professional backup so the amount of the data doesn’t get too overwhelming, especially with the huge audio/video data size lately.

Inkjet Cartridge Refill – Getting My Hands Dirty

Last week, my Canon MP530 printer was complaining about low ink again. So I figured I try out the ink refill service from Walgreen. I went to Walgreen. But the clerk told me that this model (CL-5 PGBK) is NOT one of the supported models. I didn’t know they were this picky about it. While continued shopping at Walgreen, I saw that they offer the 4-time NCR self-refill kit for $14.60. Not a bad deal but I really didn’t want to get my hands dirty. How many times I have done this and regretted every time!

But this kit come in the syringe containers – just need to squeeze out the ink directly into the cartridge. Sounds pretty easy right. I bought the kit. I regretted again that I bought it. First of all, unlike the ink I used to refill the HP cartridges with, these black inks are SOOO difficult to wash off. I should have worn gloves. For the entire night, I nearly soaked my fingers in the 409 fluid (the only detergent that works) and rubbed my fingers with paper towels for hours. The ink stayed on my fingers for more than 2 days. Secondly, the Canon cartridge has a smart chip in it that even after the refill, the cartridge still registered nearly empty. It’s going to be very difficult to tell when the cartridge really runs out of ink. For this type of printer, if the ink really ran out, the printer head (the most expensive part of the printer) may incur damage. Third, I made a big mess on the table due to the leaked ink. As it turned out, it takes some coordination to insert the rubber plug and cover up the outlet, or the ink may leak non-stop. I wasted nearly a bottle of ink due to the leak.

So how much did I save? Assuming I can refill roughly 3 times. 3 brand new cartridges would cost $39.65 from Amazon. My net saving is roughly $25. Considering the mess I made on my table and fingers, the two hours I may need to spend and the high probability of damaging my printer due to the lack of monitoring, this refill gig is not worth it. After using up the refill kit, I don’t think I would do this again. Canon has earned my money.

Imap Email Statistics with PHP

Below is a PHP script that I run daily (via a cron job) to check my imap email statistics. It generates a report like below. I use this statistic report to tell me how behind I am on my emails. It also reports a distribution of the emails for the last few weeks. You can run it on the web browser or run it on php command line (command: “php imap.php”)

Derek's INBOX Statistics:
Total number of mails = 2842
Month 2007-08 has an email count of       528   ( 15.9 MB)
Month 2007-09 has an email count of      1210   ( 76.7 MB)
Month 2007-10 has an email count of      1104   ( 79.7 MB)
Week[-8] has an email count of     81   (  3.1 MB)
Week[-7] has an email count of    186   (  5.8 MB)
Week[-6] has an email count of    200   (  5.6 MB)
Week[-5] has an email count of    198   (  6.8 MB)
Week[-4] has an email count of    298   ( 19.5 MB)
Week[-3] has an email count of    336   ( 21.4 MB)
Week[-2] has an email count of    339   ( 26.8 MB)
Week[-1] has an email count of    530   ( 33.6 MB)
Week[-0] has an email count of    674   ( 49.7 MB)
Total mail box size = 172.3 MB
Maximum email size  =   2.9 MB
Earliest email date = 08/14/2007 (58 days ago)
Elapsed time = 2 seconds

================ imap.php ========================================
<?php
global $tdate, $today;
$tdate = getdate();
$today = $tdate[0];
$php_out = 0; /* =1 if html format is desired. =0 for std text output */
$max_msg_size = -10.0;
$earliest_date = $tdate[0];

$start_time = time(); /* capture the start time for elapsed time calculation */
if ($php_out) {
   print "\n";
   print "<h1>Derek's INBOX Statistics:</h1>\n";
}
print "Derek's INBOX Statistics:\n";
$total_size = 0.0;
/* Replace the following line for your application */
$mbox = imap_open("{yourhost.com:993/imap/ssl/novalidate-cert}INBOX", "username", "your_password");
$n_msg = imap_num_msg($mbox);
if ($php_out)
   echo "<h2>Total number of mails = ".$n_msg."</h2>\n";
else
   echo "Total number of mails = ".$n_msg."\n";

for ($i=1; $i<=$n_msg; $i++) {
  $header = imap_headerinfo($mbox,$i);
  if ($header == false) {
     echo "Call failed
\n"; break; } else { $size = (float) $header->Size; if ($size > $max_msg_size) $max_msg_size = $size ; $msg_date=strtotime($header->Date); if ($msg_date < $earliest_date) $earliest_date = $msg_date; $month_key = date('Y-m',$msg_date); if ( is_null($msg_month[$month_key])) { $msg_month[$month_key] = 0; /* $msg_size[$month_key] = 0.0; */ } $msg_month[$month_key] += 1; $msg_week[getweektodate($msg_date)] += 1; $msg_week_size[getweektodate($msg_date)] += $size; $msg_size[$month_key] += $size; } } foreach ($msg_month as $key => $mon ){ $size = $msg_size[$key]/1e6; $total_size += $size; printf ("Month %s has an email count of %5d (%5.1f MB)\n",$key, $mon, $size); } foreach ( $msg_week as $key => $num ) { printf ( "Week[-%d] has an email count of %5d (%5.1f MB)\n",$key,$num,$msg_week_size[$key]/1e6); } printf ("Total mail box size = %5.1f MB\n",$total_size); unset ($key,$mon); $time_elapsed = time() - $start_time; printf("Maximum email size = %5.1f MB\n",$max_msg_size/1e6); printf("Earliest email date = %s (%d days ago)\n",date('m/d/Y', $earliest_date),($tdate[0]-$earliest_date)/60/60/24) ; print ("Elapsed time = $time_elapsed seconds\n"); imap_close($mbox); if ($php_out) print ""; function getdaystodate($indate) { return ($tdate[0]-$indate)/60/60/24; } function getweektodate($indate) { global $today; /* echo "Indate= $indate, today = $today\n"; */ return ((int) ($today-$indate)/60/60/24/7); } ?>