Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Downloads
Reply
  #1  
Old 7th August 2012, 00:55
rabtb rabtb is offline
Senior Member
 
Join Date: Aug 2008
Posts: 39
Default janhouse v3
was uploaded to ipt iv only grabbed not tested yet

here is a "guide"

http://pastebin.com/vJUWkb3t
http://pastebin.com/V0VcBMd9

it explain the most important parts how to "install" it .. some parts you can skipe offcouse if you allready have this steps installed

the most important are the cpan part

http://www25.zippyshare.com/v/35389465/file.html
Reply With Quote
The Following 4 Users Say Thank You to rabtb For This Useful Post:
chanclas (11th August 2012), Marco (7th August 2012), rfadown (27th January 2013), ShadowofDeath (26th August 2012)
  #2  
Old 7th August 2012, 05:56
Joe Joe is offline
Senior Member
 
Join Date: Apr 2010
P2P
Posts: 167
Default
You will need to bypass the keys .. I herd once this is done ..its on. This bot is very fast from what I seen . IF anyone here hack it please post the fix.


Code:
#!/usr/bin/env perl
#line 2 "/usr/bin/par.pl"

eval 'exec /usr/bin/env perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell
eval 'exec /usr/bin/env perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

package __par_pl;

# --- This script must not use any modules at compile time ---
# use strict;

#line 161

my ($par_temp, $progname, @tmpfile);
END { if ($ENV{PAR_CLEAN}) {
    require File::Temp;
    require File::Basename;
    require File::Spec;
    my $topdir = File::Basename::dirname($par_temp);
    outs(qq{Removing files in "$par_temp"});
    File::Find::finddepth(sub { ( -d ) ? rmdir : unlink }, $par_temp);
    rmdir $par_temp;
    # Don't remove topdir because this causes a race with other apps
    # that are trying to start.

    if (-d $par_temp && $^O ne 'MSWin32') {
        # Something went wrong unlinking the temporary directory.  This
        # typically happens on platforms that disallow unlinking shared
        # libraries and executables that are in use. Unlink with a background
        # shell command so the files are no longer in use by this process.
        # Don't do anything on Windows because our parent process will
        # take care of cleaning things up.

        my $tmp = new File::Temp(
            TEMPLATE => 'tmpXXXXX',
            DIR => File::Basename::dirname($topdir),
            SUFFIX => '.cmd',
            UNLINK => 0,
        );

        print $tmp "#!/bin/sh
x=1; while [ \$x -lt 10 ]; do
   rm -rf '$par_temp'
   if [ \! -d '$par_temp' ]; then
       break
   fi
   sleep 1
   x=`expr \$x + 1`
done
rm '" . $tmp->filename . "'
";
            chmod 0700,$tmp->filename;
        my $cmd = $tmp->filename . ' >/dev/null 2>&1 &';
        close $tmp;
        system($cmd);
        outs(qq(Spawned background process to perform cleanup: )
             . $tmp->filename);
    }
} }

BEGIN {
    Internals::PAR::BOOT() if defined &Internals::PAR::BOOT;

    eval {

_par_init_env();

if (exists $ENV{PAR_ARGV_0} and $ENV{PAR_ARGV_0} ) {
    @ARGV = map $ENV{"PAR_ARGV_$_"}, (1 .. $ENV{PAR_ARGC} - 1);
    $0 = $ENV{PAR_ARGV_0};
}
else {
    for (keys %ENV) {
        delete $ENV{$_} if /^PAR_ARGV_/;
    }
}

my $quiet = !$ENV{PAR_DEBUG};

# fix $progname if invoked from PATH
my %Config = (
    path_sep    => ($^O =~ /^MSWin/ ? ';' : ':'),
    _exe        => ($^O =~ /^(?:MSWin|OS2|cygwin)/ ? '.exe' : ''),
    _delim      => ($^O =~ /^MSWin|OS2/ ? '\\' : '/'),
);

_set_progname();
_set_par_temp();

# Magic string checking and extracting bundled modules {{{
my ($start_pos, $data_pos);
{
    local $SIG{__WARN__} = sub {};

    # Check file type, get start of data section {{{
    open _FH, '<', $progname or last;
    binmode(_FH);

    my $buf;
    seek _FH, -8, 2;
    read _FH, $buf, 8;
    last unless $buf eq "\nPAR.pm\n";

    seek _FH, -12, 2;
    read _FH, $buf, 4;
    seek _FH, -12 - unpack("N", $buf), 2;
    read _FH, $buf, 4;

    $data_pos = (tell _FH) - 4;
    # }}}

    # Extracting each file into memory {{{
    my %require_list;
    while ($buf eq "FILE") {
        read _FH, $buf, 4;
        read _FH, $buf, unpack("N", $buf);

        my $fullname = $buf;
        outs(qq(Unpacking file "$fullname"...));
        my $crc = ( $fullname =~ s|^([a-f\d]{8})/|| ) ? $1 : undef;
        my ($basename, $ext) = ($buf =~ m|(?:.*/)?(.*)(\..*)|);

        read _FH, $buf, 4;
        read _FH, $buf, unpack("N", $buf);

        if (defined($ext) and $ext !~ /\.(?:pm|pl|ix|al)$/i) {
            my ($out, $filename) = _tempfile($ext, $crc);
            if ($out) {
                binmode($out);
                print $out $buf;
                close $out;
                chmod 0755, $filename;
            }
            $PAR::Heavy::FullCache{$fullname} = $filename;
            $PAR::Heavy::FullCache{$filename} = $fullname;
        }
        elsif ( $fullname =~ m|^/?shlib/| and defined $ENV{PAR_TEMP} ) {
            # should be moved to _tempfile()
            my $filename = "$ENV{PAR_TEMP}/$basename$ext";
            outs("SHLIB: $filename\n");
            open my $out, '>', $filename or die $!;
            binmode($out);
            print $out $buf;
            close $out;
        }
        else {
            $require_list{$fullname} =
            $PAR::Heavy::ModuleCache{$fullname} = {
                buf => $buf,
                crc => $crc,
                name => $fullname,
            };
        }
        read _FH, $buf, 4;
    }
    # }}}

    local @INC = (sub {
        my ($self, $module) = @_;

        return if ref $module or !$module;

        my $filename = delete $require_list{$module} || do {
            my $key;
            foreach (keys %require_list) {
                next unless /\Q$module\E$/;
                $key = $_; last;
            }
            delete $require_list{$key} if defined($key);
        } or return;

        $INC{$module} = "/loader/$filename/$module";

        if ($ENV{PAR_CLEAN} and defined(&IO::File::new)) {
            my $fh = IO::File->new_tmpfile or die $!;
            binmode($fh);
            print $fh $filename->{buf};
            seek($fh, 0, 0);
            return $fh;
        }
        else {
            my ($out, $name) = _tempfile('.pm', $filename->{crc});
            if ($out) {
                binmode($out);
                print $out $filename->{buf};
                close $out;
            }
            open my $fh, '<', $name or die $!;
            binmode($fh);
            return $fh;
        }

        die "Bootstrapping failed: cannot find $module!\n";
    }, @INC);

    # Now load all bundled files {{{

    # initialize shared object processing
    require XSLoader;
    require PAR::Heavy;
    require Carp::Heavy;
    require Exporter::Heavy;
    PAR::Heavy::_init_dynaloader();

    # now let's try getting helper modules from within
    require IO::File;

    # load rest of the group in
    while (my $filename = (sort keys %require_list)[0]) {
        #local $INC{'Cwd.pm'} = __FILE__ if $^O ne 'MSWin32';
        unless ($INC{$filename} or $filename =~ /BSDPAN/) {
            # require modules, do other executable files
            if ($filename =~ /\.pmc?$/i) {
                require $filename;
            }
            else {
                # Skip ActiveState's sitecustomize.pl file:
                do $filename unless $filename =~ /sitecustomize\.pl$/;
            }
        }
        delete $require_list{$filename};
    }

    # }}}

    last unless $buf eq "PK\003\004";
    $start_pos = (tell _FH) - 4;
}
# }}}

# Argument processing {{{
my @par_args;
my ($out, $bundle, $logfh, $cache_name);

delete $ENV{PAR_APP_REUSE}; # sanitize (REUSE may be a security problem)

$quiet = 0 unless $ENV{PAR_DEBUG};
# Don't swallow arguments for compiled executables without --par-options
if (!$start_pos or ($ARGV[0] eq '--par-options' && shift)) {
    my %dist_cmd = qw(
        p   blib_to_par
        i   install_par
        u   uninstall_par
        s   sign_par
        v   verify_par
    );

    # if the app is invoked as "appname --par-options --reuse PROGRAM @PROG_ARGV",
    # use the app to run the given perl code instead of anything from the
    # app itself (but still set up the normal app environment and @INC)
    if (@ARGV and $ARGV[0] eq '--reuse') {
        shift @ARGV;
        $ENV{PAR_APP_REUSE} = shift @ARGV;
    }
    else { # normal parl behaviour

        my @add_to_inc;
        while (@ARGV) {
            $ARGV[0] =~ /^-([AIMOBLbqpiusTv])(.*)/ or last;

            if ($1 eq 'I') {
                push @add_to_inc, $2;
            }
            elsif ($1 eq 'M') {
                eval "use $2";
            }
            elsif ($1 eq 'A') {
                unshift @par_args, $2;
            }
            elsif ($1 eq 'O') {
                $out = $2;
            }
            elsif ($1 eq 'b') {
                $bundle = 'site';
            }
            elsif ($1 eq 'B') {
                $bundle = 'all';
            }
            elsif ($1 eq 'q') {
                $quiet = 1;
            }
            elsif ($1 eq 'L') {
                open $logfh, ">>", $2 or die "XXX: Cannot open log: $!";
            }
            elsif ($1 eq 'T') {
                $cache_name = $2;
            }

            shift(@ARGV);

            if (my $cmd = $dist_cmd{$1}) {
                delete $ENV{'PAR_TEMP'};
                init_inc();
                require PAR::Dist;
                &{"PAR::Dist::$cmd"}() unless @ARGV;
                &{"PAR::Dist::$cmd"}($_) for @ARGV;
                exit;
            }
        }

        unshift @INC, @add_to_inc;
    }
}

# XXX -- add --par-debug support!

# }}}

# Output mode (-O) handling {{{
if ($out) {
    {
        #local $INC{'Cwd.pm'} = __FILE__ if $^O ne 'MSWin32';
        require IO::File;
        require Archive::Zip;
    }

    my $par = shift(@ARGV);
    my $zip;


    if (defined $par) {
        open my $fh, '<', $par or die "Cannot find '$par': $!";
        binmode($fh);
        bless($fh, 'IO::File');

        $zip = Archive::Zip->new;
        ( $zip->readFromFileHandle($fh, $par) == Archive::Zip::AZ_OK() )
            or die "Read '$par' error: $!";
    }


    my %env = do {
        if ($zip and my $meta = $zip->contents('META.yml')) {
            $meta =~ s/.*^par:$//ms;
            $meta =~ s/^\S.*//ms;
            $meta =~ /^  ([^:]+): (.+)$/mg;
        }
    };

    # Open input and output files {{{
    local $/ = \4;

    if (defined $par) {
        open PAR, '<', $par or die "$!: $par";
        binmode(PAR);
        die "$par is not a PAR file" unless <PAR> eq "PK\003\004";
    }

    CreatePath($out) ;
    
    my $fh = IO::File->new(
        $out,
        IO::File::O_CREAT() | IO::File::O_WRONLY() | IO::File::O_TRUNC(),
        0777,
    ) or die $!;
    binmode($fh);

    $/ = (defined $data_pos) ? \$data_pos : undef;
    seek _FH, 0, 0;
    my $loader = scalar <_FH>;
    if (!$ENV{PAR_VERBATIM} and $loader =~ /^(?:#!|\@rem)/) {
        require PAR::Filter::PodStrip;
        PAR::Filter::PodStrip->new->apply(\$loader, $0)
    }
    foreach my $key (sort keys %env) {
        my $val = $env{$key} or next;
        $val = eval $val if $val =~ /^['"]/;
        my $magic = "__ENV_PAR_" . uc($key) . "__";
        my $set = "PAR_" . uc($key) . "=$val";
        $loader =~ s{$magic( +)}{
            $magic . $set . (' ' x (length($1) - length($set)))
        }eg;
    }
    $fh->print($loader);
    $/ = undef;
    # }}}

    # Write bundled modules {{{
    if ($bundle) {
        require PAR::Heavy;
        PAR::Heavy::_init_dynaloader();
        init_inc();

        require_modules();

        my @inc = sort {
            length($b) <=> length($a)
        } grep {
            !/BSDPAN/
        } grep {
            ($bundle ne 'site') or
            ($_ ne $Config::Config{archlibexp} and
             $_ ne $Config::Config{privlibexp});
        } @INC;

        # File exists test added to fix RT #41790:
        # Funny, non-existing entry in _<....auto/Compress/Raw/Zlib/autosplit.ix.
        # This is a band-aid fix with no deeper grasp of the issue.
        # Somebody please go through the pain of understanding what's happening,
        # I failed. -- Steffen
        my %files;
        /^_<(.+)$/ and -e $1 and $files{$1}++ for keys %::;
        $files{$_}++ for values %INC;

        my $lib_ext = $Config::Config{lib_ext};
        my %written;

        foreach (sort keys %files) {
            my ($name, $file);

            foreach my $dir (@inc) {
                if ($name = $PAR::Heavy::FullCache{$_}) {
                    $file = $_;
                    last;
                }
                elsif (/^(\Q$dir\E\/(.*[^Cc]))\Z/i) {
                    ($file, $name) = ($1, $2);
                    last;
                }
                elsif (m!^/loader/[^/]+/(.*[^Cc])\Z!) {
                    if (my $ref = $PAR::Heavy::ModuleCache{$1}) {
                        ($file, $name) = ($ref, $1);
                        last;
                    }
                    elsif (-f "$dir/$1") {
                        ($file, $name) = ("$dir/$1", $1);
                        last;
                    }
                }
            }

            next unless defined $name and not $written{$name}++;
            next if !ref($file) and $file =~ /\.\Q$lib_ext\E$/;
            outs( join "",
                qq(Packing "), ref $file ? $file->{name} : $file,
                qq("...)
            );

            my $content;
            if (ref($file)) {
                $content = $file->{buf};
            }
            else {
                open FILE, '<', $file or die "Can't open $file: $!";
                binmode(FILE);
                $content = <FILE>;
                close FILE;

                PAR::Filter::PodStrip->new->apply(\$content, $file)
                    if !$ENV{PAR_VERBATIM} and $name =~ /\.(?:pm|ix|al)$/i;

                PAR::Filter::PatchContent->new->apply(\$content, $file, $name);
            }

            outs(qq(Written as "$name"));
            $fh->print("FILE");
            $fh->print(pack('N', length($name) + 9));
            $fh->print(sprintf(
                "%08x/%s", Archive::Zip::computeCRC32($content), $name
            ));
            $fh->print(pack('N', length($content)));
            $fh->print($content);
        }
    }
    # }}}

    # Now write out the PAR and magic strings {{{
    $zip->writeToFileHandle($fh) if $zip;

    $cache_name = substr $cache_name, 0, 40;
    if (!$cache_name and my $mtime = (stat($out))[9]) {
        my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) }
            || eval { require Digest::SHA1; Digest::SHA1->new }
            || eval { require Digest::MD5; Digest::MD5->new };

        # Workaround for bug in Digest::SHA 5.38 and 5.39
        my $sha_version = eval { $Digest::SHA::VERSION } || 0;
        if ($sha_version eq '5.38' or $sha_version eq '5.39') {
            $ctx->addfile($out, "b") if ($ctx);
        }
        else {
            if ($ctx and open(my $fh, "<$out")) {
                binmode($fh);
                $ctx->addfile($fh);
                close($fh);
            }
        }

        $cache_name = $ctx ? $ctx->hexdigest : $mtime;
    }
    $cache_name .= "\0" x (41 - length $cache_name);
    $cache_name .= "CACHE";
    $fh->print($cache_name);
    $fh->print(pack('N', $fh->tell - length($loader)));
    $fh->print("\nPAR.pm\n");
    $fh->close;
    chmod 0755, $out;
    # }}}

    exit;
}
# }}}

# Prepare $progname into PAR file cache {{{
{
    last unless defined $start_pos;

    _fix_progname();

    # Now load the PAR file and put it into PAR::LibCache {{{
    require PAR;
    PAR::Heavy::_init_dynaloader();


    {
        #local $INC{'Cwd.pm'} = __FILE__ if $^O ne 'MSWin32';
        require File::Find;
        require Archive::Zip;
    }
    my $zip = Archive::Zip->new;
    my $fh = IO::File->new;
    $fh->fdopen(fileno(_FH), 'r') or die "$!: $@";
    $zip->readFromFileHandle($fh, $progname) == Archive::Zip::AZ_OK() or die "$!: $@";

    push @PAR::LibCache, $zip;
    $PAR::LibCache{$progname} = $zip;

    $quiet = !$ENV{PAR_DEBUG};
    outs(qq(\$ENV{PAR_TEMP} = "$ENV{PAR_TEMP}"));

    if (defined $ENV{PAR_TEMP}) { # should be set at this point!
        foreach my $member ( $zip->members ) {
            next if $member->isDirectory;
            my $member_name = $member->fileName;
            next unless $member_name =~ m{
                ^
                /?shlib/
                (?:$Config::Config{version}/)?
                (?:$Config::Config{archname}/)?
                ([^/]+)
                $
            }x;
            my $extract_name = $1;
            my $dest_name = File::Spec->catfile($ENV{PAR_TEMP}, $extract_name);
            if (-f $dest_name && -s _ == $member->uncompressedSize()) {
                outs(qq(Skipping "$member_name" since it already exists at "$dest_name"));
            } else {
                outs(qq(Extracting "$member_name" to "$dest_name"));
                $member->extractToFileNamed($dest_name);
                chmod(0555, $dest_name) if $^O eq "hpux";
            }
        }
    }
    # }}}
}
# }}}

# If there's no main.pl to run, show usage {{{
unless ($PAR::LibCache{$progname}) {
    die << "." unless @ARGV;
Usage: $0 [ -Alib.par ] [ -Idir ] [ -Mmodule ] [ src.par ] [ program.pl ]
       $0 [ -B|-b ] [-Ooutfile] src.par
.
    $ENV{PAR_PROGNAME} = $progname = $0 = shift(@ARGV);
}
# }}}

sub CreatePath {
    my ($name) = @_;
    
    require File::Basename;
    my ($basename, $path, $ext) = File::Basename::fileparse($name, ('\..*'));
    
    require File::Path;
    
    File::Path::mkpath($path) unless(-e $path); # mkpath dies with error
}

sub require_modules {
    #local $INC{'Cwd.pm'} = __FILE__ if $^O ne 'MSWin32';

    require lib;
    require DynaLoader;
    require integer;
    require strict;
    require warnings;
    require vars;
    require Carp;
    require Carp::Heavy;
    require Errno;
    require Exporter::Heavy;
    require Exporter;
    require Fcntl;
    require File::Temp;
    require File::Spec;
    require XSLoader;
    require Config;
    require IO::Handle;
    require IO::File;
    require Compress::Zlib;
    require Archive::Zip;
    require PAR;
    require PAR::Heavy;
    require PAR::Dist;
    require PAR::Filter::PodStrip;
    require PAR::Filter::PatchContent;
    require attributes;
    eval { require Cwd };
    eval { require Win32 };
    eval { require Scalar::Util };
    eval { require Archive::Unzip::Burst };
    eval { require Tie::Hash::NamedCapture };
    eval { require PerlIO; require PerlIO::scalar };
}

# The C version of this code appears in myldr/mktmpdir.c
# This code also lives in PAR::SetupTemp as set_par_temp_env!
sub _set_par_temp {
    if (defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) {
        $par_temp = $1;
        return;
    }

    foreach my $path (
        (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )),
        qw( C:\\TEMP /tmp . )
    ) {
        next unless defined $path and -d $path and -w $path;
        my $username;
        my $pwuid;
        # does not work everywhere:
        eval {($pwuid) = getpwuid($>) if defined $>;};

        if ( defined(&Win32::LoginName) ) {
            $username = &Win32::LoginName;
        }
        elsif (defined $pwuid) {
            $username = $pwuid;
        }
        else {
            $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM';
        }
        $username =~ s/\W/_/g;

        my $stmpdir = "$path$Config{_delim}par-$username";
        mkdir $stmpdir, 0755;
        if (!$ENV{PAR_CLEAN} and my $mtime = (stat($progname))[9]) {
            open (my $fh, "<". $progname);
            seek $fh, -18, 2;
            sysread $fh, my $buf, 6;
            if ($buf eq "\0CACHE") {
                seek $fh, -58, 2;
                sysread $fh, $buf, 41;
                $buf =~ s/\0//g;
                $stmpdir .= "$Config{_delim}cache-" . $buf;
            }
            else {
                my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) }
                    || eval { require Digest::SHA1; Digest::SHA1->new }
                    || eval { require Digest::MD5; Digest::MD5->new };

                # Workaround for bug in Digest::SHA 5.38 and 5.39
                my $sha_version = eval { $Digest::SHA::VERSION } || 0;
                if ($sha_version eq '5.38' or $sha_version eq '5.39') {
                    $ctx->addfile($progname, "b") if ($ctx);
                }
                else {
                    if ($ctx and open(my $fh, "<$progname")) {
                        binmode($fh);
                        $ctx->addfile($fh);
                        close($fh);
                    }
                }

                $stmpdir .= "$Config{_delim}cache-" . ( $ctx ? $ctx->hexdigest : $mtime );
            }
            close($fh);
        }
        else {
            $ENV{PAR_CLEAN} = 1;
            $stmpdir .= "$Config{_delim}temp-$$";
        }

        $ENV{PAR_TEMP} = $stmpdir;
        mkdir $stmpdir, 0755;
        last;
    }

    $par_temp = $1 if $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/;
}

sub _tempfile {
    my ($ext, $crc) = @_;
    my ($fh, $filename);

    $filename = "$par_temp/$crc$ext";

    if ($ENV{PAR_CLEAN}) {
        unlink $filename if -e $filename;
        push @tmpfile, $filename;
    }
    else {
        return (undef, $filename) if (-r $filename);
    }

    open $fh, '>', $filename or die $!;
    binmode($fh);
    return($fh, $filename);
}

# same code lives in PAR::SetupProgname::set_progname
sub _set_progname {
    if (defined $ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) {
        $progname = $1;
    }

    $progname ||= $0;

    if ($ENV{PAR_TEMP} and index($progname, $ENV{PAR_TEMP}) >= 0) {
        $progname = substr($progname, rindex($progname, $Config{_delim}) + 1);
    }

    if (!$ENV{PAR_PROGNAME} or index($progname, $Config{_delim}) >= 0) {
        if (open my $fh, '<', $progname) {
            return if -s $fh;
        }
        if (-s "$progname$Config{_exe}") {
            $progname .= $Config{_exe};
            return;
        }
    }

    foreach my $dir (split /\Q$Config{path_sep}\E/, $ENV{PATH}) {
        next if exists $ENV{PAR_TEMP} and $dir eq $ENV{PAR_TEMP};
        $dir =~ s/\Q$Config{_delim}\E$//;
        (($progname = "$dir$Config{_delim}$progname$Config{_exe}"), last)
            if -s "$dir$Config{_delim}$progname$Config{_exe}";
        (($progname = "$dir$Config{_delim}$progname"), last)
            if -s "$dir$Config{_delim}$progname";
    }
}

sub _fix_progname {
    $0 = $progname ||= $ENV{PAR_PROGNAME};
    if (index($progname, $Config{_delim}) < 0) {
        $progname = ".$Config{_delim}$progname";
    }

    # XXX - hack to make PWD work
    my $pwd = (defined &Cwd::getcwd) ? Cwd::getcwd()
                : ((defined &Win32::GetCwd) ? Win32::GetCwd() : `pwd`);
    chomp($pwd);
    $progname =~ s/^(?=\.\.?\Q$Config{_delim}\E)/$pwd$Config{_delim}/;

    $ENV{PAR_PROGNAME} = $progname;
}

sub _par_init_env {
    if ( $ENV{PAR_INITIALIZED}++ == 1 ) {
        return;
    } else {
        $ENV{PAR_INITIALIZED} = 2;
    }

    for (qw( SPAWNED TEMP CLEAN DEBUG CACHE PROGNAME ARGC ARGV_0 ) ) {
        delete $ENV{'PAR_'.$_};
    }
    for (qw/ TMPDIR TEMP CLEAN DEBUG /) {
        $ENV{'PAR_'.$_} = $ENV{'PAR_GLOBAL_'.$_} if exists $ENV{'PAR_GLOBAL_'.$_};
    }

    my $par_clean = "__ENV_PAR_CLEAN__               ";

    if ($ENV{PAR_TEMP}) {
        delete $ENV{PAR_CLEAN};
    }
    elsif (!exists $ENV{PAR_GLOBAL_CLEAN}) {
        my $value = substr($par_clean, 12 + length("CLEAN"));
        $ENV{PAR_CLEAN} = $1 if $value =~ /^PAR_CLEAN=(\S+)/;
    }
}

sub outs {
    return if $quiet;
    if ($logfh) {
        print $logfh "@_\n";
    }
    else {
        print "@_\n";
    }
}

sub init_inc {
    require Config;
    push @INC, grep defined, map $Config::Config{$_}, qw(
        archlibexp privlibexp sitearchexp sitelibexp
        vendorarchexp vendorlibexp
    );
}

########################################################################
# The main package for script execution

package main;

require PAR;
unshift @INC, \&PAR::find_par;
PAR->import(@par_args);

die qq(par.pl: Can't open perl script "$progname": No such file or directory\n)
    unless -e $progname;

do $progname;
CORE::exit($1) if ($@ =~/^_TK_EXIT_\((\d+)\)/);
die $@ if $@;

};

$::__ERROR = $@ if $@;
}

CORE::exit($1) if ($::__ERROR =~/^_TK_EXIT_\((\d+)\)/);
die $::__ERROR if $::__ERROR;

1;

#line 1014

__END__
PK

here is the file needs fuzzing with

Bump: Here is a bit of the FTP/folder uploader..


Code:
Part of the "FTP to Tracker" feature for uploader is option to add folders to uploader even if they were not downloaded from other tracker (and added to database before).

This is new and some function names could change a lot. And this is considered not so stable at the moment. :)

Feature is available from revision >133.

    To use it, function add_* must be added to your include/upload_*.pm file. (Replace * with your upload tracker code.)

    Folder/file you are trying to add must be located in your download_dir.

    Passing the folder to the uploader can be done using announce-helper (tuper.sh). Do it by: ./tuper.sh add category folder-name optional-upload-tracker
    For example: ./tuper.sh "TV-EN" "David.Attenborough.Frozen.Planet.S01E04.720p.HDTV.x264-FTP" xxx

(To see what announce-helper is sending to tuper-client, view announce-helper.pl)

Here is sample add_xxx function:
(I know, it is a bit messy at the moment, it will get better once some feedback is generated.)

sub add_xxx {
    my $category_name=shift;
    my $directory=shift;
    my $config=shift;

    my $to_tracker="xxx";
    my $directory_path=$config->{paths}->{download_dir}.$directory;

    #################################
    # Loading ClientFunctions class that has useful client functions
    my $r=ClientFunctions->new('upload', $to_tracker, $config);

    #################################
    # Checking if folder exists in downloads directory
    my $notsingle=0;
    if(-d $directory_path){
        $r->err("Found directory $directory to add");
        $notsingle=1;
    }elsif(-d $directory_path){
        $r->err("Found single file $directory to add");
    }else{
        $r->err("Found no files to add, aborting!", "red"); return 0;
    }

    #################################
    # Look for NFO
    my $nfo="";
    if($notsingle){
        $r->err("Looking for NFO file");
        my $upl_data_dir = $directory_path;
        my $new_nfo="";
        opendir(DIR, $upl_data_dir);
        my @files = readdir(DIR);
        for my $file (@files)
        {
            $file eq '.'  and next;
            $file eq '..' and next;
            if( $file =~ /\.nfo$/i ){
                $new_nfo=$upl_data_dir.'/'.$file;
                $r->err("NFO file found: ".$new_nfo);
                last;
            }
        }
        if($new_nfo eq ""){
            $nfo=$config->{tuper}->{no_descr_txt};
            $r->err("Failed to find original NFO...");
        }else{
            if($nfo=$r->read_file($new_nfo)){
                $r->err("Succeeded finding original NFO...");
            }else{
                $r->err("Found NFO file but failed to read it...");
            }            
        }
    }else{
        $nfo=$config->{tuper}->{no_descr_txt};
    }
    my $description=$nfo;

    #################################
    # Set up name
    my $name=$directory;
    my $filename=$directory;

    #################################
    # Create torrent
    my $torzname=$config->{paths}->{temp_dir}.$filename.".torrent";
    my $anauns="http://example.com";
    if(defined $config->{cookies}->{"announce_".$to_tracker}){
        $anauns=$config->{cookies}->{"announce_".$to_tracker};
    }
    if(-f $torzname){
        @argz=($torzname);
        system "rm", @argz;
    }
    # Checking path size
    my $size=$r->path_size($directory_path);
    # Picking piece size for mktorrent
    my $piece_size=$r->mktorrent_piece_size($size);
    # Building torrent
    @argz=('-p', '-v', '-l', $piece_size, '-a', $anauns, '-o', $torzname, $directory_path);
    $r->err("mktorrent ".join(' ', @argz));
    system "mktorrent", @argz;

    if(not -f $torzname){
        $r->err("Can't find the new torrent file, aborting."); return 0;
    }
    $r->err("Finished making torrent...");

    #################################
    # Getting info hash to add to the database

    my $torrent_data=$r->read_file($torzname);
    my $torrent_info=$r->process_torrent_data($torrent_data);
    if(not $torrent_info->{'hash'}){ $r->err('Failed to get info hash. Is the torrent broken?'); return 0; }
    my $down_hash=lc($torrent_info->{'hash'});

    ###################################
    # Writing temp files
    # Write NFO file
    my $nfo_file=$config->{paths}->{temp_dir}.$filename.".nfo";
    if($r->write_file('nfo', $nfo_file, $nfo)==0){ return 0; }
    # Wrtie description file
    my $descr_file=$config->{paths}->{temp_dir}.$filename.".txt";
    if($r->write_file('description', $descr_file, $description)==0){ return 0; }

    my $torr_file=$torzname;

     my $target_cat_name=$category_name;
     my $category_id=0;
     eval " \$category_id = &cat_ftp_srv1_".$to_tracker."(\$target_cat_name); ";
     if($category_id==0)
         { $r->err("Failed to find target tracker ($to_tracker) category ID for source tracker ($source) category name '$target_cat_name'.\nResponse was: $category_id", 'red'); return 0; }
     $r->err("Category ID for $target_cat_name on $to_tracker => $category_id");
     my $category=$category_id;

    my %retvals=(
        "name" => $name,
        "descr" => $description,
        "filename" => $filename,
        "category" => $category,
        "nfo_file" => $nfo_file,
        "descr_file" =>  $descr_file,
        "torrent_data" => $torrent,
        "down_hash" => $down_hash,
    );
    return \%retvals;

}


And in your category conversion file (upload_*.config.pm) create the conversion function with all the categories that are there:

sub cat_ftp_srv1_xxx{
        my $veids=shift;
        my %cat=(
"0-Day" => 5,
"DVDR-DE" => 20,
"Games-PS2" => 13,
        );
        return &JhUp::find_hash_value(0, $veids, \%cat);
}

This is just temporary but to wrap it all up to auto upload from FTP server, create ftp-wrapper.sh:

#!/bin/sh
[ $# -lt 3 ] && { echo "Usage: $0 [add/aadd] [category] [name]" ; exit 1; }
cd /home/tup/downloads/ && 
lftp -u "username,password" -p 21 -e "cd  $2 && mirror $3; quit" sample.com
cd /home/tup/tuper/
./tuper.sh $1 $2 $3

Edit it as needed. In this case it assumes that directories in root are named after categories.
Reply With Quote
The Following 2 Users Say Thank You to Joe For This Useful Post:
Marco (7th August 2012), rfadown (27th January 2013)
  #3  
Old 15th August 2012, 00:34
Mafiotulcata Mafiotulcata is offline
Member
 
Join Date: Apr 2010
P2P
Posts: 1
Default
@rabtb Can you please upload the second guide again?
Thanks.

@Joe As I studied the source code the variables username and key in tuper.conf is just for misleading.
I maybe get this work if I can get the second guide...
Reply With Quote
  #4  
Old 15th August 2012, 13:09
Joe Joe is offline
Senior Member
 
Join Date: Apr 2010
P2P
Posts: 167
Default
http://pastebin.com/isSwAmBn
Reply With Quote
The Following 2 Users Say Thank You to Joe For This Useful Post:
rfadown (27th January 2013), ShadowofDeath (26th August 2012)
  #5  
Old 27th January 2013, 12:29
rfadown rfadown is offline
Member
 
Join Date: Aug 2012
P2P
Posts: 11
Default
Does anyone make this script work with cygwin? I get this error message

Code:
$ ./run-tuper-client.sh
Loading announce-client...
Loaded...
Shutting down...
Initiating...
Tuper client PID: 2368
Checking if any changes are needed after last update.
Checking if tuper.db needs changes.
Shutting down...
ERROR! DBI bind_columns: invalid number of arguments: got handle + 0, expected h
andle + between 1 and -1
Usage: $h->bind_columns(\$var1 [, \$var2, ...]) at /usr/lib/perl5/site_perl/5.14
/i686-cygwin-threads-64int/DBI.pm line 2047.
Tuper fell and died. Waiting few seconds before continuing...
Tuper client closed. Reopening...
Please help me. Thanks a lot!
Reply With Quote
  #6  
Old 12th April 2013, 23:43
Ryyu Ryyu is offline
Member
 
Join Date: Apr 2013
P2P
Posts: 5
Default
Did anyone get this script working at all?
Heard that you still need access to specific files to make it work and you can only get this access by paying?

Anyone able to shed any light on this?

If so, I'd love to hear how you did it! I've been madly searching for a good auto upload script for my tracker!
Reply With Quote
  #7  
Old 13th April 2013, 11:57
mat22 mat22 is offline
Senior Member
 
Join Date: Jun 2009
Latvia
Posts: 119
Default
Haven't heard that anyone has got this version working without paying but I might be wrong. Biggest problem is - I sent Janhouse e-mail asking for current price and can I get uploader (by buying it) about 2 months ago and I still haven't received an answer.
Reply With Quote
  #8  
Old 15th April 2013, 11:53
firefly007's Avatar
firefly007 firefly007 is offline
SUPPORT GURU
 
Join Date: Jun 2010
P2P
Posts: 721
Default
Quote:
Originally Posted by mat22 View Post
Haven't heard that anyone has got this version working without paying but I might be wrong. Biggest problem is - I sent Janhouse e-mail asking for current price and can I get uploader (by buying it) about 2 months ago and I still haven't received an answer.
The pricing is on his site.
__________________




Please Support Majority Report


You can contact me on Skype live:phesadent.elect but please let me know first.


If you are ever need me desperately then please email me at dan.oak44@gmail.com and I will contact u within a week.


Due to free time I'm able to help interested member's with their tracker.

Please Note!
Depending on your requests I will charge you for my assistance for Tracker installs and mods.
All my mods are custom and prices will very depending on the request.
I'm able to install any tracker and mods including themes.

Please PM me

Reply With Quote
  #9  
Old 16th April 2013, 12:02
LeeHowarth LeeHowarth is offline
TT
 
Join Date: Nov 2008
Posts: 100
Default
Quote:
Originally Posted by mat22 View Post
Haven't heard that anyone has got this version working without paying but I might be wrong. Biggest problem is - I sent Janhouse e-mail asking for current price and can I get uploader (by buying it) about 2 months ago and I still haven't received an answer.
visit dentoo.net you will get a quick response and v4 is better
Reply With Quote
  #10  
Old 16th April 2013, 14:14
Joe Joe is offline
Senior Member
 
Join Date: Apr 2010
P2P
Posts: 167
Default
PHP Code:
 Setup
Linux

Torrent auto uploader by Janhouse can probably be used on any Linux distribution 
(and it has been tested on CentOSvarious Debian and Ubuntu versions and ArchLinuxbut this guide explains setup on Debian based distributions (Debian and Ubuntu). If you are experienced enoughyou can probably set it up on other distributions as well.
Dependencies

While the Torrent Uploader (Tuperdepends on Perl and various Perl modulessome bittorrent client is needed for actual downloading and uploading, and web server with PHP is required to use Web panel and browser pluginUploader is made to work better with rTorrent bittorrent client. And for the sake of simpleness of the setupApache2 will be used as the web server.

If 
you are on a freshly installed boxmake sure you first install sudo as user root.

apt-get update
apt
-get install sudo

Then install other dependencies that will be needed to compile rtorrent 
and perl modules.

If 
some of the following packages doesn't exist (e.g. mktorrent or rar, you can remove them from the list and continue on, they are needed only for auto extract feature). While all of them should be there for later Ubuntu versions, Debian needs to have non-free and contrib repositories enabled. You can Google how to do it, or use this How To .

If you are on older Debian version, like Debian Lenny, PHP 5.3 won'
t be in the package list. In this case you can use Dotdeb repositoryInsturctions on adding it are here .

sudo apt-get update
sudo apt
-get install subversion build-essential libtool automake openssl libsigc++-2.0-dev libncurses5-dev libncursesw5-dev libcurl4-openssl-dev libcppunit-dev irssi screen apache2 libapache2-mod-php5 php5 php5-sqlite libapache2-mod-scgi php5-xmlrpc git-core rar mktorrent libxml-parser-perl libexpat1-dev unzip

Install Perl modules using cpan
.

Uploader needs these Perl modulesConfig::Tiny Convert::Bencode Date:arse DBI DBD::SQLite Digest::SHA1 HTML::Strip IO::Async IO::Async::SSL JSON::XS Net::BitTorrent::File PAR URI::Escape WWW::Curl XML::RPC XML::Simple String::CRC32 Encode LWP LWP::UserAgent LWP:rotocol::https HTTP::Cookies HTTP::Cookies::Netscape HTTP::Request HTTP::Request::Common URI Net::RTorrent::Socket XML:arser

First time starting cpan it will ask 
if you want it to configure automaticallyJust press enter to accept default value (yes).

cpan

After it successfully configures cpan
cpan shell will open.

cpan[1]>

In itexecute the following commandIt will keep asking if it should connect to the internet or install some additional modulesJust accept the default values by pressing enter.

force install Config::Tiny Convert::Bencode Date:arse DBI DBD::SQLite Digest::SHA1 HTML::Strip IO::Async IO::Async::SSL JSON::XS Net::BitTorrent::File PAR URI::Escape WWW::Curl XML::RPC XML::Simple String::CRC32 Encode LWP LWP::UserAgent LWP:rotocol::https HTTP::Cookies HTTP::Cookies::Netscape HTTP::Request HTTP::Request::Common URI Net::RTorrent::Socket


To quit cpan shell
after everything is installed, use "quit" command.

Compiling rTorrent

Let
's make source directory

cd ~/
mkdir src

Following are instructions for compiling rTorrent with xmlrpc-c from SVN.
If errors come up during the setup, instead of SVN version, try using the stable version that can be downloaded from rTorrent web page .
Or you could use pyroscope setup script that will get all the dependencies and install rTorrent with some additional patches for the user that executes the script. (This could help for older outdated distribution versions). Guide can be found here .

Installing stable rTorrent:

Install libtorrent

wget http://libtorrent.rakshasa.no/...orrent-0.12.9.tar.gz
tar zxvf libtorrent-0.12.9.tar.gz
cd libtorrent-0.12.9
./autogen.sh
./configure
make
sudo make install
cd ../

Install xmlrpc-c

svn co https://xmlrpc-c.svn.sourcefor...oot/xmlrpc-c/stable/ xmlrpc-c-svn
cd xmlrpc-c-svn
./configure --disable-cplusplus
make
sudo make install
cd ../

Install rtorrent with xmlrpc-c support

wget http://libtorrent.rakshasa.no/...torrent-0.8.9.tar.gz
tar zxvf rtorrent-0.8.9.tar.gz
cd rtorrent-0.8.9
./autogen.sh
./configure --with-xmlrpc-c
make
sudo make install
echo "include /usr/local/lib" | sudo tee -a /etc/ld.so.conf
sudo ldconfig
cd ../

Apache (web panel)

Enable mod_scgi by executing following command.

sudo a2enmod scgi

Add SGCI mounts to /etc/apache2/httpd.conf

SCGIMount /rt1 127.0.0.1:5000
SCGIMount /rt2 127.0.0.1:5001

Create user that will be running Tuper and rTorrent. You can use whatever username and home directory you like but default configuration files use user "tup" with home directory /home/tup/ .

sudo adduser tup

Add Apache alias to default virtualhost by editing /etc/apache2/sites-available/default .
Web files will be located in /home/tup/www/ directory.
Add the following lines after "DocumentRoot" line.

  Alias /auto/ "/home/tup/www/"
  <Directory "/home/tup/www/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all
  </Directory>

Create the web directory and set up permissions. Since Apache2 on Debian and Ubuntu runs from user www-data, chown it to that user.

sudo mkdir -p /home/tup/www
sudo chown www-data:tup /home/tup/www
sudo chmod g+rxw /home/tup/www

Restart Apache2. See if any errors come up. If there are errors, fix them and repeat the command.

sudo /etc/init.d/apache2 restart

If you now navigate to http://YOUR_HOST/auto/ , you should see empty directory index.

Edit /etc/sudoers file, to allow www-data to execute rTorrent and Tuper status scripts as user tup without entering password.

www-data ALL=(tup) NOPASSWD: /home/tup/tuper/status.sh, /home/tup/tuper/start-screen.sh

Getting Tuper from SVN

Login as user tup (you can switch to it quickly by doing "sudo -i -u tup").

Check out tuper, web_panel and browse_plugin folders from SVN.
SVN client will ask for password for user "tup". Do not enter it and press enter, it will then ask for different username. Enter your SVN username and password.

cd /home/tup
svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/tuper/ tuper/
svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/web_panel/ www/web_panel/
svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/browser_plugin/ www/browser_plugin/

Configuring Tuper

Create needed directories and configuration files.

For Tuper to store .torrent files, .nfo, database and cookiejar:

mkdir -p storage/store

Session directories for rtorrent, downloads and watch directories:

mkdir .session1
mkdir .session2
mkdir downloads
mkdir storage/watch1
mkdir storage/watch2

... must finish.

cd tuper
mv default.tuper.conf tuper.conf
mv default.tuper.db ../storage/tuper.db
mv default.tuper.filter.conf tuper.filter.conf

cd ../www/web_panel
mv default.config.inc.php config.inc.php

cd ../browser_plugin
mv default.upload_plugin_config.php upload_plugin_config.php

Add username and key in /home/tup/tuper/tuper.conf and you should be able to run it.

Ok you dont need a pin or anything for this .. All you need is to make sure those keys ( pin ) match in the browser plugin an the tup.config an if you need help ask I will sort it out I used it an have all the details 
second guide


PHP Code:
This guide assumes a few things:
Ubuntu 10.04
You are connecting via Putty
After you are done editing via nano you know to hit Ctrl-OEnterCtrl-X
This is on a remote server by OVHLeaswebetc... and you have root access
You are not retarded and can follow insructions :)
You know this will not setup all configurations for your specific site and/or your sourcesThis is a stepping stone.
You do not have to do all of the things in this guide if you do not want toPick and choose if youd like.
 
This guide shows you how to setup and configure for:
Setup root passwordDelete Authorized KeysUpdate System
Add user tupSet visudo permissions
SSH setup
Windows Auto Logon SSH Tunnel
Install Packages
Setup tinyproxy (Proxy server to hide your IP, and this setup does so as Anonymous)
Ubuntu Desktop Gnome No Recommended Packages
FreeNX
CPAN (for tuper client)
Tuper Client
rTorrent libtorrent xmlrpc
ruTorrent
Apache
Webmin
FTP (SFTP only)
Linux Firewall
Fail2Ban
 
This guide is just an edit to a thread I made on T-II just added Jans Wiki to it for the auto uploader.
This guide is for those having troubles understanding how servers work and/or are new to Linux.
There are manymany ways to configure a server with the packages in this guide. If you have a better/newer/easier way for any of them leave a comment and maybe it will replace mine.
- ...and 
lastly I hope this helps most n00bs in setting up thier servers and getting that much closer to learning how tuper works.
I lied....and now lastly....Thank You Jans for the awesome uploader, and to dent and all other who help out as well in forums in problem solving/reporting. :)
 
Now....On with the show....
 
#Setup root password, Delete Authorized Keys, Update System
sudo passwd
ls .ssh/authorized_keys2
rm .ssh/authorized_keys2
apt-get update && apt-get upgrade
apt-get clean && apt-get autoclean
 
#Add user tup, Set visudo permissions
adduser tup
visudo
root ALL
=(ALLALL
tup ALL
=(ALLNOPASSWDALL
www
-data ALL=(ALLNOPASSWDALL
nx ALL
=(ALLNOPASSWDALL
 
#SSH setup
sudo nano /etc/ssh/sshd_config
Port 22002
Protocol 2
PermitRootLogin no
X11Forwarding no
UseDNS no
AllowUsers tup
sudo service ssh reload
 
#Windows Auto Logon SSH Tunnel
 
MyEnTunnel
 
On your Windows machine open your internet browser 
and go to
http
://nemesis2.qx.net/pages/MyEnTunnel
Scroll down and download the latest Stable version.
 
-
Install it as Windows Service
-Open MyEnTunnel
-Click the settings tab
-Set your settings as if it were Putty
SSH Server 
= <Server IP address>
SSH Port = <Servers SSH Port>
Username = <Your Normal User on the Server>
Passphrase = <Your Normal User's Password on the Server>
Port = <Whatever port you want your tunnel to be under. I set mine to the same as the SSH Port on the server for less confusion>
-Check mark whatever boxes youd like. Enable Dynamic Socks MUST be checked.
 
Other notable ones would be:
 
Connect on Startup
Reconnect on Failure
Infinite Retry Attempts
 
-Click Connect, and after it has connected click Save, and then Hide. Now it is in your systray, and will always auto reconnect if dropped.
-Any program you want to use this tunnel (Firefox, uTorrent, mIRC, etc...) you must set it to use a SOCKS5 proxy with the IP address of 127.0.0.1 and the Port for
 
whatever you chose MyEnTunnel to use.
 
#Install Packages
- sudo apt-get update && sudo apt-get upgrade
- sudo apt-get clean && sudo apt-get autoclean
- sudo apt-get install apache2 apache2.2-common apache2-utils aptitude apt-show-versions autoconf automake autotools-dev binutils build-essential bzip2 ca-certificates comerr-dev cpp cpp-4.1 curl dpkg-dev fail2ban file firestarter g++ g++-4.1 gawk gcc gcc-4.1 git-core htop irssi libapache2-mod-php5 libapache2-mod-scgi libapr1 libaprutil1 libapt-pkg-perl libauthen-pam-perl libc6-dev libcppunit-dev libcurl3 libcurl4-openssl-dev libexpat1 libexpat1-dev libidn11 libidn11-dev libkdb5-4 libgssrpc4 libkrb5-dev libmagic1 libncurses5 libncurses5-dev libncursesw5-dev libneon26 libnet-ssleay-perl libpam-runtime libio-pty-perl libpcre3 libpq5 libsigc++-2.0-dev libsqlite0 libsqlite3-0 libssl-dev libssp0-dev libstdc++6-4.1-dev libsvn1 libtool libwww-perl libxml2 libxml-parser-perl linux-libc-dev lynx m4 make mktorrent mime-support ntp ntpdate openssl patch perl perl-base perl-modules php5 php5-cgi php5-cli php5-common php5-curl php5-dev php5-geoip php5-sqlite php5-xmlrpc pkg-config python python-minimal python-scgi rar screen sqlite ssl-cert subversion tinyproxy ucf unrar unzip zlib1g-dev
 
#Setup tinyproxy
- sudo apt-get update && sudo apt-get upgrade
- sudo apt-get clean && sudo apt-get autoclean
- sudo nano /etc/tinyproxy.conf
Port 32002
BindSame yes
ErrorFile 404 "/usr/share/tinyproxy/404.html"
ErrorFile 400 "/usr/share/tinyproxy/400.html"
ErrorFile 503 "/usr/share/tinyproxy/503.html"
ErrorFile 403 "/usr/share/tinyproxy/403.html"
ErrorFile 408 "/usr/share/tinyproxy/408.html"
LogLevel Critical
XTinyproxy No
Allow 127.0.0.1
Allow XXX.XXX.XXX.XXX
DisableViaHeader Yes
#ConnectPort 443
#ConnectPort 563
- sudo service tinyproxy start
 
#Ubuntu Desktop - Gnome No Recommended Packages
- sudo apt-get update && sudo apt-get upgrade
- sudo apt-get clean && sudo apt-get autoclean
- sudo aptitude install --without-recommends ubuntu-desktop
 
#FreeNX
- sudo apt-get update && sudo apt-get upgrade
- sudo apt-get clean && sudo apt-get autoclean
- sudo add-apt-repository ppa:freenx-team
- sudo apt-get install python-software-properties
- sudo apt-get install freenx
- wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz
- tar xvf nxsetup.tar.gz
sudo cp nxsetup /usr/lib/nx/nxsetup
- sudo /usr/lib/nx/nxsetup --install
 
Now install NXclient on your home machine and connect through your SSH port
#Unlimited Open Files
- su root
- nano /etc/pam.d/su
session required pam_limits.so
- nano /etc/security/limits.conf
 
    soft nofile 100000
    hard nofile 100000
    -reboot
 
#CPAN
-sudo cpan
 
Hit Enter when asked to accept defaults
 
-force install Config::Tiny Convert::Bencode Date::Parse DBI DBD::SQLite Digest::SHA1 HTML::Strip IO::Async IO::Async::SSL JSON::XS Net::BitTorrent::File PAR URI::Escape WWW::Curl XML::RPC XML::Simple String::CRC32 Encode LWP LWP::UserAgent LWP::Protocol::https HTTP::Cookies HTTP::Cookies::Netscape HTTP::Request HTTP::Request::Common URI Net::RTorrent::Socket ExtUtils::Constant Socket
 
Hit Enter to accept and install and other dependency modules when asked
 
-exit
 
#Tuper Client
- cd /home/tup
- svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/tuper/ tuper/
- svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/web_panel/ www/web_panel/
- svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/browser_plugin/ www/browser_plugin/
 
When asked for SVN user and pass enter them.
Store them if youd like as well.
 
- mkdir storage
- cd storage && mkdir store watch1 watch2 && cd ~
- mkdir .session1 .session2 downloads
- cd tuper
- mv default.tuper.conf tuper.conf
- mv default.tuper.db ../storage/tuper.db
- mv default.tuper.filter.conf tuper.filter.conf
- cd ../www/web_panel
- mv default.config.inc.php config.inc.php
- cd ../browser_plugin
- mv default.upload_plugin_config.php upload_plugin_config.php
- nano upload_plugin_config.php
 
Change the password to something storng, for example:
$access_key="EK&fY308VfdP";
 
- nano /home/tup/tuper/tuper.conf
 
Add your username and key given to you by Jans:
username=
key=
 
#rTorrent - libtorrent - xmlrpc
- cd ~ && mkdir apps && cd apps
- svn co https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced xmlrpc-c
- wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.2.tar.gz
- wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.9.2.tar.gz
- tar zxfv libtorrent-0.13.2.tar.gz
- tar zxfv rtorrent-0.9.2.tar.gz
- cd xmlrpc-c
- ./configure && make && sudo make install
- cd ../libtorrent-0.13.2
- ./configure && make && sudo make install
- cd ../rtorrent-0.9.2
- ./configure --with-xmlrpc-c && make && sudo make install
- sudo ldconfig && cd ..
- rm *.tar.gz
- cd ~ && mkdir rtorrent && cd rtorrent
- mkdir .session downloads torrents
- cd ~ && nano .rtorrent.rc
#bind = 127.0.0.1
#ip = 127.0.0.1
encryption=allow_incoming,try_outgoing,enable_retry
upload_rate = 30000
download_rate = 95000
use_udp_trackers = no
 
min_peers = 500
max_peers = 500
min_peers_seed = 100
max_peers_seed = 500
max_uploads = 300
 
directory = /home/tup/downloads/
session = /home/tup/.session1/
 
schedule = watch_directory,5,5,load_start=/home/tup/storage/watch1/*.torrent
schedule = tied_directory,5,5,start_tied=
schedule = untied_directory,5,5,close_untied=
 
system.method.set_key = event.download.inserted_new,mark_start,"execute=/home/tup/tuper/tuper.sh,astatus,started,$d.get_hash="
system.method.set_key = event.download.finished,mark_fin,"execute=/home/tup/tuper/tuper.sh,astatus,uploaded,$d.get_hash="
system.method.set_key = event.download.finished,notify_me,"execute=/home/tup/tuper/tuper.sh,aupload,$d.get_hash="
system.method.set_key = event.download.erased,mark_erase,"execute=/home/tup/tuper/tuper.sh,adel,down,$d.get_hash="
 
port_range = 21006-21010
check_hash = no
encryption = allow_incoming,enable_retry,prefer_plaintext
 
#hash_read_ahead = 8
#hash_max_tries = 5
#hash_interval = 10
 
    Enable the default ratio group.
    ratio.enable=
 
    Change the limits, the defaults should be sufficient.
    ratio.min.set=120
    ratio.max.set=200
    ratio.upload.set=20M
 
    Changing the command triggered when the ratio is reached.
    system.method.set = group.seeding.ratio.command, d.erase=
 
scgi_port = localhost:5000
#scgi_local = /home/tup/rpc.socket
 
dht = disable
 
peer_exchange = no
 
- nano .rtorrent2.rc
#bind = 127.0.0.1
#ip = 127.0.0.1
encryption=allow_incoming,try_outgoing,enable_retry
upload_rate = 95000
download_rate = 15000
use_udp_trackers = no
 
min_peers = 500
max_peers = 500
min_peers_seed = 500
max_peers_seed = 500
max_uploads = 500
 
directory = /home/tup/downloads/
session = /home/tup/.session2/
 
schedule = watch_directory,5,5,load_start=/home/tup/storage/watch2/*.torrent
schedule = tied_directory,5,5,start_tied=
schedule = untied_directory,5,5,close_untied=
 
system.method.set_key = event.download.inserted_new,mark_seeded,"execute=/home/tup/tuper/tuper.sh,astatus,seeded,$d.get_hash="
system.method.set_key = event.download.erased,mark_erase,"execute=/home/tup/tuper/tuper.sh,adel,up,$d.get_hash="
 
port_range = 21001-21005
check_hash = no
encryption = allow_incoming,enable_retry,prefer_plaintext
 
#hash_read_ahead = 8
#hash_max_tries = 5
#hash_interval = 10
 
    Enable the default ratio group.
    #ratio.enable=
 
    Change the limits, the defaults should be sufficient.
    ratio.min.set=850
    ratio.max.set=1200
    ratio.upload.set=250M
 
    Changing the command triggered when the ratio is reached.
    system.method.set = group.seeding.ratio.command, d.erase=
 
scgi_port = localhost:5001
#scgi_local = /home/tup/rpc.socket
 
dht = disable
 
peer_exchange = no
- screen dmS rtorrent1 rtorrent -n -o import=~/.rtorrent.rc
screen -dmS rtorrent2 rtorrent -n -o import=~/.rtorrent2.rc
 
#ruTorrent
- cd ~ && mkdir www && cd www
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent
- mv rutorrent rtorrent1
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent
- mv rutorrent rtorrent2
- cd rtorrent1/plugins
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/throttle
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/ratio
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/Diskspace
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/Source
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/Data
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/Cpuload
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/Theme
- sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/Data
- cd ../ && cp -R plugins /home/tup/www/rtorrent2/
 
#Set permissions
- cd ~ && sudo chown R tup:tup /home/tup
cd ~ && sudo chown -R www-data:www-data www && sudo chmod -R 777 rutorrent
 
#Apache
- sudo a2enmod ssl
- sudo a2enmod auth_digest
- sudo a2enmod scgi
- sudo nano /etc/apache2/apache2.conf
 
Add these lines lines at the end:
SCGIMount /rt1 127.0.0.1:5000
SCGIMount /rt2 127.0.0.1:5001
servername localhost
- openssl req $@ new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
chmod 600 /etc/apache2/apache.pem
- sudo htdigest c /etc/apache2/passwords gods tup
sudo nano /etc/apache2/sites-available/default
 
Replace all instances of <servername or IP> with your real servername or IP
 
<VirtualHost *:80>
ServerAdmin webmaster@localhost
 
DocumentRoot /home/tup/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/tup/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
 
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
 
ErrorLog /var/log/apache2/error.log
 
    Possible values include: debug, info, notice, warn, error, crit,
    alert, emerg.
    LogLevel warn
 
CustomLog /var/log/apache2/access.log combined
 
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
 
<Location /rtorrent1>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/rtorrent1/ http://<servername or IP>/rtorrent1
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/rtorrent1"
</Location>
 
<Location /rtorrent2>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/rtorrent2/ http://<servername or IP>/rtorrent2
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/rtorrent2"
</Location>
 
<Location /web_panel>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/web_panel/ http://<servername or IP>/web_panel
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/web_panel"
</Location>
 
<Location /browser_plugin>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/browser_plugin/ http://<servername or IP>/browser_plugin
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/browser_plugin"
</Location>
 
</VirtualHost>
 
<VirtualHost *:443>
ServerAdmin webmaster@localhost
 
SSLEngine on
SSLCertificateFile /etc/apache2/apache.pem
 
DocumentRoot /home/tup/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/tup/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
 
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
 
ErrorLog /var/log/apache2/error.log
 
    Possible values include: debug, info, notice, warn, error, crit,
    alert, emerg.
    LogLevel warn
 
CustomLog /var/log/apache2/access.log combined
 
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
<Location /rtorrent1>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/rtorrent1/ http://<servername or IP>/rtorrent1
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/rtorrent1"
</Location>
<Location /rtorrent2>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/rtorrent2/ http://<servername or IP>/rtorrent2
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/rtorrent2"
</Location>
<Location /web_panel>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/web_panel/ http://<servername or IP>/web_panel
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/web_panel"
</Location>
<Location /browser_plugin>
AuthType Digest
AuthName "gods"
AuthDigestDomain /home/tup/www/browser_plugin/ http://<servername or IP>/browser_plugin
 
AuthDigestProvider file
AuthUserFile /etc/apache2/passwords
Require valid-user
SetEnv R_ENV "/home/tup/www/browser_plugin"
</Location>
</VirtualHost>
- sudo a2ensite default-ssl
- sudo service apache2 reload
Check that everything is working by opening a browser and going to:
 
http://<servername or IP>/rtorrent1
http://<servername or IP>/rtorrent2
http://<servername or IP>/web_panel
 
#Webmin
- sudo nano /etc/apt/sources.list
deb http://download.webmin.com/download/repository sarge contrib
- wget http://www.webmin.com/jcameron-key.asc
- sudo apt-key add jcameron-key.asc
- sudo apt-get update
- sudo apt-get install webmin
https://<servername or IP>:10000
 
#SFTP
 
Connect via your FTP client. Set it to use SFTP and connect through your SSH, just like you would with Putty.
 
#Linux Firewall
 
Now it is time to set up the linux firewall to close all the ports other than the ones we need. This is where the GUI will come in handy for those who do not
 
understand IPTables.
 
- sudo apt-get update && sudo apt-get upgrade
- sudo apt-get clean && sudo apt-get auto-clean
 
Connect with your NX client on your windows machine.
- System > Administration > Firestarter
- When you launch firestarter for the first time, it will take you through a setup wizard.
-Click forward, and you will be able to select the network device. This device you must choose correctly. There may be a list of them. On almost all setups you will
 
chose eth0.
-Select eth0
-Do not check the other boxes.
-Click Forward, and then click Forward again.
-Uncheck to start the Firewall now. You must uncheck this or it will lock out all ports when you click Save.
-Click the Policy tab
-Make sure that Editing is set to Inboud Traffic Policy
-Right click under Allow Service, and you will do this individually for all your ports you need open.
Port = 32002, 80, 443, 10000, 57001
Anyone should be set for 57001
All others are to be set to your IP, unless you have a Dynamic IP address in which case you should set all of these ports to Anyone.
 
#Fail2Ban
- su root
- apt-get update && apt-get upgrade
- apt-get clean && apt-get autoclean
- nano /etc/fail2ban/jail.conf
ignoreip = 127.0.0.1 Your_Home_IP
 
EX : ignoreip = 127.0.0.1 24.127.*.* 192.168.1.*
You can use as many IP'
as you wantJust use a space in between each IP address. If you have a Dynamic IPit would be a good idea to accept the whole range like i gave in the example above.
 
[
ssh]
enabled true
port 
ssh
maxretry 
3
 
[Apache]
All Apache modules should be changed to yes.
 
Scroll to the bottom of jail.conf and add these lines to monitor Webmin
 
[webmin-auth]
enabled true
port 
10000
filter 
webmin-auth
logpath 
= /var/log/auth.log
maxretry 
3
 
service fail2ban restart
 
To delete 1 rules
:
iptables -F fail2ban-ssh
 
To delete just 1 IP rule
:
iptables -D fail2ban-ssh host-name/ip DROP
 
#Update/Upgrade and Reboot
apt-get update && apt-get upgrade
apt-get clean && apt-get autoclean
reboot
 
...and you're done
 
Replies (2)
Comment
RE: Server setup for n00bs - Added by Janhouse 18 days ago
 
Nice, this looks quite good. :)
I didn'
t like the server setup part about visudo and the NOPASSWD. (!)
Comment
RE
Server setup for n00bs Added by voidale 18 days ago
 
Installing the script seems to be easy the hard part is to setup download
/upload scripts no good guides for it :( but nice work nonetheless
 
(1-2/2
Reply With Quote
The Following User Says Thank You to Joe For This Useful Post:
Marco (27th June 2013)
Reply

Tags
janhouse , v3

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 11:20. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.