Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

uP2P — micro P2P file sharing application

   1  
   2  #!/bin/sh
   3  # uP2P.sh 0.0.1, 436 characters (excluding comments)
   4  [ $3 ]&&export W=$1 H="$2 $3" K=`mktemp`;Z=/dev/null;e(){ echo "$*";};n(){
   5  nc $* 2>$Z;};x(){ nc -lp ${H#* } -e $1 &>$Z <$Z&};f(){ cat $K|while read h;do
   6  e $W $1 "$2"|n $h;done };case $# in 4)e $W s "$4"|n $H|while read h p f; do
   7  e $W g "$f"|n $h $p>"$f";done;;5)e $H>$K;e $W d $H|n $4 $5>>$K;x $0;;0)x $0
   8  read w c r;[ $W = $w ]&&case $c in s)f l "$r";;g)cat "$r";;a)e $r>>$K;;d)cat $K
   9  f a "$r";;l)ls|grep "$r"|sed "s/^/$H /";;esac;;esac


Source: uP2P, mentioned here
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS