Watch P2P Television on Linux with Sopcast and VLC player

On Windows I was used to watching on-line television with the software Sopcast. On linux I had to spend about an hour to setup everything to correctly view P2P Tv, so I believe that this post may be useful to other people.

First of all, find and download the file sopcast-3.0.1-1.pkg.tar.gz or a more recent version if available. Then unzip it on your disk and change directory going into its bin folder

tar xfvz sopcast-3.0.1-1.pkg.tar.gz
cd sopcast-3.0.1-1.pkg/usr/bin/

It’s now time to run the service that will connect to a p2p television stream, and will stream that video on your PC.

./sp-sc-auth sop:// 3908 8908 > /dev/null

Obviously replace the URL sop:// with the URL of the television you want to watch (on there are some good channel listings) Be careful to pick an URL for Sopcast (there are many other kind of p2p softwares such as TvAnts and so on that uses different protocols).

Now there is a background service on your system that streams that TV on the chosen port 8908

The final step is to run VLC Media Player to view that stream on your monitor. This is the command:

vlc http://localhost:8908/tv.asf

Enjoy the show 🙂

Executing Commands and Scripts Remotely with ssh

Often it’s required to execute on a remote server a command or a whole bash script.
Not everyone knows that through ssh it’s possible to execute this task.

Here’s the ssh syntax:

usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-w local_tun[:remote_tun]] [user@]hostname [command]

In the following example , the ls command is run on the remote server.

ssh ls

To run a local script on the remote server, it’s required to upload it (through scp), set it as executable and finally run it.

The related example:

ssh "chmod +x /remotedir/"
ssh /remotedir/

Of course it’s required to type the password after each command (or to use a identity key file)

Looking through the ssh options it’s possible to find many other feature offered by this common command.

Copying Files between Clients and Servers over ssh using scp

It’s quite common to need to upload or download file between one or more servers and the local computer.

If it’s available a ssh access on the servers, using scp to transfer file from and to the server could be a very good option.

Here’s its syntax:

usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2

A very simple example:

scp localfilename.txt

The previous example copies localfilename.txt from the local directory to the server using remoteuser as the ssh account to authenticate on the remote server. On the remote server the transferred file will be stored as remotefilename.txt in the default login directory of remoteuser.

Copying file from and to specific directories:

scp /localdir/localfilename.txt

Compared to the previous example, in this case, the file is taken from /localdir/localfilename.txt and stored remotely on /remotedir/remotefilename.txt.
Obviously remoteuser should have write permission on the remote directory where the file is going to be written.

In the next case, the authentication is made through a keyfile, this is the syntax:

scp -i keyfile /localdir/localfilename.txt

In this case to login as remoteuser there will not be a prompt for password, but keyfile is used as identity file.

It’s even possible to copy directly files from one server to another


Finally one of the best features is to copy recursively directory trees to the remote server:

scp -r /localdirectory

In this case, the whole content of localdirectory is recursively copied into remotedirectory. This can be very useful for moving quickly website structures.
I hope you’ve found some useful information in this tutorial.