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