Few years ago, when one my friend decided to try out Linux, he has noticed that there is no easy way to prepare files for an usenet upload. Although I barely knew what Usenet is, I decided to provide a simple solution – write a script, which will simplify the whole process as much as possible.
I still consider myself a Usenet-newbie and the friend, who was the reason I wrote the script, switched back to Windows, but “rarnpar” has received some recognition in a meantime and it was even mentioned on reddit(which boosted visits for my blog a lot). Because of all the feedback I was getting, I was improving the script, step by step, and now time has come to dedicate a page entirely for this simple rar & par2 wrapper.
If you find it useful, I would appreciate a comment or a suggestion how to improve it.
If you don’t know how to start, well, I have a “How to” guide prepared by my friend(who wishes to remain anonymous), which will(hopefully answer your questions. If you still have questions after reading it, I would try answering them, just, please keep in mind, that I don’t know, what “block size” is and I don’t know why some things were implemented the way they were – the script was written for other people to use. I haven’t had a need for it and I am doing only basic tests after I add some new features. Because of this there could be bugs. It’s in your power to help me fix them – just write a message, when you see that something isn’t right.
Tad-Do’s Rarnpar Mini-Guide(by anonymous)
1) What’s this?
- Rarnpar is a script written specifically for making it easy to RAR and PAR2 lots of files\folders at once
2) System requirements?
- It runs on Linux distros.
3) A monkey could do it!
- Well,it is a scientific fact that we share common ancestors with monkeys. On a serious note, the script might be of use to Usenet uploaders, especially the ones who don’t know much about scripting because it offers advanced features such as:
- a) Cryptorenaming mode
- b) Exclusions
- c) Simplified NFO creating
- d) Mediainfo support
- e) Folder\file mode
- f) Prefix\suffix
- g) SFV creation
4) Uh? I feel stupid!
- No worries! Everything will be explained in time.
I presume that you are not a hardcore command line only linux geek (if it was the case, you wouldn’t be reading all this, would you?), so I assume that you do have desktop environment available on your OS.
Taking this into account I won’t be addressing how to do all this stuff via commands only.
1) Go to https://tad-do.net/wp-content/rarnpar,copy and paste into any text editor and save as yourfilename
2) Right mouse click on the file and set permissions to “Allow executing file as a program”
Alternatively run in a terminal opened in a folder where you saved the file “
sudo chmod +x yourfilename” or “
sudo chmod +x /folder1/folder2/../yourfilename“
3) Copy\move the file to
You will need root access to do that.
If a terminal is opened in the file’s folder run “
sudo cp yourfilename /usr/local/bin/” otherwise run “
sudo cp /folder1/folder2/../yourfilename /usr/local/bin/”
4) You will need some dependencies installed in order to run the script.
We will do it via a terminal
sudo apt-get install rar
sudo apt-get install par2
sudo apt-get install cksfv
sudo apt-get install mediainfo
They are already installed on any linux distro.
To check if they are, run in terminal “
dpkg -s coreutils“
Let’s assume that you named rarnpar file as rarnpar 😉
Having put rarnpar into
/usr/local/bin we can now run it anywhere we like from a terminal
If you run it without any options, then it automatically runs as “
rarnpar --help” which in turn will show you all the options available and a brief explanation.
-b (default 384000)
Example: -b 640000
par2 block size. Default value is 384000.
Which equals 3000 lines (option that you have to set in your Usenet upload client).
Other popular values are:
640000 (=5000 lines) and 1280000(=10000 lines)
Hint: You shouldn’t make it larger than 1280000 and 10000 lines in your upload client because newsservers might reject articles you will be uploading with numbers larger than these.
Par2 block count. You can’t use both -b and -B.
Hint: I suggest that you stick to -b.
Creates a folder for each processed file\folder
Specifies a working directory where files\folders you want to process are
Generally there is no need to do that if you run the script from a terminal opened in this folder
Comma separated list of expressions to exclude
Limits size of recovery files, Don’t use both -l and -u)
-m (default 0)
Rar compression level from 0 to 5
Hint: We don’t generally use compression for archives to be uploaded to Usenet or anywhere else.
Supports md5,sha1,sha224,sha256,sha384,sha512 algorithms
What does it do exactly?
Say, you have a video file I_am_not_a_pirate.mp4 in a folder. You open up a terminal in this folder and run “
rarpar -d -M md5“
Now, you have in your folder another folder(-d) “d5fa019be35a69dc4daf279bab53412c” which contains archives and par2 files named “d5fa019be35a69dc4daf279bab53412c” and your file in this archive is renamed to hash as well. Original file
that was RARed and PARed is kept intact
“d5fa019be35a69dc4daf279bab53412c” – is hash made from your file’s name.
The script also generates a dummy NFO files so that you know based on it’s name what exactly this hashed release is.
Hash is based only on a filename\folder name\+suffixes\prefixes (see below). Extensions are not taken into account
Processes only files larger than X MB
Uses old style rar naming
rarpar -d -M md5 -n
Old style rar naming is on the left
Creates NFO for processed media files. Works only in a file mode (default)
When you have this option enabled your NFO file created for media files will contain mediainfo details
New name. Rename file/directory during processing. Shouldn’t be used with multiple items. Disabled in recursive mode.
rarpar -d -M md5 -v 15 -V -NN MPIAA.2013.DVDRip -p [PORN] -s -COOLGROUP --sfv -P pass
As you can see, hash is calculated from [PORN]MPIAA.2013.DVDRip-COOLGROUP The file in archives had it’s original name intact because we used hash key (-M) and a password(-P) If we didn’t use “-M” then we would have rars and par2 files named as [PORN]MPIAA.2013.DVDRip-COOLGROUP Same renaming can be done to a single subdirectory. Don’t forget you should use
-NN only for processing one item (file\folder)
Sets output directory
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -N
On the left is the output directory, on the right the folder where we opened terminal and ran the script
Nfo file contains mediainfo details of this particular file
A filename’s prefix
Just in case if you need one for whatever reasons
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -N -p [fuckYouMpiAA]
Hash is calculated from “[fuckYouMpiAA]I_am_not_a_pirate“
Creates password protected archives.
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -N -p [fuckYouMpiAA] -P youllneverknow
Same results as in #13 but passworded + this time a file\folder inside archives is not renamed to hash because RARs are password protected.
PAR2 recovery in % (default 10)
Hint: For files\folders >=4Gb it’s better to use 5, not 10
rarpar -r 5 -d -M md5 -O /media/truecrypt3/UPLOAD/ -N -p [fuckYouMpiAA] -P youllneverknow
Recursive mode. Works only when processing files
Allows the script to process files in subfolders.
A filename’s suffix. Pretty much the same as prefix
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -N -p [fuckYouMpiAA] -P youllneverknow -s -CoolGROUP
Creates SFV file
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -N -p [fuckYouMpiAA] -P youllneverknow -s -CoolGROUP --sfv
The script processes subdirectories, not files. Not used with
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -p [fuckYouMpiAA] -P youllneverknow -s -CoolGROUP --sfv --subdir
Hash is calculated from “[fuckYouMpiAA]wtf_do_we_have_here-CoolGROUP“
Uniform par2 recovery file size.
Hint:Not a good idea. Leave it
-v (default 50)
RAR volume size in MB.
At your own discretion.
rarpar -d -M md5 -O /media/truecrypt3/UPLOAD/ -p [fuckYouMpiAA] -P youllneverknow -s -CoolGROUP --sfv --subdir -v 15
If turned on, you get to see detailed processing information (% and what not) in a terminal.
It is advisable to turn it on. This way you can monitor the process if needed.
There are quite a lot of posts dedicated to rarnpar in this blog, but if you want to get the most recent version, you could use following link: https://tad-do.net/wp-content/rarnpar. If you would like, for some reason, to get previous versions, you could always check a post dedicated to that particular version:
- Newsmangler Support in Rarnpar – Version 0.80
- Config files for rarnpar – Version 0.78
- Random passwords in rarnpar – Version 0.77
- Fine-tuning par- and rar- sets – Version 0.75
- Version 0.7
- Password protection – Now in Rarnpar! – Version 0.65
- Exclusions in rarnpar – Version 0.6
- One more bug squashed – Version 0.52
- Rarnpar – Bugfix – Version 0.51
- Rarnpar – Version 0.5
- One more rarnpar update – Version 0.43
- New Day – New Version – Version 0.41
- New rarnpar version – Version 0.4
- Small bugfix for the rarnpar script – Version 0.32
- Usenet File Preparation. Part II – Version 0.3
- Automating Usenet file preparation – Version 0.22(Initial public release)
The script is distributed under GPL v2 license with NO WARRANTY WHATSOEVER. Feel free to modify it to suit your needs.