Fast Mass Usenet Posting using both windows and linux, utilizing winrar, par2 and newspost

On Windows

    winrar.bat

This file will archive each file in your selected folder, split it by ~50 megabytes and then put the archives in their own subfolder.

Set the folder that contains your files in the winrar batch file. Make sure it doesn’t contain any spaces. Also don’t forget to set your rar.exe location (it’s in the winrar folder).


C:
set folder=C:\ConcertRecordings
for /f "usebackq delims=|" %%f in (`dir /b "%folder%"`) do "C:\Program Files (x86)\WinRAR\rar.exe" a -ep -ep1 -m0 -v50000 -df "%folder%\%%f_\%%~nf.rar" "%folder%\%%f"

@ECHO OFF
FOR %%F IN ("%folder%\*.part*.rar") DO CALL :process "%%F"
GOTO :EOF

:process
CALL :checkpath "%~dpn1"
MOVE %1 "%subfolder%" >NUL
GOTO :EOF

:checkpath
SET "subfolder=%~dpn1"
IF NOT EXIST "%subfolder%\" MKDIR "%subfolder%"
GOTO :EOF

pause

Alternatively you can also RAR subfolders rather than files.

    par2.bat

This file will create par2 recovery files for all files in all subfolders in our current folder. If the previous step worked correctly, these subfolders will each contain an archived file.

Make sure you have the par2 commandline executable (get the latest par2cmdline-x.x-x86-win32.zip) in C:\WINDOWS\
Then just move par2.bat in the main folder, the one that now contains all the subfolders.


FOR /R %%g IN (.) DO C:\WINDOWS\par2.exe c -r10 -s384000 "%%g\%%~ng.par2" "%%g\*"
del /q *.par2
pause

You will now have a script (well, 2) that automatically rar + par all files in a given directory, now all we need to do is automate their uploading process. We use linux for this. I find the easiest way is to download virtualbox, install Debian 6 and just copy your folders over using FTP (I recommend proftpd). After having done that, it’s time to install newspost on linux.

On Linux

First Install newspost

After all this we set our standard usenet-posting settings:


newspost -f you@yourbox.yourdomain -F yournickname -i news.yourisp.com -u yourusername -p yourpassword -n alt.binaries.boneless -s "def" -d

And last but not least we create a bash script that goes through all your previously made subfolders and, after replacing all whitespace with an underscore, upload their content to usenet. Change /var/ftpfolder/uploaded to wherever you set your ftp folder (pay attention, it’s in there twice!) to but keep the /*/ at the end of second occurence intact!

    autopost.sh


#!/bin/bash
find /var/ftpfolder/uploaded -name "* *" -type d | rename 's/ /_/g'
shopt -s globstar
for dir in /var/ftpfolder/uploaded/*/
do
thedirname=`basename $dir`
newspost -s "$thedirname" -n alt.binaries.boneless $dir/*
done

Make autopost.sh executable.

chmod u+x autopost.sh

Now whenever you run “bash autopost.sh” *all* folders in /var/ftpfolder/uploaded get their content uploaded to usenet, using the folder name as the post name.

One thought on “Fast Mass Usenet Posting using both windows and linux, utilizing winrar, par2 and newspost

Leave a Reply

Your email address will not be published. Required fields are marked *