Over come ""error 676: the phone line busy"
GOTO DSL ROUTER SITE (http://192.168.1.1).. PASSWORD N LOGIN ID IS
"ADMIN"
AND CLICK ON ADVANCE SETUP THEN CLICK ON WAN ...
HERE U WILL SEE SOME VALUES (((VPI/VCI 0/35 Con. ID Category Service
Interface Protocol Igmp QoS State ))) AND ON 1ST OPTION {VPI/VCI 0/35}
TICK THE REMOVE OPTION AND REMOVE IT......THEN CLICK ON ADD OPTION AND CLICK NEXT NEXT AND LAST SAVE IT
....U HAVE TO DO NOTHING;;; DONT CHANGE ANYTHING VALUES THAT WILL COME ..ALL ARE PRE SET AND SO AFTER SAVE
CLICK ON SAVE/REBOOT.......
UR DONE .......... .....
THIS IS SOLUTION FOR PHONE
Not able to connect to the router 192.168.1.1 says page cannot be displayed
go to your local area connection's properties
in tcp/ip connections keep it to :use the following ip address" then in
ip address = 192.168.1.2
subnet mask = 255.255.255.0 (automatically it will take or else you type it)
default gateway = 192.168.1.1
PPPoE & Bridge mode:
PPPoE
(1) PPPoE modem is an always connected mode.(userid and password stored in modem)
(2) For getting good speed with torrents ports are required to be forwarded.
(3) For connecting multiple PCs modem must be in PPPoE mode.
(4) Telenet scripts are required for scheduled automatic booting and re booting.
(5) More secured.
Bridge mode
(1) Connects to net through dialer by entering userid and password
(2) No need of port forwarding for torrents as all ports are open
(3) Telenet scripts are not required for scheduled downloads.
(4) Strong firewalls required as as all ports r open.
Reference:
change from bridge mode to pppoe mode: http://www.chennai.bsnl.co.in/BBS/Wireless/WirelessSecurity.htm#WA3002_Modem_configuration:
http://www.indiabroadband.net/bsnl-broadband/10489-phone-line-busy-error-ut300r2u-modem-here-100-solution.html
http://www.indiabroadband.net/bsnl-broadband/15507-not-able-connect-router-192-168-1-1-says-page-cannot-displayed.html
http://www.indiabroadband.net/bsnl-broadband/8088-pppoe-bridge-mode.html
http://en.kioskea.net/forum/affich-91194-bsnl-wifi-iti-dna-a211-1
Saturday, December 19, 2009
Wednesday, November 18, 2009
About GDB
GDB is a wonderful tool if you are using linux as your platform for software development.
I will list done some of the frequently used approaches here.
I will list done some of the frequently used approaches here.
watch point:
awatch *0x8092581000
rwatch *0x8092581000
it will start breaking whenever there is read/write at: 0xa87c0e255f7f0080
find /g 0x8080000000,0x8092581000, 0x8080459578
-- this is to search for value: 0x8080459578 between address 0x8080000000 && 0x8092581000
find 0x8080000000,0x8092581000, "tbl_sm_main"
-- this is to search a string.
find /g 0x8080000000,0x8092581000, 0x8080459578
-- this is to search for value: 0x8080459578 between address 0x8080000000 && 0x8092581000
find 0x8080000000,0x8092581000, "tbl_sm_main"
-- this is to search a string.
Printf usage
printf "Delete object: %d\n", i
Commands:
1. info frame
-- will list down the registry level info about the particular frame, it will be useful when you are debugging cores.
2. info args
-- will list the arguments passed to the function in particular frame.
3. disassemble
-- will give the assembly code for the function.
4. disassemble 0xf1704f0 0xf17050f
-- will give the assembly code between two addresses
5. info registers
-- will give the details of registers and stored values
6. info reg OR x $
-- will output the contents for regiser, ex1: info reg r32 ex2: x $r32
7. info source
8. info sources
9. set pagination on/off
10. x/32w 0x100f3000
-- To print 32 words from address 0x100f3000
11. x/s
-- To print contents of the address as string
12. x/nc -- To print content of the address as character, it will print "n" characters starting from the address.
13. x/t -- To print in binary
14. x/nx -- To print in hexa
15. core
-- To attached to the core file
16. generate-core-file
-- To generate a core at the particular instance on a running process.
17. set follow-fork-mode parent/child/ask
-- To set whether to follow parent or child or ask whom to follow.
18. show follow-fork-mode
-- To display the status of fork mode
19. set history expansion on -- To enable capturing history, you can "!" to rerun the olde commands as similar to Bash command. 20. set height
21. set width
-- To set width of the screen. if the lines in gdb are not wrapping after giving above command then run "shell reset" to make it work properly
22. set confirm off/on
-- Disables/Enables confirmation requests
23. show confirm
-- Displays the status of confirmation requests
24. show convenience
-- Print a list of convenience variables used so far, and their values. Abbreviated show conv.
Convenience variables are prefixed with `$'. Any name preceded by `$' can be used for a
convenience variable, unless it is one of the predefined machine-specific register names.
25. output/fmt expression
-- Print the value of expression and nothing but that value: no newlines, no `$nn = '.
The value is not entered in the value history either. You can use the same formats as for print.
26. set print pretty on/off
-- Cause GDB to print structures in an indented format with one member per line.
27. show print pretty
-- Show which format GDB is using to print structures.
28. info proc map
-- to list process memory mapping
29. maintenance info sections
-- to list core memory mapping
30. info files
-- list the memory mapping of all the files 31. info line <function name> -- display 32. add-symbol-file <library.so> .txt -- we can get.txt address of library from info files. -- this will help adding loading symbol files manually34. info wallclock -- this will give timing in the recording.35. set backtrace limit unlimited -- to set backtrace to unlimited36. print $_siginfo
-- this brings signal received on crash and offending address details are also listed37. UNDO: info snapshots-- this provide process-ids of snapshots through which we can rough memory utilization of the process at that particular snapshot
To allow the system to dump the core:
default configuration file for gdb is: .gdbinit
To print the size of the structure in GDB:
p sizeof(struct ) ---- make sure symbol for the structure is present.
Breakpoints:
#include
void assert(int expression);
If expression evaluates to 0 (false), then the expression, sourcecode filename, and line number are sent to the standard error, and then calls the abort function.
To enable core dumps for your current shell, use ulimit to set a maximal core dump size in megabytes.
For this example, we'll "limit" core dumps to 1 gigabyte:
$ulimit -c 1024
To use macros in the gdb use following option during compiling:
#define NDEBUG === > then the macro assert does nothing.
References:
http://sourceware.org/gdb/onlinedocs/gdb/Forks.html
http://arioch.unomaha.edu/~jclark/gdb_plus.html
http://discussknowhow.blogspot.com/2008/07/analyzing-core-dumps-and-assert.html
http://developer.apple.com/mac/library/documentation/DeveloperTools/gdb/gdb/gdb_10.html
http://www.haifux.org/lectures/222/GDB_haifux_David_Khosid.pdf -- Advanced debbuging with gdb
GNU Debugger - Advanced GDB Actions - GoldhiveWiki http://sunsite.ualberta.ca/Documentation/Gnu/gdb-4.18/html_chapter/gdb_15.html http://web.mit.edu/gnu/doc/html/gdb_10.html https://eli.thegreenplace.net/2011/09/06/stack-frame-layout-on-x86-64
Commands:
1. info frame
-- will list down the registry level info about the particular frame, it will be useful when you are debugging cores.
2. info args
-- will list the arguments passed to the function in particular frame.
3. disassemble
-- will give the assembly code for the function.
4. disassemble 0xf1704f0 0xf17050f
-- will give the assembly code between two addresses
5. info registers
-- will give the details of registers and stored values
6. info reg
-- will output the contents for regiser, ex1: info reg r32 ex2: x $r32
7. info source
8. info sources
9. set pagination on/off
10. x/32w 0x100f3000
-- To print 32 words from address 0x100f3000
11. x/s
-- To print contents of the address as string
12. x/nc -- To print content of the address as character, it will print "n" characters starting from the address.
13. x/t -- To print in binary
14. x/nx -- To print in hexa
15. core
-- To attached to the core file
16. generate-core-file
-- To generate a core at the particular instance on a running process.
17. set follow-fork-mode parent/child/ask
-- To set whether to follow parent or child or ask whom to follow.
18. show follow-fork-mode
-- To display the status of fork mode
19. set history expansion on -- To enable capturing history, you can "!" to rerun the olde commands as similar to Bash command. 20. set height
-- this brings signal received on crash and offending address details are also listed37. UNDO: info snapshots-- this provide process-ids of snapshots through which we can rough memory utilization of the process at that particular snapshot
To allow the system to dump the core:
ulimit -c unlimited
History related commands:
- These commands display the state of the GDB history parameters.
show history
show history filename
show history save
show history size
show history expansion
show commands
- Display the last ten commands in the command history.
show commands n
- Print ten commands centered on command number n.
show commands +
- Print ten commands just after the commands last printed.
Logging related commands:
show logging # displays weather logging is on / off
set logging on # enable logging
set logging off # disable logging
set logging file log-file.txt # set name for log file, default is gdb.txt
set logging overwrite # To
append logs of debug sessions or
create new on every debug session using
Good post on checkpoints:
http://sourceware.org/gdb/onlinedocs/gdb/Checkpoint_002fRestart.html#Checkpoint_002fRestart
Tracing function calls of process through gdb:
http://stackoverflow.com/questions/311840/tool-to-trace-local-function-calls-in-linux#312058
Breaking the process whenever a function from a specific file is getting executed:
http://stackoverflow.com/questions/475283/using-gdb-stop-the-program-when-it-is-using-any-function-from-file-x
default configuration file for gdb is: .gdbinit
To print the size of the structure in GDB:
p sizeof(struct
Breakpoints:
- break FUNCTION
- Set a breakpoint at entry to function FUNCTION.
- break LINENUM
- Set a breakpoint at line LINENUM in the current source file.
- break FILENAME:LINENUM
- Set a breakpoint at line LINENUM in source file FILENAME.
- break FILENAME:FUNCTION
- Set a breakpoint at entry to function FUNCTION found in file FILENAME.
- break ... if COND
- Set a breakpoint with condition COND; evaluate the expression COND each time the breakpoint is reached, and stop only if the value is nonzero--that is, if COND evaluates as true. ... stands for one of the possible arguments described above (or no argument) specifying where to break.
#include
void assert(int expression);
If expression evaluates to 0 (false), then the expression, sourcecode filename, and line number are sent to the standard error, and then calls the abort function.
To enable core dumps for your current shell, use ulimit to set a maximal core dump size in megabytes.
For this example, we'll "limit" core dumps to 1 gigabyte:
$ulimit -c 1024
To use macros in the gdb use following option during compiling:
gcc -gdwarf-2 -g3 sample.c -o sample
#define NDEBUG === > then the macro assert does nothing.
References:
http://sourceware.org/gdb/onlinedocs/gdb/Forks.html
http://arioch.unomaha.edu/~jclark/gdb_plus.html
http://discussknowhow.blogspot.com/2008/07/analyzing-core-dumps-and-assert.html
http://developer.apple.com/mac/library/documentation/DeveloperTools/gdb/gdb/gdb_10.html
http://www.haifux.org/lectures/222/GDB_haifux_David_Khosid.pdf -- Advanced debbuging with gdb
GNU Debugger - Advanced GDB Actions - GoldhiveWiki http://sunsite.ualberta.ca/Documentation/Gnu/gdb-4.18/html_chapter/gdb_15.html http://web.mit.edu/gnu/doc/html/gdb_10.html https://eli.thegreenplace.net/2011/09/06/stack-frame-layout-on-x86-64
Thursday, November 12, 2009
Compilers
I like to put some words on compilers sooner or later. So starting this article. In the meanwhile I will be adding articles I came across.
References:
1. http://www.linuxjournal.com/content/examining-compilation-process-part-1
2. http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html#Preprocessor-Output
References:
1. http://www.linuxjournal.com/content/examining-compilation-process-part-1
2. http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html#Preprocessor-Output
Monday, November 9, 2009
File recovery
References:
1. http://www.makeuseof.com/tag/3-remarkable-file-recovery-tools/
2. http://www.makeuseof.com/tag/restore-your-deleted-files-easily-with-recuva/
3. http://www.makeuseof.com/tag/recover-lost-computer-files-with-undelete-plus/
4. http://www.makeuseof.com/tag/recover-deleted-files-from-your-linux-system/
5. http://www.geekgirls.com/windows_recycle_bin.htm
1. http://www.makeuseof.com/tag/3-remarkable-file-recovery-tools/
2. http://www.makeuseof.com/tag/restore-your-deleted-files-easily-with-recuva/
3. http://www.makeuseof.com/tag/recover-lost-computer-files-with-undelete-plus/
4. http://www.makeuseof.com/tag/recover-deleted-files-from-your-linux-system/
5. http://www.geekgirls.com/windows_recycle_bin.htm
IP Fragmentation
Encapsulation:
When a host or router handles a datagram, the IP software determines the next hop to which the datagram should be sent. Thus a datagram could traverse many physical networks, each with their own frame formats. An IP datagram is encapsulated in the data area of the frame.
MTU:
The basic fact in networking is that not all networking technologies were created equal. One of the differences between various layer-2 technologies is the maximum payload (commonly called Maximum Transmission Unit – MTU) a layer-2 frame can transport.
Fragmentation:
IP uses a technique called fragmentation to solve the problem of heterogeneous MTUs. When a datagram is larger than the MTU of the network over which it must be sent, it is divided into smaller fragments which are each sent separately.
Path MTU Discovery: The generic solution to the IP fragmentation issues should be the Path MTU Discovery that was issued as an RFC.
It works by setting the DF (Don't Fragment) option in the IP headers of outgoing packets. Any device along the path whose MTU is smaller than the packet will drop such packets and send back an ICMP "Destination Unreachable (Datagram Too Big)" message containing its MTU, allowing the source host to reduce its assumed path MTU appropriately. The process repeats until the MTU is small enough to traverse the entire path without fragmentation.
References:
http://penguin.dcs.bbk.ac.uk/academic/networks/network-layer/fragmentation/index.php
http://www-inteng.fnal.gov/Integrated_Eng/software/locsys/syscode/ipsoftware/IPFragmentation.html
http://www.nil.si/ipcorner/IP_Fragmentation/
When a host or router handles a datagram, the IP software determines the next hop to which the datagram should be sent. Thus a datagram could traverse many physical networks, each with their own frame formats. An IP datagram is encapsulated in the data area of the frame.
MTU:
The basic fact in networking is that not all networking technologies were created equal. One of the differences between various layer-2 technologies is the maximum payload (commonly called Maximum Transmission Unit – MTU) a layer-2 frame can transport.
Fragmentation:
IP uses a technique called fragmentation to solve the problem of heterogeneous MTUs. When a datagram is larger than the MTU of the network over which it must be sent, it is divided into smaller fragments which are each sent separately.
Path MTU Discovery: The generic solution to the IP fragmentation issues should be the Path MTU Discovery that was issued as an RFC.
It works by setting the DF (Don't Fragment) option in the IP headers of outgoing packets. Any device along the path whose MTU is smaller than the packet will drop such packets and send back an ICMP "Destination Unreachable (Datagram Too Big)" message containing its MTU, allowing the source host to reduce its assumed path MTU appropriately. The process repeats until the MTU is small enough to traverse the entire path without fragmentation.
References:
http://penguin.dcs.bbk.ac.uk/academic/networks/network-layer/fragmentation/index.php
http://www-inteng.fnal.gov/Integrated_Eng/software/locsys/syscode/ipsoftware/IPFragmentation.html
http://www.nil.si/ipcorner/IP_Fragmentation/
Friday, November 6, 2009
Format USB drive
Long long ago I used to format external memory devices. But recently when I needed an USB to be formatted because of virus, interestingly I forgot the method to do it. So I thought of adding this info here for future reference.
steps:
1. First, connect your USB device to your computer. Then right-click on My Computer from the desktop and choose Manage.
2. Next click on Device Manager and then expand out Disk Drives. You should see your USB drive listed there as “Generic USB 2.0 USB Drive” or something similar.
3. Now right-click on the USB drive under Disk Drives and choose Properties. Then go to the Policies tab.
4. Now you will see two options, the “Optimize for quick removal” selected by default. Go ahead and change that by selecting the “Optimize for performance” option. This enables writing caching on the drive and therefore allows you to format it as NTFS! Sweet.
5. That’s it. Now click OK and then go to My Computer. Right click on the drive in My Computer and choose Format. In the File System drop down you will now see the option for NTFS!
References:
http://www.online-tech-tips.com/computer-tips/format-usb-ntfs/
steps:
1. First, connect your USB device to your computer. Then right-click on My Computer from the desktop and choose Manage.
2. Next click on Device Manager and then expand out Disk Drives. You should see your USB drive listed there as “Generic USB 2.0 USB Drive” or something similar.
3. Now right-click on the USB drive under Disk Drives and choose Properties. Then go to the Policies tab.
4. Now you will see two options, the “Optimize for quick removal” selected by default. Go ahead and change that by selecting the “Optimize for performance” option. This enables writing caching on the drive and therefore allows you to format it as NTFS! Sweet.
5. That’s it. Now click OK and then go to My Computer. Right click on the drive in My Computer and choose Format. In the File System drop down you will now see the option for NTFS!
References:
http://www.online-tech-tips.com/computer-tips/format-usb-ntfs/
Thursday, October 22, 2009
Cscope with vim
today I came to know the best way of using cscope with vim(I mean through ex editor commands).
SHORTCUT:
Ctrl-b will browse through history of cscope searches that u performed earlier at the cscope prompt.
first set the default editor to vim
export EDITOR=vim
:cs add cscope.out
as described under ":help cscope-howtouse"
Is the screen getting unresponsive/blocked/can't reattach, then try setting following command next time:
:nonblock on (or) -- default is 1 second.
:nonblock 5
To browse the code through commands instead of typing ":cs f x",
download the following file:
http://cscope.sourceforge.net/cscope_maps.vim
copy it to:
~/.vim/plugin directory (assuming u are using >=vim6) and follow the following command options and I can tell you it's worth trying and with this options cscope became best browsing tool for me:
To get the help from vim :help cscope or :cs help
Command to see the runtimepath of vim :set runtimepath
Building cscope database on readonly workspace
Create cross reference file with readonly directories or files by giving complete path:
1. cscope -R -s dir,dir,dir -f cross-reference.file --- if this doesn't work, try the following:
Go to one of the directories for which you need to build database, because -s option seems to take including the current directory to build database. Here lets think you are in dirpath1
cscope -R -s dirpath2/* dirpath3/* -f cross-reference.file
2. cscope -R /complete-path/file1.c /complete-path/file.h -f cross-reference.file
3. find `pwd` -name [*.ch] | sort > file
cscope -R -i file -f cross-reference.file
To just start with cross-reference file
cscope -d -f cross-reference.file
To display last n elements of the path name:
cscope -pn
To set the cscope tags:
set cst
>>>>>>
set csprg=/router/bin/cscope
References:
http://vimdoc.sourceforge.net/htmldoc/if_cscop.html
http://www.swaroopch.com/notes/Vim_en:Programmers_Editor
http://vim.dindinx.net/orig/html/if_cscop.txt.php
http://www.uic.edu/depts/accc/software/unixgeneral/vi101.html
http://vim.sourceforge.net/scripts/script.php?script_id=213
http://www.vim.org/scripts/script.php?script_id=1638
http://www.vim.org/scripts/script.php?script_id=2502
http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html
http://cscope.sourceforge.net/cscope_vim_tutorial.html
http://uw714doc.sco.com/en/SDK_cdebug/B_CmdLnOpts.html
http://unix.stackexchange.com/questions/46568/gnu-screen-freezes-trying-to-reattach
SHORTCUT:
Ctrl-b will browse through history of cscope searches that u performed earlier at the cscope prompt.
first set the default editor to vim
export EDITOR=vim
- Find this definition - :cs f g
- Find functions called by this function - :cs f d
- Find functions calling this function - :cs f c
- Find this text string - :cs f t
- Find this file - :cs f f
- Find files #including this file - :cs f i
- Find this C symbol - :cs f s
- Find this egrep pattern - :cs f e
:cs add cscope.out
as described under ":help cscope-howtouse"
Is the screen getting unresponsive/blocked/can't reattach, then try setting following command next time:
:nonblock on (or) -- default is 1 second.
:nonblock 5
To browse the code through commands instead of typing ":cs f x",
download the following file:
http://cscope.sourceforge.net/cscope_maps.vim
copy it to:
~/.vim/plugin directory (assuming u are using >=vim6) and follow the following command options and I can tell you it's worth trying and with this options cscope became best browsing tool for me:
- To jump to a result type the results number (+ enter)
- Use tags commands to return after a jump to a result: ctrl-t
To return to same spot as departure, use ctrl-o - To use "tags" navigation to search for words under the cursor (ctrl-\ or ctrl-])
- CTRL-\ s/g/c/f..etc for key board shortcuts
- "CTRL-spacebar s". This time, your Vim window will split in two horizontally , and the Cscope search result will be put in the new window. [if you've never used multiple Vim windows before: move between windows via 'CTRL-W w' (or CTRL-W arrow key, or CTRL-W h/j/k/l for left/up/down/right), close a window via 'CTRL-W c' (or good old ':q'), make the current window the only one via 'CTRL-W o', split a window into two via 'CTRL-W s' (or 'CTRL-W v' for a vertical split), open a file in a new window via ':spl[it] filename']
- "CTRL-spacebar CTRL-spacebar s" (just hold down the CTRL key and tap the spacebar twice). If you have trouble hitting the keys fast enough for this to work, go into the cscope_maps.vim script and change Vim's timeout settings as described in the comments This time your Vim window will be split vertically
To get the help from vim :help cscope or :cs help
Command to see the runtimepath of vim :set runtimepath
Building cscope database on readonly workspace
Create cross reference file with readonly directories or files by giving complete path:
1. cscope -R -s dir,dir,dir -f cross-reference.file --- if this doesn't work, try the following:
Go to one of the directories for which you need to build database, because -s option seems to take including the current directory to build database. Here lets think you are in dirpath1
cscope -R -s dirpath2/* dirpath3/* -f cross-reference.file
2. cscope -R /complete-path/file1.c /complete-path/file.h -f cross-reference.file
3. find `pwd` -name [*.ch] | sort > file
cscope -R -i file -f cross-reference.file
To just start with cross-reference file
cscope -d -f cross-reference.file
To display last n elements of the path name:
cscope -pn
To set the cscope tags:
set cst
>>>>>>
set csprg=/router/bin/cscope
References:
http://vimdoc.sourceforge.net/htmldoc/if_cscop.html
http://www.swaroopch.com/notes/Vim_en:Programmers_Editor
http://vim.dindinx.net/orig/html/if_cscop.txt.php
http://www.uic.edu/depts/accc/software/unixgeneral/vi101.html
http://vim.sourceforge.net/scripts/script.php?script_id=213
http://www.vim.org/scripts/script.php?script_id=1638
http://www.vim.org/scripts/script.php?script_id=2502
http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html
http://cscope.sourceforge.net/cscope_vim_tutorial.html
http://uw714doc.sco.com/en/SDK_cdebug/B_CmdLnOpts.html
http://unix.stackexchange.com/questions/46568/gnu-screen-freezes-trying-to-reattach
Subscribe to:
Posts (Atom)