Getting the list of IOCTLS in the kernel.

2010-06-25 1 min read Linux

Sometime back I was helping one of my friends in looking for all the IOCTLs supported by the kernel. Well we did not find the info we were looking for and thus thought to write a perl script to get all the IOCTLS supported by the kernel. Here it is, simple script to scan through the code and give you a list:

#!/usr/bin/perl —

@files = `grep -r ” _IO” /usr/src/redhat/SOURCES/linux-2.6.20/* |grep define ioctls_grep`;
open (DAT, ”ioctls_grep”) ||die ”could not open ioctls_grep”;
@files = DAT;
close(DAT);
my %ioctls_numbers;
print ”Grep completed..\n”;
open (DAT, ”ioctls_numbers_found”);

Continue reading

find duplicate entry in a list in bash with sed

2010-06-25 1 min read Bash Fedora Learning

Here I will take an example of rss2email list, but I guess I will be able to pass on the concept.

Here is example of the output of the r2e list command:

1: http://blog.amit-agarwal.co.in/feed (default: amitag@localhost)
2: http://feeds2.feedburner.com/AllAboutLinux (default: amitag@localhost)
3: http://feeds2.feedburner.com/Command-line-fu (default: amitag@localhost)
4: http://blogs.members.freewebs.com/Members/Blogs/viewBlogRSS.jsp?userid=29731143 (default: amitag@localhost)

Target here is to get the list of all duplicate entries if any. So, first we need to remove the numbers from the begining and the email ID from the end.

Continue reading