Wednesday, October 24, 2007

Triple Boot in MacBook (Debian AMD64) using rEFIt

I have got success to create triple boot in mac book using rEFIt

salahuddin-pashas-computer:~ salahuddin$ diskutil list
#: type name size identifier
0: GUID_ partition_scheme *111.8 GB disk0
1: EFI 200.0 MB disk0s1
2: Apple_HFS Macintosh HD 111.2 GB disk0s2

Resize the volume

diskutil resizeVolume /dev/disk$OSX OSXpartsize 2ndPartType 2ndPartLabel 2ndPartSize 3rdPartType 3rdPartLabel 3rdPartSize

Here I am giving

diskutil resizeVolume /dev/disk0s2 71.1G Linux Linux 25G "MS-DOS FAT32" Windows 15G

(If you face problem while resizing the partitions, install/reinstall a fresh copy of Mac OS)

Install rEFIt in Mac OS (Mac disk image)

reboot your mac book and ensure that rEFIt is loading at boot time.

Boot Windows XP SP2 32bit, you will find the CD appear in the boot menu of rEFIt or use 'C' to boot. Now install it sda4
(warning: just format the sda4 in (fat32 or ntfs) while installing windows, but do not repartition/change anything!!!)

reboot and you will find 2 option for booting the Mac OS and Windows.
(warning: do not update the partition record in the rEFIt now, the Linux partition may update as fat32)

Installing Debian:

Get the AMD64 version of Debian (you can also use generic 32 bit)

Install Debian normally without the grub or lilo

(when it will try to install grub or lilo use go back, and from main menu select finish installation from Debian installation CD.)

From rEFIt menu update the partition record. Important!!!

Now boot with Debian installation CD up to the partitioning.
(otherwise you will face problem while installing lilo)
(*** you can see the easy way below after update the partition table)

go to console mode
mkdir /tmp/debian
mount /dev/sda3 /tmp/debian
chroot /tmp/debian
mount /proc
apt-get install lilo
nano /etc/lilo.conf

sample lilo config


image=/vmlinuz initrd=/initrd.img

Install lilo in sda3
lilo -b /dev/sda3


(***another easy way is install debian from begining again, now install lilo in /dev/sda3)(do not install grub) done...

After reboot you will find 3 OS boot option in rEFIt menu.

Important configuration!!!

Install CPU frequency, otherwise you mac book can be too hot in a short time.

Configure the Color Profile (install xcalib using apt)

F1, F2, F3... Key configuration
apt-get install pommed



Saturday, October 06, 2007

Bought a MacBook

Today I bought

Intel Core 2 Duo 2.16 GHZ (white)
2 GB Ram

With Mr. Jamil and Mofidul Islam

Thursday, September 27, 2007

Check date in Java Script

here is my date check javascript.

function leapyearcheck(year)

if(year.value % 4 != 0)
return 0;

if(year.value % 100 != 0)
return 1; //leap year


if(year.value % 400 != 0)
return 0

return 1; //leap year



function datecheck(day,month,year) //call this function

//alert("Not Leap Year");

if(month.value == 2)
if(day.value > 28)
alert("Check the Day and Month");
return false;




//alert("Leap Year");
if(month.value == 2)
if(day.value > 29)
alert("Check the Day and Month");
return false;


Thanks to HasinHyder for a tricky one..

var dt = new Date(year+"/02/29");
if (dt.getMonth()=="1")
alert (year + " is a leap year");
alert(year + " is not a leap year")

mdb file in

To work with mdb file, open the select connect to an existing database, select Microsoft Access.

browse the mdb file and you need to save a odb file that will enable you to view the tables,query etc on it.

To copy the content of a table in Calc
go to View--> Data Sources

right click in the left pannel of in the database view option, click on the "Registered databases", click "New" and locate your created odb file.

Click on the database you want to copy. Select the Queries/Tables and copy the content by righ click on the query/table name.

Paste in the Now you can save in ods, and also save as in different formats.

Sunday, September 02, 2007

Thursday, August 30, 2007

Starting for IIUC OSS Camp-5

Me (salahuddin66) , Mahay Alam Khan and Belayet Hossain starting for IIUC OSS Camp-5 Chittagong.

Open Source Camp - 5
31th - 1th August 2007
Chittagong, Bangladesh

Tuesday, July 17, 2007

Today I got success to configure phpbb with wordpress.It will enable the phpbb registered user to login the wordpress blog (after get approve from admin) with same id and password.I tried with phpBB-2.0.22 and wordpress-2.2.1Simply after install both in a same database.create a connections.php in the includes directory of the phpbbconnections.php

<?php$con = mysql_connect("localhost","your_username","your_password");
if (!$con){die('Could not connect: ' . mysql_error());}mysql_select_db("your_database", $con);?>
edit includes/usercp_register.php of the phpbbaround 630 lines you will find some line like this
/ Get current date//$sql = "INSERT INTO " . USERS_TABLE . " (user_id, ...);
Bellow this line add
// added by salahuddin66include_once("connections.php");
$query = "INSERT INTO wp_users (user_login, user_nicename, display_name, user_pass, user_email, user_registered) VALUES ('" . str_replace("'", "''", $username) . "', '" . str_replace("'", "''", $username) . "', '". str_replace("'", "''", $username) . "', '" . str_replace("'", "''", $new_password) . "', '" . str_replace("'", "''", $email)."', NOW() )";
if (!mysql_query($query,$con)){die('Error: ' . mysql_error());}
// finish added by salahuddin66
done..Now the users will register for the phpbb forum will also register for the wordpress blog automatically.To enable his wordpress account, wordpress admin need to give him approve/some role.

Sunday, June 10, 2007

My first GTK app

bDict is my first GTK app. It is written in C using glade3,Glib and based on the "Anubadok: The Bangla Machine Translator"

I just create the GTK GUI for bdict

AIUB 4th OSS Camp on 8th and 9th June 2007

Group Photo

Friday, June 01, 2007

Backup Evolution mails

Yesterday I backup my Evloution mails from my office hdd to home hdd.

Shutdown evolution and gconftool-2:

$evolution --force-shutdown
$gconftool-2 --shutdown

You need to backup this directory.


Create a tar.gz
$tar -cvzf evolution-backup.tar.gz .evolution .gconf/apps/evolution .gnome2_private/Evolution

To restore, use:
$gconftool-2 --shutdown
$evolution --force-shutdown
$tar xzf evolution-backup.tar.gz
$gconftool-2 --unload evolution_setting.xml
$gconftool-2 --load evolution_setting.xml

Mysql C API undefined reference to `mysql_init'

Today I was trying to compile simple program written in C to connect mysql

/tmp/ccetdBsn.o: In function `main':
sqltest.c:(.text+0x35): undefined reference to `mysql_init'
sqltest.c:(.text+0x77): undefined reference to `mysql_real_connect'
sqltest.c:(.text+0x86): undefined reference to `mysql_error'
sqltest.c:(.text+0xbf): undefined reference to `mysql_query'
sqltest.c:(.text+0xce): undefined reference to `mysql_error'
sqltest.c:(.text+0xfc): undefined reference to `mysql_use_result'
sqltest.c:(.text+0x130): undefined reference to `mysql_fetch_row'
sqltest.c:(.text+0x144): undefined reference to `mysql_free_result'
sqltest.c:(.text+0x14f): undefined reference to `mysql_close'

I found some people also face this problem.

The problem solved after giving
gcc -o test  -L/usr/lib/mysql -lmysqlclient test.c


Friday, May 25, 2007

Ram in Bangla in Debian Etch

To type U+200D in ben_probhat use "shift + ="

to write this in Debian Etch use (ben_probhat)

r + shift + = + / + shift + z + a + m



xkb_symbols "ben_probhat" {
name[Group1]= "India - Bengali Probhat";

key <AE12> { [ equal, 0x100200D ] };

Special thanks and all credits goes to Sayamindu (who solve this problem in bn)

thanks to Omi Azad for sending me the in pidgin

Note: It also works in Ubuntu 7.04 (Feisty Fawn)


Sunday, May 20, 2007

Bangla/Bengali In Debian Etch

Install this package.

#apt-get install ttf-bengali-fonts ttf-indic-fonts

you may need to restart your Xserver to view bangla/bengali.


Click Add

Layout Option--->Group Shift/Lock behaviour (or use whatever you like)

Now I can switch to Bangla/English by pressing two ALt key together.
(Use any option here that you like)

Friday, May 18, 2007

Xen Installation in debian etch

Install Xen first

#apt-get update
#apt-get install xen-hypervisor-3.0.3-1-i386 xen-utils-3.0.3-1
#apt-get install linux-image-2.6.18-4-xen-686

give the version no according to you deb repository.

edit /etc/xen/xend-config.sxp
uncomment this two line
(network-script network-bridge)
(vif-script vif-bridge)

Install tools for xen
#apt-get install bridge-utils iproute sysfsutils libc6-xen xen-tools

Create a directory
#mkdir /home/xen

edit /etc/xen-tools/xen-tools.conf

here is my sample config file
(Here I am showing only uncomment part)
dir = /home/xen
debootstrap = 1
# Disk and Sizing options.
size = 1Gb # Disk image size.
memory = 128Mb # Memory size
swap = 128Mb # Swap size
# noswap = 1 # Don't use swap at all for the new system.
fs = ext3 # use the EXT3 filesystem for the disk image.
dist = etch # Default distribution to install.
image = full # Specify sparse vs. full disk images.

# Networking setup values.

# Uncomment and adjust these network settings if you wish to give your
# new instances static IP addresses.
gateway =
netmask =
# Uncomment this if you wish the images to use DHCP
# dhcp = 1

# Uncomment the following line if you wish to interactively setup
# a new root password for images.
passwd = 1

# Default kernel and ramdisk to use for the virtual servers
kernel = /boot/vmlinuz-2.6.18-4-xen-686
initrd = /boot/initrd.img-2.6.18-4-xen-686

# The default mirror for debootstrap which can be used to install
# Debian Sid, Sarge, and Etch.
mirror =

To create an image (here I am showing with debootstraping)
#xen-create-image --hostname=test --ip= --passwd
it will ask for the root passwd after finish the debootstrap.

edit /etc/xen/test.cfg

check the kernel version is correct for your system
kernel = '/boot/vmlinuz-2.6.18-4-xen-686'
ramdisk = '/boot/initrd.img-2.6.18-4-xen-686'

xen-tools generate the disk sda for me. Later I change it to hda
root = '/dev/hda1 ro'
disk = [ 'file:/home/xen/domains/test/disk.img,hda1,w', 'file:/home/xen/domains/test/swap.img,hda2,w' ]

check you ip
if = [ 'ip=' ]

To start the vm
#xm create test.cfg -c

it will start to boot (simple output)
checking file systems...fsck 1.40-WIP (14-Nov-2006)
Setting kernel variables...done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Setting up networking....
Configuring network interfaces...done.
INIT: Entering runlevel: 2
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
* Not starting internet superserver: no services enabled.
Starting OpenBSD Secure Shell server: sshdNET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
Starting periodic command scheduler: crond.

Debian GNU/Linux 4.0 test tty1

test login:

or use
file-->open Domain File
and select the /etc/xen/test.cfg

Here is the nmap output for ip
Interesting ports on test (
Not shown: 1696 closed ports
22/tcp open ssh
MAC Address: 00:16:3E:1F:8F:58 (Xensource)
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux (X86)
Uptime: 198.839 days (since Tue Oct 31 15:09:34 2006)
Network Distance: 1 hop

Now I can ssh to my
#debian:/home/salahuddin# ssh root@
root@'s password:
Last login: Fri May 18 05:50:41 2007
Linux test 2.6.18-4-xen-686 #1 SMP Mon Mar 26 21:49:04 UTC 2007 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
test:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:15:BC:3F
inet addr: Bcast: Mask:
inet6 addr: fe80::216:3eff:fe15:bc3f/64 Scope:Link
RX packets:92 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15420 (15.0 KiB) TX bytes:5239 (5.1 KiB)

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


Broadcast message from root@test (ttyp0) (Fri May 18 06:16:58 2007):

The system is going down for system halt NOW!
test:~# Connection to closed by remote host.
Connection to closed.

Change your kernel path and disk config according to your system.
First time I tried with image = sparse in /etc/xen-tools/xen-tools.conf but it did not work for me.
Later I give image = full.

for more doc:

Thursday, May 17, 2007

Simple Bird in Inskscape

The Inkscape Logo.

Here is my simple bird I design it using Inkscape. See the image step by step.

At last.

Note: First get an original picture of the bird then see it carefully and start you design.

Simple 3d ball in Inkscape

The Inkscape Logo.

Here I am designing a simple 3d ball.

See the image step by step.

At the last I am trying to create a shadow.

I give some effect to the shadow, like the real world, then rotate our light direction in the ball so that it match or follow our real world.

Always think about the real world rules that the materials and light follow.

This is just a simple design for the beginner...

Wednesday, May 16, 2007

Post Html code in Blog

to post html code in your blog or in a html page. Just convert the HTML code to Special characters. (so simple)


Tuesday, May 15, 2007

Bangla to Hex

Here is my Bangla to Hex converter using php and little ajax. Thanks to Mr. Jamil for giving me this idea.


<script type="text/javascript" src="ajax.js"> </script>
<div align="center"><h1>Bangla HEX</h1></div>
<div align="center"></div>
Input in UTF-8: <input type="text" name="input" onkeyup="show(this.value)">
<p>Hex: <span id="txtHint"></span></p>


var xmlHttp

function show(str0)
if (xmlHttp==null)
alert ("Browser does not support HTTP Request")
var url="show.php"

function stateChanged()
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

function GetXmlHttpObject()
var xmlHttp=null;
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
catch (e)
//Internet Explorer
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
catch (e)
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttp;




function unibin2hex($u) {
$k = mb_convert_encoding($u, 'UCS-2LE', 'UTF-8');

$position = 0;

$run = strlen($u)/3;

for($i=0; $i<$run; $i++) //bengali char strlen return 3 for one char so div by 3 . Here run the loop for i

$k1 = bin2hex(substr($k, $position, 1)); //convert unicode part by part using bin2hex using substr
$k2 = bin2hex(substr($k, $position+1, 1));

$out = $k2.$k1; //combine two sub scring that we use to convert.

echo " ". $out; // out

$position = $position +2; //here we are converting part by part by so we need to increase 2 in every step


HDD Partitioning in Linux

Technically, a hard disk should contain either as many as four primary partitions, or one to three primaries along with a single extended partition. Each of these partitions are described by a 16-byte entry in the Partition Table which is located in the Master Boot Record.


Many poeple confused with Linux partitioning system when they are installing Linux for the first time. In linux they see hda1 then hda5 but they are familiar with C:, D: etc

your HDD can be recognize by hda, hdb,hdc,hdd, sda, sdb etc depending on the master, slave and cable position. Here i am describing with hda

A HDD with 4 Primary Partitions

here hda4 is the full extended partion so extended partition start from hda5

generally a windows / most of the PC has this type of partition system.

here hda2 is the full extended partion and hda3 and hda4 are reserved as we can create 2 more primary partitions so extended partition start from hda5

Extended partition generally start from hda5

so if anyone want to install linux in his G: drive then he need to delete the hda8 then create 2 partitions

one swap space (it can be compare with windows virtual memory) ram * 2 (size recomanded) and another root / partition.

Note: I would suggest to create swap first then root / partition and at the last of the HDD sector more then or at least 8 MB free unallocated space. When user need to reinstall windows sometimes it creates problem, if there is no free unallocated space.

Sunday, May 13, 2007

Back from JU Open Source Camp - 3

Just back from Jahangirnagar University

Group Photo

Organizer with Guest

Thursday, May 10, 2007

Going to JU Open Source Camp - 3

Me (salahuddin66), Jamil Ahmed, Suzan, Zaher is starting for Jahangirnagar University to attend the

Open Source Camp - 3
Sponsored by Prime Bank
11th - 12th May 2007
Savar, Bangladesh

Monday, May 07, 2007

Recover GRUB after reinstall windows

Boot using a Live CD or Installation CD.

mount your linux partition. Chroot, mount /proc and give the grub specific command to overwrite or update the mbr or where you want.

like my Linux root in /dev/hda6

after boot with the Live CD

#mkdir /mnt/lin (create a folder to use as a mount point)
#mount /dev/hda6 /mnt/lin
#chroot /mnt/lin
# mount /proc
#grub-install /dev/hda

the update-grub and grub-install command will work of Debian, Ubuntu and Debian based distro. If your are using other distribution. Read their grub policy and command. Here chroot will enable you to access the existing Linux system using the live CD kernel.

note: If you use normal Installation CD to recover grub then you might need to give the path known by the kernel. Like then you may need to use ../disc0/part4/ etc instead of /dev/hda6. You can find the exact path by execution a script called os-prober that generally comes with the installation CD of Debian.

Monday, April 30, 2007

./config.guess: No such file or directory

today i was trying to compile gaim, I installed autoconf, automake and other necessary libs to compile but it show me

salahuddin@debian:~/Desktop/compile/gaim-1.5.0$ ./configure
checking build system type... /bin/sh: ./config.guess: No such file or directory
configure: error: cannot guess build type; you must specify one

later I found it is a err of automake in my Debian testing
debian:/home/salahuddin/Desktop/compile/gaim-1.5.0# automake --add-missing version mismatch. This is Automake 1.10, but the definition used by this AM_INIT_AUTOMAKE comes from Automake 1.9.5. You should recreate aclocal.m4 with aclocal and run automake again. required file `./config.rpath' not found installing `./config.guess'
src/protocols/gg/ compiling `libgg.c' with per-target flags requires `AM_PROG_CC_C_O' in `' required file `./README' not found installing `./COPYING' required file `plugins/' not found required file `plugins/docklet/' not found required file `plugins/gevolution/' not found required file `plugins/gaim-remote/' not found required file `plugins/gestures/' not found required file `plugins/perl/' not found required file `plugins/perl/common/' not found required file `plugins/ssl/' not found required file `plugins/tcl/' not found required file `plugins/ticker/' not found required file `sounds/' not found required directory ./plugins does not exist required directory ./sounds does not exist
The problem solved & now while i give ./configure
salahuddin@debian:~/Desktop/compile/gaim-1.5.0$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes

Thursday, April 19, 2007

My debian package

My debian package

apollon MIGRATED to testing link

c-sig 3.8-11 MIGRATED to testing link

special thanks to my sponsor Matthew Grant

Monday, April 09, 2007

Install Debian GNU/Hurd

I have installed Debian GNU/Hurd in my PC for testing.

(i am installing in hda1)
#mke2fs -b 4096 -o hurd /dev/hda1
#mount -t ext2 /dev/hda1 /gnu
#cd /gnu
#tar --same-owner -xvjpf ~/gnu.tar.bz2

I add in my /boot/grub/menu.list

title Debian GNU/Hurd
kernel (hd0,0)/boot/gnumach.gz root=device:hd0s1 -s
module (hd0,0)/hurd/ext2fs.static --multiboot-command-line=${kernel-command-line} \
--host-priv-port=${host-port} --device-master-port=${device-port} \
--exec-server-task=${exec-task} -T typed ${root} $(task-create) \
module (hd0,0)/lib/ /hurd/exec $(exec-task=task-create)

Here Hurd has not yet been configured, it must be started in single user mode. Adding a `-s'.
Assuming that the first drive (i.e. `(hd0)') is the master on the primary controller.

boot into your Hurd system. give "login root"

>login root
# export TERM=mach

to setup packages and hurd
# ./native-install

reboot and edit /boot/grub/menu.list (just remove the -s option) the grub you are using at that time.
title Debian GNU/Hurd
kernel (hd0,0)/boot/gnumach.gz root=device:hd0s1
module (hd0,0)/hurd/ext2fs.static --multiboot-command-line=${kernel-command-line} \
--host-priv-port=${host-port} --device-master-port=${device-port} \
--exec-server-task=${exec-task} -T typed ${root} $(task-create) \
module (hd0,0)/lib/ /hurd/exec $(exec-task=task-create)
boot the hund again and give the ./native-install again to finish the setup.

GNU Hurd Link
Debian GNU/Hurd install Link
Hurd Live CD Link

Wednesday, March 28, 2007

Install Compiz in Debian Sid

#apt-get install compiz compiz-gnome compiz-gtk

for the config read more click here

Sunday, March 25, 2007

Back From SUST Open Source Camp-1

Back from SUST Open Source Camp-1

from right Anir bhai, Mak bhai, Munir bhai, Jamil Ahmed, Salahuddin66 (me) , Zaher walking