Subscribe for email updates

Get all updates to your inbox to stay tune.

Curve tracing programs - Draw sin(x) curve using Graphics programming in C

Learn how to draw curve tracing graphics programs in c language

Graphics programming in C

Learn how to write basic and advanced graphics programming in c language

Curve tracing programs - Draw Cos(x) curve using Graphics programming in C

Learn how to draw curve tracing graphics programs in c language

Make file tutorial

A step by step guide to learn how to write make file in Linux with examples

Monday, December 17, 2012

How to change core dump file path location and file name pattern - in Linux


Core files are very useful to debug program which are terminated abruptly.But the core files are larger in size. Due to the amount of space require to generate core file, it may require to change default core file path location to some other location.
Follow the steps to change default core file location to /tmp/user/
echo "/tmp/user/core.%p" > /proc/sys/kernel/core_pattern

Lets try something more interesting. Looking at the core pattern, one can identify following things.

Thursday, December 6, 2012

How to delete spaces using sed in Linux

I faced a issue where my configuration file contains name=value pairs. But automation scripts generated configuration file which contains "name = value". There is space between name and value. To delete the spaces, I used the following command.
#cat inputfilename | sed 's/ //g' > outputfilename

Wednesday, December 5, 2012

Extract pre/post install,uninstall scripts from RPM in Linux

It is quite useful sometimes to debug by extracting the pre,post install scripts and post uninstall scripts from RPM. Or to verify what actions being performed by rpm scripts during install, upgrade and uninstall process. To extract rpm scripts run the following command.
#rpm -qp --scripts > ./rpm_scripts
Open ./rpm_scripts file to view the scripts.

Wednesday, June 20, 2012

CLOC - Count Lines of source code

Hello readers, Recently i came to know about a tool which is very powerful and provides lots of details about your source code. It supports many languages including c,c++,scripting,xml,sql  etc.

The tool is "CLOC" which stands for 'Count Lines Of Code'.

Lets see how to download, how to use it with an example.

1. CLOC overview:

The following overview is taken from official website.

'cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Given two versions of a code base, cloc can compute differences in blank, comment, and source lines. It is written entirely in Perl with no dependencies outside the standard distribution of Perl v5.6 and higher (code from some external modules is embedded within cloc) and so is quite portable. cloc is known to run on many flavors of Linux, Mac OS X, AIX, Solaris, IRIX, z/OS, and Windows. (To run the Perl source version of cloc on Windows one needs ActiveState Perl 5.6.1 or higher, Cygwin, or MobaXTerm with the Perl plug-in installed. Alternatively one can use the Windows binary of cloc generated with perl2exe to run on Windows computers that have neither Perl nor Cygwin.)'


Wednesday, June 13, 2012

calculate MD5 Digest using EVP API


Previous articles discussed about calculating MD5 Digest and Calculating SHA Digest using openssl API and C program. The above two programs uses MD5 specific apis defined in openssl/md5.h and SHA specific apis defined in openssl/sha.h.

To Make all cryptographic  operations generic, openssl provided envelope APIs referred as "Digital envelopes". The EVP library provides a high-level interface to cryptographic functions. There are many EVP_ functions.

One of them is EVP_Digest. Here we are going to discuss how to use EVP_Digest API to calculate MD5 digest of a file.

Tuesday, June 12, 2012

List of thread Ids of a process in Linux using Proc


we have seen how to identify number of threads associated with a process in Linux. Read article Thread count in a linux process. Lets see the another tip to achieve the same task.

Using proc pseudo file system, one can get lot of useful information about a process and its thread. Each file in the proc file system has specific information about a process. Read about proc file system.

Wednesday, June 6, 2012

Thread count in a linux process

Have you ever tried to see how many threads a process has ?
You might have used GDB to figure this out. Is it possible to get number of threads a process has without using GDB ?

Yes, It is possible. Lets see two ways of figuring this out without using GDB.


Tuesday, June 5, 2012

Calculate MD5 Digest - Using BIO APIs



Previous articles discussed about calculating MD5 Digest and Calculating SHA Digest using openssl API and C program. The above two programs are written using stdio file input output APIs. These APIs are platform dependent.

To avoid this problem, openSSL provides an I/O abstraction , it hides many of the underlying I/O details from an application. That is BIO API library. This post explains calculate MD5 digest using openssl,BIO APIs.


Thursday, May 31, 2012

Calculate SHA Digest

Digest is a practical technique to verify that a file is not corrupted. Digest is a fixed length of string which is a result of hash on blocks of input message. Depending on the hash technique, the digest length varies.

There are various types of standards of calculating digest. For example, MD2,MD4,MD5,SHA1,SHA..etc.
MD5 generates 16bytes of Digest where as SHA digest is of 20bytes(160 bits) long.

We have seen how to generate MD5 digest using c program and openSSL command in last article. Read Calculate MD5 Digest.

In this post, we will see how to generate SHA digest using c program and openSSL command line interface.

Tuesday, May 22, 2012

calculate MD5 Digest

Digest is a practical technique to verify that a file is not corrupted. For example, If a rpm file is transferred over internet, Before installing, it is always good practice to verify that the file is not corrupted. The most popular practices are verifying the digest of the received file. If you have a digest already with you, then generate digest on the received file and compare both. If both matches, then it is confirmed that the file is correct. else file is corrupted. Digest will definitely vary even if a single bit varies in a file.

Digest is a fixed length of string which is a result of hash on blocks of input message.
Depending on the hash technique, the digest length varies.

There are various types of standards of calculating digest. For example, MD2,MD4,MD5,SHA1,SHA..etc.
MD5 generates 16bytes of Digest where as SHA digest is of 20bytes long.

Thursday, May 17, 2012

Bash tip to extract path from absolute filename

Thanks to Bash advanced features. We have seen Search and replace technique in last post. Now lets try another technique to extract content from a variable based on some filter.

Lets take a use case.
1. Extract path from a file name which is an absolute file path.

For this, we need to extract path except the filename. Lets see how to achieve this using advance bash scripting.

Syntax is:
${S1%S2}
S1 - String on which filter is required
S2 - String which needs to be removed from the end.

Which means in the fillename, from the end it removes characters till it finds "/", including "/"

Example1:  Extract path from file name

[bash] # var="/home/product/module/libTest.a"

[bash] # var=${var%/*}
[bash] # echo $var

/home/product/module

Example2:  Remove world from "Helloworld"

[bash] # var="Helloworld"

[bash] # var=${var%world}

[bash] # echo $var
Hello
[bash] #


Monday, May 14, 2012

The SLR Camera Simulator - good to learn photography basics

Photography is a passion, I just started learning about DSLR basics. Really it is a good start to learn about the concepts what does ISO means, what is aperture ? how shutter speed plays a vital role in night shots or day shots. Thanks to google and http://camerasim.com, here I found a SLR simulator, which is a good start. It has several control, by varying these controls - see how picture appears in different aperture,shutter speed and ISO settings. I enjoyed in playing with this simulator. Hope you will enjoy.

Thursday, May 10, 2012

Program to validate hostname and IPV4 address


Here we will see how to validate a given IPV4 address or given hostname. In the last post (IPV4 address format validation), we have seen different IPV4 address format. We will verify all those formats practically here.

Lets have a quick glance on the functions used in this program.

getaddrinfo(), function returns addresses associated with the given IP address or hostname. If this function returns error means that the input address is not in a valid IPV4 format or the host name is not resolved. The following program is based on this output. It is written and tested on Linux.


freeaddrinfo() function used to free the address structure returned by getaddrinfo.
gai_strerror() function used to get the error string for the error returned by getaddrinfo().

/* IPV4 and hostname validation */
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>

/*Validate IPV4 or hostname function */
int validateIPV4Addr(char *addr)
{
    int rc=0;
    struct addrinfo hints;
    struct addrinfo *result=NULL, *rp=NULL;
    int s;

   /* Obtain address(es) matching host */
    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
    hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
    hints.ai_flags = 0;
    hints.ai_protocol = 0;          /* Any protocol */

   s = getaddrinfo(addr, NULL, &hints, &result);
    if (s != 0) {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(s));
        rc=1;
    } else {

  for (rp = result; rp != NULL; rp = rp->ai_next) {
     struct sockaddr_in *a=(struct sockaddr_in *)rp->ai_addr;
     fprintf(stdout,"%s\n",inet_ntoa(a->sin_addr));
    }

  }

  if( result != NULL )
    freeaddrinfo(result);

  return rc;
}


int
main(int argc, char *argv[])
{
  int rc;

   if (argc < 2) {
        fprintf(stderr, "Usage: %s [ipv4|hostname]\n", argv[0]);
        exit(EXIT_FAILURE);
    }

   rc=validateIPV4Addr(argv[1]);
   if( rc!=0 ){
     fprintf(stderr,"IP address/hostname is invalid\n");
     exit(EXIT_FAILURE);
   }

   fprintf(stdout,"IP address/hostname is valid\n");
   return 0;

}
Output:
The following cases shows output of the program on different formats of IPaddress and hostname validation. 

 ncooltips# ./validateip
Usage: ./validateip [ipv4|hostname]

 ncooltips# ./validateip 1
0.0.0.1
IP address/hostname is valid

 ncooltips# ./validateip 1.2
1.0.0.2
IP address/hostname is valid

 ncooltips# ./validateip 1.2.3
1.2.0.3
IP address/hostname is valid

 ncooltips# ./validateip 1.2.3.4
1.2.3.4
IP address/hostname is valid

 ncooltips# ./validateip 1.2.3.489
getaddrinfo: Name or service not known
IP address/hostname is invalid

 ncooltips# ./validateip localhost
0.0.0.0
127.0.0.1
IP address/hostname is valid

 ncooltips# ./validateip localhostnotvalid
getaddrinfo: Name or service not known
IP address/hostname is invalid


Monday, May 7, 2012

IPV4 address format validation

This is a usual practice to validate a IPV4 address format read from a configuration file before consuming it. For this one should know what are all the valid IPV4 address formats.

1. IPV4 address consists of 32bits , i.e  in human readable format it is four octets devided by period ( dot)
    A.B.C.D
 Here each octet takes value from 0-255 so the valid IPv4 adress ranges from 0.0.0.0 to 255.255.255.255

2. The following formats are also valid

i.   8
     This address is treated as 32 bit integer so it is equal to 0.0.0.8

ii.   1.8
     In this format first octet is treated as first 8 bits and last octet is treated 24 bits. It is equal to 1.0.0.8

iii.   1.2.8
     In this format first two octets are treated as first 16bits and last octet is treated as next 16 bits of ip address. It is equal to 1.2.0.8

So, to validate any IPV4 address, one should consider all of the above valid IPV4 address formats.

Thursday, April 26, 2012

Search and replace in Bash scripting

Search and replace is common requirement in any scripting. Bash provides simple way to replace strings/characters in variable.

The bash syntax for search and replace is

${S1//S2/S3}

S1- Source string
S2- String to search
S3 - String to replace with

Lets see simple example.

Example1:  Replace all "/" with "\"

[bash] # var="/home/product/module/lib"
[bash] # var=${var//\//\\} [bash] # echo $var \home\product\module\lib

Example2:  Replace all "product" with "src"

[bash] # var="/home/product/module/lib"
[bash] # var=${var//product/src} [bash] # echo $var /home/src/module/lib [bash] #

Thursday, March 29, 2012

An Introduction to CSS3 Transitions - Good article by css3.info

A very good article about the css3 transitions.
Worth reading..
Click here CSS3 transition explained in detail



Wednesday, March 7, 2012

Incognito window - Google chrome


In normal browsing, browsers store some files,cookies,history and form data in temp directory. If it is on personal computer then it is okay but think of a computer which is not owned by you. May be Internet cafe. It is unsecured to access your bank account or mail inbox in public computer. One way to get rid of this cookies,temporary files getting stored in computer is to Browse in "Private Browsing" mode. In Google Chrome it is called "Incognito Window". Read Private Browsing in Internet Explorer.
Using this option, whatever you browse, history, files, form data all will be removed once you close the window.

Tuesday, March 6, 2012

Private Browsing - Internet explorer

In normal browsing, browsers store some files,cookies,history and form data in temp directory. If it is on personal computer then it is okay but think of a computer which is not owned by you. May be Internet cafe. It is unsecured to access your bank account or mail inbox in public computer. One way to get rid of this cookies,temporary files getting stored in computer is to Browse in "Private Browsing" mode. In Google Chrome it is called "Incognito Window".
Using this option, whatever you browse, history, files, form data all will be removed once you close the window.

Monday, March 5, 2012

Drawing shapes

C Graphics library provides many APIs to draw different shapes. Like Lines,Rectangles, Cirle, Arc, Filled rectangle and 3D rectangle. The following example illustrates drawing shapes in C Graphics using  line(), circle(), arc(), rectangle(), bar(). Use setcolor() to change the color of drawing line. There are other ways to change the line style and fill style which will be covered in later posts.

Wednesday, February 29, 2012

playing with colors in C graphics


Hello all, Lets play with colors in c Graphics. In this example, lines are shown in different colors. The number of colors is limited by the graphic mode which is detected by the initgraph(). read "C graphics" for basic c graphic program.  To check the maximum colors a graphic mode supports, use getmaxcolor() function. In current system, the graphic mode supports 15 colors. Use setcolor() to change the color of the next drawing object. In this example, after setting the color, the line is drawn in that color.

The programs output is shown below.

Monday, February 27, 2012

First C graphic program - Draw a line


Hello all, Lets start with simple c graphics program. first thing is to go through the basic skelton of a c graphic program. Usually c program runs in a text mode. To run graphic program, we need to change the screen mode from text mode to graphics mode. initgraph() function does this job. All graphic functions are defined in graphics.h header file. I will not be going though all the details about graphic modes, however all details about devices and modes are clearly documented in turboc help index. please refer for more details.
For all our programs, we will leave to initgraph, the job of selecting graphic device and supported mode automatically. All the driver files are located in "c:\tc\BGI\" directory by default after Installing turbo C++.

Thursday, February 23, 2012

Simple two person chat by hacking pseudo terminals in Linux

Hello Linux users,
have you ever tried to communicate with colleague without using gtalk,lotusnotes, yahoo messenger,communicator or any other fancy chats. ?
Have you ever tried to communicate through putty ?
For a while assume that you are working in a environment where all fancy chats are disabled and no official communicator. what did you do?  well, if you have answer its good. otherwise here is a hack for linux users.

All you need is you and your friend need access to the same linux machine. I think it is quite natural in work place.lets see how you can chat with your friend using this hack.

Yes it is possible see a two person chat by hacking the pseudo terminals. The steps are shown below.

Wednesday, February 22, 2012

Setup Turbo C++ Lab for testing

Hello there,
Lets start the C Graphics series with setting up your Turbo C++ lab for testing the programs. Turbo c++ compiler is a widely used compiler before the current fancy GUI compilers. It is not longer used to develop large applications. However for c programming language practice purpose, it is still being used in engineering class labs and personal computers. Our focus is to provide program and technique which can be used in another fancy compilers as well.

all you require is

Pseudo terminal hack in Linux

Hello all,
Lets see interesting demo on posting message into pseudo terminals of another user. There may be cases where there are multiple user logged in a linux machine as a root and you want to convey some message to a user. For example, may be you require to kill a process which is owned by a terminal and you want to convey that to the terminal owner before you process. Or think about any practical use case which you might come across. You are not sure where the user is located or working from. He may be in office or at home. It is quite difficult to identify using the ip address from where he is logged in. Since the login user name is root, it is also difficult to find out who is he. Here i am trying to post a hack, please use it for ethical purpose only. since this causes inconvenience to the users logged in that machine..

First, check how many users are logged in. "who" command lists the users logged in. There are 3 users are logged in.


Currently for demo purpose I connected 3 sessions from the same machine to remote host. so it is showing same ip address in the list. ( in real case, the ip list may vary, as sending message to your terminal doesnt make sense, isnt it ? )

Friday, February 17, 2012

How to find machine architecture in Linux ?

Run the following command to get the hardware or machine architecture( 32bit or 64bit).
uname, arch and getconf commands can be used for this purpose.

The output of these command is 64bit machine is shown here.

linux # uname -m
x86_64

linux # arch
x86_64

linux # getconf -a | grep LONG_BIT
LONG_BIT 64

The same command output shown in 32bit machine.

Thursday, February 16, 2012

which rpm package file belongs to ?

How to find which rpm package owns a file?

To know this, run the following command.

rpm -qf [full path of the file]

For example:
[root]# rpm -qf /usr/lib64/libpthread.so
glibc-devel-2.12-1.47.el6.x86_64

Wednesday, February 15, 2012

Boeing Trip last weekend - My first Java script Album


I had been to Boeing Future flights Trip. It was awesome to watch flights assembling. Amazing really. sharing that experience here. Along with this I would like post this as album. This is written using java script and css. I will be posting how to create own album in your blogger soon. Click the Images below to see the effect.


where is size_t defined ?

Many functions uses size_t to make consistence in referring size. size_t is defined in the following header. ( These headers details are taken from RHEL  )


32bit i686 architecture:
/usr/lib/gcc/i686-redhat-linux/4.4.4/include/stddef.h
#define __SIZE_TYPE__ long unsigned int
typedef __SIZE_TYPE__ size_t;


64bit x86 architecture:
/usr/lib/gcc/x86_64-redhat-linux/4.4.5/include/stddef.h
#define __SIZE_TYPE__ long unsigned int

Monday, February 13, 2012

C Graphics Programming - Promotion video (Random Bouncing balls with random colours)

Hello Readers,
I hope you are eager to see the kinds of posts that ncooltips presents in this series. I am still working on the content. For now I would like to present a promotion video. This video shows "Random Bouncing balls with random colours using C Graphics in Windows Turbo C++". Hope you like it.


Please leave some comments behind.

Saturday, February 11, 2012

C-Graphics Programming Series Introduction


Hello Readers..
'N'Cooltips introduces a new series which covers Graphics programming in C. This series covers various topics of C-Graphics starting from Basics to Advanced. Soon we present interesting C-Graphics programs in this series. The image in this post is a sample Graphics output generated by C program in Windows. I hope really you enjoy reading this series.

To understand and to get depth of the programs, We except Reader should know the Basics of C program. Since Graphics is a such a topic, It requires basic mathematics to draw objects (rectangle,circle, etc). But as we go more in detail to generate animations, writing simple Games - expectations from the user may vary. This requires some advanced mathematics concepts like Curve tracing, x-Y plane, Tita plane , Co-ordinate system ( cartesian and Polar). As said, though it is complex, we will try to present complete program in readable manner so that you really no need to worry about the internals. But having these knowledge really adds value to explore more programs yourself. Lets not make the introduction complex - DOT.

Visit the C-Graphics page for examples. Or click here

Please leave your comments behind.

Link text move effect in web pages using Java script and CSS


I was trying to create a page for C-Graphics , the new series which I will be publishing soon.I thought that lets try to create some animated link in that page, I tried link text move effect using java script and css. I am providing that details here, may be useful for you to create good looking web pages with animated links

The effect is shown on the following link. To see the effect - place mouse over the link.




nCoolTips




The java script code is shown below. and It is given with example html file. Hope you like it.
<!-- text move effect presented by www.ncooltips.com -->
<html>
<head>
<style type="text/css">
p
{
position:absolute;
}
</style>

<script type="text/javascript">
i=0;
k=0;
t=0;

function movepos2()
{

if( t == 1 ) {
   document.getElementById("manu").style.left=k+"px";
   k++;
   }
}


function movepos()
{

 var i=0;
 t=1;
 k=10;

 for(i=0;i<20;i++) {
 setTimeout("movepos2()",i*20);
 }
}

function resetpos()
{
 k=0;
 t=0;
 document.getElementById("manu").style.left="10px";
}
</script>
</head>

<a href="_black"><p id="manu" onmouseover="movepos()" onmouseout="resetpos()">Linux Cool Tips</p></a>
</body>
</html>

Friday, February 10, 2012

Evening walk at Renton landing ( and CSS )



CSS (cascading style sheet)  is awesome, one can tweak web page and its element as per the wish. I love it. Here I tried to use css to show the album. Now it looks nice :-) (W58WN2KCZQXC)

These pictures captured by Praveen on an evening walk towards renton landing. That was a fully sunny day.

Thursday, February 2, 2012

Syntax Highlighters - richer code snippets in post


I have been looking for some enhancements in my postings, One of them is the code high lighter.It adds good look to post which contains code snippet. It is really cool using these code highlighters.

Thanks for the 'Syntax highlighter'. Here is the sample code snippet.


Let me know if you need the usage. I can help , of course google always.. :-)

Wednesday, February 1, 2012

Power of Proc-8: Details of a process current status

Have you ever tried these without using gdb and ps in Linux ..
1. How many threads a process has ?
2. is any one tracing the process ?
3. what is current Process state ?

Here we go. Before going into details, The all commands are experimented on Linux version 2.6.32 x86_64 and RHEL61.

Proc file system provides all information about a process current state. These details can be seen by looking at the file "/proc/[pid]/status".
Most of these details provided here can also be seen in "ps" command output and also using gdb.

Monday, January 30, 2012

Power of Proc-7: process exe file path

Another intresting entry in proc file system is "/proc/[pid]/exe"
this file shows to a binary file which the process or command
is associated with.

Lets see an example:
1. Chose crond process. Process id is 1379
cooltips# ps -eaf | grep cron

root  1379     1  0  2011 ? 0:00:07 crond


Here ps is showing only process name in the above output,
to look at the exact command which is being used to run
the process can be seen in step 2.

Sunday, January 29, 2012

Power of Proc-6: open File descriptors information of a process

This post  talks about one of the interesting information proc provides, that is about the open file descriptors information of a process. Looking at this info one can tell , how many file descriptors that a process own, how many of them are files, sockets , pipes and interesting entity called inotify. I will not be covering what is inotify in this post as inotify itself will be covered as a new post in future.

Lets take an example and try to see the files that a process opened.
1. Again chose same  crond process and look at the file information.


cooltips# ps -eaf | grep crond
root      1379     1  0  2011 ?        00:00:07 crond
2. See the files in the directory "/proc/[pid]/fd"
cooltips# ls -l /proc/1379/fd
total 0
lrwx------. 1 root root 64 Jan 29 21:34 0 -> /dev/null
lrwx------. 1 root root 64 Jan 29 21:34 1 -> /dev/null
lrwx------. 1 root root 64 Jan 29 21:34 2 -> /dev/null
lrwx------. 1 root root 64 Jan 29 21:34 3 -> /var/run/crond.pid
lrwx------. 1 root root 64 Jan 29 21:34 4 -> socket:[9759032]
lr-x------. 1 root root 64 Jan 29 21:34 5 -> inotify
Lets go through one by one...
 the directory "fd" contains all links to files.


Friday, January 27, 2012

Power of Proc-5: Linux process environment details

Using proc file system in Linux , it is possible to get the environment details of a running process. It indicates the environment setting when the process was executed.

/proc/[pid]/"environ" file contains all the environment variable information about the chosen process.

For example:
1. Chose a process , lets chose crond
2. Identify process ID of crond



proctest# ps -eaf | grep cron
root      1379     1  0  2011 ?        00:00:07 crond
process ID is 1379

3.  Get the process environment details, by looking at content of "/proc/[pid]/environ" file

walking towards office - Beautiful scenes near wallmart,Renton








The very first experience in snow fall @renton


Still Snowing... @Renton and Seattle, WA. 
felt lack of DSLR :-(












  • Snowfall @ Renton,WA




Monday, January 23, 2012

Rajinet

No ISP
No internet
No protocol
That is Rajinet

Hatsup to desimatrini!!

Friday, January 20, 2012

sillywebcam

This is really cool. on Jimdaniel comment on my previous post pointing to this site. at sillywebcam site you take snaps of your wish(of course listed ones) with your webcam without installing any software. However not sure whether it serves the earlier stated purpose and also it requires internet. I feel you can have some fun with taking funny pics.

Few examples like, photo in frame, Fake magazine covers,  silly scenes, Hair styles and many many more.
Give it a try and have fun online :-)

http://www.SillyWebcam.com

Issue with Sudo Command without tty [Terminal].

Issue with Sudo Command without tty [Terminal].
[sudo: sorry, you must have a tty to run sudo]

Solution: 
/etc/sudoers file comes with requiretty option by default.
Just by disabling this option [Use visudo command] you can avoid the the following error.
[sudo: sorry, you must have a tty to run sudo]

#
# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
#         You have to run "ssh -t hostname sudo <cmd>".
#
Defaults    requiretty  <++++++++++disable this. (comment this line using #)

~Praveen Bodke.

Wednesday, January 18, 2012

Amazing - Snowfall @ Renton(Seattle,WA)

మంచు కురిసే వేళలో ....

camdesk software - a webcam widget on desktop


Sample Screen shot

Friends, Camdesk is a cool software which shows live webcam as a desktop widget. This is most useful software while giving demos sharing desktop - showing your presence also. Also useful while recording a tutorial using onscreen capture. Give it a try.


You can find more info and down load at Camdesk

Have fun :-)

Tuesday, January 17, 2012

Schedule commands in Linux - at command

'at' command is used to schedule commands to execute on specified time.

1. to schedule:
at -f     [commandfile]  [time]

2.to list scheduled jobs:
at -l
or
atq

3. to cancel scheduled jobs: Use job id listed in atq
atrm [jobid]


All the above commands interacts with the daemon process named 'atd'. atd will manage and executes all jobs scheduled. By default all users are allowed to use 'at'. But it can be restricted by configuring the /etc/at.allow and /etc/at.deny files. Add username per line to restrict/allow usage.

Before using the above command make sure that the atd service is running.

To start atd service
#service atd start

Have fun :-)

Sunday, January 15, 2012

Zoom in windows desktop - cool tool

Friends,
it may be required several times to zoon your screen to show few things on the screen bigger while delivering a presentation or demos. Here is a tool which will allow use to zoom in windows desktop by a key press.

click here to Zoomit

 hope you enjoy using this tools during presentations. Get rid of tweaking font size in putty..etc.

cheers

Tuesday, January 10, 2012

Drawing charts in Linux using gnuplot tool

The following article explains gnuplot tool , how to plot a graph,chart using set of user provided data.
Drawing charts in Linux using gnuplot tool

This tool can generate graph output in different file formats. for more details visit http://www.gnuplot.info/

Ptrace - useful information

Nice articles about ptrace.
1.Playing with Ptrace-1
2.Playing with ptrace-2

Very useful information how ptrace can be used, how to implement debug tools , inserting break points, modifying process code dynamically .. etc.