Main Page

Homepage of Indiangeek

 


Tech Blog of Indiangeek
Delete
DATE: 12/19/2007 at 03:16:25
IndianGeek Babbles:
Blog moves

The blog has moved to HERE


Delete
DATE: 10/31/2005 at 10:45:27
IndianGeek Babbles:
Sony Camcorder (and some more canon/fuji/nikon/minolta digicam and camcorder) blank screen issue

UPDATE: Apparently, Sony supplies CCDs for other companies also, and they are facing similar issues. DPReview covers it HERE.
IndianGeek Muses:
Off topic from RebelXT, but worth mentionaing. I had a Sony TRV19 camcorder. After about one-and-half years, in the recording mode, it started giving blank screens. On researching the web, I realized it's not a problem only with my camcorder but a significant number of trv19, trv22 and trv33 camcorders. People were talking about class action lawsuits against sony also.

Now the good news. Sony has agreed to fix the problem at no charge and free shipping. Use this LINK TO SONY'S SITE to start the process if you are affected by this.

From Sony's site:

   It has recently come to our attention that a limited number of products, manufactured prior to March 2004, that incorporate a certain type of image sensor device (CCD) may exhibit the following:

       * When the product is used in camera mode, the LCD panel and/or electronic viewfinder exhibits either a distorted image or no image at all.

   We have determined that this only occurs in a limited number of devices, but may be accelerated if they are exposed to hot and humid environments.

   From October 3, 2005 through October 2, 2007, Sony will repair, free of charge, affected products exhibiting the above-mentioned problem where it is caused by the image sensor device. Sony will also cover the cost of shipping and handling to service to correct this issue.

   Please contact the Sony Customer Information Services Center for further assistance at 1-866-703-7669.



Delete
DATE: 7/1/2005 at 14:19:47
IndianGeek Babbles:
Rebel XT Blog

I have started a blog on my Digital Rebel XT. You can read it Here


Delete
DATE: 6/13/2005 at 17:44:21
IndianGeek Says:
Multi Search

I cooked up some Javascript scripts so that someone can search multiple search engines TOGETHER for the same thing. Most of the guys on the net who does similar stuff uses server side scripts. The main bottleneck there will be the hosting servers speed. Basically you will be going through another website to get to google. Compromises on privacy of what you are searching for too.

On the other hand, this set of javascripts will allow you to do the searching from client side scripts, which will make it much faster and scalable. Also, you can just save the webpage in your local disk and use it, instead of connecting to my site again and again. The modular design allows you to add your own search engine to it if you are familiar with a little javascript.
Try it out at search.indiangeek.com. Let me know how you like it.


Delete
DATE: 3/14/2005 at 17:58:25
IndianGeek Thinks Aloud:
Detecting Memory leaks with gdb

I cooked up this nice nice nice trick to detect memory corruption using gdb. It needs two things. libc compiled with -g option, and statically linked to your program... so that you can step into the malloc/free functions of libc and still do source level debugging.
The idea is, gdb allows you to run a set of gdb commands or a gdb script when a breakpoint is hit. :help commands on gdb prompt gives the following output:
(gdb) help commands
Set commands to be executed when a breakpoint is hit.Give breakpoint number as argument after "commands".With no argument, the targeted breakpoint is the last one set.The commands themselves follow starting on the next line.Type a line containing "end" to indicate the end of them.Give "silent" as the first line to make the breakpoint silent; then no output is printed when it is hit, except what the commands print.

So, you can potentially set breakpoints at two locations, end of malloc routine, and beginning of free routine. For malloc breakpoint, set the commands as the following (replace r, size as the malloc return pointer and size passed to malloc respectively):
silent
printf "Malloc-ed %x %d\n",r,size
continue
end

For free breakpoint, set the commands as the following (replace ptr with the pointer passed to free)
silent
printf "Free-ed %x\n",ptr
continue
end

After this, just continue/run the program, and you will get an output like this:
Free-ed 8102000
Malloc-ed 80fbc38 132
Malloc-ed 80fbd38 132
Malloc-ed 80fbe00 132
Malloc-ed bfbff790 2
Malloc-ed 80baa8a 15
Free-ed 80d4160
Free-ed 80d4150
Malloc-ed 80d4105 4096
Malloc-ed 80d4105 4096
Free-ed 8103000
Malloc-ed 80d4105 4096
Malloc-ed 80d4105 4096
Free-ed 8103000
Free-ed 8105000
Free-ed 8104000
Malloc-ed 80d3080 4096
Free-ed 8103000


This is a crude example of the trick, but you can extend it by writing perl scripts to parse the output, adding backtrace to the output so that you can catch the non-freed memory. Comes in handy in a system which does not have tools like dmalloc/mmalloc ported, but has libc source that can be compiled and statically linked.



Delete
DATE: 3/11/2005 at 14:18:48
IndianGeek Speaks:
Memory leaks

This[Subscription needed] article on LinuxJournal talks about tools to detect memory leaks (and corruptions). Also, here is a description of setting up malloc hooks so that you can write your own memory corruption detection library. Has a neat example too.


Delete
DATE: 3/3/2005 at -2:19:45
IndianGeek Muses:
Gmail distribution

I have got a bunch of gmail invitations lying around. So, if you want one, send me a mail to indiangeek _AT_ gmail.com.


Delete
DATE: 2/23/2005 at 10:10:53
IndianGeek Says:
Canon Digital Rebel XT / 350D

Canon Released Digital Rebel's new version, with lots of enhancements and a smaller size and more mega pixels. It will be available at stores towards the end of March. Amazon is already taking pre-orders of it.
A Review can be found at DPReview.


Delete
DATE: 12/2/2004 at 18:22:44
IndianGeek Babbles:
Netflix Search

    How many times have you wondered how you can check out movies released only in 2004 in NetFlix. The search inside Netflix really is pathetic.
    I realized, they store the movies in a way that it can be crawled pretty easily with a small piece of perl script. So, wrote one for myself and hooked it up to store the data into a MySQL database at the back-end. Within a day , it has indexed about 20,000 movies, year of release and description. I'm letting it scroll in a restricted manner (5 hits a sec) so that I don't get banned for DOS attack. Also, need to enhance the script so that it will extract more info (like ratings, MPAA rating) etc so that we can search based on them. I will also open up a SELECT query interface later so that database-savvy people can make their own advanced queries. Saving those queries??? Now you are asking for too much... but I'll see.
    If you find this interesting, do leave me a note on the guestmessage book. A pat in the back is always appreciated.
    The link for Netflix search is at : Netflix Search . Enjoy!!


Delete
DATE: 11/15/2004 at 10:43:56
IndianGeek Wonders:
Fedora Core 3 Upgrade

   Upgraded my home machine to FC3. Previously, I had FC1 and WinXP dual boot on that. I just reinstalled FC3 on FC1. I generally prefer to reinstall rather than upgrade. Two reasons. Firstly, allows me to sort through and /dev/null all the junk accumulated over time. Secondly, won't have to spend time migrating the configs that clashes with each other, specially for different applications which does not "upgrade" well.
   Installed FC3 from the DVD image. After installing FC3 and grub (I previously had grub too), the boot will get stuck at GRUB stage 2 loading. I realized I didn't have a linux bootable floppy to get around, but luckily the DVD image had a rescue option which dropped me down to a linux shell. Reinstalled grub by calling grub-install to the MBR, and it booted up fine. Don't know exactly what went wrong at the time of install.
   The first impression is, interface looks sleeker, and it comes with Firefox. Yum upgraded it to the Firefox 1.0RC. Will wait for Firefox 1.0 to become RPMed and added to the FC3 repository as there is not a huge amount of differences between them.
   Although Thunderbird comes with the distro, it is not chosen to be installed as the default mail client. Evolution is given preference here, and I agree, as it has pretty sleek interface as well as connectivity to M$ exchange, which will come in handy for a lot of office people making a switch to Linux or trying it out.
   I'll have to upgrade my office PC, once I get some time. Looking forward to it.


Delete
DATE: 11/8/2004 at 15:13:53
IndianGeek Wonders: Fedora core 3 has been released. Download instructions are here. I'm stuck with Redhat 9 at my work PC and am longing to move on to Fedora and the newer KDE. But it will need some time to install and migrate to Fedora, and time is what I don't have much of!!
    I was wondering about Google and PageRank. Talking to a friend, Pagerank is not the sole identifier to list your site on top. They must be having a keyword relevancy algorithm too. For example,say pagerank of  samya.indiangeek.com is 3 and pagerank of another site is 8, which happens to have "IndianGeek" somewhere in the site content (but is not relevant to it), should it show up at top for a search for Indiangeek?? Now the question is, what is the way they rank for a certain keyword? Is the algorithm public?



Delete
DATE: 10/15/2004 at 14:43:48
IndianGeek Babbles:
Designated Initializers

Was having a discussion at work about designated initializers in C. A designated initializer is where you use the name of a structure element to initialize it. Something like:
struct s {
         int a;
         char b;
         char c; };

struct s s1 = {
    .a = 1,
    .c = 'a',
    .b = 'z'
    };
The advantages are:
1. You can initialize them in any order, and the compiler takes care of the rest.
2. There is no chance of you introducing a bug by swapping locations of two elements. On the same note, if someone introduces a new element to the structure, it doesn't have to be initialized by everybody who uses the structure, and won't mess up the ordering.
3. Elements that are not initialized will get initialized to 0 or NULL based on its type. So, you won't have to explicitly initialize them.
4. Code is much more readeable and greppable.
   We realized that this was not a standard according to C89, but gcc started supporting it as an extension. Finally in C99, this was standardized.


Delete
DATE: 9/1/2004 at 10:48:15
IndianGeek Thinks Aloud: Who wants Gmail.
I have about six gmail invites lying around, and I can give them out (since all my friends already have gmail accounts). So, if you want one, shoot me an email at indiangeek (_at_) gmail.com.


Delete
DATE: 8/6/2004 at 16:07:30
IndianGeek Says: Is it a good idea to create a list of IP addresses used by spammers, and then ban any emails coming from them? Maybe, have a central database of such IP addresses. Whenever a person marks a message as a spam, the originating IP address gets entered into this databse. There will be a weight associated with each ip address which will be incremented every time a person with a different mail address reports a spam received on that mail address from that ip. To avoid spam attacks on the database, only bigger mail providers, like Yahoo/Hotmail/Gmail etc will be allowed to submit such spam reports to begin with. Spam filters could be generated which can query this database and can drop/bounce/take other action based on the weight of the IP address. Top 100 or so IPs in terms of spam weight will be prosecuted against.
Wonder if there is something already present like this!!


Delete
DATE: 8/6/2004 at 13:29:53
IndianGeek Says: Looking throught the site log, I saw some kind of activity which is trying to see if my site uses some kind of web-based mailing tool that can be used for spamming. The strange thing is, the requests coming from random IPs, not even part of the same network, but coming in succession to each other. How do they manage that. Maybe, the spammers have reserved IPs from different subnets which they use foir spamming so that a particular subnet or a pattern of IPs cannot be banned. Clever !!
The logs are attached below:
198.237.114.56 - - [22/Jul/2004:06:56:04 -0400] "POST /cgi-bin/tellafriend.pl HTTP/1.0" 404
66.234.235.202 - - [22/Jul/2004:06:56:04 -0400] "POST /cgi-bin/formmail.pl HTTP/1.0" 404
200.48.218.179 - - [22/Jul/2004:06:56:05 -0400] "POST /cgi-bin/contact.cgi HTTP/1.0" 404
66.231.210.185 - - [22/Jul/2004:06:56:24 -0400] "POST /cgi-bin/mailform.pl HTTP/1.0" 404
12.22.85.3 - - [22/Jul/2004:06:56:26 -0400] "POST /cgi-bin/formmail.cgi HTTP/1.0" 404
66.14.125.180 - - [22/Jul/2004:06:56:26 -0400] "POST /cgi-bin/FormMail.pl HTTP/1.0" 404
141.158.65.245 - - [22/Jul/2004:06:56:27 -0400] "POST /mail.cgi HTTP/1.0" 404
216.220.213.10 - - [22/Jul/2004:06:56:27 -0400] "POST /cgi-bin/fmail.pl HTTP/1.1" 404
196.40.1.90 - - [22/Jul/2004:06:56:28 -0400] "POST /cgi-bin/form.cgi HTTP/1.0" 404
208.42.127.45 - - [22/Jul/2004:06:56:31 -0400] "POST /cgi-bin/contact.pl HTTP/1.0" 404
212.15.27.6 - - [22/Jul/2004:06:56:34 -0400] "POST /cgi/formmail HTTP/1.0" 404
200.140.131.100 - - [22/Jul/2004:06:56:36 -0400] "POST /cgi-bin/mail.cgi HTTP/1.0" 404
12.162.2.33 - - [22/Jul/2004:06:56:37 -0400] "POST /formmail.pl HTTP/1.1" 404
195.53.31.35 - - [22/Jul/2004:06:56:40 -0400] "POST /cgi-bin/feedback.cgi HTTP/1.1" 404
193.172.150.2 - - [22/Jul/2004:06:56:45 -0400] "POST /contact.cgi HTTP/1.0" 404
200.31.79.213 - - [22/Jul/2004:06:56:47 -0400] "POST /form-bin/deliver HTTP/1.0" 404
198.237.114.56 - - [22/Jul/2004:06:56:48 -0400] "POST /cgi-bin/cgiemail/contact.txt HTTP/1.0" 404
207.68.98.5 - - [22/Jul/2004:06:56:48 -0400] "POST /cgi-bin/form.pl HTTP/1.0" 404
167.206.198.115 - - [22/Jul/2004:06:56:49 -0400] "POST /cgi-bin/mailform.cgi HTTP/1.0" 404
12.178.37.234 - - [22/Jul/2004:06:56:49 -0400] "POST /cgi-bin/feedback.pl HTTP/1.1" 404
64.56.118.178 - - [22/Jul/2004:06:56:50 -0400] "POST /cgi-bin/mail.pl HTTP/1.0" 404
195.53.31.35 - - [22/Jul/2004:06:56:51 -0400] "POST /cgi-bin/sender.pl HTTP/1.1" 404
64.56.118.178 - - [22/Jul/2004:06:56:52 -0400] "POST /cgi-bin/mailer/mailer.cgi HTTP/1.0" 404
196.40.74.44 - - [22/Jul/2004:06:56:53 -0400] "POST /cgi-bin/ezformml.cgi HTTP/1.1" 404
200.30.68.59 - - [22/Jul/2004:06:56:54 -0400] "POST /cgi-bin/email.cgi HTTP/1.0" 404



Delete
DATE: 8/5/2004 at 13:27:43
IndianGeek Muses:
.vimrc tricks

Small vim function for creating function header. You can modify it to your will.
function! FuncHdr()
       "Save current position
       let line_no = line(".")
       "Find the function
       normal ^
       "execute "norm! /^\\(\\w\\+[ :&*]\\{1,2}\\)\\+\\w\\+\\s*(\"
       execute "norm! /^[^(]*(.*\"
       execute "norm! /(\b"
       "echo getline(".")

       let fun_name = expand("")
       "echo fun_name
       let line_buff = ""
       while match(line_buff,")") == -1
               let line_buff = line_buff . getline(".")
               normal! j
       endwhile
       "echo line_buff
       "remove before bracket
       let args_list = substitute(line_buff, ".*(","","")
       "remove after bracket
       let args_list = substitute(args_list, ").*","","")
       "remove whitespaces
       let args_list = substitute(args_list, '\s\+'," ","g")
       let args_list = substitute(args_list, '^\s\+',"","g")
       "remove comments
       let args_list = substitute(args_list, '\/\*.*\*\/',"","g")
       let args_list = substitute(args_list, ',[ ]*',"\n","g")
       "echo args_list
       execute "normal! :".line_no."\"
       execute "normal! A\\/\"
       execute "normal! 79A*\"
       execute "normal! A\  FUNCTION:  ".fun_name."\"
       execute "normal! A\\ARGUMENTS: \n".args_list."\"
       execute "normal! A\\DESCRIPTION: \"
       execute "normal! A\\\/\h78i\*\kk"
       normal A
endfunction



Delete
DATE: 7/16/2004 at 17:00:14
IndianGeek Babbles: Today I faced a strange Makefile issue with gmake. Assume the makefile as:

%.x %.z:
    echo "$(@) $(suffix $(@))"
all:a.x a.z

According to gmake manual:
Similar commands work for all the targets. The commands do not need to be absolutely identical, since the automatic variable `$@' can be used to substitute the particular target to be remade into the commands (see section Automatic Variables). For example:
bigoutput littleoutput : text.g
      generate text.g -$(subst output,,$@) > $@

is equivalent to
bigoutput : text.g
      generate text.g -big > bigoutput
littleoutput : text.g
      generate text.g -little > littleoutput


So, I expected my makefile to generate:
echo "a.x .x"
a.x .x
echo "a.z .z"
a.z .z
But instead it generates
echo "a.x .x"
a.x .x
and ignores the a.z rule.

The problem happens to be that gmake does not really extend an implicit rule to multiple rules, so, after executing it once, it decides to not execute it again.

The solution to this is to use static pattern based rules. Using that, the makefile will look like the following that will solve the problem:

a.x a.z:a.%:
    echo $(@)

all:a.x a.z



Delete
DATE: 7/16/2004 at 16:50:24
IndianGeek Babbles: I have decided to convert this blog into a tech blog instead of a site blog.


Delete
DATE: 7/9/2004 at 11:39:27
IndianGeek Says: Added a favicon.ico for my site. Added a Wiki searchbox. Also fixed the bookmarking feature that was not working since I moved to the table based model.
I'm registering a lot of site visits recently. Great!!


Delete
DATE: 4/28/2004 at 10:17:54
IndianGeek Wonders: Weird!! Google does not support searching frames properly (or at all??). Still, gmail uses frames!!
BTW, now I can be reached at s a m y a d (_AT_) g m a i l . c o m.


Show all entries
End of log



You are Visitor #

GuestBook
Sign My GuestBook

Message

From


Google Search


Computer Dictionary:



Wiki Search



Random Websites

Weather at My part of the world
Weather at Sunnyvale

 


Add Bookmark

This page was last modified on: 06/29/05