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.