Saturday, September 4, 2010

The internet and web series

I figure one of the best ways to gloss at current scene is to start at the internet level and then span out to whats going on currently. This will be a brief explanation,and would answer questions that I wasnt able to get during my course time.

Starting with IP, I will go on with what I see best as next part or extension of IP and so on....

Stay tuned, good bye!

Tuesday, June 22, 2010

The path to manipulate data....

One my way to work with twitter data and their annotation, it seems I will have to know quite a bit of atleast some technologies that are used to serialize data, the earlier man used JSON, so I have to peek into JSON stuff in order to get a hang of it.

JSON , is Java Script Object Notation, much like XML its used to seralize objects, in my case he has used it to parse the csv seperated data, in order to generate objects that can be rather decently accessed.

One good advantage of JSON over XML is that JSON is very light weight, in that you essentially avoid the tagging process that goes on with XML, so var v={ "name":"Nikhil","game":["khokho","dharma-guru"] } and var obj=eval(v), instantly creates an object that you can access with member-of "." operator, obj.name would then return my name.

A more detailed description of this is found here:
http://msdn.microsoft.com/en-us/library/bb299886.aspx

Sunday, June 6, 2010

Working on Named entity recognizers.

Today onwards I will be working on a named entity recognizer. Its supposed to be stanford ner s/w project trained with twitter data. The twitter data was annotated using mturk and other crowd sourcing entities.Now this annotated data is going to go into the NER system and finally this will give us a NER that recognizes the system names.
This is the goal of the project.

Friday, May 21, 2010

End of Spring!

It all ended on 18th may, my pen and my brain smoked, as I left the classroom and went towards the exit. The last of the exams , called Algorithmic analysis (advanced) finished at exactly 2.30 pm, on that day.

Finally, it was all over!

I did some pretty cool things this semester, the coolest of all was a particle simulator...It was a simple 3 dimensional particle simulator, which simulated the gravitational force. The better thing being it worked using open-mp a new technology that allows multi-threading stuff to be done in some 2-3 stmts.

There are some pretty good tutorials out there, which anyone can use, but their isnt much help on the 3 dimensional collision part. So I think I should write a bit about it, and I will in my next post.


So basically, the program follows the Single process multiple data model , and does a spatial decomposition, of the cube in which the actual collision takes place.

A 3d puzzle game could easily be done here...or so I think.

Here are a few screen shots, and a video (the video is quick ,cause There is apparently some shitty problem when recording videos of off linux)

Thursday, April 22, 2010

Of SouthPark and Scarcasm.. Holy prophets and gingers

In the last week's episode SouthPark went on to identify the limits of portraying Muhammad, the supposedly last prophet in whom muslims believe. The plot was rather ingenious , with superstars wanting (only naturally), the power of Muhammad which makes him impervious to any remarks that anyone can make , and on the other side, gingers lead by CopperCab Cartman, wanting to know how Muhammad managed to make himself impervious to sarcastic attacks.

Cleverly enough the creators come up with a way to portray muhammad without actually showing who he was (and in turn "RE-MAKING" him into what they want him to be ). They made him a "BEAR" wearing prophet,with a very shrilly voice.

And now they wont air the episode due to various issues (death threats included).


I think islamic people need to sit back and not be so up tight (learn from buddha..who is shown smoking weed and chillin out ).


So basically the episode tries to find a commonality between the people who are pissed off by others... and by raking they are:
1. Muhammad (who basically cannot tolerate a single world, and only talks of death for those who do ).
2.Hollywood stars ( :)...... )
3.Gingers.


They are only going to worsen their case by repeatedly interrupting the ingeniously-negative-creativity of SouthPark.

Here are a few stars who know how to handle, and few who dont:

The fudge packer





And Muhammad now trying to use "DEATH-THREAT":


Another Orkut bug....

During mid Feb, I saw this bug that was recurrently mutating into new forms, yet the original code remained awfully similar. I think orkut had blocked processing of all that is html in their posts for a few days untill the issue was resloved.

I managed to make a local copy of that source in order to find out what it was really trying to do...
And as usual , firebug was a great help in making things rather discreet and easy to see...

The code made social engg request targeted to mobile users, offering them "fake-recharge " for life worths time, and in truth it added those guys who clicked into a predecided community, and posted comments on albums(of the victim).



I maintain a fake profile on orkut from which I do all such things , and I tested this one from it. Now it does work but I wonder how did the creator of this bug find out the exact parameters google's orkut webapp requires in order to successfully process the request ?

Its because of internal details like this, that I believe this guy would have worked on it internally at some point in time. And now that orkut is full of heare and there, its all the more difficult to see whats going on exactly whithout having access to the actual source that spwan those frames.

Asynch request /reply has definitely made the web all the more interesting .....

As a part of my grad coursework, I had demonstrated how flash can be used to override the browser's same origin policy (since flash works on flash's policy ,which is set by website owners,its not fixed like the browsers's same origin policy)...

It basically translates to this: If I have ability to upload an swf movie on your trusted domain, your pretty much screwed(if u run it, and you will, cause that is what social engg will make you do) !

:)

Lately I am busy doing this project on particle simulation, its awesome project , in which I basically try to do about a billion particles simulation in real time. So this field is rather unrelated to security as such, although its my second favorite topic "optimization".

Optimization problems are always interesting in a variety of ways, they basically mess with your brain so much that your consumed by searching for possibilities....and then mathematical tools come to your rescue telling you that you have wasted all your time in-vain , searching for a desert rose....

^_^

Till later, see ya!

Saturday, February 27, 2010

Old wine, new bottle : dynamic programming.


As a part of my grad coursework , I came across this topic... dynamic programming. There's already a lot of description of this topic all over the web, and some of it is truly cool. But when I hear about dynamic programming, I just think its not a new trick at all....its kind of an improved version of divide and conquer..... that reduces time requirement by storing results to the so called "common sub problems".

Well I didnt realize something as old as dynamic programming could be fun to read, I mean one of the descriptions that I read was about dividing a problem into sub solutions. This is basically done using what is called "copy and paste" or something , and the argument in general is:

"Suppose I have optimal solution, then I view this solution as answer of a function with args as two sub solutions"

Optimal(best) Answer to main problem =
Combine((optimal)best ans subprob 1, optimal(best) ans subprob 2)



And to prove this, the argument, we generally say

if the answers to subprob 1 and 2 were not optimal , then we would have taken other solutions that were optimal,and resulting answer would be different(read optimal).
but this cant be, cause we are considering that our main answer is optimal.


eg. consider a shortest path problem.

We say I know the optimal answer of shortest path from a to z.

Then I say, I know that this path is combination of shortest path from a to g and g to z.

sp(a,z) = Combine( SP(a,g) , SP(g,z))

now why should combination of Sp(a,g) and sp(g,z) result always into shortest path? why?

The sub problems are independent. ie. the shortest path from a to g, does not change based on selecting of shortest path from g to z.
Now because of above stmt,in this case, we can easily combine the distances of SP(a,g) and SP(g,z) and that would give us the shortest distance.


But might this always be the case ?

Not really. Consider now for eg. a longest path subproblem. In this we need to find the longest path from a to z, which has no cycles. ie. a simple path.

Now suppose we decide g.
then LP(a,g) is longest simple path from a to g
and LP(g,z) is the longest simple path from g to z.

Now just imagine, that both of this paths actually go through a vertex k....

now lets try to join the two paths.

(a-----k-----g) + (g----k-----z) = a-----k----g----k------z.


Now clearly k---g---k is a cycle and hence this solution is not valid(we dont want cycles).

Shitty feeling isnt it?

now what is really happening here is, the optimal solutions to the subproblems arent independant.

ie. if LP(a,g) involves k, then LP(g,z) should not involve k for all k element of (a-z) -{a,z,g}


This is a dependancy among sub problems, and these problems are called dependant subproblem.




Now next what, now as far as this, dynamic programming is similar to d& c. The difference is that dynamic programming makes use of previously calculated results in order to generate newer ones, thus avoiding repeated calculation, in our shortest path example, this isnt so visible, but for problems like knapsack etc, you can easily see that.


So now, how to excell in the "dynamic programming" , imho you just need to know d&c by heart in order to do this stuff....after all,

dynamic programming isnt something new, its just d&c with some optimizations.

Thursday, January 14, 2010

Linux and NICs (bringing up the NIC)

Hello,
Today I will post about detection of NIC (h/w) and if a driver was installed .

Like windows, there is no central way on linux to check if something happened.

To check if NIC is present :

use lspci (list pci devices) : generally nic is connected thru pci bus (if you have one on usb, use lsusb)

ls is a general command to list things on linux, prolly ls+pci is listing pci devices and so on.

Then check if the driver was loaded:

The simplest way of do this is to grep eth lines on /var/log/dmesg file.
dmsg would prolly contain bootup messages.

cat /var/log/dmesg | grep eth

the output should be:

[xxx.xxx] eth0 : registered xyzcompany name etc.

Now simply bringup the network

For this, you need to add entries to /etc/network/interfaces file.
add:
auto eth0
iface eth0 inet dhcp

save.(you can do this via gedit, or vi or any other editor you want)
even cat > would do.
after this, use ifup -a

ifup -a

brings up all interfaces.

try pinging, traceroute and if its replying then your network is up and running!

Wonders of Virtualization

The last time I had to install linux, I had to work out partitioning the hard disk, installing the boot sector on the appropriate partition, and 10k other things. Along with the tension that if I mess something, that would prolly mean reinstalling the whole system again (ie.wasting 2-3hrs) or then complete loss of data :) , if the partition was done absent mindedly,and I boast(in a sarcastic way) a long tradition of making absent minded mistakes.

Now here comes the saviour : FULL VIRTUILIZATION.

As the name suggests , full virtuilization provides virtuilization at level of machine lvl instructions (or machine code), by doing so, a single pc could host a dozen os at a time in complete relative isolation, which is totally rad(ical).


For users like me , who like to try out all that new distros have to offer, this comes as a unparalled boon, now i dont need to toggle my actualy h/w settings, instead i just "virtually-install" any operating system I need to.Thus eleminating any risk that the os installation/running may have brought to the other ones installed.

Ofcourse there are thousands of reasons why virtuilization was actually so important, some being ability of a single hardware to provide multiple guest level operating systems- the primary goal .

Currently virtuilization is important because it helps isolate the hardware and software, by providing a level of virtuilization in between, so processor p0 on a virtual os, may not really exsist. Where is all this heading to ? Well, this is one of the principles of security called diffusion.
Something that diffuses a central attack target into many splinters only one of which is true, or each share 1/nth risk the original, if there were n virtual processors in this particular case.

The downtime is reduced to ~"0" by making use of virtuilization, the answer being obvious that, any damage that occours , ocours to a part of the system rather than the whole system, so next time you jam out a nic, its just the virtual nic, not the real one, so your attack would bring down only part of the operating system.

This added complexity results into security-by-ignorance.


All in all, this is the new beginning of computers ,where a single laptop would host a mac, linux, solaris, and any other os one would like....all at a time.

That is impressive!!!



Try out Virtual Box, one of the coolest full vir s/w available for FREE!