Tuesday, January 30, 2007

Vmware in Sid

Here's how I confugured Vmware in my Debian sid:

Added necessary repos in /etc/apt/sources.list
#echo "deb http://www.fbriere.net/debian/dists/unstable ./" >> /etc/apt/sources.list
#echo "deb-src http://www.fbriere.net/debian/dists/unstable ./" >> /etc/apt/sources.list

Installed with apt-get
#apt-get install vmware4 vmware-source module-assistance linux-headers-`uname -r`

Now comes the module installation process

#m-a prepare, m-a update; m-a a-i vmware

If this does not work for some realson, do the following to compile the module manually

#cd /usr/src
#tar xvjf vmware.tar.bz2
#cd /usr/src/modules/vmware
#make
#mkdir -p /lib/module/`uname -r`/misc/
#ln vmmon.ko vmnet.ko /lib/modules/`uname -r`/misc/
#depmod -a

See if the modules got installed properly:
#lsmod
The two entrises confirmed that
vmnet 28396 0
vmmon 167180 0

Monday, January 29, 2007

Oracle 10g in Debian Sid

Today I installed and configured Oracle 10g Express Edition in my Debian Sid.

Here is how I did this:

#echo "deb http://oss.oracle.com/debian/ unstable main non-free" >> /etc/apt/sources.list
#apt-get update
#apt-get install oracle-xe oracle-xe-client

I had to download about 250 MB of installation files. Then the installer smoked me with this error message:

"This system does not meet the minimum requirements of swap space. Based on the amount of physical memory available on the system, Oracle Database 10g Express Edition requires 1008 mb of swap space. This system has 509 mb of swap space. Confugure more swap space on the system and retry the installation."

I had to enlarge my swap space to 1024 mb and the started the installer again. This time oracle got installed perfectly.

Then I had 2 do this:

#/etc/init.d/oracle-xe configure

Just answered yes to all the questions and orcacle got configured perfectly.

Then opened my web browser and put "http://127.0.0.1:8080/apex" in the address bar.

An interface like below popped up in the browser:


Entered 'system' for the username and provided the password that I used during the post-installation confugure process.

Friday, January 26, 2007

Running TC in Linux

Last time I posted how 2 use graphics.h in Linux. That really works great 4 me, but there is a simple catch. Sometimes it requires some minor modification to our code. But when you don't have that time to modify the code? Well, there's simple no other way that 2 run Turbo C in Linux. :D

I heard that there is a Linux version of Turbo C out there but could not find any. Then how did I run Turbo C in Linux? I did that in the most stupid way. See 4 yourselves.

#apt-get install dosbox

After installation I did this:

$dosbox

A black window came like below:


Here in the prompt I put this:

Z:\>mount c ~
Z:\>C:

This mounted my home dir to drive letter C.

I had TC installer in my home folder. So ran the installer and installed it this in C:\TC\BIN

C:\TC\BIN>tc

Now I there was the most intriguing part, TC's UI was there. I had 2 set a few environment variable's in TC and then compiled This Program without error:

Thursday, January 18, 2007

graphics.h in Linux

For my Univ project, I need 2 use graphics.h. Everyone knows graphics.h is not in C's standard library. Only Turbo C supports it and for that I need 2 use windows all the time which I don't like. So I had 2 find an alternate way of doing it and libgraph was just the thing I needed most. 'libgraph' is mainly a wrapper around SDL's libraries that effectively provides most of the functions of graphics.h.

Here is how I set up libgraph in my Debian Sid:

Downloaded the latest version of libgraph from this site:

http://download.savannah.nongnu.org/releases/libgraph/

First installed some libraries that libgraph depends on:

#apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev

(if you are using other distros like Fedora or Suse, packages 4 these distros are also avalable)

Extarcted the tarball

$tar xvzf libgraph-1.0.2.tar.gz

Then inside the folder ran this:

$./configure
$make
#make install

The default destination for the shared library files is /use/local/lib, if this path is not included in your library path (mine was not) then u have to add that manually in your /etc/ld.so.conf

Our installation is complete now. Now I make a simple test.c with these codes:

#include stdio.h
#include graphics.h

int main(void)
{
int gd=DETECT, gm=VGAMAX;
initgraph(&gd, &gm, 0);
moveto(0, 0);
rectangle(50,50,500,200);
while (!kbhit());
closegraph();
return 0;
}

[Note: There seems 2 be some problem when I try to put stdio.h inside angled brackets so I'm writing that normally]

Now when we need 2 compile this test.c file we need 2 provide '
-lgraph' flag

$gcc test.c -o test.out -
lgraph

Walla! I saw a black window with a rectangle in the middle.

Tuesday, January 16, 2007

Moved my Sid to a new HDD

I had been using Sid on a 40 Gb HDD which was running out of life. A couple of bad sectors in the root partition made me buy a new 80 Gb HDD.

Here is how I moved my whole system to new HDD:

First i booted with ubuntu live cd. Partitioned the new hard drive with some ext3 filesystem. Then mounted them:

#mount -t ext3 /dev/hda5 /mnt/new_debian
#mount -t ext3 /dev/hdc6 /mnt/old_debian

#cp -av /mnt/old_debian/. /mnt/new_debian/.

Then mounted proc
#mount -t proc /proc /mnt/new_debian/proc

#chroot /mnt/new_debian /bin/bash
#cd /dev
#/sbin/MAKEDEV generic

Now editted fstab and mtab to reflect my new hdd setting (i.e. my new root and swap partitions):

#vim /etc/fstab
#vim /etc/mtab

Then ran grub

#grub
> root (hd0,4)
> setup (hd0)
> quit

#grub-install /dev/hda

My new system is working as good as my old one now.

Thursday, January 11, 2007

Write access on NTFS volume in Linux

Getting write access on a NTFS volume is a bit hairy in Linux. But that has been made easy by ntfs-3g driver.

"The NTFS-3G driver is an open source, freely available NTFS driver for Linux with read and write support. It provides safe and fast handling of the Windows XP, Windows Server 2003, Windows 2000 and Windows Vista file systems. Most POSIX file system operations are supported, with the exception of full file ownership and access right support."

I installed it in my debian sid in this way:

#apt-get install ntfs-3g

Then editted /etc/fstab like this:

/dev/hda1 /mnt/win_c ntfs-3g rw,user 0 0

then executed this in root shell to grant my access 2 that drive as normal user.

#adduser fuse

You can find more info on this on http://www.ntfs-3g.org/

Thanks to Mr. Jamil Ahmed to pointing me to this amazing stuff.

Wednesday, January 10, 2007

Run wvdial as normal user

Here is a way I found out to run wvdial as a normal user:

#adduser <you> dip
#adduser <you> dialout
#chmod 660 /etc/wvdial.conf

Now you can run wvdial as normal user. No need 2 be root.

Tuesday, January 09, 2007

PWD webpage

I, along with my friend salahuddin and lavluda developed a web portal for for the Public Works Department of Bangladesh. We developed the basic structure of the web portal by using Joomla CMS and then customized it to our needs.

The address of the portal is http://www.pwd.gov.bd/

Back to Blogging

After a failed attempt last year to get back to blogging, I'm trying it again this year. I really wanted to get back, but got busy will...