My Thoughtful Quotes

May 29th, 2008

Sometimes I say something in Present Indefinite tense. It means its a universal truth type thing. These are my believes. Its something like my dialog that I like to use every situation. I am writing it here so that I wont forget it. I’ll add more and more when I get time or when I get new one.

You’ll get all my quotes here

EDGE/GPRS Modem Connection In Linux

April 5th, 2008

wvdialconf কমান্ড দিলে /etc/wvdial.conf ফাইল তৈরী হবে।
যদি wvdialconf আপনার মডেম ঠিক মতো ডিটেক্ট করতে পারে, মানে কোন ACM
ডিভাইস পাওয়া যায়, তবে /etc/wvdial.conf ফাইল খুলে এডিট করতে হবে।
আমি যেটা ইউজ করি সেটা হল এমন,

[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
# initial string for gp
Init3 = AT+CGDCONT=,,”gpinternet”
ISDN = 0
Modem Type = USB Modem
# phone numbe to dial
Phone = *99***1#
# No username/password authentication
Stupid Mode=1
# Stupid User
Username = b
# Stupid Pass
Password = a

প্রয়োজনীয় তথ্যগুলো কমেন্টের ভিতর লিখেছি। দেখলেই বুঝতে পারবেন আশাকরি।

কনফিগারেশন ফাইল তৈরী হয়ে গেলে ডায়াল করুন wvdial দিয়ে।
আমার ডায়ালিং লগ দেখুন।

# wvdial
–> WvDial: Internet dialer version 1.54.0
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Sending: AT+CGDCONT=,,”gpinternet”
AT+CGDCONT=,,”gpinternet”
OK
–> Modem initialized.
–> Sending: ATDT*99***1#
–> Waiting for carrier.
ATDT*99***1#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Thu Dec 6 05:26:16 2007
–> pid of pppd: 29319
–> Using interface ppp0
–> local IP address 10.130.25.193
–> remote IP address 10.6.6.6
–> primary DNS address 202.56.4.120
–> secondary DNS address 202.56.4.121

এরপর কারসর ব্লিন্ক করতে থাকবে, মানে আপনি টারমিনালে ফিরে আসবেন না।
ঝামেলা এড়াতে চাইলে,

# wvdial 1> /dev/null 2> /dev/null &

Url scheme of popular IMs

April 3rd, 2008

Did you know almost every popular IM services provide a url scheme so that you can launch IM window just by clicking on a webpage??

Ok. Lets make it clear. Suppose you have an yahoo id ami_shiplu@yahoo.com. Now you want when people visiting your web pages they will come across a link, like Contact Me. When vistior clicks on the link this YIM window directly opens a conversation window between the vistor and you. Just a one click solution of sending IM. You can put this url in your web, blog, email signature etc.

How it works? Well, almost every popular IM services support an Url scheme. For example, Yahoo uses ymsgr:, GoogleTalk uses gtalk: etc. If you can buld a url with the correct parameter, It will call the native IM client installed in your computer.

Ok, Enough lecture. I am showing you the IMs and their url schemes.

Yahoo

To you use yahoo IM link, write the following in you webpage,

<a href=”ymsgr:sendIM?YourYahooId”>IM with Me</a>

MSN

To you use MSN IM link, write the following in you webpage,

<a href=”msnim:chat?contact=yourMSNEmailAddress”>IM with Me</a>

AIM

To you use AOL IM link, write the following in you webpage,

<a href=”aim:goim?screenname=YourAOLID”>IM with Me</a>

Google Talk

To you use yahoo IM link, write the following in you webpage,

<a href=”gtalk:chat?jid=YourGmailID@gmail.com“>IM with Me</a>

You can start a call too with it.

<a href=”gtalk:call?jid=YourGmailID@gmail.com“>Call Me</a>

SKYPE

To you use SKYPE IM link, write the following in you webpage,

<a href=”skype:YourSkypeId?chat”>IM with Me</a>

You can start a call too with it.

<a href=”callto:yourSkypeID“>Call Me on Skype</a>

<a href=”skype:yourSkypeID?call“>Call Me on Skype</a>

You can find more about skype links here on skype’s official web.

Domain redirection to localhost

March 20th, 2008

What is this: When you enter http://www.yahoo.com in your address bar of browser, It wont go to http://www.yahoo.com rather it will show a custom page which is inside you pc not in Internet.

Why is this: Sometimes you may need to restrict your children from accessing site that contains adult content, violent pictures etc. Also web service developer may use it to simulate and debug web service host.

Tools: You need actually nothing. Only skill of editing files. A text editor will do. In Windows machine you can use notepad.exe. For Linux machine you can use vi, ed, ee etc.

How: There is a special file called `hosts` which contain about domain and ip address mapping information. The format is plain text. In Windows the file in “%SystemRoot%\System32\Drivers\Etc” directory and in Linux its in “/etc” directory. Here is a sample file content for my Windows XP Service pack 2.


# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

Its almost same for Linux. This file is responsible to redirect any request to “localhost” domain to 127.0.0.1 IP. Yes, thats why you get ping response from 127.0.0.1 when you ping “localhost”.

Now open the file and add some alias to “localhost” entry. Like the following,

127.0.0.1 localhost badweb.com www.badweb2.net

When you are done saving the file. Ping “badweb.com”. You’ll get response from 127.0.0.1. Now whenever someone enters http://www.badweb2.net in any browser it will show the content of http://127.0.0.1/. If you don’t have any web server installed it will show a “page not found” page. And it serves our purpose as well. The surfer of badweb.com will always see the web is down. ;)

Disadvantage: The main problem is if you put “badweb.com” as alias it wont work for any sub domain of “badweb.com”. For example, If you put,

127.0.0.1 localhost badweb.com

Entering http://www.badweb.com/ wont redirect to http://127.0.0.1 also http://anysubdomain.badweb.com wont work too. To work around you have to put series of sub domains. Like this,

127.0.0.1 localhost badweb.com www.badweb.com anysubdomain.badweb.com

For this the entry will be too long. :( :(

Some addition: You can enhance it more by the following methods

  1. Installing a web server.
  2. Creating alias IP for your network device

Installing a web server will make you show a customized page. You can put a message there too. Like “Access denied”. So unauthorized user will see your message every time they visit their page. Also you can put per domain customized page with a little knowledge of Javascript or PHP or URL rewrite.

If you can create alias of your own IP pinging the domain will get response from different IP and all of the IP are alias. Its just same web but IPs are different. if you use 176.16.16.[1-254] as you alias you can put some entry in hosts file like the follwing


127.0.0.1 localhost
176.16.16.1 badweb.com
176.16.16.4 www.badweb.com
176.16.16.2 badweb.net
176.16.16.3 verybadweb.com

Now you’ll get response from different IPs. It’ll be hard for visitor to track the whole thing.

Thats all.

Keep bluffing. ;)



© 2008 by A K M Mokaddim


Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
Based on a work at talk.cmyweb.net.