Hi, today we’ll use java to create a simple web crawler which can be used to fetch webpages recursively untill it fetches 1000, this limit can be changed as per our need. This code fetches only the url links out the fetched pages. It can be customized to fetch other resources according to our need. Eg. Images or mp3 etc. Continue reading
Author Archives: nandal
RMI – Remote Method Invocation
Java RMI – Here we will see with an example how Java RMI works n can be used for creating distributed application over the network. Continue reading
Code to Count no of Words in a File
Hi pals,
Yesterday, I had a telephonic interview and the interviewer asked to create this program. Hope it might be helpful for you. He left the decision of choosing the programming to chose on me. The interviewer was a Window User and I prefer GNU/Linux. Therefore, I decided to code in Java. Because the program compiled in java is machine independent. It only requires Java Runtime Environment to run on the target platform.
Now let’s look at the code. Continue reading
Control Remote Machine using C programs
Here are two programs by which we can control a machine remotely
Last time we learnt how to create a chat programs using the sockets. By which we can communicate on two different machines on a network.
Today, We will do an interesting stuff by creating a pair of programs a remote and a control to control a machine remotely using the sockets through UDP.
Chat Program using UDP for Linux
Hi, Today we will create two sample programs which will demonstrate the use of Sockets in UDP through a chat mechanism. Here we will write two c programs. 1) ram.c 2) shayam.c . Both will create sockets and use the two functions 1) sendto() 2) recvfrom() functions provided in the linux system calls for sending and recieving UDP datagrams over sockets. Continue reading
Shell Script to copy files in a folder
A shell script to find all the files in the given path recursively and then copying them in the target folder
#!/bin/sh ################################################################# # A shell script to go through a directory recursively and copy # # all the files in the given folder by sandeep nandal 2012 # ################################################################# Continue reading
Copy file using C & Threads
Creating a copy program in c using threads
This program will break the big file in smaller chunks and then uses dedicated threads to copy the data of that particular chunk from the source to the target. As a result we can copy the file of big sizes by making the use of parallelism.
Here is the code. Continue reading
open any file from terminal in linux
All window users know how to open a file with it’s default application, by simply double click on the file icon. Same can be done if linux is used in X Window Graphical User Interface. Eg. double click any .mp3 file to play the .mp3 in the default music player or double click any .pdf file in default pdf viewer. Now here we list how to open these files through (command line) terminal with their default applications.These commands work same as if you double click the file in GUI. Continue reading
C/C++ programming with linux
All the linux distros come with default programming tools (eg- gcc compiler, make utility, gdb debugger etc.). It makes it fun n powerful to program in linux with C/C++ by using the tools provided. Continue reading
tree.sh – shell script to list all subdirectories
In linux command line to view all the subdirectories in a tree like structure. Here is a shell script which you can use:- Continue reading