Archive for category Simple tricks

Configure Citycell Zoom ZTE CDMA USB Modem in Ubuntu & Fedora

Few months ago, I configured citycell zoom in my friend’s pc. That was Huawei modem and was much easy to configure. First tried to detect modem using wvdialconf in the terminal. Then just edited wvdial.conf file (/etc/wvdial.conf) with the detected path and after dialing wvdial cdma in the terminal it was successfully connected.

But recently in the eid vacation when i was in chittagong, i’ve bought citycell zoom with ZTE usb modem for using internet there. It was very much easy to setup and connect to internet in windows XP but failed to do so in ubuntu. First i tried to detect modem using wvdialconf. But It was showing a msg like failed to detect modem. then tried to grep tty using dmesg | grep tty but failed again, then tried to view modem using cat /proc/bus/usb/devices. But i haven’t found anything like devices in cat /proc/bus/usb/devices directory.

Anyway, Here is what you have to do to detect ZTE usb modem.

In ubuntu, you have to uncomment few lines to explore devices directory. So edit mountdevsubfs.sh file. ( ** No need to do this in fedora core, it will automatically detect devices in /proc/bus/usb/ directory)

sudo gedit /etc/init.d/mountdevsubfs.sh

and uncomment following lines from this file.

# Magic to make /proc/bus/usb work
mkdir -p /dev/bus/usb/.usbfs
domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb

Now start the service

/etc/init.d/mountdevsubfs.sh start and reboot your pc.

Then check if the USB device is detected properly
cat /proc/bus/usb/devices

Try to find some output like this

T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs=  1
P:  Vendor=19d2 ProdID=fffd Rev= 0.00
S:  Manufacturer=ZTE, Incorporated
S:  Product=ZTE CDMA Tech
C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128ms
E:  Ad=8a(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=0b(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E:  Ad=83(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Now probe for this USB device
modprobe usbserial vendor=0×19d2 product=0×fffd

You are done!!

Now run wvdialconf in the terminal Or you can edit /etc/wvdial.conf file and paste these following lines.

[Modem0]
Modem = /dev/ttyUSB0
Baud = 230400
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
[Dialer cdma]
Username = waps
Password = waps
Phone = #777
Stupid Mode = 1
Inherits = Modem0

Now you can connect to internet by applying the following command in terminal.

wvdial cdma

Using the same procedure, i’ve configured this modem in my office (fedora) also.

Thats it! Enjoy. :)

Note: For Ubuntu intrepid 8.10 and Ubuntu 9.04 jaunty jackalope, Please see my comments, i hope that will help you to connect to Internet

, , ,

25 Comments

Necessary commands (tips) to tune apache

To search in the current directory and all sub directories for a file named httpd.conf
find . -name “httpd.conf” -print

To find some string or text, type
find . -exec grep “MaxClients” ‘{}’ \; -print
This command will search in the current directory and all sub directories. All files that contain the string with the path.

If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.
find . -exec grep -q “www.athabasca” ‘{}’ \; -print

Send 1000 Request to apache using apache benchmark
ab -n 1000 -c 200 -k YOUR_URL

To view error log of httpd. type
grep -i maxclient /var/log/httpd/error_log*
To view Process status type and load average type top and uptime respectively.

To open a file and search something(Here Example is: MaxClients) from there type
vi +/MaxClients /etc/httpd/conf/httpd.conf

To view total memory used by httpd, type
ps -ylC httpd –sort:rss

, , ,

2 Comments

How to use windows application in linux.

There is several way to use windows application in linux. As i used to play games a lot in windows so after installing linux i was worried about all those stuff :(
Then after surfing internet, I’ve found several way to use windows application.

I was very much excited about the way of setting up virtual machine in linux and one can switch to any operating system using vmware server without rebooting. I’ve already installed it now I can boot windows from my linux (fedora and ubuntu) using vmware server and play my favorite games there. But one important thing is :) vmware works good for high configured pc. ( i mean at least 1 gb ram, around 8 gb space for vm, above 1.7 ghz processor bla bla )

OR
You can install wine in linux which creates windows environment to run windows application. But it doesn’t support all the application.

OR

Search www.osalt.com to find open source alternative solutions of your windows application.  You  may find several alternative software for linux operating system.

,

No Comments

how to set cron

Via the “crontab” command from the shell.

crontab -l will show you your currently set up cron jobs on the server.

crontab -r will delete your current cron jobs.

crontab -e will allow you to add or edit your current cron jobs by using your default text editor to edit your “crontab file”.

Note, vi has a bug in it and will not work to edit your crontab! We recommend nano (which is just like pico), which is the default editor anyway!

Your crontab includes all the cron jobs you’d like, with one cron entry per line. A cron entry looks like this:

45 2 * * *     /home/user/script.pl

# The first number is the minute of the hour for the command to run on.
# The second number is the hour of the day for the command to run on.
# The third number is the day of the month for the command to run on.
# The fourth number is the month of the year for the command to run on.
# The fifth number is the day of the week for the command to run on.

Here are some examples to help you learn the syntax for the numbers:
# 32 * * * * : will be run every hour on the 32nd minute.
# 12,42 * * * * : will be run twice an hour on the 12th and 42nd minutes.
# */15 */2 * * *: will be run at 0:00, 0:15, 0:30, 0:45, 2:00, 2:15, 2:30, …
# 43 18 * * 7: will be run at 6:43pm every Sunday.

, ,

No Comments

how to protect your directory with htaccess

create a .htaccess file in the directory that you want to protect and write following lines there.

AuthUserFile /manage_blog/.htpasswd
AuthGroupFile /dev/null
AuthName “Arman Imtiaz”
AuthType Basic

<Limit GET>
require valid-user
</Limit>


then in the commandpromt go to the directory that you want to protect and write the following command

htpasswd -c .htpasswd shabuz (shabuz is my username)

then set your password. that’s enough

,

1 Comment

How to grabe all checkbox value from html form and parse it in php

Suppose, we are creating a tool for admin user. where admin can view all the comments and then take necessary action (publish, delete, modify). So in a page it will show all the comments with a checkbox beside every comments. There may have pagination or not.. whatever, doesn’t matter.

So if admin check several checkbox and click on any action then in php file one can grab all the checkbox value by the follwoing way…

I’m considering that you have done all the html stuff :P, One important thing is, in html i’ve set checkbox name with check_coresponding_id_of_that_row. something like

<input id="check_$row-&gt;id" name="check_$row-&gt;id" type="checkbox" />

Now in php file paste these lines and debug. Hope you will get your desired result.

$test = $_POST;
foreach($test as $key=>$value)
{
//$pieces[] = explode(”check”, $key);
$key = strstr($key, ‘_’);
$key = substr($key, 1);
$msg_id[] = $key;
}$message_id = implode(”,”, $msg_id);$message_id = substr($message_id, 0, -1);
print_r($message_id);

There is several way to do it actually :) but hey, i’ve kept this portion for my personal use too ;).

Ke jane kon din lage.. lol :)

No Comments