P2P In 15 Lines of Code
nile_list writes "Edward Felten of the very fine Freedom to Tinker has written a 15 line P2P program in Python. From the post on Freedom to Tinker, "I wrote TinyP2P to illustrate the difficulty of regulating peer-to-peer applications. Peer-to-peer apps can be very simple, and any moderately skilled programmer can write one, so attempts to ban their creation would be fruitless." Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl."
Freedom to Tinker has written a 15 line P2P program in Python
Does anyone have a
Trolling is a art,
15 Lines? 9 Lines.
The python code has
import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac
The perl code puts multiple commands in one line.
Those are both cheating. And not really 15 or 9 lines of code. How many lines of code are just os.py alone? Using these upper level languages is not a good way to prove how simple these activates are because they use many complicated libraries preinstalled in the language. It is like saying I can write a webserver in 3 lines of code.
#!/UpperlevelProgrammingLanguage
Import webserver
Run Webserver
Version in lower level language like C with just say the <includes> are better but still a bit of cheating. If you did in in assembly then that is even fairer. The true test is how many lines of code in assembly without an OS.
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
Anyone can write a P2P client, but who will you network with? Not very useful with the other P.
Do Perl developers have some kind of reverse size-compensation complex?
Anything you can do I can do smaller?
P2P Does Not Break the Law
People Do
...but it only worked with 1 dimension. I'm working on scaling it up, but I'm worried it might get longer.
I can see P2P becoming the next DeCSS in the eyes of the courts and receiving similar treatment.
So when can I expect my shirt?
I'm Matthew Skala, the author of MoleSter, and my name was spelled correctly in the item I submitted about this.
I have just created a zero line P2P program which I have entitled "Walking to the Neighbor's House to Borrow a Movie".
I could be evil and patent it, but I have decided to release it under the GPL.
...are dedicated to spyware if its anything like kazaa.
From the webpage: Every time I look at the word "molester" my brain tries to parse it as "mole-ster" instead of the agentive of "to molest", and now I have an excuse to name a piece of software MoleSter, so I'm going to use it.
I think that the RIAA and MPAA are going to get a lot of positive spin when people start reading that they're going after all the MoleSters on the Internets.
"What do you think?" "I think 'What, do you think?!'"
#!/bin/bash
### ToDo: Write P2P app here
But according to this article from a story that was posted on Slashdot yesterday:
But if next July's anticipated Supreme Court ruling in the MPAA/RIAA vs Grokster/Streamcast goes in favour of the movie and music industries, the heat is going to be on any technology, no matter how benign the intentions of its developer, that nevertheless makes piracy possible.
Which is rather stupid and obtuse. If you're trying to pioneer a novel way to transfer data, then it could be used for piracy. Anything that transfers bits and bytes around can be held liable. So setting this precedent is just PLAIN STUPID. How far will *AA go? Let's say this precedent had already been established... then they could go after Brian Cohen. They could hold him responsible for create an application "makes piracy possible, regardless of his benign intentions". This way the *AA could crush anything that they see as a potential threat.
Vivin Suresh Paliath
http://vivin.net
I like
#! /bin/bash
/src/mldonkey/distrib/
cd
# --- start mldonkey ---
./mlnet
Buy Steampunk Clothing Online!
An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
Buy Steampunk Clothing Online!
It's commonly referred to as "golf". ;)
http://www.perlmonks.org/index.pl?node=golf
I only post comments when someone on the internet is wrong.
...that Perl is a true write-only language.
Unix: Where
Until it's required to have DRM in the OS... And, bans on malicious code... Perhaps a ban on compilers...
Unlikely isn't the word I'd use when we have people who have no clue as to what they're talking about. They'd think they were banning viruses!
Moderate funny ha ha.
Our lawyers are currently perfecting a new TinyLawsuit specifically to defeat your invention. You will like it- Only _10_ lines of legalese!
The ball is now in your court, Mr. Felten!
Regards, The RIAA/MPAA
The link is intent. The notion that the RIAA/MPAA have is that makers of P2P applications are doing something complex and difficult, and so banning P2P applications isn't a big deal--it's a specialized activity that's hard to do, and it's relatively easy to police, and to demonstrate intent on behalf of the programmer.
The goal of showing tha P2P applications are easy to write and can be extremely small is to say that you really can't ban P2P without banning the ability to transfer data over the internet in general. The idea here is that what's "core" to a P2P ap isn't all the fancy bells and whistles--it's a pretty simple and straightforward concept.
The idea here is that if someone wanted to ban text editors, since they could potentially be used to copy down copyrighted information. They may say that their war is with Microsoft, and specifically Word. But the point is that you don't have to be Microsoft to write a text editor, and all those bells and whistles Microsoft writes aren't what makes it a word processor--it's the really simple concept of modifying text in a file. "edit" isn't nearly as complex, but does the same thing. The problem isn't with the big pieces of software but with the underlying concept.
TinyP2P requires you specify the server address and port. Um, how is this different then FTPing to a server? Or sending a file over some IM service? Or copying a file over a network share?
I thought the real point of p2p, as in file sharing, was the ability to search many hosts for something, even though you do not know what hosts exist, ideally without even requiring a central server the hosts must register with.
Dan East
Better known as 318230.
There goes my argument that Python promotes readable code....
"First you gotta do the truffle shuffle."
Both these programs remind me of the obfuscated C program contest of years ago. They put multiple lines of code on one text line and use cryptic variable names to save space. They try to be cute to be small. Let's see how small a program can really be written if it is written in a decent style understandable by all. Not everyone knows the more arcane python and perl syntax. But a competent programmer could decipher it if written in a good style. The comment that "any moderately skilled programmer can write one" is BS if it has to be written so cryptically that only the interpreter/compiler can decipher it.
Not only will they not go after Bram and BT because it's just shifting bits around (they might as well go after FTP), I wouldn't be surprised if someone tried to hire him or they built off of exisiting code. BT-style file transfer is just far too efficient and effective to stifle, and with a few modifications could make Video-On-Demand viable.
Hell, the only reason I can see why Apple's iTunes/Quicktime division isn't all over him already is because they're probably cooking up their own software, service, and hardware on their own.
---If you can't trust a nerd, who can you trust?
I get the following error:
TCPA ERROR #12: Unsigned script execution blocked; Trusted Computing violation sent to MS-Patriot Log Authority.
Can anyone help?
Power to the Peaceful
Because the laws that prohibit shoplifting DON'T prevent you from walking into a store on the theory that MAYBE you might shoplift. They also don't prevent stores from putting merchandise on display on tables near the entrance on the theory that MAYBE that might make it easier for shoplifters. It's the SHOPLIFTING that's the crime.
The point is the RIAA's argument in the Grokster case isn't about the fact that people trading filed ILLEGALLY is against the law. Their argument is that P2P programs INDUCE people to break the law, and so should be banned--it's not an attack on the people acting illegally but the MEANS to possibly do so.
To go back to your shoplifting argument, this would be the RIAA arguing that shopping malls have to be banned because they create an environment that makes shoplifting easier. See the problem?
I guess the people who wrote them are "appers" or "scripters" or "serverers" or "clienters". Certainly not "programmers", since they're not writing "programs".
OK, I'll stop now. I'm sure you've had the error of your ways pointed out many times. It's OK to make a mistake; what I'm really amused by is the fact that your post has been modded "Interesting".
The CB App. What's your 20?
If you'd read Skala's website, you'd see he already addresses your weak argument:
You're using Socket.pm, and it's huge, that's cheating!
Read the fucking code. I'm only using Socket.pm for its defined constants (such as SOCK_STREAM). I could easily eliminate Socket.pm, and save probably another 20 bytes or so, by replacing those constants with the numbers they represent; I have not done so yet only for portability's sake - it might make my code Linux-specific and I'd like to avoid that.
"Truth is not decided by majority vote" consensus gentium -- Norman Geisler
Rappers do.
Brian Cohen was, however, the eponymous hero of Monty Python's Life of Brian. Bloody Romans.
you had me at #!
"Friend Gives me movie to return to rental place and I forgot to go to the rental place" method.
I get more movies that way.
The Kruger Dunning explains most post on
I've added some new features to your wonderful program, which I too am releasing under the GPL. I call it:
"Breaking in to the Neighbor's House to steal a Movie".
Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl.
There have been discussions recently about potential employers doing a Google search on job applicants, so the way I see it Mr. Scala's either very smart or very stupid.
Very stupid, for the fact a lot of searches will put "Matthew Scala" and "molester" together on the same page.
Very smart, because this tactic will bury any evidence of his pedophilia under a pile of MoleSter links and pages.
=P
± 29 dB
i never liked email anyway
Tinyp2p proves that software aspect of p2p networking is accessible to the vast majority of us and that means that the IP police will never have a single simple target to chase.
But it is the hardware part of p2p that is scary. All p2p networks can come down if our broadband providers decide to block the ports normally used for it or to take any other restrictive measure.
The right to digitally communicate and associate, is seriously at risk! I have wrote more extensively about it here: http://slashdot.org/~fccoelho/journal/
These mini-P2P programs may not be useful for serious media sharing, but I can think of a real-world application - distribution of banned text (articles, newspapers, etc.) in the PRC and other repressive states. The software's tiny - small enough that anyone with Python or Perl installed could just keep the program on a folded sheet of paper, type it in when they want to use it, and delete the program when they were done. If you got in trouble, just burn the paper.
I'm the stranger...posting to
P2P is the marijuana of the 21st century in the sense that it is an activity done by millions of people who don't think there is anything wrong with doing it. And it has been (actually in this case, will be) made illegal by clueless legislators prompted by outlandish claims by business groups.
Now you have a classic situation where a vague law can be focused on a large group of people for political reasons. Individuals can be selected either randomly or because of their unrelated political activities or beliefs and be fed into the legal machinery for the 'criminal' activity of using P2P.
Given the for-profit corporate prison industry in the USA and the oversupply of greedy lawyers, this looks like a new profit center focused on young people in the same way that the marijuana industry turned out to be extremely profitable for the lawyer-corporate prison coalition.
Make P2P vaguely illegal.
Make it incredibly easy to do.
Select 100 young people at random.
Check for P2P activity.
If yes, offer them a deal:
go to prison for your 'crime'
(the corporate prison makes $30,000 per year)
-or-
pay a $10,000 fine to the RIAA and turn in several friends doing P2P. (keeps the chain going).
-or-
pay a lawyer $20,000 and get probation. ($10,000 goes to the lawyer and $10,000 goes to the judge), along with turning in several friends using P2P.
You can see how this can become very profitable for the lawyers, RIAA, and prison corporations. Each will make sizable bribes (campaign contributions) to politicians to keep the laws against P2P quite strict, in the name of fairness to musicians and artists.
Code is left intact, but here is the whitespace massaged into a more widely-accepted (and readable) convention. You see, Python isn't -that- sensitive to whitespace! ;-)
myU, prs, srv = ("http://"+ar[3]+":"+ar[4], ar[5:], lambda x:x.serve_forever())
# tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html)
import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac # (C) 2004, E.W. Felten
ar, pw, res = (sys.argv, lambda u:hmac.new(sys.argv[1],u).hexdigest(), re.search)
pxy, xs = (xmlrpclib.ServerProxy, SimpleXMLRPCServer.SimpleXMLRPCServer)
def ls(p=""):
return filter(
lambda n: (p == "") or res(p, n),
os.listdir(os.getcwd()))
if ar[2] != "client": # license: http://creativecommons.org/licenses/by-nc-sa/2.0
def pr(x=[]):
return ([(y in prs) or prs.append(y) for y in x] or 1) and prs
def c(n):
return ((lambda f: (f.read(), f.close()))(file(n)))[0]
f = lambda p, n, a: \
(p == pw(myU)) and (((n == 0) and pr(a)) or ((n == 1) and [ls(a)]) or c(a))
def aug(u):
return ((u == myU) and pr()) or pr(pxy(u).f(pw(u), 0, pr([myU])))
pr() and [aug(s) for s in aug(pr()[0])]
(lambda sv: sv.register_function(f, "f") or srv(sv))(xs((ar[3],int(ar[4]))))
for url in pxy(ar[3]).f(pw(ar[3]), 0, []):
for fn in filter(lambda n: not n in ls(), (pxy(url).f(pw(url), 1, ar[4]))[0]):
(lambda fi: fi.write(pxy(url).f(pw(url), 2, fn)) or fi.close())(file(fn, "wc"))
I'ts all very insteresting to read about this, but I'm wondering... seems creating P2P is very simple, yet why takes it so long for people to take up the chalenge of making a 'small social network' P2P-system?
Wasn't it on this veryè same slashdot, that not too long ago an article was mentioned about a site who was willing to pay a considerable amount of money to any coder willing to work on a OSS P2P system annex IM which was meant to be used in a small network of friends, and thus, below the radar of RIAA and co.
I gather the author in question isn't very interested in money, at least compared to 'status among peers' (something that seems to be typical of good coders working on OSS projects, like Linus). But I can't imagine that NO coder (at least the last time I checked) has taken that offer up for 1000 bucks, while this one makes a simple P2P prog in a matter of days, just to prove a point, or even just for the fun of it.
I'm not sure how it was called again, but some probably will remember and maybe post a link to it...now, the only thing to find are skala-type dudes - and getting a nice bonus on top. Volunteers?
--- "To pee or not to pee, that is the question." ---