Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

P2P In 15 Lines of Code

timothy posted more than 9 years ago | from the practice-and-theory dept.

The Internet 418

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."

cancel ×

418 comments

Sorry! There are no comments related to the filter you selected.

hrm.. (5, Funny)

grub (11606) | more than 9 years ago | (#11096702)


Freedom to Tinker has written a 15 line P2P program in Python

Does anyone have a .torrent link for it?

Re:hrm.. (5, Funny)

Anonymous Coward | more than 9 years ago | (#11096805)

it's 9 lines in perl....

#!/usr/bin/perl

fjdohsb0y[tu34qtyjhq5ykl2yjh4u5iongvwy5iopy9uy7u 87 srthmn90;
ps394b7-6vh0ae6se0n89789t75j890t67scj89 067j890e54t 890;
5478n35890904hn907t85j90670w9-57-xfg90hjx;om nxrt9b n0ps54;
s907n-679s-90xe54/6w547/7589vj0s9-78se-06 vw346hbn8 7n98i7eu6;
463g3w6g6v6u45betyv4yc45y4y5s7n86uijy4 63q4awy;
4w57ne568une5j7vc7uyh35xjh7z6jx5uj6ukdtm cdryjtu;
68ne578iyjvyhdrc h6ug37eb64n84mw6m8 s4r6i4rt6;

I was suprised it was so simple! i can not believe i did not think of it already!

Re:hrm.. (1)

javax (598925) | more than 9 years ago | (#11096935)

actually, its ONE line of perl, though that line probably has more than 80 characters...

or in BASH: (4, Funny)

Anonymous Coward | more than 9 years ago | (#11096858)

#! /bin/bash

cd /src/mldonkey/distrib/

# --- start mldonkey ---
./mlnet

Re:hrm.. (1)

bonch (38532) | more than 9 years ago | (#11096965)

I appreciate the author's point in writing this app, but from what I can tell, companies aren't trying to shut down the applications as much as they are going after the individual downloaders and servers that use those applications to trade files illegally. This is what people were recommending these companies do during the Napster trial--don't shut down the whole thing, shut down those individuals doing the infringing.

P2P should always have a place as an excellent distribution method for valid files. The best the copyright holders can do is just watch for their files to appear on these networks and take action. The networks aren't going to enforce themselves, and it doesn't seem like P2P authors are all that interested in implementing enforcement mechanisms (see past comments by Bittorrent's author). It's up to the companies to do it.

Not a good true complexity issue. (2, Interesting)

jellomizer (103300) | more than 9 years ago | (#11096708)

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.

Re:Not a good true complexity issue. (1)

malfunct (120790) | more than 9 years ago | (#11096775)

I think it depends on whether the libraries are commonly available and considered part of the language "framework". If they are then its not really cheating as the amount of work involved is installing the framework (which is necessary to do any development in the language) and writing 15 lines of code.

Of course multiple commands on the same line is cheating, especially in perl where you have to know all the magic to make things compact.

Re:Not a good true complexity issue. (5, Insightful)

wwahammy (765566) | more than 9 years ago | (#11096777)

The point is that a person/entity can create a P2P program with a very small amount of custom code. If someone is going to ban P2P for "inducing" copyright infringement, they'd look stupid for banning a program this small or they'd have to ban the libraries that are used too which is pretty unlikely.

Re:Not a good true complexity issue. (2, Insightful)

SilentChris (452960) | more than 9 years ago | (#11096851)

"they'd look stupid for banning a program this small or they'd have to ban the libraries that are used too which is pretty unlikely."

Uh, why? If a person writes a virus in Visual Basic, no one blames Visual Basic (at least, no one outside techies). Yet the virus itself is clearly harmful. The libraries are just a framework for both good and bad apps.

Unlikely? (4, Insightful)

simpl3x (238301) | more than 9 years ago | (#11096993)

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.

Re:Not a good true complexity issue. (5, Insightful)

grub (11606) | more than 9 years ago | (#11096779)


A p2p app is pretty pointless without a network stack but no one counts that as part of the app or supporting code. Don't pick the nits too much.

Re:Not a good true complexity issue. (0)

Anonymous Coward | more than 9 years ago | (#11096789)

Plus it's not understandable.

Re:Not a good true complexity issue. (0)

Anonymous Coward | more than 9 years ago | (#11096792)

Hasn't this been said enough around here?!?!?

DON'T RE-INVENT THE WHEEL

Importable modules are there specifically to be used (re-used?) like this. I think this guy deserves more credit than you give him.

Re:Not a good true complexity issue. (5, Insightful)

Abcd1234 (188840) | more than 9 years ago | (#11096793)

Umm, you're missing the point. The fact is with commonly available tools, and I'd consider Perl and Python (or Java) with their massive stock libraries "commonly available", one can easily write a p2p app (heck, BitTorrent is written in Python, so I think it's a very valid example).

Hell, by your logic, the following application:

int main(int argc, char **argv)
{
printf("Hello World");
}

is cheating, since I'm using printf, and god knows how complicated that call is, not to mention all the code in the OS to make the text appear on stdout!

China: 15 Lines of Piracy (-1, Troll)

Anonymous Coward | more than 9 years ago | (#11096797)

Posting those 15 lines of Python code may not have been a good idea. The Chinese will take those 15 lines and parlay them into 150 million transfers -- uploads and downloads -- of pirated American software like Windows XP [phrusa.org] .

America has a piracy problem; about 25% of business software is stolen. However, the problem in China is (1) that 95% of software is stolen and (2) most Chinese believe that they are entitled to steal softare (i.e. there is nothing wrong with stealing).

No way, no how is Chinese culture similar to Western culture.

Re:China: 15 Lines of Piracy (0)

Anonymous Coward | more than 9 years ago | (#11096817)

Go away, stupid troll. Take your anti-Chinese rantings elsewhere. We're sick of them and we don't care.

Re:China: 15 Lines of Piracy (-1, Offtopic)

UserGoogol (623581) | more than 9 years ago | (#11096846)

Abusing Tibet is bad.
Abusing Microsoft is good.
Defending Tibet is good.
Defending Tibet by trolling is bad.

Re:Not a good true complexity issue. (1)

BridgeBum (11413) | more than 9 years ago | (#11096809)

While what you say is true, unless your UpperlevelProgrammingLanguage is commonly available, there is a lot of complexity in getting said language to install and work on a large number of systems. Using standard high level languages with standard libraries does cut down on the work to make portable servers available to the masses.

The length of code isn't the real issue here, it's the effort required in writing said server and making it available to others.

Re:Not a good true complexity issue. (5, Insightful)

dtolton (162216) | more than 9 years ago | (#11096814)

I think you are missing the point. The point isn't that you can write a library called p2p and write a a two line python program:

import p2p

p2p.run()

the point is that using standard built in libaries of these languages you can build a fully working p2p system in a very short amount of code.

I do agree though that 15 lines is a bit misleading, although the python program is not putting multiple statements on one line, you can't do that in python. Instead he has removed all whitespace, put all defs and the following body on one line etc.

Again though, the point *isn't* trying to make a program that is highly "pythonic", it isn't. The point is that using basic libraries that have been in Python for years, you can roll a p2p server in 20 minutes.

Re:Not a good true complexity issue. (1)

ipjohnson (580042) | more than 9 years ago | (#11096827)

While I agree there is underlying code written in a multitude of different languages why does it not count?

Maybe it speaks volumes about where our coding languages have gone but the fact that you can write it in 15 lines (or 9 depending on which language you prefer :) just goes to show how easy it really is to write a P2P app with today's modern languages and libraries.

Or are you one of those people that wants to go back to punch card for the authentic programming experience?

Re:Not a good true complexity issue. (3, Insightful)

Johnathon_Dough (719310) | more than 9 years ago | (#11096837)

So? Are they going to have to also make illegal import sys, os, SimpleXMLRPCServer, xmlrpclib, re, and hmac? Or are those going to be on there because they have functions necessary to the OS not related to P2P apps?

I think the point he was trying to make, is that it is too late to ban. Yeah, it would have been more impressive if he had coded it out of 15 lines of 1's and 0's, however, I think showing that you can take a bunch of embedded functions, and write a script that acts as a P2P app is a worthwhile example.

Re:Not a good true complexity issue. (2, Funny)

Anonymous Crowhead (577505) | more than 9 years ago | (#11096894)

Those are both cheating.

Okay, here's p2p in two lines of perl:

#!/usr/bin/perl
`wget http://www.filefront.com/?filepath=/gnutelliums/gt k-gnutella/gtk-gnutella-0.92.1c.tar.gz`;

Re:Not a good true complexity issue. (2, Insightful)

Smidge204 (605297) | more than 9 years ago | (#11096896)

The problem with that comparison is that things like os.py are standard libraries that are used by a very wide selection of programs. The 15 lines here are actually unique, meaningful code specific to the application's task. The libraries are available to everyone. Nobody counts the code in header files as their own.

Your "web browser" example is just invoking another program, and so it doesn't do anything unique or application specific.

So when he says "done in 15 lines of code", it means that all the programmer has to do is type out 15 lines of code, and that using libraries for support functions is pretty much a given.

Unless you're a pedantic shithead, of course.

I will grant you that putting multiple commands on one line is cheating, though. However if the symantics of the language allow you to shorthand multiple actions in a single command then it'sa fair game!
=Smidge=

Re:Not a good true complexity issue. (4, Insightful)

CableModemSniper (556285) | more than 9 years ago | (#11096903)

#!/UpperlevelProgrammingLanguage
Import webserver
Run Webserver
----
What, like this?
#!/usr/bin/env ruby
require 'webrick'
s = WEBrick::HTTPServer.new( :Port => 80, :DocumentRoot => File.join(Dir.pwd, "htdocs")
trap("INT") { s.shutdown }
s.start

Re:Not a good true complexity issue. (5, Funny)

Rheagar (556811) | more than 9 years ago | (#11096907)

It also uses files, which is totally cheating. Without fi.write(), this guy would have to do a lot more work to have the computer convert a virtual address into the a device real address and accessing the filesystem implementation specific rules to carry out the necessary data and metadata operations to complete the task. And thats just the half of it.

Re:Not a good true complexity issue. (0)

Anonymous Coward | more than 9 years ago | (#11096910)

I don't even need a programming language to have a p2p network -- I just run MS Outlook, no need to click on anything, the preview pane does all the work...and there you have it, instant botnet with filesharing capabilities.

Lines of code: zero

Re:Not a good true complexity issue. (0)

Anonymous Coward | more than 9 years ago | (#11096913)

Yes, because nobody ever runs an OS, they are so retro.

Re:Not a good true complexity issue. (1)

jbeaupre (752124) | more than 9 years ago | (#11096934)

Neglecting stuff like OS or processor, how about two categories:
1) Fewest lines (characters) of custom code
2) Smallest compiled code size

Runtime compiled or scripts might only be eligible for the first category.

--warning, cheap joke coming--

Then guys can whip it out and compare sizes like real men.

Re:Not a good true complexity issue. (5, Insightful)

Jerf (17166) | more than 9 years ago | (#11096947)

While what you say is true, I think you are partially missing the point, because what you say is part of the point.

None of the components included in the Python program are specifically P2P. But each of these components are common, powerful, and widely available; almost every, if not every, mainstream language you can think to name has each of these libraries easily available. This isn't news to Prof. Felten, it's an integral part of his point: These readily available libraries, for which no reasonable grounds can be come up with to eliminate them, are trivially combined into a P2P program.

It is not the same as "import webserver; webserver.run()".

Moreover, there is nothing XML-RPC or HMAC specific about the code, really, and you can't ban all RPC libraries, all hashing libraries, etc.

This isn't really a demonstration of the power of Python or anything, and I think Molester sort of misses that point, though turning it into a Perl Golf contest is cool and nerdy and all. (Besides, Pythonistas like me are generally not impressed with such hyper-concision, since one of the reasons we use Python is readability and maintainablity; as a game it is great fun though.) Prof. Felten's point needs to be understood more like an academic proof that a problem is intractable; reduce the problem to something like the halting problem with a 1-to-1 mapping, and you're done. Here, Ed Felten reduces "P2P" to (taking it generically) a language and OS (absolutely vital, can't be banned without banning computers entirely), networking/communication, a bit of string processing (re is convenient but any turing complete language can do that), and a hashing algorithm which probably isn't even vital to the process.

The point is to show that at the core, P2P can't be banned because there really isn't a "P2P" technology, it is an incredibly simple and straightforward application of the basic capabilities of a computer and a network connection. It has already been shown a rough equivalent can be written in Perl, and any number of others will probably pop up now. Languages like C++ or Java probably can't get down to 10 lines, but they will still be simple programs as programs in those languages go.

Re:Not a good true complexity issue. (1)

Corporal Punishment (210982) | more than 9 years ago | (#11096980)

I don't think they are cheating. If you can use the installed libs to create something faster/smaller/quicker than by using some other language, then more power to you. I don't think you should have know the complete TCP/IP handshake process in order to create a network app. Of course if you do understand networking at that level, that's all the better.

Having said that, in python you can create a webserver in two lines of code:


import BaseHTTPServer
BaseHTTPServer.test()


Sorry, couldn't resist. ;)

P2P only works if there are other peers (2, Insightful)

xswl0931 (562013) | more than 9 years ago | (#11096720)

Anyone can write a P2P client, but who will you network with? Not very useful with the other P.

Re:P2P only works if there are other peers (1)

dtolton (162216) | more than 9 years ago | (#11096970)

You can get a nifty little utility for Python called Py2Exe which converts Python code into a native executable file. It will extact all of the relevant libraries and build a fully working stand alone exe file. Seems like it would be pretty easy to build a network this way, people wouldn't even need python to run it.

It could be shorter... (0)

Anonymous Coward | more than 9 years ago | (#11096721)

if whitespace didn't mean something.

BWAGHAHAHA! (-1, Troll)

NoMoreNicksLeft (516230) | more than 9 years ago | (#11096722)

11 bytes of x86 assembly, beat that you l0s3rs!

Size complex? (5, Funny)

stevenbdjr (539653) | more than 9 years ago | (#11096724)

Do Perl developers have some kind of reverse size-compensation complex?

Anything you can do I can do smaller?

Re:Size complex? (1)

RailGunner (554645) | more than 9 years ago | (#11096794)

A better question - is why did he name the perl script after a perpetrator of illegal sexual contact?

Oh - it's not Molester, it's Mole-Ster (like Hulkster, brutha). Hm.

Re:Size complex? (1)

ccharles (799761) | more than 9 years ago | (#11096795)

It's because our penises are so huge.

Disclaimer: I'm not really a PERL developer.

Re:Size complex? (1)

scribblej (195445) | more than 9 years ago | (#11096966)

It's because our pensises are so huge.

Disclaimer: I *am* a Perl developer, ladies.

Re:Size complex? (0)

Anonymous Coward | more than 9 years ago | (#11096990)

Anything you can do [..] ... Perl can do on fewer lines.

can you write hello world... (0, Offtopic)

djeddiej (825677) | more than 9 years ago | (#11096725)

in one line of code? I have seen object oriented versions of hello world... http://laguna.fmedic.unam.mx/~daniel/pygtutorial/p ygtutorial/x101.html Is this a first post?

Re:can you write hello world... (0)

Anonymous Coward | more than 9 years ago | (#11096874)

<?php echo 'Hello, world!'; ?>

Re:can you write hello world... (1)

pseudochaotic (548897) | more than 9 years ago | (#11096912)

It's kind of odd to use a GUI example, isn't it? I would think that making a GUI hello world is a lot more complicated than a normal 'hello world'.

In C#... (1)

Swamii (594522) | more than 9 years ago | (#11096957)

class _{static void Main(){System.Console.WriteLine("Hello world!");}}

Re:can you write hello world... (1)

DrEldarion (114072) | more than 9 years ago | (#11096971)

Very easily:

10 PRINT "Hello World"

P2P Does Not Break the Law (3, Insightful)

phunster (701222) | more than 9 years ago | (#11096729)

P2P Does Not Break the Law
People Do

Re:P2P Does Not Break the Law (5, Insightful)

Anonymous Coward | more than 9 years ago | (#11096813)

The point is that when copyright holders attempt to take action against those people, you all start crying "They're suing children!" So they sue the P2P networks instead, and you start crying "Unfair! Go sue the users!" So they...

Re:P2P Does Not Break the Law (1)

MHobbit (830388) | more than 9 years ago | (#11096954)

Amen.

Re:P2P Does Not Break the Law (2, Insightful)

ad0gg (594412) | more than 9 years ago | (#11097012)

Nuclear bombs don't kill people, people do.

Carson Kressley is Qu... (-1, Offtopic)

The Outer L... (840490) | more than 9 years ago | (#11096732)

...ite the snappy dresser.

Oh and he like it in the ass.

I wrote a 7-line renderer with physics engine... (3, Funny)

Anonymous Coward | more than 9 years ago | (#11096735)

...but it only worked with 1 dimension. I'm working on scaling it up, but I'm worried it might get longer.

Matt Scala? (-1, Offtopic)

Jaysyn (203771) | more than 9 years ago | (#11096737)

Any relation to Anthony Scala?

Jaysyn

Re:Matt Scala? (1)

Reckless Visionary (323969) | more than 9 years ago | (#11096816)

who, this guy [collegesports.com] ?

or did you mean Scalia?

Re:Matt Scala? (1)

RailGunner (554645) | more than 9 years ago | (#11096831)

I doubt there's any relation between Matt Scala and Supreme Court Justice Antonin Scalia.

the script (no karma whoring) (-1, Redundant)

Anonymous Coward | more than 9 years ago | (#11096738)

# 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.SimpleXM LRPCServer)
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
myU,prs,srv = ("http://"+ar[3]+":"+ar[4], ar[5:],lambda x:x.serve_forever())
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"))

You just knew it... (0)

Anonymous Coward | more than 9 years ago | (#11096745)

*Someone* had to respond with a Perl script. I guess the animosity hasn't yet subsided.

When will this code be on a T-shirt? (5, Interesting)

QangMartoq (614688) | more than 9 years ago | (#11096750)

As we saw when the courts tried to ban DeCSS, the code was printed onto t-shirts.

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?

Re:When will this code be on a T-shirt? (3, Funny)

Anonymous Coward | more than 9 years ago | (#11096905)

What a lazy bastard you are! Not only do you think you're entitled to steal music, but you think you're guaranteed a shirt!

It's too much effort to print a lousy t-shirt yourself, but artists shouldn't get paid for their lives' work?

Re:When will this code be on a T-shirt? (1)

LiquidCoooled (634315) | more than 9 years ago | (#11096975)

I could send you a knitting pattern to make your own, but if i do the KIAA will send out a team of attack grannies.

Slashdot editors strike again! (5, Funny)

Anonymous Coward | more than 9 years ago | (#11096752)

I'm Matthew Skala, the author of MoleSter, and my name was spelled correctly in the item I submitted about this.

Re:Slashdot editors strike again! (1, Interesting)

Anonymous Coward | more than 9 years ago | (#11096834)

wtf why did you pick "molester' as the name for your product. how about michaeljacksonster?

Re:Slashdot editors strike again! (1)

greenfly (40953) | more than 9 years ago | (#11096886)

I'd be careful. If this program becomes popular, your name might be the first one to come up when someone searches for "molester" and if people use the app to trade kiddie porn you are in even more trouble :p

I can beat that (5, Funny)

Anonymous Coward | more than 9 years ago | (#11096757)

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.

Bah! That's nothing! (0)

Anonymous Coward | more than 9 years ago | (#11096812)

I have just DESTROYED a MINUS TEN line P2P program!

I'm waiting (0, Offtopic)

stuffduff (681819) | more than 9 years ago | (#11096763)

I'm waiting for the mod chip for my game console.

I bet 13 of those lines... (5, Funny)

Anonymous Coward | more than 9 years ago | (#11096765)

...are dedicated to spyware if its anything like kazaa.

Oh yeah? (1, Funny)

KillerDeathRobot (818062) | more than 9 years ago | (#11096766)

Well I can write "Pointless story" in one line.

A filesharing client named moleSter.. 'molester'? (0)

Anonymous Coward | more than 9 years ago | (#11096784)

umm.. methinks, not the best name for it

Re:A filesharing client named moleSter.. 'molester (0)

Anonymous Coward | more than 9 years ago | (#11096848)

Yeah, I would have called it Michael Jackson.

No Napsta Land (0)

zoftie (195518) | more than 9 years ago | (#11096785)

Sure beats Shawn Fanning's code quality and its cross platform!

Cheaters, both. (-1, Redundant)

The Ape With No Name (213531) | more than 9 years ago | (#11096804)

Look they get to call these 15 or less lines of code because they tightly defined what they can get away with. Yes, but Socket.pm for Perl is:


ape@opica:~$ wc /usr/lib/perl/5.8.4/Socket.pm
229 372 3514 /usr/lib/perl/5.8.4/Socket.pm


I guess I could do the same in some shitty language like VB by just importing a whole program as a library and passing it to "run." Phhhbt.

Re:Cheaters, both. (0)

Anonymous Coward | more than 9 years ago | (#11097004)

By you reckoning, you'd need to write the BIOS code as well - don't nit pick.

MoleSter? (5, Funny)

Mad_Rain (674268) | more than 9 years ago | (#11096806)

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.

Re:MoleSter? (3, Funny)

LiquidCoooled (634315) | more than 9 years ago | (#11097006)

9 line molesters at that.

The most worrying part is on the site, he challenges people to make smaller molester clones.

Oh yeah, I got it in 2 lines of shell: (4, Funny)

Anonymous Coward | more than 9 years ago | (#11096822)

#!/bin/bash
### ToDo: Write P2P app here

Re:Oh yeah, I got it in 2 lines of shell: (0)

Anonymous Coward | more than 9 years ago | (#11096864)

Ofcourse you mean..

#!/bin/sh

if [ $# == 1 ]; then
torrent $0
else
echo "Usage: $0
fi

Re:Oh yeah, I got it in 2 lines of shell: (0)

Anonymous Coward | more than 9 years ago | (#11096873)

Quick, post it to SourceForge!

Re:Oh yeah, I got it in 2 lines of shell: (0)

Anonymous Coward | more than 9 years ago | (#11096920)

What about this, then ?

#!/bin/bash /usr/bin/amule

Yeah he's a laugh riot (0)

Anonymous Coward | more than 9 years ago | (#11096843)

Molestation and child abuse are hee-larious. Keep sending out the laughs, mr funny computer nerd.

He could be liable... (4, Insightful)

vivin (671928) | more than 9 years ago | (#11096847)

But according to this article [theregister.co.uk] from a story [slashdot.org] 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.

Re:He could be liable... (0)

Anonymous Coward | more than 9 years ago | (#11096952)

oh I see...

then I should get rid of this here ftp.exe program?

ThinkGeek (4, Funny)

Lord_Dweomer (648696) | more than 9 years ago | (#11096860)

And cue ThinkGeek tshirt slashvertisement in 5...4...3...

Whose side is he on again? (0, Troll)

Tackhead (54550) | more than 9 years ago | (#11096861)

> Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl."

Senator Orrin Hatch (Disney-Utah) thanked Mr. Scala for helping to prove his point that P2P was all about molestation [wired.com] and vowed to redouble his efforts to eliminate this erototoxin-spreading technology from the face of the earth.

"First Napster - encouraging the taking of naps, a clear incitement to sloth. Now MoleSter - whose purpose is obvious to anyone who reads its name. And these demon-possessed perverts even have languages for it now; they write in 'python' - the language of the Serpent, and they write in 'perl' - a blasphemous reference to the Biblical story of casting pearls before swine. When, oh, when, will our cries be heard? When, oh, when will we be permitted to protect our citizens from such debauchery? When, oh, when, will the check from MPAA and RIAA clear? We must fight terroristm, because it's for the children!"

mod 3Own (-1)

Anonymous Coward | more than 9 years ago | (#11096866)

first avoid going rivalry, and we'@ll do and doing what

Code Size vs. Regulation... (1)

MP3Chuck (652277) | more than 9 years ago | (#11096878)

I don't see the correlation. Were p2p be made illegal(or whatever ... it's hypothetical), it wouldn't really matter whether it was 15 lines or 15 thousand lines.

Baah...that's nothing (3, Funny)

GillBates0 (664202) | more than 9 years ago | (#11096880)

Here's a one-line P2P application I wrote in whitespace [dur.ac.uk] :

/*following code does p2p transfer*/

P2P tattoo (3, Interesting)

Lord_Dweomer (648696) | more than 9 years ago | (#11096882)

So I know that you can encode entire programs on barcodes. Well, could someone have a tattoo with this barcode on it for the program and carry it with them wherever they go? Even a temporary tattoo would be cool. Wearable computing takes on a whole new meaning, plus, you'd never be without access to free media.

Isn't that interesting. (0, Offtopic)

ServerIrv (840609) | more than 9 years ago | (#11096884)

The fact that it's only 15 lines long, doesn't really say anything. How efficient is it? I've fallen into that trap before. Given the same language, a program isn't necessarily more efficient because it has fewer lines. Did you use a vector when a simple array would have worked? Even better, screw using multiple files, because then you don't have to include any inheritance or extra lines for accessing variables in another file. Just create programs with one file. I'm not trying to insinuate that I'm the programming god, but there is sometimes a difference between a well crafted program and a program with a small codebase.

Time for an IOPC.org? (1)

wedgehead (654217) | more than 9 years ago | (#11096891)

Does this mean it's time for an International Obfuscated Python Code Contest? (only slightly obfuscated reference to the International Obfuscated C Code Contest [ioccc.org] )

Duh factor (me, not you) (1, Funny)

JCOTTON (775912) | more than 9 years ago | (#11096897)

Excuse me for asking, but this article implies that you need to have "python" running to use the 15 line code. Here is the command line:

python tinyp2p.py password server hostname portnum [otherurl]

I believe that the python interpreter (i am assuming that it runs like an interpreter) may be larger than 15 lines.
It also assumes that you have a web server running on your box. What other assumptions are unique to this app? That you have a url defined as a domain?

In other words, I really couldn't run this from a DOS prompt, could I? So, it doesn't really count as a "program". Does it compile into an exe? If not, then what is this article talking about?

Re:Duh factor (me, not you) (1)

Jerf (17166) | more than 9 years ago | (#11097009)

In other words, I really couldn't run this from a DOS prompt, could I? So, it doesn't really count as a "program".

I hate to do this but: LOL.

You need to (metaphorically) get out more.

plausible deniability without encryption? (1)

twentycavities (556077) | more than 9 years ago | (#11096926)

Concerning suing users...if someone were to make something like Freenet, only without encryption, would the plausible deniability thing still work? For example, if Soulseek automatically downloaded a Britney Spears song onto my harddrive, then uploaded it to someone else. I'm not really the "true source" of the file, right? Whatever. Discuss!

What about the libraries? (1)

Jerrry (43027) | more than 9 years ago | (#11096940)

15 lines, sure, but how many lines of code are in the libraries it imports? More than a few, I suspect.

Proof of concept... (2, Funny)

d-man (83148) | more than 9 years ago | (#11096964)

...that Perl is a true write-only language.

Must have... (1)

bcrowell (177657) | more than 9 years ago | (#11096978)

...the T-shirt!

Well... (1)

Blue-Footed Boobie (799209) | more than 9 years ago | (#11096988)

Molester? I hardly knew her!

Nice Try, Mr. Felten! (5, Funny)

smug_lisp_weenie (824771) | more than 9 years ago | (#11096994)

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

Gotta love Perl (1)

johansalk (818687) | more than 9 years ago | (#11097010)


Here is the Perl p2p one

$p=shift;$a=shift;i(shift);use Socket;socket S,PF_INET,SOCK_STREAM,6; bind S,&a($a);listen S,5;$/=undef;while(@ARGV&&($_="$p $a f".shift)|| accept(C,S)&&($_=)&&close C){m!^(.*?) (.*?) ([e-i])([^/]*)/(.*)$!s&& $1 eq$p&&&$3($2,$4,$5);}sub e{open F,'>',$_[1];print F $_[2];close F} sub f{&s($_,@_)foreach keys %k}sub g{open(F,');close F}sub h{&s($_[0],$_,'i')foreach keys %k}sub i{$k{ $_[0]}=1}sub a{$_[0]=~/^(.*):(\d+)$/&&$2>2e3&&sockaddr_in($2,in et_aton( $1))}sub s{socket X,PF_INET,SOCK_STREAM,6;$w=shift;if(connect X,&a($w) ){print X "$p $_[0] $_[1]/$_[2]";close X}else{undef $k{$p}}}
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?