Interactive script to mount iso images

0 comments

My laptop's DVD drive is bad, so I prefer copying images of CD/DVDs through a friends computer DVD drive and pasting it in my cd_image folder (a special folder I created for just iso images).
The command I use for copying CD/DVD images is
dd if=/dev/sr0 of=/home/freeman/cd_image/cdname.iso
This command is pretty straight forward,  the dd stands for disk dump, if stands for input file and of stands for output file. I do not have problem with remembering the command. But I often have problem remembering the exact mount options for iso file (which is the cd image file).
So I decided to write a shell script for interactively mounting any iso image in any mount point point (which is often an empty folder).
The following is a step-wise description of the shell creation

STEP 1
I created a special folder in my home folder and named it shell, using the following command
[freeman@freeman ~]$ mkdir shell
I changed directory to the shell subdirectory I just created
[freeman@freeman ~]$ cd shell

STEP 2
I created a new file (named it mountiso) and entered the script in in using vi editor
[freeman@freeman shell]$ vi mountiso
#!/bin/bash
#This shell is for mounting cd images from anywhere to any empty folder
echo -n "Enter the full path of the iso image: "
read image
echo -n "Enter the full path of the mount point, an empty folder: "
read folder
mount -t iso9660 -o loop $image $folder
exit 0

STEP 3
I made the mountiso file executable by changing it's file permissions
[freeman@freeman shell]$ chmod a+x mountiso
I also included the /home/freeman/shell path in the PATH environment variable
[freeman@freeman shell]$ PATH=$PATH:/home/freeman/shell
To make is global, I exported the new PATH
[freeman@freeman shell]$ export PATH

So that was all, to run the new script I just enter mountiso (regardless of my current working directory) and enter both the image location and mount point without bothering about the mount options.

How to use ZTE MF627 USB modem on linux

0 comments

I just bought a ZTE MF627 USB modem (it supports GPRS/EDGE/3G/HSDPA) to serve as my internet highway, the stuff works great with little configuration on Windows. Actually it came with MTN Nigeria internet settings but I could use it with other networks via Windows Dial-up.
The major problem was that in my Ubuntu and Fedora linux, I just could not use it. When I enter dmesg at the Commandline terminal, it detects it as a CD drive.
So after seeking lots of help online I finally got a way to go round the issue.
In my windows XP, the device manager alloted COM19 to the modem. I went straight to hyperterminal and connected to COM19 using the usual "8-N-1 None" settings, you can put the baudrate at any value. In the terminal I simply entered
AT+ZOPRT=5
AT+ZCDRUN=8
This will change the default mode of the modem from the CD drive to the modem mode. But you will not be able to install the software that came preloaded into the device, so if you want to use it on a new windows system, you might have to run AT+ZCDRUN=9 to enable you install the MTN or any other proprietary software that came with the modem.
After that your Linux system will now identify the modem and make it available as /dev/ttyUSB2 or /dev/ttyUSB3 ( I think /dev/ttyUSB2 if you do not have 3G or HSDPA and /dev/ttyUSB3 if you have the service on the network). You can now use your preferred Point-to-Point Protocol connection tool.
If you are using Fedora 11 or 12, you can go to System, Preference and Network connection for very easy configuration of the modem.



Just click on Mobile Broadband and Add.

 Enter the internet settings as given you by the network provider, in the PPP setting untick all the compression methods, and the allowed authentication method should be PAP alone (except if your provider specifies any additional one).
With this done, you are ready to go, just click on the network icon on the task bar and choose the network you just configured.
For Ubuntu, mandriva and other distros including fedora, you can use any PPP tool -- gnome-ppp, kppp and wvdial. Just specify the right device address.

How to use dial up point-to-point protocol to connect to the internet via a GPRS mobile phone

0 comments

I am sorry the title looks clumsily long, but that is to show that I am going to very much explain how you can access the internet using dial up on a Linux OS through an application called KPPP.
I assume that you already have the application installed, if you don't have you can view my previous post on installing software in linux.
STEP 1
Launch the kppp software, a user inteface like the one below will come up

Don't mind the entries in the login ID and password, in this tutorial I will create a new account.
STEP 2
Click on the configuration button below, a pop up dialogue box will come up as show below.

Click on the new button at the middle right side, a popup box like the one shown below.

Click on Manual Setup, another popup will replace this current one, as shown below

Enter the name you want to give this connection. Click on Add button, put *#99# as the phone number. Leave the other settings at the default.
Click on Modems right beside Accounts on the top menu bar, click on new .

In the new dialogue box shown below, enter the access point name as the modem name, enter the port of the phone connection and leave the other settings as they are.

STEP 3
If you want to use a bluetooth connection, plug the bluetooth dongle to the computer, go to the Konsole commandline tool and enter the folloswing commands
$ sudo su
# hcitool scan
(copy the device hardware address of the phone)
#rfcomm connect 2 00.00.00.11.AA.FF (replace with the copied address)
Make sure you speciy /dev/rfcomm2 in the Modem device setting, actually you can use rfcomm1 or rfcomm3 just by replacing the 2 in “rfcomm connect 2” with the appropraite number.

Now go back to the kppp, after saving the settings by selecting ok, in the main kppp dialogue box enter the login ID or username and password. If you conncetion doesn't need one just put “wap” for both as kppp will not connect without them since you will be connecting using PAP (Don't worry about understanding, just do it and you'll be alright).



Click on connect and you will be prompted to enter bluetooth passkey, then the connection will be made.

 
Follow me on Twitter | About me | Terms of Service | Privacy Policy