Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Preparing and uploading binaries to Usenet (CLI)

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Preparing and uploading binaries to Usenet (CLI)

#1 Post by Hallvor »

Preparing files

Since I keep forgetting how to prepare my binaries from the CLI, I thought it would be better if I wrote it online for future reference. Perhaps someone will find it useful as well.

This howto I will show how you can split archives into bits and make parity files from the CLI.

You will need non-free software to do the following steps.

First we need necessary software, namely rar to archive and split the binaries, and then par2 for error correction during download.

Code: Select all

# apt-get install rar par2
Let is assume I have the file debian-8.6.0-i386-netinst.iso inside my home directory, with the path /home/hallvor/debian-8.6.0-i386-netinst.iso

I then issue the following command:

Code: Select all

$ rar a debian-8.6.0-i386-netinst.rar -v50m -m0  debian-8.6.0-i386-netinst *
This command will start rar and create several archives, starting with a file called debian-8.6.0-i386-netinst.rar. -50m means that rar will split the archives into file sizes of 50 megabytes. -m0 means no compression, 3 is default and 5 is best. The iso will be stored inside a folder named debian-8.6.0-i386-netinst when it is extracted, and the * means all files in the directory will be appended. The advantage of creating a folder for the extracted file is especially apparent for a multi-file archive, where files otherwise could be accidentally mixed with others.

Parity files will make your Usenet client able to repair downloads with errors.

You can now remove the .iso from the directory.

Issue the following command to create parity files:

Code: Select all

$ par2create "debian-8.6.0-i386-netinst" -r20 -n10 *.rar
-r20 means it will create parity files of 20% redundancy, and -n10 means 10 files.

The parity files can be verified with

Code: Select all

$ par2verify *.par2 
The files are now ready to be uploaded.


Uploading files

There are not many options available for uploading files if you want to use open source software on GNU/Linux. One of the most popular ones with a GUI is JBinUp. It works well, uses Java, but is closed source. Other options are newspost, bur unfortunately it hasn't been under active development since more than a decade. Then there is sanguinews - a very good CLI usenet uploader for GNU/Linux.

Sanguinews is not in the official repositories, so we need build-essential and ruby-dev to install it.

Code: Select all

# apt-get install build-essential ruby-dev
You can now install sanguinews as a gem

Code: Select all

# gem install sanguinews
Now we need to put a config file called .sanguinews in your /home directory (as regular user)

Code: Select all

$ nano ~/.sanguinews.conf
Paste this content into the file

Code: Select all

# Sample config file
# Groups to post to
# Separate multiple groups with comma
groups = alt.binaries.test
# Your identity
from = witty_nickname <whatever@example.com>

# Username to use for authentication
username = your_username
# Password
password = your_password
# server to use
server = your_server
# Use SSL connection?
ssl = yes
# port
port = 563
# number of connections
connections = 10
# article size in bytes
article_size = 768000
# Wait this many seconds before trying to reconnect after unsuccessful upload
reconnect_delay = 5
# Subject prefix to use
prefix = "[sanguinews] - "
# Enable nzb creation
nzb = yes
# Use header checking? Upload will be slow but reliable.
header_check = no

# Debug information
debug = no
#######################
# headers
#######################
# X-No-Archive
xna = no
You need to at least edit the following parts: groups (to post to), username, password and server.

After you have finished editing everything, press Ctrl + X, and then Y to save the changes.

You can find different options for sanguinews by typing sanguinews --help

hallvor@debian-hp:~$ sanguinews --help

Code: Select all

sanguinews v0.80.1. Copyright (c) 2013-2014 Tadeus Dobrovolskij.
Comes with ABSOLUTELY NO WARRANTY. Distributed under GPL v2 license(http://www.gnu.org/licenses/gpl-2.0.txt).
sanguinews is a simple nntp(usenet) binary poster. It supports multithreading and SSL. More info in README.

Usage: sanguinews [OPTIONS] [DIRECTORY] | -f FILE1..[FILEX]

Options
    -c, --config CONFIG              use different config file
    -C, --check                      check headers while uploading; slow but reliable
    -f, --file FILE                  upload FILE, treat all additional parameters as files
    -g, --groups GROUP_LIST          use these groups(comma separated) for upload
    -h, --help                       help
    -p, --password PASSWORD          use PASSWORD as your password(overwrites config file)
    -r, --recursive                  process all files under each directory recursively
    -u, --user USERNAME              use USERNAME as your username(overwrites config file)
    -v, --verbose                    be verbose?
    -V, --version                    print version information and then exit

hallvor@debian-hp:~$ 
Let's upload something and assume that I put all the files above in ~/upload

The files can then be uploaded with

Code: Select all

$ sanguinews -v /home/hallvor/upload/
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Re: Preparing and uploading binaries to Usenet (CLI)

#2 Post by Hallvor »

Debian Stretch:

An update in Ruby has caused Sanguinews to crash when trying to upload binaries:

Code: Select all

/var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/nntp.rb:401:in `do_start': Object#timeout is deprecated, use Timeout.timeout instead.
/var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/nntp.rb:401:in `do_start': Object#timeout is deprecated, use Timeout.timeout instead.
/var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/nntp.rb:401:in `do_start': Object#timeout is deprecated, use Timeout.timeout instead.
/var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/thread-pool.rb:99:in `join': No live threads left. Deadlock? (fatal)
        from /var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/thread-pool.rb:99:in `map'
        from /var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/thread-pool.rb:99:in `shutdown'
        from /var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews.rb:284:in `run!'
        from /var/lib/gems/2.3.0/gems/sanguinews-0.80.1/bin/sanguinews:4:in `<top (required)>'
        from /usr/local/bin/sanguinews:22:in `load'
        from /usr/local/bin/sanguinews:22:in `<main>'

Fortunately there is an easy fix.

You need to edit the following file as root:

Code: Select all

# /var/lib/gems/2.3.0/gems/sanguinews-0.80.1/lib/sanguinews/nntp.rb
Now go to line 401 and replace this line...

Code: Select all

socket= :timeout(@open_timeout) { TCPSocket.open(@address, @port) }
with this:

Code: Select all

socket = ::Timeout.timeout(@open_timeout) { TCPSocket.open(@address, @port) }
Save, exit, and it should work again.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Post Reply