Hello!

This content has been updated. You will be momentarily redirected to the current version.

Moved!



Moved! I now blog at http://www.saicharan.in



Wednesday, November 29, 2006

Testing the RAM for defects on Windows

Somebody had asked me to look at some problem being created by Ulead DVD Factory 10.0. The error reported was some failure to read a memory location. This message repeated for Nero also, after a few days.
I suspected faulty RAM, after seeing the log. The message was EXCEPTION_ACCESS_VIOLATION. But, I did not know the right tools for testing the RAM. So, a Google Search led me to the following tools:
1) MemTest
2) Microsoft's Windows Memory Diagnostic.

I did not test Memtest, but I used the Microsoft solution. It was easy to use, but the UI is not for the layman.

Notes:
-Please keep a floppy disk handy. If you are one of those forward looking geeks, and do not have a floppy drive, you need to have a CD writer. Check out the details provided here for working with a CD.
- After you run the program and have created a floppy, boot from the floppy.
- To run Advanced Diagnostic tests, hit the T button on your keyboard.

Sunday, November 19, 2006

Sorting Algorithms : A visual treatment

Check out this link at: http://netlib.bell-labs.com/cm/cs/pearls/sortanim.html
It is from the Programming Pearls site. Gives some insight into the working of the algorithm. Check the behaviour of different algorithms on different inputs. However, it would be more helpful if we also have some control over the speed; this will help the visualization better!

Let me see if I can fix that recipe (ofcourse, I will start with the SortAnim.java provided at the site).

Saturday, November 18, 2006

Eclipse Update behind a proxy

Updating Eclipse from behind a proxy was quite counter-intuitive for me; or was it??? I had expected to find the proxy setting in the same window where the updater hooks up to the internet. Unfortunately, with Eclipse, it was under Window > Preferences > Install/Update > Use HTTP Proxy...
But this option of not having to hunt around the eclipse site for the plug-ins is a real killer concept. Saves a lot of time too. One up to the Eclipse project.

Thursday, November 16, 2006

Installation of Sun Studio 10 on Sun Solaris Machine

1. First uninstall the existing version by typing:
 - cd /var/sadm/prod/com.sun.studio_10
- Run the batch uninstaller.
- Further info on uninstalling can be found at: http://docs.sun.com/source/819-0485/remove.html
2. Next, put the Tar file in the directory in which you wish to install. Untar it. Keep the tar file in the same directory as the installer file.
3. Run the installer and follow instructions.

Wednesday, November 15, 2006

C Tidbit

The assignment operator returns something! In the case of a character, it returns the character that was assigned. So, it is useful to write code this way:

while ((to[i] = from[i]) != '\0')

Excellent, free iCal Calendars

This is a log of my adventures with iCal Calendar clients and format.
I tried Outlook Calendar & Google Calendar. Both were good. But, when I tried Google Calendar, it was in the offing and so I could not get much out of it. It was good but was accessible only when on the net.

So, I hit upon Rainlander. It was good, it integrated with Outlook and also understood the iCal format. But, I wanted to fill out just one calendar and use it on any client - both application and web-based. So, I filled out the Google Calendar (whew, that took really long!). Then, I realized that I could not actually use it anywhere else at that stage of development of Google Calendar.

So, I again filled out the Outlook calendar (because I had read this time that I can use the outlook2ical utility, which is free!!!). Bingo, I used the outlook2ical utility and could export my Outlook calendar to the iCal format which is widely supported.

Next, I experimented with phpicalendar using the .ics file that I exported with outlook2ical utility. It is cool and easy to use (as long as I had XAMPP with me, I had nothing to worry!)

Using Minix on VMWare

  • There is nothing special that you need to do incase you need to run Minix on VMWare. Infact, you can download the VMWare ready image of Minix from here. Only, this image is not allowing ftp access to VMWare. After much effort, I found an image file for Minix 2.0.4 which was consolidated. The website is so confusing. It does not specify clearly what needs to be downloaded and they have lots of things there too!!!
  • To allow ping to work, just set up NAT as described here.
  • Read this post or this post to enable FTP and Telnet access to Minix.

VMWare : SSH access to RH9 from Windows using PuTTY

Refer to my previous post regarding setting up Internet access via RH9 Guest OS. Make sure you have similar settings. Then, just change the firewall settings to allow incoming SSH connections.

Nothing else needs to be done.

VMWare : Internet access from Guest VM (RedHat 9)

  • You donot need to create any internet sharing in windows etc. VMWare will take care of that for you.
  • To set up internet access from the guest VM, set the VM to use NAT for ethernet.
  • Set the IP address to the same segment as that of VMNet8. (just make sure that it is not .2).

Now you can access the Internet from the Guest VM!

VMWare : Do's & Donts

  • VMWare by default creates two Vitual Network Adapters: VMNet1 & VMNet8.
  • VMNet1 is useful for host-only connection.
  • VMNet8 is for NAT access.
  • Donot change the IP domains which are assigned by default. You could wreck the DHCP, DNS & Routing domian that VMWare creates.
  • To change these settings, please use: Edit > Virtual Network Settings > NAT.
  • By default, the IP Address .2 with the VMNet8 segment, is the IP address of VMWare's DNS & router.

Windows : Autorun is Disabled?

Here is a solution for the Geeks; it modifies the Windows registry:

  1. Start RegEdit (regedt32.exe).
2. Go to HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/Cdrom.
3. Edit the Autorun value to '1' to enable autorn, and '0'
to disable autorun.
4. Close RegEdit.

NOTE: You may have to restart the system.

A simpler solution (not guaranteed to work if autorun has been disabled in the registry, as in my case) is:

  1. Right-click on the drive.
2. Choose properties.
3. Choose Autoplay.
4. Choose the action you want to take for various file types.

Linux : Mounting a USB device - made simpler

1) At the terminal, log in as root.

2) Open the /etc/fstab file for editing.

3) Append the following entry to the file: /dev/sda1 /mnt/usb autofs 0 0

4) Start > System Tools > Disk Management

5) Select the device to be mounted and mount.

NOTES:

1) /dev/sda1 is the name of the device whose file system you want to mount at /mnt/usb (this too is your choice!)

2) autofs tells the mount command that the filesystem type should (attempted to) be detected automatically. If you want, you can explicitly specify a file system.

3) In the options, DONOT specify the kudzu option. The kudzu option will cause /etc/fstab to be updated when the usb device is unmounted or unplugged. Thus, the entry will vanish after this. For more information regarding kudzu, use man kudzu at the terminal.

4) In the options, please specify user and NOT owner. If you donot specify user, the DiskManagement will not show the USB device if this is launched by a non-root user (by default). The GUI for DiskManagement is actually a command called usermount that reads from /etc/fstab and displays a list. Hence, if user is NOT specified, the device will not show up in the list. Further, the user option indicates that ANY user can mount this device!!!

5) For convinience, the DiskManagement can be added to the launcher panel (Start > System Tools. Right Click on DiskManagement and click on Add to Launcher Panel)

Changing the default command for RedHat8 Launch Panel

For accessing the Windows Network using Samba, only Nautilus seemed to be understanding the smb:// protocol. I did not want to each time start a terminal and type nautilus to start Nautilus. So, I wanted to add a launch panel icon. I could not find a way to add and configure a new icon. So I dragged the Help icon from the Main Menu and modified its Properties to run the command /usr/bin/nautilus. But this by default opened my home directory. I wanted it to open smb://Hostname. I had experimented earlier at the terminal and found that nautilus took as its command line arguements the location to be opened. So, I changed the command to /usr/bin/nautilus smb://Hostname. This worked well for me. But, I wanted some more sophistication. I wanted to log in directly since smb:// (like ftp://), takes the username and password separated by a colon followed by @ and the hostname. So, I changed the command to /usr/bin/nautilus smb://User Name:Password@Hostname. Nut, commandline did not parse the space separated user name (which Windows allows). So, as an additional change, using my instincts from my working with Linux, I enclosed the User Name within single quotes. This worked well. Similar strategy is also required to be used with the password if it contains spaces. Remember that while typing the username and password in the address bar of nautilus or at the Properties panel of the Launch Panel, the Password in NOT masked. So, it is at your risk that you do this.

So, all said and done, here is how the command looked at the end of the experimental session:

/usr/bin/nautilus smb://'User Name':'Pass word'@Hostname

Samba Server Setup

Check if the Samba server is installed: You can check this by going to Main Menu > System Settings > Server Settings > Services. Then, look for a service named smb. If it is present, that means, the Samba server is installed. If it is not started, start it up.

If you donot have the Samba server installed on your system, you should install it from the RedHat 9 CDs. The server along with the GUI to configure Samba are present on CDs 1, 2 & 3.
- Insert CD1.
- Go to the CDROM and navigate to RedHat > RPMS.
Here, look for a file called samba*.rpm. Install it.
- Insert CD2. Navigate to RedHat > RPMS.
Install a package called redhat-config-samba*.
- Insert CD3. Navigate to RedHat > RPMS.
Install a package called samba-swat*

NOTE: SWAT is a browser based configuration tool for Samba. It talks be default on port 901. So, to use this, httpd should be running on Linux and the firewall should not block this port.) We will use the GUI rather than SWAT for configuration.

  • Go to the command prompt and type: /usr/bin/redhat-config-samba (it is in /usr/bin folder).
  • Login as root.
  • You will get a screen similar to the one shown here.
  • Go to Preferences > Server Settings. The default settings are shown here. I had to keep the group to something different from what was the Workgroup on my Windows system. Give a nice description; this is what people from other systems will see as the title for the Server (eg. In Windows, in the My Network Places, Show Work Group Computer, this is what will be seen.)
  • On the Security tab,
- set the Authentication Mode to User.
- set the Encrypted Password to Yes.
- set Guest account to the user for whom you are setting up this share.
(I donot as yet know how to allow for anonymous shares...)
- click OK.
  • Go to Preferences > Samba Users.
- click add.
- Select the Unix username for the user whom you want to
permit to use the share. When he logs in, he will be takent to his home
directory unless some other shared folder has been specified.
- If the user is logging in from Windows, provide his Windows username

(this simplifies authentication and hepls to map Windows users to Linux users, I think so, I am not sure about this part).

- Provide a password (preferrably different from his Linux login password).
- click OK.
  • Click Add, and add a shared folder to allow access from outside the Linux machine.
  • To access this share from Windows, Go to My Network Places > View Workgroup Computers > Microsoft Windows Networks. Go to the appropriate workgroup that you had specified earlier. Here you will find the Samba Server with the description you provided earlier. Open this Samba and there you go!!!

Now someone please tell me how to access the Windows Shares from Linux. Any help would be appreciated. :)

UPDATE: Okay, just discovered that File & Printer Sharing must be enabled on Windows for accessing the Shared Files! For this, please run the Network Setup Wizard with appropriate options!!!

VMWare : Internet / FTP / Telnet Access to Linux Guest from Windows Host

1) After installing VMWare workstation or VMWare Player, find out the IP Subnet of the VM Network Adapter named VMNet8. This is the VMAdapter that is used for NAT connectivity.
2) Set up the Linux host's IP address to be in the same IP Subnet as VMNet8. Just make sure that you donot use the IP addresses subnet.1 OR subnet.2 Subnet.1 is used by VMNet8 while subnet.2 is used as the IP of the NAT Gateway. (Refer to VMWorkstation documentation for more details).
4) Set the default Gateway to subnet.2
3) Set up VMWare to use Ethernet in NAT mode.
4) Done.

VMWare : Sharing Files by Connecting to Windows from Linux

Check out this link from VMWare Documentation: http://www.vmware.com/support/gsx3/doc/running_fileshare_lin2win_gsx.html#1089626

Minix - FTP & Tlenet Access

I had a problem accessing my Minix VMWare guest OS, via FTP or Telnet. Here is how the problem was solved...

A little bit of history:
Yesterday, I had to set up a RedHat 9 Guest OS for one of my faculty members. I realized that even though telnet was installed and running, I was unable to access it even locally!!! Then I realized that I had to edit the 'telnet' file in /etc/xinetd.d to allow incoming telnet connections (inspite of changes to the firewall configuration to allow incoming telnet connections).

Back to present:
So I realized that perhaps something similar needs to be done even with Minix (after all, it is a variant of Unix and must have similar security features!!!). But, when I went to the /etc folder in Minix, I found no xinetd.d folder. Looking around, I found the serv.access file. Guessing that it must be the right place to look, I opened it. Bingo!
There it was. Only, I had to decipher how the entires should look like in that file. Ever so helpful, a comment asked me to man serv.access. Also, I looked at the /usr/adm/log file. It was all there - all those access denied messages...

Initially, my /etc/serv.access file was like this:

# /etc/serv.access
# 2006-05-21
# See the serv.access(5) man pages to learn how to edit this file
# to make your system safe on the network.
# this is insecure! replace with something more specific asap
telnet ftp: +* log;

# this is better, keep outsiders out

# telnet ftp: +*.local log;

# this records all unsuccessful access attempts in/usr/adm/log

*: -* log;

After a reading the man page and a little tinkering, I changed the line "telnet ftp: +* log;" to "telnet ftp: + log;". i.e., I just removed the *. May be very insecure, but it does the job for me. Perhaps one could add an IP address or a range of IPs to enhance security (as described in the man page).

One another word:
This might be very helpful on the VMWare front:

I am still using NAT. I had to just set the IP address of my Minix to be on the same subnet as VMNet8 (which is the default subnet on which VMWare does NAT-ing). Also, the default gateway on the guest OS - Minix - had to be set to VMNet8-subnet-.2 ( The .2 IP is the gateway across which VMWare does NAT).

Thats it!!!. All works fine now...

Adding a Favicon

Check out this Wiki article : http://en.wikipedia.org/wiki/Favicon

FTP Server on Windows 2003 Server R2

We had set up IIS on Windows 2003 server. Along with HTTP, we also had to set up FTP server to allow our staff members to be able to upload info to their respective folders.
The initial set up worked, but it was readonly, inspite of the folder permission being write. Then, I checked out that if I logged in as admin, I could create folders! So, I went to check out the folder permissions for the admin account. It was exactly as I had configured the staff account (FULL CONTROL), except that the permission were only for the current folder. For the staff account permissions, I had chosen to give full control to "This folder, and subfolders and files(as intuition and common sense would have served anyone). But, I must confess that I donot fully understand the NTFS permissions structure. So, I changed the staff permissions to this folder only and bingo! it worked.

Networking Lessons

Subnets, Non-routable IPS:
Learner's Perspective - http://www.easydesksoftware.com/news/news28.htm

Admin's Perspective - http://www.pku.edu.cn/academic/research/computer-center/tc/html/TC0000.html
Admin's Perspective - http://www.pku.edu.cn/academic/research/computer-center/tc/html/TC0305.html

Network Access across a router

This document recapitulates the tasks that were needed to be done by us to enable access between the online and offline systems in the lab at my hostel:

1) First set up a DNS ( with a domain name say ssshcc.edu )
- Set up the forward and reverse lookup zones
2) Set up the DNS machine to act as the router also between the two segments.
3) For each computer on the online and offline segments, change the primary DNS suffix of the computer to the DNS domain name ( as specified in step 1 )
- Right Click My Computer > Properties
- Computer Name
- Change
- More
- Type in the new Primary DNS Suffix
4) For each machine in the online and offline segements, make sure that the guest account is allowed network access.
- Start > Control Panel > Local Security Policy > Local Policy > User Rights Assignment > Deny Logon over Network
- Remove the Users whom you wish to allow network access (if the name is in the list)
5) Make sure that the default gateways and Primary and Secondary DNServers are correctly entered in the Network Configuration.
6) In the lab, i.e., in the SSSHCC, the online systems donot have guest login interactively, but we want the guest users from the offline segement to be able to access the online systems. For this, we enable the Guest user account on the Online systems, but prevent their Interactive Login as follows:
- Start > Control Panel > Local Security Policy > Local Policy > User Rights Assignment > Deny Logon Locally
- Add Guest user.
7)Here, you can choose the custom list and add the required IPs or choose then Any computer option as required.
8) One last setting: The windows firewall by default allows only computers on the same segment to access each other. This needs to be changed:

It is like this: Port 445 (which is what windows uses for file and printer sharing) by default accepts connections only from computers on the same subnet as itself. This behaviour can be changed as described in the document: https://docs.google.com/View?docid=ajgs46pc346b_9dxvvjc.
You can find Microsoft's description of the solution(KB840634) at http://support.microsoft.com/kb/840634

Windows XP Pro: Network access: logon failure

Windows XP Pro: Network access: logon failure: the user has not been granted the requested logon type at this computer

Solutions:
0) Start > Control Panel > Administrative Tools > Local Security Policy > Local Policies > User Rights Assignment:
- Goto : Deny Access to this Computer from the Network
- Remove the user name to whom you wish give permission to access the computer over the network.
1) Just run the network setup wizard and turn on file and printer sharing. If that does not help, try the next link:
2) http://www.experts-exchange.com/Operating_Systems/Windows_Server_2003/Q_21072962.html?qid=21072962
3) http://www.experts-exchange.com/Operating_Systems/Windows_Server_2003/Q_21072962.html

Matlab license manager error: Solaris 10

If the Sun Machine is not properly shut down when Matlab (license) server is running, you will be unable to start matlab after the reboot. You will get an error -15.
To trouble shoot, I did the following:
- I knew that lmstart command present int $MATLAB/etc directory starts the matlab license manager.
- To start the license manager (i.e., to run the lmstart command), you need to be logged in as a non-root user.
- So, I tried to start the license manager.
- I got a message saying that I needed to delete some files: /var/tmp/lm_*.log and /var/tmp/lm_*.dat
- For this you need to log in as root.
- Once this is done, run lmstart again.
- Done.