Rest in Peace Rahul Sharma

Rahul Sharma better known as rawone was one of the newest members of Durgapur Linux Users' Group, passed away on October 14, 2012.
Rahul was always the brighter student and was very good at heart. He valued hard work more than anything, which makes us feel for him even more. Rahul was enthusiastic to take dgplug to greater heights. It's truly unfortunate that he passed away before his time, but his absence will always be felt among us.

May his soul rest in peace!

A program to show the file pointed to by a symlink

#include<unistd.h>
#include<stdio.h>
#include<malloc.h>

int tracelink(char *filename)
{
	char *buffer=malloc(1024);
	long a;
	
	a=readlink(filename,buffer,1023);
	if(a<0)
	{
		printf("An error occured\n");
		return -1;
	}
	else
	{
		printf("%s\n",buffer);
		return 0;
	}
}

int main(int argc,char **argv)
{
	if(argc==1)
	{
		printf("Specify the symlink as an argument\n");
	}
	else
	{
		tracelink(argv[1]);
	}
	return 0;
}

A program to list a directories' contents along with their size

#include<unistd.h>
#include<sys/types.h>
#include<sys/dir.h>
#include<sys/stat.h>

#include<string.h>
#include<malloc.h>

int listdir(char *dname);
int main(int argc,char **argv)
{
	int i;
	char **dirs;
	
	if(argc==1)
	{
		listdir(".");
	}
	else
	{
		for(i=1;i<argc;i++)
		{
			listdir(argv[i]);
		}
	}
	return 0;
}

A program to find total and free memory

#include<stdio.h>
#include<malloc.h>
int main()
{
	FILE *fp = fopen("/proc/meminfo","r");
	long mb;
	char *token=malloc(40);
	
	fscanf(fp,"%s",token);
	fscanf(fp,"%s",token);
	mb=atol(token,10)/1024;
	printf("Total memory = %ld MB\n",mb);
	
	fscanf(fp,"%s %s",token,token);
	fscanf(fp,"%s",token);
	mb=atol(token,10)/1024;
	printf("Free memory = %ld MB\n",mb);
	
	fclose(fp);
	
	return 0;
}

Summer training 2010 started

We started Summer training 2010 on #dgplug , you can get the details here.

badam-halwa-of-embedded-systems

The Badam Halwa of Embedded Systems is an introductory presentation to address basic concepts in systems programming for newbies.

Summer Training 2009 started

We started Summer Training 2009. IRC logs can be found here.

Can you join us in #dgplug on  irc.freenode,net

Paul W. Frields is going to talk on Fedora Docs

Paul W. Frields, the fearless Fedora Project Leader and long time contributor to the Fedora Docs project, is going to conduct a session on Fedora Docs as part of dgplug’s summer training.

Syndicate content