Thursday, September 15, 2011

Linux Terms and Commands

ext -- Linux Extended filesystem — the original Linux filesystem
ext2 -- Second extended filesystem,Advanced features to ext
ext3 -- Third extended filesystem, supports journaling
ext4 -- Fourth extended filesystem, supports advanced journaling
ntfs -- Support for Microsoft NT filesystem
The Unity  -- Desktop on the Ubuntu

Common Linux Directory Names
Directory and its Usage

/
root of the virtual directory, where normally, no files are placed
/bin
binary directory, where many GNU user-level utilities are stored
/boot
boot directory, where boot files are stored
/dev
device directory, where Linux creates device nodes
/etc
system configuration files directory
/home
home directory, where Linux creates user directories
/lib
library directory, where system and application library files are stored
/media
media directory, a common place for mount points used for removable media
/mnt
mount directory, another common place for mount points used for removable media
/opt
optional directory, often used to store third-party software packages and data files
/proc
process directory, where current hardware and process information is stored
/root
root home directory
/sbin
system binary directory, where many GNU admin-level utilities are stored
/run
run directory, where runtime data is held during system operation
/srv
service directory, where local services store their files
/sys
system directory, where system hardware information files are stored
/tmp
temporary directory, where temporary work files can be created and destroyed
/usr
user binary directory, where the bulk of GNU user-level utilities and data files are stored
/var
variable directory, for files that change frequently, such as log files.

cd
pwd

ls
ls -F forward slash after directory name

ls -RF //Excellent ls command,shows full contents including sub directories.

ls -l  //Long Listing

File globbing using *
ls -l my_s*t //my_shirt,my_short



How to enable globstar so that you can do things like ls **/*.c
first check your shell version is Bash 4 by

$0 --verion

now set globstar settings by

shopt -s globstar

it is suggested to restart the shell .


 Linux ls command and its importance in daily use.



The Linux ls command is an essential and very powerful command for daily usage.mainly used for browsing the contents of directories.its power comes when it is used with the
its options to customize the output.

In order to find the last modified/touched file in a directory we can use ls -Al.
if you want only the last four files that are modified in a directory then the following command will help.

satyendra $ ls -Alt | head -4
total 7668
-rw-r--r--  1 satyendra Administrators 2359296 Sep 21 21:20 ntuser.dat
-rw-r--r--  1 satyendra Administrators  262144 Sep 21 21:20 ntuser.dat.LOG1
dr-xr-xr-x  0 satyendra Administrators   98304 Sep 21 20:57 Recent

The –t option shows files by the time they are modified.
head -4 takes the input from ls -Alt and shows only the last 3 modified files.

Wednesday, September 14, 2011

Agile Scrum dictionary


What is Agile Methodology
Agile software methodology (Develop quickly and lightly) is based on iterative and incremental development 
methodology.ideally each iteration(Also known as Sprint in Agile terms)is spanned for 2weeks.
during these two weeks a potentially shippable product (also known as increment) is implemented.

What is Scrum
Scrum is a light-weight Agile method mainly used for managing software development.
scrum perfectly suits for completing complex projects,yet scrum methods are simple to implement on daily basis.

Sprint
Sprint is an iteration of work during which a potentially shippable product increment is worked upon and produced. Currently, the recommended sprint duration is 2-weeks.

Daily Scrum
A short daily meeting (ideally 15 minutes)where each team member stands and answers 3 questions:
1. What have I done (yesterday )for the sprint since the last Scrum meeting?
2. What will I do (today) for the sprint before the next Scrum meeting?
3. Impediments (work blocking issues)faced by each individual while performing work for the sprint.

Saturday, July 16, 2011

What does static void function () means??

what does static void() function means.
it means When you don't want a function to be called from other functions that are defined in other files.

main.c

   main()
   {
     Func1(); //this is not accassble here  since it is static in the funcs.c file

     Func2();//this is accassble here
   }
 

funcs.c

   static void Func1(void); // i am static im not going out side of this class :-)
   void Func2(void);

     
   void Func1(void)
   {
     printf("Func1 called");
   }


   void Func2(void)      
   {
     printf("Func2 called");
   }

Thursday, July 7, 2011

Domain Sockets Vs Shared Memory

Domain Sockets Vs Shared Memory
--------------------------------------------
It's been a question for a long time,which is a better design approach.
Shared Memory ( Shared Memory is faster),
domain sockets(less problems,nearness to real life).

Shared Memory advantages
-----------------------------------
non-linear storage
will never block
multiple programs can access it.

Shared Memory disadvantages
------------------------------------------
need locking implementation
need manual freeing, even if unused by any program
Programs that crash in a critical region
Programs that spend too long time in the critical region
Locking too much
Distributed shared memory
Sharing limits scalability
Sharing can introduce deadlocks
Sharing makes systems error prone and debugging difficult
Sharing doesn't exist in the real world

Domain Sockets advantages
----------------------------------------
blocking and non-blocking mode and switching between them
you don't have to free them when tasks are completed

Domain sockets disadvantages
----------------------------------------
must read and write in a linear fashion

Finally Domain sockets are a lot easier to re-implement a distributed computing. The speed gain factor of Shared Memory will be lost because of the need of a safe design. However, with the use of proper kernel calls in a particular architecture,one can achieve greater speed with Shared Memory.

Tuesday, May 31, 2011

SIP – Session Initiation Protocol Glossary


SIP             Session Initiation Protocol.
IETF           Internet Engineering Task Force
RTP           Real-Time Protocol
RTSP         Real-Time Steaming Protocol
SIMPLE      Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions
TCP            Transport Control Protocol
UDP            User Datagram Protocol
IMPP          Instant Messaging and Presence Protocol
URI             Uniform Resource Identifier
PSTN         Public Switched Telephone Network
SMTP         Simple Mail Transfer Protocol
VPN            Virtual Private Networking
IPsec          Internet Protocol Security
ENUM         Electronic Numbering

Threshold --- The starting point for a new state or experience, which may be of one’s interest. 

The Threshold limit value (TLV) of noise pollution  is a level to which it is believed a worker can be exposed day after day for a working lifetime without adverse health effects.



Tuesday, May 17, 2011

Strace_oprofiler)----(kernel/application Performance checking tools)


Profiling
Profliling is a type of dynamic program analysis, which comprises of  investigation of a program’s behavior when the program is being executed.

The usual purpose of profiling is to determine which part of the program is needs to be optimized for decreasing its memory requirements, increasing overall speed.

Flat profiler
Flat profilers compute the average call times, from the calls, and do not break down the call times based on the callee or the context.

Call-graph profiler
Callgraph profilers show the call times, and frequencies of the functions, and also the call-chains involved based on the callee. However context is not preserved.
Oprofiler allows you to learn where the application spent its time and which functions called which other functions while it was executing.
It is useful in determining which part of the application is slower than expected, and might help for rewriting your program to execute faster.

 We can notice which functions are being called more or less number of times than you expected.

CallGraph
A call graph is a directed graph that represents calling relationships between functions/subroutines in a program. Here each node represents a procedure and each edge (x,y) indicates that procedure/function x calls procedure/function  y.
A cycle in the graph indicates recursive function/procedure calls.

How to use Strace
---------------------------
what is  strace ?? (Its a nice debugging tool,if you know how to use it effectively)
strace tool shows how an application interacts with the operating system, how it uses the system calls  strace displays the system calls made by te application and their parameters,it also shows the return values of each and every system calls.
To know which system calls our application is calling, give this in the console
 strace   path_to_the_program_you_want_to_run(here path to your application is argument to strace)

Trace system calls
------------------------------
strace -f ls
Important: Failed system calls return -1.
eg:-: access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
In the above example, the access() return value is -1 , given along with symbolic name of ENOENT error code. which clearly means file does not exist.


Wednesday, March 23, 2011

What is C++!!!?

"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it".
 No built-in garbage collection.[3