Thursday, May 30, 2013

About autorun file on removable medias

Whenever one insert any media like CD in his computer, it senses the new CD and looks for a file in root of CD called autorun.inf. This is the first file gets excuted on insertion of any CD. It contains the command to be run for autoplay, and the icon to be shown while veiwing on file explorer.

It's a plain text file, which can be edited using any text editor, like notepad. It basically contains key=value pair for commands. Sample of autorun.inf file:

[autorun]
open=setup.exe
icon=setup.ico

some other commands which can be written on autorun.inf file
shellexecute=[filepath\]filename
UseAutoPlay=1

This setup.exe and setup.ico should be on root directory of CD.
To test the autorun created by you, refer to Disabling autorun autoplay, to enable autorun for any particular type of drive, for example you can enable for FIXED drives and then test on your C/D/E drives.

For more information on creation of autorun file please refer to wiki page.

Using android adb shell

To excute shell command using your pc, connect device to your system, and give command as "adb devices", to check whether device is connected properly or not.
Now you can excute "adb shell" command to access shell of your device.

All available shell commands for Android phones can be checked using below command:
adb shell ls /system/bin

rm : It's similar to rm command of Unix to remove files and directories.
rmdir : rmdir(rd) command removes an empty directoryon Unix, windows, DOS systems

Tuesday, April 23, 2013

Computer books in hindi

There are very few articles in hindi on Computer technology. If you are not good in English and want to learn computer, then this article is for you.

Download below books as PDF and learn computer in Hindi.

कंप्यूटर टेक्नोलॉजी के बारे में हिंदी में आजकल बहुत ही कम लेख उपलब्ध है। यदि आप अंग्रेजी भाषा में आरामदायक महसूस नहीं करते और कंप्यूटर टेक्नोलॉजी को हिंदी में सीखना चाहते है तो ये लेख आपके लिए है। 

यहाँ दी गई पुश्ताको को आप .pdf फॉर्मेट में डाउनलोड करके कभी भी अध्यन कर सकते है। उम्मीद करता हू यह लेख आपके कम आयेगा। 


Computer Science(Programming in C++, computer introduction, data structure)
Book:1
Computer Science-1 Index
Computer Science-1 Chapters
Book:2
Computer Science-2 Index
Computer Scinece-2 Chapters

Information Practices : Book for studying security, programming, and DBMS(mySQL)
Book1:
Informatics Practices-1 Index
Informatics Practices-1 Chapters
Book2:
Information Practices-2 Index
Information Practices-2 Chapters

Multimedia and Web Technology (Animation and HTML)
Book1:
Multimedia and Web Technology-1 Index
Multimedia and Web Technology-1 Chapters






Sunday, February 10, 2013

Some important adb commands for android debugging

adb root       - To get root access on device, this will provide full permission to user
adb remount - Remounts /system partition on the device
adb push      - To push any file, into device file system.
e.g. adb push <local system path>\<filename> <path on device>/<filename>
adb pull:  To pull out file form the device
e.g. adb pull <path on device>/<filename> <local system path>\<filename>
adb shell       - To enter into device's command prompt, and to execute shell command for device.
adb install     - To install any apk file( application file)
 e.g adb install mytest.apk
adb uninstall  - To remove application
adb version   - To know the adb tool version
adb devices   - list of devices connected to adb
adb get-serialno - Prints serial number
adb start-server - Starts ADB server
adb kill-server   - Stops ADB deamon server
adb logcat         - Collects device Log

Sunday, January 27, 2013

collecting kernel logs on android devices

For kernel logs
adb shell cat /proc/kmsg > kmsg.log
For platform logs:
adb logcat -v time >plat.log 

Tuesday, November 20, 2012

Failed to Load PDF document on Chrome

If you have faced the issue of loading PDF files on Chrome "Failed to Load PDF document" then you can try below solution:

1. Type on chrome address bar : chrome://plugins/
2. Search for PDF using Ctrl+F
3. You will find "Chrome PDF Viewer" and "Adobe PDF Plug-In" .
4. Just disable Chrome PDF Viewer. and restart browser.

Saturday, November 17, 2012

Structure of IMEI and IMEISV

IMEI is called International Mobile station Equipment Identity.
As the name suggests it recognizes the manufacturer of the mobile equipment. It is a serial number which is allocated by equipment manufacturer, and is used to register to network operator, which stores it in EIR (Equipment Identity Register).

This is the serial which is used when your device gets stolen.
IMEI is of total 14 digits pus a check digit, while IMEISV is of 16 digits., this includes information on origin, model, and manufacturer of device.

Format of IMEI: AA-BBBBBB-CCCCCC-D
IMEISV: AA-BBBBBB-CCCCCC-EE

IMEI has following parts:

Type approval code(TAC): 6 decimal places (AA-BBBB), centrally assigned and tells about model
Final Assembly Code(FAC):2 decimal places (BB), tell about location of device's construction and is manufacturer specific.
Serial Number(SNR): 6 decimal places, assigned by manufacturer.
Spare/Checksum: 1 digit

IMEI = TAC+FAC+SNR+Checksum

In the new format of IMEI, FAC doesn't any more exist, now TAC is made 8 digits long and rest all is same.

IMEISV(IMEI Software version): contains 14 initial digits similar to IMEI but last 2 digits are called as Software Version Number (SVN)

To know your IMEA number on your handset, dial *#06#
Now based on this IMEI you can find out information about your device using below site:
IMEI Number Lookup

Example:
49015420: 
Issuer:BAPT

Brand: Nokia
Model: 3110
Manufacturer: Nokia Mobile
Devie type: Phone

A list of Manufacturers and thier TAC is vailable at below link:
List of TAC

Tuesday, November 6, 2012

AT Commands

Here are few of very common AT commands listed down for use:
AT: to check weather AT commands are working proper.

Call Control:
ATA: answer the Call.
ATD: Dial a call

AT+CGDCONT? : To know APN profiles on phone
AT+CGDCONT=<cmd>, <n>
                                cmd : 1/0 (Activate/Deactivate)
                                 n: number of profile index

Basic Information of Mobile:
AT+CGMI: Name of manufacturer
AT+CGMM: Model number
AT+CGSN: To get IMEI
AT+CGMR: To get software version

Basic information of Subscriber:
AT+CNUM: To get MSISDN
AT+CIMI: To get IMSI

Current Status Of phone:
AT+CREG? : Query
AT+CBC: Current battery charging query
AT+COPS? : Query for current operation state( like operator)

Security Related:
AT+CLCK: Facility locks opening or locking
AT+CPWD: To change password
AT+CPIN? : To check SIM Status

if you want ot know more in detail about AT command please leave a comment.

Sunday, August 7, 2011

Latest version of Perl for download

If you don't have perl installed on your system then you can download from these following links:


For more download options look for following link:

Removing Autorun Newfoder.exe virus from your system



To remove this virus please follow the below steps:
  1. Search for autorun.inf file in your computer. If it's in read only mode, then change it by right clicking on it and then in properties uncheck the "Read Only" option.
  2. Now open it in notepad and delete all data in it and save it.
  3. Don't forget to change the status to "Read only" mode , so that virus can't modify it again.
  4. Click on Start -> Run -> gpedit.msc.
  5. User configuration -> Administrative template -> system -> Turn off autoplay -> Enable ( For all drives) refer to this link for more detail.
  6. Start-> Run->msconfig
  7. Startup tab & services -> search regsvr.exe and un-check all and click OK.
  8. select exit without restart.
  9. Control panel -> Scheduled tasks -> delete the Atl task, if listed there.
  10. Start -> run -> regedit
  11. Edit ->find -> search for regsvr.exe. Delete all regsvr.exe occurrences.
  12. Don't delete Explorer.exe if regsvr.exe appears with it. Delete only regsvr.exe.
  13. Goto [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] and modify value in Shell = Explorer.exe regsvr.exe and delete regsvr.exe from here.
  14. Now search for all occurrences of regsvr.exe in your system and delete them.
  15. Search for "svchost .exe" ( remember space between svchost & .exe) and delete all occurrences.
  16. Also search for "*.exe" and remove all virus affected files, don't remove any legitimate file( any installer file).
  17. Restart the system and enjoy..

For more detail on handling autorun.inf file, if you have option set for "don't show hidden files" and you are not able to see autorun.inf file then use following link for removing autorun.inf file.

Some more links you may be interested in:

Disabling Autorun/Autoplay using Registry editor


To get rid off virus affecting your system because of autoplay of drives please use below steps:
1. Type regedit on run prompt.
2. Navigate to below location:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
3. you will find a key value as "NoDriveTypeAutoRun" , which is one byte value.
4. Please set the value of key as "95" Hex value to disable autorun on removable media and Network drives.

Regedit
5. Be very careful while modifying reg values. Below table will explain you to understand the meaning of bits to set for disabling any type of media.

Value              Meaning
0x1/0x80   Disables AutoRun on drives of unknown type
0x4            Disables AutoRun on removable drives
0x8            Disables AutoRun on fixed drives
0x10          Disables AutoRun on network drives
0x20          Disables AutoRun on CD-ROM drives
0x40          Disables AutoRun on RAM disks
0xFF         Disables AutoRun on all kinds of drives


If any of the bit is set into this hex valye, that type of drive will be disabled for autorun.
Bit    Type of Drive
0/7    UNKNOWN

1       NO ROOT DIR
2       REMOVABLE
3       FIXED
4       REMOTE
5       CDROM
6       RAMDISK

For setting values you must always add 0x80 to the value of drive you want to set for.
A few examples for setting values:
for removable drives: 0x80 + 0x04 = 0x84 ( Hexadecimal addition)
for removable & fixed drives : 0x80 + 0x04 + 0x08 = 0x8C
for removable + fixed drives +CD ROM = 0x80 + 0x04 + 0x08 +0x20 = 0xAC(1010 1100)


For changing Autorun option using Group policy please refer to following links:

Disabling autoplay option in Windows XP using Group Policy
turning-off-autoplay-on-all-drives


Disabling autoplay option in Windows XP using Group Policy

Use following option to disable autoplay in ur system:
1. type gpedit.msc in run window and enter.
2. then goto Computer configuration->Administrative template -> System 




3. Then in right side u will find Turn off autoplay 





4. Double click on that and check "enabled" and select for "all drives"




5. Now click on apply and OK.
6. Similarly follow above steps step 3 to step 5 for 
    User configuration ->Administrative template -> System 


7. This setting for "User Configuration" is must. 


Steps for Advanced Users / System Admins:
if you want to Modify using registry edit then please goto this link.
Disabling Autoplay_Autorun using Registry editor for Advanced Users


Now when you insert any pendrive or any other media it will not be played automatically and you will be safe from Viruses.



Wednesday, March 30, 2011

Cygwin Installation

Cygwin is

  • a collection of tools which provide Linux kind of environment for windows.
  • a DLL which provides substantial Linux API functionality. 

This can be downloaded and installed from Cygwin website. Click Here to download.

While you are installing it will ask for package downloading, which you can download from internet or if you already have downloaded then you can give the local path. Now it will ask for packages to be installed. Just select the packages for installation.

For more information refer to this site.

It provides many linux tools like ls 

LS: unix command for listing files and directories

ls is a command to list files and directories in Unix and unix like systems.

if it is invoked without any arguments then will list files and folders in current working directory in bare format. In this bare format its difficult to distinguish files and folders and other parameters.
FORMAT: ls [Options] [Filename]
Following are the most common options to be used with "ls".
-a :  Include all files even which are starting with "."(Hidden files in Unix ), by default they are ignored.
-l  : Long format, lists permissions in unix format, size, owner , date modified etc.
-F : Appends a character to reveal the type of file e.g. * for executables '/' for directory
-R : list recursively all the directories and files
-d : list directories instead of content
-t : sort by modification time
-h : Print size in human readable format like 1M, 4G ( Use with -l)

Example: 
For listing files and directories with their parameters like size permissions and all.
> ls -l 
For listing in as ls -l along with size in human readable format..
>ls -h -l

Note: ls can also be used in windows environment with cygwin installation.

CACLS command for windows changing mode permission


It is a command line utility which displays and modify Access Control Lists (ACLs) in windows environment(Microsoft windows NT) of files and folders. An Access Control List is a list of permissions for securable object, such as a file or folder, that controls who can access it.
 
XCACLS.exe : It's a updated version for cacls for windows 2000 and later.
 
CACLS filename [/T] [/E] [/C] [/G user:perm] [/P user:perm [...]] [/D user [...]]
 
Options:
filename: Name of the file to be modify ( * wildcard for all files )
/T            Changes ACLs of specified files in the current directory and all subdirectories.
/E            Edit ACL instead of replacing it.
/C            Continue on access denied errors.
/G user:perm  Grant specified user access rights.
/P user:perm  Replace specified user's access rights.
/D user       Deny specified user access.--
 
Perm can be:
N  None
R  Read
W  Write
C  Change (write)
F  Full control
 
Examples:
1: to replace ACL with Full access permission to current directory and all subdirectories for user "test"
>cacls * /T /P test:F
2. To edit ACL for particular user "test" with Change access for abc.text file without changing other permission.
> cacls abc.text /E test:C
 
Also look for chmod a linux command for changing file permissions.
 

Tuesday, March 8, 2011

Sending AT commands using microsoft hyperTerminal

MS Hyperterminal is a small program which can be used for sending AT commands to ur GSM/3G phone connected as modem to ur PC. For linux users minicom can be used as HyperTerminal.
for getting hyper terminal in windows Vista and 7 use this link
Hyperterminal can be found in start->programs->accessories->communications->Hyperterminal

You should first check ur device whether it's connected properly, and working fine or not.

Now you should set up ur device as modem. In Hyper terminal you can start a new connection and select the com port where your device is appearing (check in device manager).

Now you can send the AT commands to ur device.

Now you should Type "AT" in the main window.
A response "OK" should be returned from the modem.
Now type "AT+CPIN?" in the main window.
The AT command "AT+CPIN?" is used to query whether the modem is waiting for a PIN ( i.e. password). If the response is "+CPIN: READY", it means the SIM card doesn't require a PIN and its ready for use.
else you can set the PIN using "AT+CPIN=<pin>"



Alternatives for Hyper Terminal in windows vista and Windows7

for getting hyper terminal in windows Vista and 7 use this link or you can use following options:

> windows remote shell (WinRS)
> use phone and modem options if you are using Hyperterminal for modem connections (AT Command).
> Can use Putty also. Download putty.exe

For getting more info on WinRS type "winrs /?" in your command prompt.

Wednesday, November 17, 2010

Conversion of macros into String literals

The # preprocessor operator converts the argument that follows it into a string literal. The preprocessor operator # can be used only in a function-like macro definition.

#include <stdio.h>

#define PRINT(name) printf("The value of " #name " is %d\n", name)

main()
{
 int abc = 100;

 PRINT(abc);
}
Output: The value of abc is 100
Macro Expansion
--> printf("The value of " #name " is %d\n", name)
--> printf("The value of " "abc" " is %d\n", 100)
--> printf("The value of abc is %d\n", 100)
The unary # operator produces a string from its operand. Adjacent string literals are getting concatenated in above example. If the operand to # contains double quotes or escape sequences, they are also expanded.
Similarly ## operator concatenate two tokens passed in macro to a single token.

#define JOIN(a,b)  a ## b
main()
{
   int myname = 100;
   printf("%d", JOIN(my,name));
}
It will be converted into printf("%d", myname);

Thursday, September 16, 2010

Perl System Routines: Functions for process

exec: abandon this program to run another

exit: exits from program


fork: creates new process just like this

getppid: get parent process ID

getpriority: returns current priority of the process

kill: sends a signal to a process or group of process

setpriority:

sleep:

syscall:

system:

times:

wait:

waitpid:

warn:

unlink in Perl: to delete the file

Unlink : this command permanently deletes a list of file from system.
Return: returns number of files successfully deleted. on failure sets value of "$!"  and returns false. It will not tell you the name of file which it couldn't delete.
Do not try deleting directory instead use rmdir command.

unlink("file1.txt");
unlink "a.txt", "b.txt";
unlink @list;
unlink glob "*.bak";