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~

Installing QNX 6.4.1 on Ubuntu 20.04

Installing QNX 6.4.1 on Ubuntu 20.04 Install pre-requisites $: sudo dpkg --add-architecture i386 $: sudo apt update $: sudo apt install li...