Thursday, April 8, 2010

Moving to new Site and Blog

Hey guys

I've moved to a new website and a new blog. You will find all of the posts of this blog in that site and the blog. Please check those out for any new posts.

Site: http://hafizimtiaz.freehostia.com/
Blog: http://hafizimtiaz.wordpress.com/

Sorry for the inconvenience.

Friday, June 20, 2008

Home Networking : File Transferring

Many of us have two or more computers at our home and like to share files between these PCs. If you don't have a huge PenDrive or portable HDD or a DVD writer, then you might have problem to transfer large files from one PC to another. You can easily create a Local Area Network (LAN) among the computers for sharing files among the PCs.

This article shows how to connect two PCs using a cross-over LAN cable for file sharing purposes.

Here are the descriptions of the PCs

PC1: Ubuntu 8.04 with a Tenda 10/100Mbps LAN card
PC2: Windows XP Profesional with Built-in 10/100Mbps LAN card


Procedures:
  • Install these packages either from synaptic or command line
  1. samba
  2. smbfs
  • Click the System > Administration > Network
  • "Unlock" using administrator password


  • Click "Wired Connection" and then select "Properties"
  • Select "Static IP Address" and give an IP address upto your wish
  • Then click on "Subnet Mask" field. It will automatically set a value
  • Click OK
  • Click Close




  • Now in the Windows PC, select Start > Settings > Network Connections
  • Select TCP/IP settings properties
  • Give a manual IP address which differs only in the last number of the previous given IP address to the Ubuntu PC
  • Now, connect the LAN RJ-45 connectors on both the machines
  • You should note on the windows PC that 100Mbps network cable is connected
  • Now, Go to My Network Places
  • Click "Set up a home or small office network"
  • Give a computer name to identify it from other PCs
  • Give a workgroup name and REMEMBER IT
  • Restart your Windows PC, if necessary
  • In your Ubuntu PC, search for 'smb.conf' file on your file-system
  • As root, open each of them and set the 'workgroup' entity as the workgroup name that you have given on the Windows PC
  • Save the file
  • You are done now. try to 'ping' one PC from another. It should work
  • To browse the files of Windows PC from Ubuntu PC, press ALT + F2
  • Then type 'smb://windows.pc.ip.address/' and hit ENTER. This will bring the shared folders of the Windows pc to your Ubuntu desktop
  • To see the shared folders of Ubuntu PC from Windows PC, go to My Network Places. Then click 'View Workgroup Computers'. It should show the Ubuntu PC name. Double click to open it. Now here are the shared directories of the Ubuntu PC right on your Windows PC desktop!!

Saturday, May 31, 2008

Changing the default 'generic' kernel to 'server' kernel

If you install Ubuntu from the live cd or alternate install cd, the 'generic' kernel would be installed by default. The 'generic' kernel focuses on i586 and i686 CPU architectures. But if you have a newer CPU, like Pentium 4 HT, Dual Core or Core2Duo, you might want to install the 'server' kernel to improve your PC performance. The 'server' kernel focuses on i686 architectures and posses some unique advantages over 'generic' kernel in case of task management.

Note that you should not change the default kernel if you don't have a CPU that belong in the families stated above. And also be aware of the fact that kernel changing might cause big problems in your computer [such as making the system unstable!].

Here is the complete walkthrough of changing your kernel:

1. Disable any proprietory video card driver that you are using. You must do this, otherwise your computer could not start X after enabling the new kernel.

2. Open Synaptic package manager and select the following packages for installation
  • linux-server
  • linux-headers-2.6.24-17-server
  • linux-headers-server
  • linux-image-2.6.24-17-server
  • linux-image-server
  • linux-restricted-modules-2.6.24-17-server
  • linux-restricted-modules-server
  • linux-ubuntu-modules-2.6.24-17-server
3. Now install these packages by clicking 'Apply'

4. Restart your computer upon completation of download and installation

5. From System > Administration > Hardware Driver menu, enable the proprietory video card driver that you have disabled previously. You might have to restart your PC again.

6. Its all done. You can check your kernel version by typing 'uname -r' in the terminal.

You might want to uninstall the old generic kernel packages to free up your hard drive space. In that case, open Synaptic package manager and mark these packages for complete removal:

  • linux-generic
  • linux-headers-2.6.24-17-generic
  • linux-headers-generic
  • linux-image-2.6.24-17-generic
  • linux-image-generic
  • linux-restricted-modules-2.6.24-17-generic
  • linux-restricted-modules-generic
  • linux-ubuntu-modules-2.6.24-17-generic
After uninstalling these packages, restart your computer. Now you won't see option for 'generic' kernel boot in the GRUB.

Wednesday, May 28, 2008

Installing LaTeX on Ubuntu 8.04

LaTeX is a very handy and commonly used for editing professional style documents. It is mainly used for writing scientific papers, reports, articles and any official documents.

In Windows, usually we use WinEdt as front end LaTeX editor and Texlive or Miktex as compiler. Texlive is available through Ubuntu repository. But Miktex is not so easily installable in Ubuntu. You have to compile it from scratch after downloading the source from SourceForge.net.

The replacement for WinEdt in Ubuntu might be Kile or Texmaker. Kile is a KDE native applicaton, though you can install it on Ubuntu using Synaptic. But you have to install some KDE libraries which you might not like!

So, I think Texmaker is the best choice. Though it is available through Synaptic, it does not install Texlive as its dependencies [ I was very surprised to learn that ].

Anyway, there are solutions to this problem :-)

Just select these packages manually after selecting Texmaker on Synaptic and confirming additional packages :

tex-common
texlive-base
texlive-base-bin
texlive-common
texlive-doc-base
texlive-latex-base

After Synaptic downloads and installs the packages, you can edit and compile LaTeX documents.

There is another problem involving Texmaker. It configures 'xpdf' as its default PDF viewer. As Ubuntu 8.04 does not have 'xpdf', you have to set 'evince' as the default PDF viewer. To do so :

1. Go to the OPTIONS menu in Texmaker
2. Select CONFIGURE TEXMAKER
3. On the COMMANDS tab, find 'Pdf viewer' text field
4. Replace 'xpdf' with 'evince' keeping other texts on this field intact.

Now, you are done. You can view PDF by selecting VIEW PDF from TOOLS menu after compiling the document usinf PDFLatex.

Saturday, May 17, 2008

Connecting to the Internet with Sony Ericsson K550i

When I first installed linux, my nightmare was to connect to the internet. I had an internal modem, but as it was very old, my linux distros [Fedora Core 4, Ubuntu 6.06 LTS] didn't have driver for it. I googles for my modem's driver and found one. But I couldn't make it work.

Anyway, now I have a Sony Ericsson K550i phone which I use as an EDGE modem. Sony Ericsson does not provide any driver or PC suit software for linux. The phone driver is not required because linux detects it easily. The trick is to get connected to the internet using it.

Write the following code in an empty file and save with name "wvdial.conf"

[Modem0]
Modem = /dev/ttyACM0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM0
FlowControl = CRTSCTS
[Dialer gpinternet]
Username = {your username}
Password = {your password}
Phone = *99#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","{your APN}"
Inherits = Modem0


Save the file in any location [ I am assuming that it is in /home/{yourname}/Desktop/ ]


Now, open a terminal window and be root.

$sudo -i
{type your password here}

$cp /home/{yourname}/Desktop/wvdial.conf /etc/

Done!!

Now create a launcher in the desktop with command:

wvdial {your APN}

Your computer should be connected to the internet through your SonyEricsson K550i phone now.

This technique should also work for similar SonyEricsson phones as K750i, K790i, K800i, W810i etc.

Thanks to Jubair and Ayub vai for helping me writing this tutorial.

Monday, May 12, 2008

Instaling MATLAB R2007a on Ubuntu 8.04

One of the most prominent reason's for which I had to stay in Windows was MATLAB. As an engineering student, I need MATLAB very often. But I didn't find MATLAB CD/DVD for linux in the computer markets of Dhaka. I have installed VMWare Server on my Ubuntu and installed Win XP inside the virtual machine and thereby tried to use MATLAB in linux. But the performance was too poor to be useful. At last I got MATLAB R2007a Unix DVD and thought "wow, now i don't have to stay in windows!!". I am giving here the complete procedure of installing MATLAB R2007a Unix on Ubuntu 8.04.

  • You must have SUN JAVA installed to use MATLAB on GUI. So please install sun-java in your Ubuntu first. You can do it easily through Synaptic. Just search for "sun-java" and from the search results install the latest version.
  • I am assuming that you have Java installed and you have the ISO image of MATLAB R2007a Unix DVD. If the ISO image is in location /home/{yourname}/ directory and you want to install MATLAB in /usr/local/matlab74 directory then:
Be root
$sudo -i
Password:

Make mount directory for the ISO image and mount
$mkdir /media/iso
$modprobe loop
$mount /home/{yourname}/matlab.iso /media/iso/ -t iso9660 -o loop

Create installation directory
$mkdir /usr/local/matlab74
$ cd /usr/local/matlab74

Copy the license file into installation directory
$cp /home/{yourname}/license.dat ./

Start installing matlab
$sh /media/iso/install

Configure the necessary aspects during the GUI installation guide. Usually default values are OK
After installation, run the post installation script

$sh install_matlab

Again the default values offered are OK. Continue with pressing 'y'
Here it is. The installation is complete. You can now run MATLAB without any trouble !! Just type in terminal [you don't need to be root anymore..]

$cd /usr/local/matlab74/bin
$sh matlab

You can create a desktop shortcut for easy starting matlab. Create a launcher with command

matlab -desktop

  • If you have problem with matlab menubar, like the menubar disappears when you enable Compiz Fusion, do the following
$sudo -i
Password:

$gedit /usr/local/matlab74/bin/matlab

Add this line just after "#!/bin/sh"

export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre/

Now you should find the menubar even with Compiz Fusion enabled... :-)

Sunday, May 11, 2008

Switching From Windows To Linux

I have been using computers since I was 14 years old. In my elementary school, I used IBM computers with 80386 and 80486 computers with DOS and Windows 3.1 operating systems. Since then I became very much attracted to computers. I had a computer of my own when I was 15. It was a clone PC with Intel Pentium MMX 200MHz processor and 32MB of SIMM RAM. It had a hard disk of capacity 3.2GB and a VGA card with memory only 2MB.

I used to run Windows 98 in that machine. Once I installed RedHat Linux 7 on that machine with KDE desktop. But I quickly switched back to Windows due to unavailability of games in Linux!

Anyway, I have recently switched to Ubuntu 8.04 permanently. I hope I can stay in this OS for long time because I think I have everything that I need in Ubuntu.