diff options
Diffstat (limited to 'nocompile/bin')
-rwxr-xr-x | nocompile/bin/dcchelper | 10 | ||||
-rwxr-xr-x | nocompile/bin/ipdist.sh | 26 | ||||
-rwxr-xr-x | nocompile/bin/nc.perl1.sh | 2 | ||||
-rwxr-xr-x | nocompile/bin/nc.pl | 3 | ||||
-rwxr-xr-x | nocompile/bin/rfc | 8 | ||||
-rwxr-xr-x | nocompile/bin/tpb.sh | 36 |
6 files changed, 85 insertions, 0 deletions
diff --git a/nocompile/bin/dcchelper b/nocompile/bin/dcchelper new file mode 100755 index 0000000..d4f3fc9 --- /dev/null +++ b/nocompile/bin/dcchelper @@ -0,0 +1,10 @@ +#!/bin/sh +hop0="$(hop0 "$1")" +if [ "$hop0" = "192.168.0.2" ];then + if ! printf "%s" "$1" | grep "^192\.168\.0\." 2>&1 >/dev/null;then + IP=$(dig +short armitage.hacking.allowed.org @8.8.8.8) + fi +else + IP=$hop0 +fi +ipconvert "$IP" | grep "^dec: " | cut '-d ' -f2 diff --git a/nocompile/bin/ipdist.sh b/nocompile/bin/ipdist.sh new file mode 100755 index 0000000..ca97696 --- /dev/null +++ b/nocompile/bin/ipdist.sh @@ -0,0 +1,26 @@ +#!/bin/sh +if [ "_$1" = "_" -o "_$2" = "_" ];then + echo "usage: $0 hostA hostB" + exit +fi + +#constants for now. +c=299.792458 #km/ms of light in vacuum +iof=1.4475 #picked the higher of two from wikipedia. +# http://en.wikipedia.org/wiki/Optical_fiber#Index_of_refraction + +ipA=$(gethostbyname "$1") +ipB=$(gethostbyname "$2") +A=$(whob "$ipA" | egrep "^Lat|^Lon" | cut '-d ' -f2 | tr '\n' ' ') +B=$(whob "$ipB" | egrep "^Lat|^Lon" | cut '-d ' -f2 | tr '\n' ' ') +km=$(echo "$A" "$B" \ + | geod +ellps=clrk66 -I +units=km \ + | cut -f3) +ms=$(printf '%s / %s * %s\n' "$km" "$c" "$iof" | bc) + +echo "ipA: $ipA" +echo "ipB: $ipB" +echo "c: $c" +echo "iof: $iof" +echo "km: $km" +echo "ms: $ms" diff --git a/nocompile/bin/nc.perl1.sh b/nocompile/bin/nc.perl1.sh new file mode 100755 index 0000000..cfd8535 --- /dev/null +++ b/nocompile/bin/nc.perl1.sh @@ -0,0 +1,2 @@ +#!/bin/sh +perl -mIO::Socket -e '$socket=IO::Socket::INET->new(PeerAddr=>"$ARGV[0]:$ARGV[1]",Proto=>"tcp",Timeout=>1);if(fork()) {while($l=<stdin>) {print $socket "$l";}} else {while($l=<$socket>) {print $l;}}' $1 $2 diff --git a/nocompile/bin/nc.pl b/nocompile/bin/nc.pl new file mode 100755 index 0000000..ff52ab7 --- /dev/null +++ b/nocompile/bin/nc.pl @@ -0,0 +1,3 @@ +#!/usr/pkg/bin/perl +use IO::Socket; +$s=IO::Socket::INET->new(PeerAddr=>"$ARGV[0]:$ARGV[1]",Proto=>"tcp",Timeout=>1);if(fork()){while($l=<stdin>){print $s $l;}}else{while($l=<$s>){print $l;}} diff --git a/nocompile/bin/rfc b/nocompile/bin/rfc new file mode 100755 index 0000000..56440ae --- /dev/null +++ b/nocompile/bin/rfc @@ -0,0 +1,8 @@ +#!/bin/sh +RFCPATH=/anarchy/rfc +if [ ! -f "${RFCPATH}/rfc$1.txt" ];then + echo "RFC file not found... downloading..." + wget http://www.ietf.org/rfc/rfc$1.txt -O "${RFCPATH}/rfc$1.txt" + echo "RFC has now been downloaded." +fi +less "${RFCPATH}/rfc$1.txt" diff --git a/nocompile/bin/tpb.sh b/nocompile/bin/tpb.sh new file mode 100755 index 0000000..7162b21 --- /dev/null +++ b/nocompile/bin/tpb.sh @@ -0,0 +1,36 @@ +#!/bin/sh +#get magnets based on search. easy. :P +if [ "_$1" = "_" ];then + echo usage: tpb.sh search_term [category] [limit] + echo "categories:" + echo "0 = any" + echo "100 = audio" + echo "200 = video" + echo "300 = applications" + echo "400 = games" + echo "500 = porn" + +else + if [ "_$2" = "_" ];then + cat=0 + else + cat="$2" + fi + if [ "_$3" = "_" ];then + lim=5 + else + lim="$3" + fi +#last number: +#0 = any +#100 = audio +#200 = video +#300 = applications +#400 = games +#500 = porn + wget -qO- 'https://thepiratebay.se/search/'"$1"'/0/99/'"$cat" \ + | tr '"' "\n" \ + | grep ^magnet \ + | decode_html_entities \ + | head -n "$lim" +fi |