Sunday, December 23, 2007

Midnight Commander not displaying properly in mrxvt

I think the problem here is not really directly related to Mrxvt not supporting unicode since MC does not fully support Unicode either. The problem I think is that Debian Etch (4.0) is shipped with Unicode support enabled by default. In fact locale shows that encoding is by default set to UTF-8. Now, to get a better display of MC, we need to make some minor adjustments. First, open terminal, like xterm or Eterm, then change to root user and do the following:
#: dpkg-reconfigure --force locales
Select locales you need to be installed/configured in your system. Then select, for example, en_US.ISO-8859-15. This will configure your system to use ISO-8859-15 encoding by default. Restart computer and off you go. ~ts

Sunday, December 09, 2007

STAF silent install with options on user login and quick menu

STAF is a software test automation framework, see this link for more information. When installing the software remotely without manual intervention, silent install is must have feature. The package was actually created using InstallShield Multiplatform. In fact silent installation is documented in the STAF User's Guide. But unfortunately it does not mention all the options, just the most frequently used ones. What I am going to do here is to document how to get those options and a sample command to install STAF with "Start STAF on user login" and "Place Icons on the Quick Start Menu" not included during installation. To get the command line options, you need to read the InstallShield .uip file that defines all those options. For STAF this can be found from this link. To get the command line option for "Start STAF on user login" and "Place Icons on the Quick Start Menu" was not really that challenging because the developers were using variables that pretty much describes them. Example, stafOptions.startSTAFOnLogin was used for "Start STAF on user login" and stafOptions.iconsOnQuickStartMenu was used for "Place Icons on the Quick Start Menu." With the information at hand, command should now look like below:
d:\>STAF323-setup-win32 -is:log D:\ismplog.txt -silent -W license.selection="Accept" -W setupTypes.selectedSetupTypeId="Full" -W stafOptions.updateEnvironmentVariables="System" -W stafOptions.defaultIPvVersion="IPv4 only" -W stafOptions.startSTAFOnLogin="false" -W stafOptions.iconsOnQuickStartMenu="false"
This assumes that STAF323-setup-win32.exe is in the system path or on D:\. ~ts

Error message when you try to set an IP address on a network adapter

When removing hardware devices in Windows, the drivers are left in the system just in case you need to install the device again. But this can be problematic with network cards specially when it is configured statically. To remove this hidden network card, do the following:
c:\>set devmgr_show_nonpresent_devices=1
c:\>DEVMGMT.MSC
Then in the Device Manager window, do View->Show Hidden Devices. Delete network cards that are not present in the system as necessary. See this link for more information and other methods. ~ts

Saturday, December 01, 2007

Getting sound working on ECS A097 under Debian Etch

I had my machine installed with Debian Etch minimal install. Looks like by default alsa-base et al are not installed by default. Anyway, to get sound working on this machine and distribution, just do:
~: su 
#: apt-get install alsa-base alsa-utils
and off you go. Also visit the following links for more information http://forums.debian.net/viewtopic.php?t=21180 http://newbiedoc.berlios.de/wiki/Sound_in_Debian_GNU/Linux ~ts

Friday, November 30, 2007

Changing the default system font used by Iceweasel/Firefox on Debian Etch

What I mean with system font here is the font that is being used in the menu bar.. etc. That would include anything that is shown in the About window, task bar, tab bar. For this exercise we will use terminus. This may not be the best font for menus as this is a fixed width font i think. Anyway, we need to first install the font first.
~: su
#: apt-get install terminus
#: exit
~: cd ~/.mozilla/firefox
Here you need to determine what is the first part of *.defualt. Once you have the name then do change into that directory, example:
~: cd xpwzepdt.default
Now make a copy of userChrome-example.css
~: cp userChrome-example.css userChrome.css
Do edit the file, then make the following changes
# ~: nano -w userChrome.css
# this one will set the default system Iceweasel font to terminus

* {
font-family: terminus !important;
font-size: 8pt !important;
}
Enjoy! ~ts

Wednesday, November 28, 2007

Configure gateway on an interface brought up with dhcp

My home network is quite non-standard. I have an AirLink 101 wireless router which act as a DHCP server as well. I haven't found a way to configure this device so that the data returned by the DHCP server to the clients will include my real gateway machine's address. I think this is possible with this device but since the manual is so sparce and I haven't encountered information online that shows me how to do this so I change the gateway address instead on the clients. For machines with Debian Etch installed, this can be configured in /etc/network/interfaces. See below for my configuration:
#: nano -w /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
 gateway 192.168.1.10
 up route del default
 up route add default gw 192.168.1.10
~ts

Thursday, November 22, 2007

Assigning keyboard shortcut for "Remove Last Icon" in FreeMind

Freemind is a mind mapping application. Latest version can be found in http://freemind.sourceforge.net/wiki/index.php/Main_Page, it was at version 0.9.0 beta 14 when I wrote this document.

I really like this application and the design is quite intuitive. Since this program is still in beta there are rough around the edges. Like say setting the keyboard shortcut for removing the last icon for a node is not working.

What I am going to do here is to document how to get this one functionality working. By default (at least for 0.9.0 beta 14) "Remove Last Icon" is assigned to "BACK_SPACE" key. But for some reason it is not working.

Here are the steps on getting this guy working:

1.) Extract a copy of mindmap_menus.xml. For zip installation, this can be found in <Extracted_Dir>/lib/freemind.jar. I used 7-zip to extract the file. Tough 7-zip's website didn't mention that it supports jar files it is capable of handling the file type successfully. Jar is pretty much the same as zip format which is supported by 7-zip.

2.) Using a text editor, I am using wscite, add the following line.:

<menu_category name="icons">
     <menu_action field="removeLastIconAction"  key_ref="keystroke_remove_last_icon"/>
</menu_category>

This should in line 138 for 0.9.0 beta 14

3.) Merge back the file into freemind.jar. Again you can use 7-zip to do this.

4.) Restart FreeMind. Note here that "BACK_SPACE" is still not working. In this case I don't how to make this work with this key. But in this exercise, we will re-assign it to Ctrl+D.

5.) Re-assign the key to Ctrl+D. Open auto.properties. This file can found in C:\Documents and Settings\<user name>\.freemind. Add the following line to this file:

#start to copy from this line

keystroke_remove_last_icon=control D

#end here.

6) Restart Freemind again. It should be working by now.

You might be interested on how to determine the "field" part of  mindmap_menus.xml. For most cases it can found in the source file http://sourceforge.krugle.com/kse/files/cvs/cvs.sourceforge.net/freemind/freemind/freemind/modes/ControllerAdapter.java staring line number 165.

Happy mind mapping!!!

~ts

Sunday, November 11, 2007

Configure STAF to run as a Windows service

There are some advantages on running STAF as a Windows service. Common reason being that the STAF functionality is available even without user logged into the system.

Configuring STAF to run as a service needs an auxiliary application, like srvany.exe. This file is part of Windows Resource Kit. Due to licensing restrictions I cannot attach the file here but it should not be big of a problem as you can download the resource kit from Microsoft for free. Do a google using the keywords "Windows Resource kit" and start from there. The filename of the installer normally is rktools.exe. Once downloaded, install the software look for srvany.exe and instsrv.exe.  You can copy this files somewhere so that you can use it other machines. See below for the steps for configuring STAF to run as a service:

1) Copy instsrv.exe and srvany.exe into C:\Windows\System32 (actually $windir\system32 ).

2) In Windows console ( Start->Run "cmd.exe"), change to directory C:\Windows\System32.

3) Install a Windows service placeholder, like:

instsrv.exe STAF C:\Windows\System32\svrany.exe

Note "STAF" here can be any string but for convenience and easy correlation we used STAF.

4) Modify this service to actually run STAFProc.exe via registry. Open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\STAF

5) Under this subkey, add a key named as "parameters".

6) Select the new "parameters" key and add a string value named "application". It should be of type REG_SZ.

7) Change the data to "C:\STAF\bin\STAFProc.exe".

8) Close regedit.exe.

9) If we need STAF to interact with the desktop then minor adjustment is necessary. Modify the STAF service using services applet ( in Windows 2003/Windows XP it can be accessed via Start->Control Panel->Administrative Tools->Services ). Double click on STAF service ( or via context menu then Properties ), select Log on tab. Enable "Allow service to interact with desktop"

Useful links:

How To Create a User-Defined Service by Microsoft

~ts

Wednesday, November 07, 2007

Configure Ubuntu to search hostnames across domains

I am not sure if I messed up my Ubuntu system or something but it does not search hostnames within our intranet on different domains. On Windows systems, this is automatically done for you through DNS Suffix Search List which I believe is being supplied by DHCP server, not really sure. Now to get my Ubuntu machine ping other hosts on another domain we have to do two things. First we need to do this. Then configure our Ubuntu box for the search order. This can be done in two ways. GUI via System->Administration->Network, it should show something like this:

Or this can be done through the file /etc/resolv.conf. See below for an equivalent configuration.

#: nano -w /etc/resolv.conf

#<-- start here
nameserver 142.176.1.82
nameserver 142.176.1.101
nameserver 142.176.1.102
domain asia.nothing.com
search asia.nothing.com na.nothing.com

~ts

Wednesday, October 03, 2007

Manually configure networking in Debian under VBox

For some reason my Debian 4.0 box running under VBOX does not connect to the internet via NAT all the time, reason? I don't know. Anyway, I was able to get it up and running using the usual old, in the terminal configuration. First, since my first interface, eth0, is configured by default to get IP from DHCP, I have to bring it down, i.e.
#: ifdown eth0
Now, let us bring it up manually with an IP that is probably not being used by other VMs running inside VBOX in this case we will try 10.0.2.3.
#: ifconfig eth0 up 10.0.2.3 netmask 255.255.255.0
Note that by default, VBOX gateway is 10.0.2.2 or basically we can also say that this is the IP address of the host machine internally. Let us now add entry into the routing table to route traffic to the gateway.
#: route add default gw 10.0.2.2
One last change we need to make is in the file /etc/resolv.conf.
#: nano -w /etc/resolv.conf

#<-- this line is not included, search for namesever
nameserver 192.xxx.xxx.xxx
Note that the IP address that should be used for the nameserver should point to an existing DNS server. Since my host is running Windows XP Sp2, nameserver/DNS can be easily determined via the command:
C:\>ipconfig /all
As sample output would be:
C:\>ipconfig /all

Windows IP Configuration

       Host Name . . . . . . . . . . . . : machine_name
       Primary Dns Suffix  . . . . . . . : me.atmy.com
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : me.atmy.com
                                           me2.atmy.com

Ethernet adapter VMware Network Adapter VMnet8:

       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet8
       Physical Address. . . . . . . . . : 00-50-56-C0-00-08
       Dhcp Enabled. . . . . . . . . . . : No
       IP Address. . . . . . . . . . . . : 192.168.33.1
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:

       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet1
       Physical Address. . . . . . . . . : 00-50-56-C0-00-01
       Dhcp Enabled. . . . . . . . . . . : No
       IP Address. . . . . . . . . . . . : 192.168.106.1
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :

Ethernet adapter Wireless Network Connection:

       Media State . . . . . . . . . . . : Media disconnected
       Description . . . . . . . . . . . : Intel(R) PRO/Wireless 2200BG Network
Connection
       Physical Address. . . . . . . . . : 00-13-CE-F0-BD-CB

Ethernet adapter Network Bridge (Network Bridge):

       Media State . . . . . . . . . . . : Media disconnected
       Description . . . . . . . . . . . : MAC Bridge Miniport
       Physical Address. . . . . . . . . : 02-FF-EC-C1-2E-3C

PPP adapter HUAWEI3G.Globe - 3G with HSDPA:

       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : WAN (PPP/SLIP) Interface
       Physical Address. . . . . . . . . : 00-53-45-00-00-00
       Dhcp Enabled. . . . . . . . . . . : No
       IP Address. . . . . . . . . . . . : 10.60.136.220
       Subnet Mask . . . . . . . . . . . : 255.255.255.255
       Default Gateway . . . . . . . . . : 10.60.136.220
       DNS Servers . . . . . . . . . . . : 192.40.100.30
                                           203.177.255.10
       NetBIOS over Tcpip. . . . . . . . : Disabled

C:\>
In the sample above we have two DNS servers, 192.40.100.30 and 203.177.255.10. So you might have a nameserver entry of both or just one of them. ~ts

Thursday, September 27, 2007

Gadgets I like

Keyboard X-Slim Mini Keyboard USB+PS2 Model: KLS-5UP by A4 TECH

Themes that matters

Smoke : nice and clean, url : http://www.spuler.us. ~ts

Thursday, September 20, 2007

How to get Linux box ping a Windows machine via netbios/wins

Name resolution in Linux is controlled by System Databases and Name Switch Configuration file which is located in /etc/nsswitch.conf, at least for my Debian based system. Note this is only true I think with libc5 and newer with NYS support and the GNU C Library 2.x (libc.so.6). The most import section to get a Linux to ping a Windows machine is the hosts statement.
# ~: nano /etc/nsswitch.conf

# <----- several lines before this one
hosts: files dns wins

What this says is that the gethostbyname and similar functions will first check the local database (/etc/hosts). If the name cannot be found then do use dns and finally wins.

But for wins lookup to work, winbind needs to be installed. Winbind provides 3 major functions for integrating with Windows network. But we are not really using anyone of those 3 major functions but rather we need the functionality provided by /lib/libnss_wins.so library. So to get this file installed, do:

#: apt-get install winbind
And as a side note, I have to reboot the machine to get this to work. There might be some service that I need to restart but which I don't know. Related links:

For a Ubuntu box, use the following link:

http://ubuntuforums.org/showthread.php?t=88206

~ts

Tuesday, September 18, 2007

Creating Windows icon using GIMP

Windows application icons normally used in an application is a multi-page icon. One is 16x16 at 4bpp and 32x32 that can be set as high as 32bpp. Creating an icon in GIMP is a easy a creating a new graphics document. Set the background to transparent and size to 32x32. On the first layer, add 16x16 and on the second layer add 32x32 picture. Save the file as .ico and select 4bpp for 16x16 image and 32bpp for 32x32. That should be it and off you go, you know have a nice looking Windows icon.

Wednesday, July 18, 2007

Installing Bugzilla in Ubuntu 7.04

Bugzilla is server software designed to help you manage software development. I though that installing this software in Ubuntu 7.04 is as easy is launching Synaptic Manager and install Bugzilla. But it turns out that there are few quirks here and there. Or shall we say installation is not really straight forward. I got it to start working by getting some information in Ubuntu forums, specifically this post. Since my main goal of installing this software is to try out the Task Based perspective of Eclipse, Mylyn, but it turns out that Task Repositories does not like http://localhost/cgi-bin/bugzilla/editparams.cgi, so I am pretty much stuck. After poking around, I got it working by modifying /etc/apache/httpd.conf, adding the following lines:
#: nano -w /etc/apache/httpd.conf

#<-- lots of lines before this of course
  Alias /bugs/ /usr/lib/cgi-bin/bugzilla/

  
     AddHandler cgi-script .cgi
     Options +Indexes +ExecCGI
     DirectoryIndex index.cgi
     AllowOverride Limit
  
~ts~

Tuesday, July 03, 2007

Install vmware-tools in Debian Sarge

Since Debian Sarge is not officially supported by VMWare, getting Debian to work efficiently on VMWare needs some minor adjustments. Like the video driver, NIC and mouse driver needs to be updated. To take the full functionality of VMWare and to get better performance, user needs to install the vmware-tools. Below is a quick guide on how to install the vmware-tools in Debian Sarge. Note: need to log-in as root. 1) Get the version of Linux kernel.
#: uname -r
A sample output of the above command could be:
>> 2.8.18-4-686
which basically says that you have a linux-2.8.18-4-686. 2) Now let us check if we have Linux headers for the version as shown above.
#: apt-get install -s linux-headers-2.6.18-4-686
The statement above means that we will do a simulated install of package "linux-headers-2.6.18-4-686". See below for a sample output:
technomachine:/home/techno# apt-get install -s linux-headers-2.6.18-4-686
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
linux-headers-2.6.18-4-686
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst linux-headers-2.6.18-4-686 (2.6.18.dfsg.1-12etch2 Debian-Security:stable)
Conf linux-headers-2.6.18-4-686 (2.6.18.dfsg.1-12etch2 Debian-Security:stable)
3) Since it looks like it is good, then lets install this package.
#: apt-get install linux-headers-2.6.18-4-686
4) Do create a smylink of the linux header.
#: ln -s /usr/src/linux-headers-2.6.18-4-686 /usr/src/linux
5) Install GCC.
#: apt-get install -s gcc
Sample output should look like the following:
technomachine:/home/techno# apt-get install -s gcc
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
manpages-dev autoconf automake1.9 libtool flex bison gcc-doc
Recommended packages:
libc6-dev libc-dev
The following NEW packages will be installed:
gcc
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst gcc (4:4.1.1-15 Debian:4.0r0/stable)
Conf gcc (4:4.1.1-15 Debian:4.0r0/stable)
Again, since it looks like it is okay, then let us install GCC.
#: apt-get install gcc
6) Define our C compiler now.
#: export CC=/usr/bin/gcc-4.1
7) In VMware Host, do VM->Install VMware Tools... 8) Now back in the virtualized Debian, do:
#: mount /dev/cdrom
#: cd /mnt/cdrom #I am assuming that the cdrom is mounted here, else consult manpage
#: mkdir ~/temp
#: cp VMwareTools-1.0.3-44356.tar.gz ~/temp
#: cd ~/temp
#: tar -xvzf VMwareTools-1.0.3-44356.tar.gz
#: cd vmware-tools-distrib
#: ./vmware-install.pl
Then just use the default values (thus say, hit the Enter key :) 8) After all is done, we need to copy the VMware mouse driver for mouse integration.
#: cd /usr/lib/vmware-tools/configurator/XOrg/7.0
#: cp vmmouse_drv.so /usr/lib/xorg/modules/drivers
9) Edit /etc/X11/xorg.conf to use the new mouse driver:
#: nano -w /etc/X11/xorg.conf

Section "InputDevice"
Identifier "Configured Mouse"
Driver  "vmmouse"  #<---this part   Option  "CorePointer"   Option  "Device"  "/dev/input/mice"   Option  "Protocol"  "ps/2"   Option  "Emulate3Buttons" "true" EndSection
10) Reboot the machine :). We need this so that the fast network driver will also load. This is the easiest anyway. Happy Debian :) ~ts~

Monday, July 02, 2007

Generating UUID in Jython

I have been poking around STAX/STAF recently and I found a need to generate UUID or GUID in Windows. I tried uuid module in CPython but I can't call it inside my STAX job. I tried to create STAX process but I noticed that if the program is under heavy usage I cannot guarantee that the STAX process that runs the CPython gets the resulting UUID string. Since STAX is using Jython, I reasoned out that this should be possible in Java. A quick search in Google shows java.util.UUID. This class is just what I need. So, basically, in Jython I can generate a UUID using the following command: import java print java.util.UUID.randomUUID() ~ts~

Generate universally unique ID in Python

In my previous post, I discussed how to generate GUID (Windows world) or the standard equivalent UUID to generate a guaranteed unique identifier from Python. I didn't know that their is a CPython library that can do this in a more platform neutral way. Just today, I came across the module uuid. uuid is now part of the standard Python library but as to when, I am not sure. One thing I am certain, it is there in Python 2.5.1.


Below is a sample code to generate a UUID version 4.

import uuid

print uuid.uuid4()


If you want to know more about UUID and the standards using it, please pay a visit to Wikipedia - UUID.

~ts~

Saturday, June 30, 2007

Getting PUTTY to draw line correctly

This is a shameful direct copy of the information from this link. To make it all work right, you need to twiddle the following configuration settings: Terminal → Keyboard: Change the sequences sent by: The Functions keys and Keypad: Select Linux. Window → Appearance: Font settings: Pick a font that contains the Unicode line drawing characters, such as Andale Mono or Lucida Console. (Unfortunately Vista’s gorgeous new Consolas font does not have those.) Window → Translation: Character set translation on received data: Select UTF-8. Adjust how PuTTY handles line drawing characters: Select Use Unicode line drawing code points. Connection → Data: Terminal details: Terminal-type string: Enter “linux”. Now line drawing characters should show up as they are supposed to. ~ts~

Tuesday, June 26, 2007

Generate GUID in Python running in Windows

GUID can be useful as a primary key for a databases and also for the records or rows of data that needs to be unique. There are a lot of tools that can generate a GUID but in this quickie blog, I am documenting how to generate a GUID using Python in Windows.

To generate a GUID, import the code below:

import pythoncom

_guid = pythoncom.CreateGuid
()
_guid_str = str(_guid
)
print
"%s GUID is %d long"%(_guid_str,len(_guid_str))


~ts~

Wednesday, June 20, 2007

Grab screen capture programatically

Pre-requisite:
  1. Python 2.5 for Windows
  2. Python Imaging Library (PIL).

Install Python 2.5 for Microsoft Windows. Make sure that you have administrative rights to be able to install the application properly. After having verified that Python is installed and working, install Python Imaging Library. See below for a sample of screen capture python script.

#--<-start code here->--

import ImageGrab;

img = ImageGrab.grab
()
img.save(
"D:\\test.jpg")

 

#--<-end code here->--
~ts~

Saturday, June 09, 2007

Direct link download to Yahoo Messenger installer

Here is the link for downloading v10 Yahoo Messenger.
Here is the link for downloading v9 Yahoo Messenger.
Here is the link for downloading v8 Yahoo Messenger.

~ts~

Friday, June 08, 2007

Detecting the process using/locking a file

In Windows, if a file is being used, normally user cannot delete it. But there are cases, especially during development and/or troubleshooting, where a file needs to be deleted or renamed. The issue here is that deleting a locked/used file is not allowed in Windows. Windows Explorer does not give even a slight hint as to who has the lock on the file. Fortunately, Mark Russinovich of Microsoft, developed a tool to list the process that is having a lock on the file. The name of the tool is "handle" and can be downloaded from the site. If you have a file readme.txt and you want to delete it and for some reason their is a rouge application getting hold of it. To get the process name of the application that's using it, just issue the command:
handle readme.txt
~ts~

Thursday, June 07, 2007

Clear arp cache

Background: The address resolution protocol (arp) is a protocol used by the Internet Protocol (IP), specifically IPv4, to map IP network addresses to the hardware addresses used by a data link protocol. The protocol operates below the network layer as a part of the interface between the OSI network and OSI link layer. It is used when IPv4 is used over Ethernet. The term address resolution refers to the process of finding an address of a computer in a network. The address is "resolved" using a protocol in which a piece of information is sent by a client process executing on the local computer to a server process executing on a remote computer. The information received by the server allows the server to uniquely identify the network system for which the address was required and therefore to provide the required address. The address resolution procedure is completed when the client receives a response from the server containing the required address. An Ethernet network uses two hardware addresses which identify the source and destination of each frame sent by the Ethernet. The destination address (all 1's) may also identify a broadcast packet (to be sent to all connected computers). The hardware address is also known as the Medium Access Control (MAC) address, in reference to the standards which define Ethernet. Each computer network interface card is allocated a globally unique 6 byte link address when the factory manufactures the card (stored in a PROM). This is the normal link source address used by an interface. A computer sends all packets which it creates with its own hardware source link address, and receives all packets which match the same hardware address in the destination field or one (or more) pre-selected broadcast/multicast addresses. The Ethernet address is a link layer address and is dependent on the interface card which is used. IP operates at the network layer and is not concerned with the link addresses of individual nodes which are to be used.The address resolution protocol (arp) is therefore used to translate between the two types of address. The arp client and server processes operate on all computers using IP over Ethernet. The processes are normally implemented as part of the software driver that drives the network interface card. There are four types of arp messages that may be sent by the arp protocol. These are identified by four values in the "operation" field of an arp message. The types of message are: ARP request ARP reply RARP request RARP reply To reduce the number of address resolution requests, a client normally caches resolved addresses for a (short) period of time. The arp cache is of a finite size, and would become full of incomplete and obsolete entries for computers that are not in use if it was allowed to grow without check. The arp cache is therefore periodically flushed of all entries. This deletes unused entries and frees space in the cache. It also removes any unsuccessful attempts to contact computers which are not currently running. To clear the Arp Cache on a Windows-based system, the following command line should be used:
netsh interface ip delete arpcache
~ts~

Saturday, May 12, 2007

Uninstall an application from the command line

Software automation testing sometimes need to perform installation and un-installation of software products. One of the new things that I learned was that a user can un-install a certain application from the command line. To determine how to uninstall a certain product, open registry and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. For the application that you want to uninstall look for the key "UninstallString". Copy and paste this string in the command line, hit on {ENTER} and it should uninstall the application for you. ~ts~

Determine the application that spawn a certain process

Maintaining the performance of a computer takes a lot of research and tinkering of the system. One of the tools that that I find really useful is Process Explorer formerly of Sys Internals which is now a part of Microsoft. It was originally and still is designed/maintained by Mark Russinovich, et al. One of the key features that I like with Process Explorer is that it shows a tree view of the running process in a system. And in addition to that it allows the user to search by process handle or a DLL substring. The best feature that I like with this tool is that it shows you the command line arguments used to run the application. If you think this is too good to be true, see for yourself. Head to http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx and download the file. ~ts~

Saturday, April 28, 2007

Programming icons

"Packaging is the product itselft." This is the matra for most marketing folks. This is no different in designing user interfaces for customer use. Selecting a nice set of icons then becomes a serious issue if the product is for general public consumption. This complicates even more for small shops or one man team designing software solutions. Thanks to the current revolution in software development... open source, creative commons and the likes. Listed below are some icon set that are either LGPL, CCA or etc. Ximian icon sets License : LGPL The icons are being used in OpenOffice and Ximian Desktop 2 Silk Icon set License : Create Commons Attribution 2.5 License “Silk” is a smooth, free icon set, containing over 700 16-by-16 pixel icons in strokably-soft PNG format. Containing a large variety of icons, you're sure to find something that tickles your fancy. And all for a low low price of $0.00. You can't say fairer than that. ~ts~

Sunday, April 22, 2007

List Microsoft Windows products installed in a system

I develop a short python script to display Microsft Corporation software that is installed on a system. This script can be modifed easily to check for all installed OS hotfixes if need be. See below for the script:

<---code-----

import _winreg
import sys

hkcu = _winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE
)
m_key =
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
m_UnInstall = _winreg.OpenKey( hkcu, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
)

_index =
0
while True
:
    try
:
        m_subkey = _winreg.EnumKey(m_UnInstall,_index
)
        m_newkey = m_key +
"\\"
+ m_subkey
        m_RegistryKey = _winreg.OpenKey( hkcu, m_newkey
)
        try
:
            if _winreg.QueryValueEx(m_RegistryKey,
r"Publisher")[0] == r"Microsoft Corporation"
:
                
                
print _winreg.QueryValueEx(m_RegistryKey,
r"DisplayName")[0
]
                _winreg.CloseKey(m_RegistryKey
)
        except
:
#            print "Unexpected error:", sys.exc_info()[0]
            
pass

#        print "current key %s" % m_newkey
        _index = _index +
1
        
    
except EnvironmentError
:
#        print "Nothing to retrieve"
        
break
_winreg.CloseKey(m_UnInstall
)
_winreg.CloseKey(hkcu)

<---code-----

Or download it from here.
~ts~

Tuesday, April 10, 2007

Enable command line completion using TAB char for Windows 2000 Professional

Command line completion is almost always expected of terminals on Linux systems. On Windows 2000 Professional, command line completion can be enabled by changing the following registry entry: KEY = HKEY_CURRENT_USER\Software\Microsoft\Command Processor PARAMETER = CompletionChar Change the value from 0 to 9(TAB in HEX).

Thursday, April 05, 2007

Python 2.5 install issue on some Windows XP machines

I have installed Python 2.5 from ActiveState on two machines now and each one was working pretty nice. But on one of my machines PythonWin refused to load, see below for the message:
---------------------------
Python for Win32
---------------------------
The application can not locate win32ui.pyd (or Python) (126)
The specified module could not be found.

---------------------------
OK   
Searching in ASPN network I found out that this is an open issue, see 68141. The good thing with this bug is that the workaround is quite simple if you have a working installation. Just copy pythoncom25.dll and pywintypes25.dll into c:\windows\system32 of the machine that PythonWin does not work. What if you don't have a working machine? Well, low and behold, I have it for you. Download it here. I'll be more than thankful if anyone can report to me that this issue is already fixed so that I can update this blog. Another work-around is to install pythonwin on top of currently installed version from http://sourceforge.net/project/showfiles.php?group_id=78018. Select pywin32-210.win32-py2.5.exe and download. ~ts~

Saturday, March 31, 2007

mrxvt settings that I like

mrxvt is a tabbed VT102 terminal emulator for X Window System. This is like gnome-terminal(GNOME) or konsole(KDE). The good thing with mrxvt is that it is light-weight so this is good for old machine when combined with lighter window managers like fluxbox when running in graphical mode. Below is my .mrxvtrc configuration suites my taste:
# save this to ~/.mrxvtrc
Mrxvt.background:     black
Mrxvt.foreground:     gray
Mrxvt.cursorColor:     yellow
Mrxvt.tabBackground:     black
Mrxvt.tabForeground:     yellow
Mrxvt.bottomTabbar:     True
Mrxvt.scrollbarRight:     True
Mrxvt.scrollbarStyle:     rxvt
Mrxvt.borderColor:     green
Mrxvt.transparent:     False
Mrxvt.transparentTabbar:    False
Mrxvt.itabBackground:     black
Mrxvt.background:     black
Mrxvt.foreground:     gray
Mrxvt.cursorColor:     yellow
Mrxvt.borderColor:     green
Mrxvt.transparent:     False
Mrxvt.geometry:     100x25
#-------------------------------------------------------------------
#Tabbar related configuration

Mrxvt.tabBackground:     black
Mrxvt.tabForeground:     yellow
Mrxvt.bottomTabbar:     True
Mrxvt.transparentTabbar:    False
Mrxvt.itabBackground:    #101010
Mrxvt.tabBackground:    #000000
Mrxvt.itabForeground:    #909090
Mrxvt.tabForeground:    #9a9a9a

#seems like not working
Mrxvt.minVisibleTabs:    8

Mrxvt.hideButtons:    True

# Number of lines to save in the scroll back buffer for all tabs
Mrxvt.saveLines:    500


# Scroll bar related
Mrxvt.scrollbarRight:     True
Mrxvt.scrollbarStyle:     rxvt
Mrxvt.scrollColor:    #808080
Mrxvt.troughColor:    #202020

#
# ---------------------------------- FONTS ----------------------------------- #
#
Mrxvt.font:   -*-terminus-*-r-*-*-*-*-*-*-*-*-*-*
Mrxvt.mfont:   -*-terminus-*-r-*-*-*-*-*-*-*-*-*-*
Mrxvt.boldFont:  -*-terminus-*-r-*-*-*-*-*-*-*-*-*-*
#Mrxvt.xft:      1
#Mrxvt.xftFont:      Bitstream Vera Sans Mono
#Mrxvt.xftSize:      10
#Mrxvt.xftAntialias:    1
Or download this configuration. ~yth~

Sunday, March 25, 2007

Gentoo make.conf for ECS A097

This file maybe useful for people installing Gentoo into their ECS A097. Highlighted text below is the make.conf that I use for my own A097.
# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
# CFLAGS="-O2 -mtune=i686 -pipe"
# CHOST="i386-pc-linux-gnu"
# CXXFLAGS="${CFLAGS}"
CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
USE="-qt3 -qt4 -arts -kde -bindist gtk gnome hal avahi X tk bitmap-fonts truetype-fonts type1-fonts alsa nptl nptlonly"
SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"

GENTOO_MIRRORS="http://gentoo.gg3.net/ "
INPUT_DEVICES="keyboard mouse"
VIDEO_CARDS="sis"
ALSA_CARDS="ali5451"
~yth

Sunday, March 04, 2007

Installing Gentoo into ECS A097

ECS A097 is a laptop using a Transmeta Crusoe microprocessor. Crusoe is different from two other will known processors, namely AMD microprocessors and Intel microprocessor, because it is using the VLIW technology. Intel and AMD are mostly CISC based processors. With the Transmeta Crusoe design, some of the instructions are being run by the processor and some are implemented in software they called code morphing. By doing this they basically offloaded the microprocessor thereby consuming less power. To prove further about Crusoe check the following link. What I am going to do here basically is to document how to run Linux in Transmeta Crusoe the fastest possible. There are many ways of achieving this like installing the OS using LFS but we will use Gentoo here instead. Install sequence: 1) Download install-x86-minimal-2006.1.iso from www.gentoo.org. 2) Burn the image into a CD-R/W. 3) Boot the machine using the minimal Gentoo CD. 4) Since my network was not configured properly on boot-up, I configured eth0 using "net-setup eth0." This is needed in my case because my network configuration is not really one of the common setup. I have a gateway running Windows XP SP2 and I have a DHCP served by Airlink wireless router. I don't know how to setup the router so that when a computer requests for an IP it should also return the correct gateway. My problem really is with configuring the router with non-default gateway. Anyways, enough for that. Since this is my own network I know what data to supply for the gateway and the DNS servers. 5):(... I got stumbled with issues and forgot to document every steps I have taken to configure this portable computer in Gentoo. Better luck next time. Some important information I have collected while playing around with Gentoo. Updating entire Gentoo system:
#: emerge --update --deep --newuse world
#: emerge --deepclean
#: revdep-rebuild
Very Important when updating kernel: Run the following command to rebuild external modules:
#: module-rebuild rebuild
~yth~

Friday, March 02, 2007

Globe Visibility Speed Tracking

Location : Near Shangri La Plaza Hotel, Mandaluyong City, Philipipines

Decide for yourself if this internet subscription is worth the cost

Impression: Globe Visibility is very slow compared to wired, always on internet subscription. Upload is very very slow. Browsing is marginally/slightly faster to dial-up.
But note the price. Globe Visibility is 2000.oo flat which is way more expensive compared to cable/dsl. If you don't need extreme mobility please do yourself a favor, get wired connection.
Note: Listed below are top speed, nominal/average speed is way below dial-up speeds.

[Update (04March07)] After pooking around with how E220 modem works, I was able to achieve reasonable speeds. I think with this new speed Globe Visibility is good enough for home and for mobile users. I will create another blog entry describing how I managed to get decent speeds from Visibility.

See the table tracking here. I have another table with more columns here .

Udpates:
As of 06August2007 I can only connect to Edge network :(.
23Nov2008 - Seems like Globe has issues with DNS. Accessing random websites return something indicative of DNS issues. I have called Globe and asked them to contact me if they have more information from their tech group but to no avail. Seems like they just don't really care about their customers but the bill is coming on time though. And for the past 3 or 4 weeks we can only connect reliably through EDGE.

Sunday, January 28, 2007

Creating a dynamic form in Palm OS

Code below shows how to create a dynamic form for Palm OS 3.0 or greater. See this link of the entire project created using Palm OS Development Suite.

/****************************************************************************** * Application Name : DynamicUI.prc * Purpose : Demonstrate how to create a dynamic UI * Programmed by : Techno Scavenger *****************************************************************************/ #include <PalmOS.h> /*********************************************************************** * * Internal Constants * ***********************************************************************/ #define appFileCreator 'ewa8' #define appVersionNum 0x01 #define appPrefID 0x00 #define appPrefVersionNum 0x01 /*********************************************************************** * * Application constants * ***********************************************************************/ #define MainForm 1000 /*********************************************************************** * FUNCTION: MainFormHandleEvent * DESCRIPTION: This routine is the event handler for the * "MainForm" of this application. * PARAMETERS: pEvent - a pointer to an EventType structure * RETURNED: true if the event has handle and should not be passed * to a higher level handler. * REVISION HISTORY: ***********************************************************************/ static Boolean MainFormHandleEvent(EventType* pEvent) { Boolean handled = false; FormType* pForm; switch (pEvent->eType) { case frmOpenEvent: pForm = FrmGetActiveForm(); FrmDrawForm(pForm); handled = true; break; default: break; } return handled; } /*********************************************************************** * FUNCTION: AppHandleEvent * DESCRIPTION: This routine loads form resources and set the event * handler for the form loaded. * PARAMETERS: event - a pointer to an EventType structure * RETURNED: true if the event has handle and should not be passed * to a higher level handler. * REVISION HISTORY: ***********************************************************************/ static Boolean AppHandleEvent(EventType* pEvent) { UInt16 formId; FormType* pForm; Boolean handled = false; if (pEvent->eType == frmLoadEvent) { formId = pEvent->data.frmLoad.formID; // pForm = FrmInitForm(formId); pForm = FrmGetFormPtr(MainForm); FrmSetActiveForm(pForm); // Set the event handler for the form. The handler of the currently // active form is called by FrmHandleEvent each time is receives an // event. switch (formId) { case MainForm: FrmSetEventHandler(pForm, MainFormHandleEvent); break; default: break; } handled = true; } return handled; } /*********************************************************************** * FUNCTION: AppEventLoop * DESCRIPTION: This routine is the event loop for the application. * PARAMETERS: nothing * RETURNED: nothing * REVISION HISTORY: ***********************************************************************/ static void AppEventLoop(void) { Err error; EventType event; do { EvtGetEvent(&event, evtWaitForever); if (SysHandleEvent(&event)) continue; if (MenuHandleEvent(0, &event, &error)) continue; if (AppHandleEvent(&event)) continue; FrmDispatchEvent(&event); } while (event.eType != appStopEvent); } /*********************************************************************** * FUNCTION: AppStart * DESCRIPTION: Get the current application's preferences. * PARAMETERS: nothing * RETURNED: Err value errNone if nothing went wrong * REVISION HISTORY: ***********************************************************************/ static Err AppStart(void) { // FrmGotoForm(MainForm); static Char strTitle[13] = "Dynamic Form"; FormType* pMainForm; pMainForm = FrmNewForm( MainForm, strTitle, 0, 0, 160, 160, false, 0, 0, 0); FrmGotoForm(MainForm); return errNone; } /*********************************************************************** * FUNCTION: AppStop * DESCRIPTION: Save the current state of the application. * PARAMETERS: nothing * RETURNED: nothing * REVISION HISTORY: ***********************************************************************/ static void AppStop(void) { // Close all the open forms. FrmCloseAllForms(); } /*********************************************************************** * FUNCTION: PilotMain * DESCRIPTION: This is the main entry point for the application. * PARAMETERS: cmd - word value specifying the launch code. * cmdPB - pointer to a structure that is associated with the launch code. * launchFlags - word value providing extra information about the launch. * RETURNED: Result of launch * REVISION HISTORY: ***********************************************************************/ UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) { Err error = errNone; switch (cmd) { case sysAppLaunchCmdNormalLaunch: if ((error = AppStart()) == 0) { AppEventLoop(); AppStop(); } break; default: break; } return error; }

Sunday, January 21, 2007

Useful Internet Explorer 7 addons

Inline Search - an Internet Explorer add-on that mimics Firefox search behavior. It is a non-modal coupled with "find as you type" functionality.

Saturday, January 20, 2007

Use Palm OS Developement Suite documentation in latest version of Eclipse

Palm OS Developer Suite v 1.2 comes with Eclipse 3.0.x and CDT 2.0.2.ps002 which is quite outdated. Latest Eclipse version as of this writing was 3.2.1 with CDT at version 3.1.1. This latest CDT comes with lots of goodies like bracket matching and code folding which is absent in the CDT that comes with PODS. To use the documentation from PODS to the latest version of Eclipse copy the following directory including the files: com.palmsource.eclipse.sdk.palmos5.doc.user_1.2.0.23 com.palmsource.eclipse.tools.doc.user_1.2.0.23 Assuming default install these files should be located in C:\Program Files\PalmSource\Palm OS Developer Suite\eclipse\plugins. Copy this files into \plugins

Sunday, January 14, 2007

Open any document in IFix via shell

Below is a sample procedure to open a text in IFix.
Private Sub CommandButton1_Click()
    Dim ret As Long
    Dim hwnd As Long

    hwnd = FindWindow(vbNullString, Application.Caption)
    ret = shellExecute(hwnd, "Open", "c:\DVPendingFileRenameOp.log", vbNullString, vbNullString, 4)
End Sub
Note: Application is an IFix global variable.

Monday, January 08, 2007

Shell extension issue with Free Download Manager

I have found an issue with using Free Download Manager on Windows XP Pro Sp2. It used to work before then it suddenly causes Explorer to crash. Here are some data about the extension installed by Free Download Manager Extension name : FDMIECookiesBHO Class Type : FDMIECookiesBHO Class Filename : C:\Program Files\Free Download Manager\iefdmcks.dll I discovered that this is the extension that caused Explorer to crash using ShellExView. Note that I was a happy user of Free Download Manager for more than a year. This extension might have been affected by Windows Update. I was using Free Download Manager 1.8, this might be fixed with the newer version. Here some side effects of this extension: a) Clicking on a folder in the navigation view (treeview) that contains files in Explorer will crash the application. b) Windows Event Viewer logs something like this: Type: Information Source: Winlogon Category: None Event ID: 1002 Description: The Shell stopped unexpectedly and Explorer.exe was restarted.

VI common commands

Cursor movements in command mode: h=move the cursor to the left one character position l=move the cursor to the right one character position j=move the cursor down one line k=move the cursor up one line Changing mode: i=enter insert mode, the characters typed in will be inserted before the current cursor position. If you specify a count, all the text that had been inserted will be repeated that many times. a=enter insert mode, the characters typed in will be inserted after the current cursor position. If you specify a count, all the text that had been inserted will be repeated that many times. Text manipulation in command mode: x=delete character under the cursor. Count specifies how many characters to delete. The characters will be deleted after the cursor. u=undo the last change to the file. Typing u again will re-do the change. r=replace one character under the cursor. Specify count to replace a number of characters Cutting and Yanking:

The command commonly used command for cutting is d. This command deletes text from the file. The command is preceded by an optional count and followed by a movement specification. If you double the command by typing dd, it deletes the current line. Here are some combinations of these:

d^
deletes from current cursor position to the beginning of the line.
d$
deletes from current cursor position to the end of the line.
dw
deletes from current cursor position to the end of the word.
3dd
deletes three lines from current cursor position downwards.

There is also the y command which operates similarly to the d command which take text from the file without deleting the text.

Pasting:

The commands to paste are p and P. The only differ in the position relative to the cursor where they paste. p pastes the specified or general buffer after the cursor position, while P pastes the specified or general buffer before the cursor position. Specifying count before the paste command pastes text the specified number of times.

Windows Update fails

When performing Microsoft Windows Update fails (XP, not sure for other variants) try to add the following into trusted sites in Tools | Internet Options | Security Tab:
http://update.microsoft.com/

FreeBSD common commands

Install fluxbox
#: cd /usr/ports/x11-wm/fluxbox ; make install clean
Run fluxbox when executing startx
$: cd ~
$: touch .xinitrc
$: echo "exec fluxbox" > .xinitrc
Installing vmware-tools (FreeBSD 6.1, comes with XOrg 7.x)
#: mount /cdrom
#: cp /cdrom/vmware-freebsd-tools.tar.gz /tmp
#: cd /tmp
#: tar xvzf vmware-freebsd-tools.tar.gz
#: cd vmware-tools-distrib
#: ./vmware-install.pl ;defualts here should be fine
#: cd /usr/X11R6/lib/modules/drivers ;we need the following since vmware-install.pl does not install the mouse driver
#: cp /tmp/vmware-tools-distrib/lib/configurator/XOrg/6.8.x/vmmouse_drv.o
#: vi /etc/X11/xorg.conf
In vi, change the following lines:
Section "InputDevice"
 Identifier  "Mouse0"
 Driver      "vmmouse" #<<-- this line (changed from "mouse")
 Option     "Protocol" "ps/2"
 Option     "Device" "/dev/input/mouse0"
 Option     "ZAxisMapping" "4 5 6 7"
EndSection
//@end@\\

Friday, January 05, 2007

Common QNX commands

To open Phindows with specific screen resolution
c:\path_to_phindows>phindows.exe -t{IP_ADDRESS} -w800 -h600 ;opens a Phindows session on the specified ip using 800x600 res

Thursday, January 04, 2007

Compile farms and test machines

SourceForge.net provides a number of services to the developers of Open Source software development projects hosted on SourceForge.net. Part of this service offering is the SourceForge.net Compile Farm, which provides developers access to a pool of hosts that may be used for the compiling and testing of software. Each host within the Compile Farm is running a different Operating System (OS) on a different hardware platform. HP Testdrive - Want to try the latest technologies over the Internet? This program allows you to testdrive some of the hottest hardware and operating systems available today. Have you ever wanted to try out HP's exciting 64-bit Integrity and PA-RISC technology? Get time on SMP x86 and Opteron ProLiant servers? Try out a Blade server. Try different Open Source operating systems. Do it here! Just register for an account and fasten your seatbelt! Cray - Need to check if your application will work for the mainframes? What are you waiting for, dive in. Nomachine - Need to test remote access performance for NX server? Drop by here.

Wednesday, January 03, 2007

Common Solaris 10 commands

To change screen resolution
#: kdmconfig (note can only be used for XSun)
To reboot the machine
#: init 6
or
#: shutdown -i6 -g0 -y

Monday, January 01, 2007

Reading documents in Handspring Visor

There are quit a few choices when reading documents in Handspring Visor or Palm based PDA's. One is Adobe Acrobat Reader for Palm and Plucker. There might be more but these are the ones that I have used so far. The latest Adobe Reader for Palm OS works only for OS version 3.5 or greater. So for the Handspring Visor we are left with one application, Plucker. Latest version (1.8) does not seem to support Palm OS 3.0. When I was writing this blog it seems like the Plucker website was down. So I instead picked the older version from internet archive. I took v1.6 and low and behold it is working like a charm in Visor Deluxe. For readers convenience, you can download the file from here. Need to download and install 7-zip to extract the contents, though. Update (22Jan07) I found out that there are two binaries for v1.8 of the viewer application. One is for high resolution and non-hires. Non-high resolution works like a charm in Palm OS 3.0.x. Try this link.