Tuesday, July 22, 2014

SSH Port complete tunneling and forwarding for uTorrent and others

Someone(Dchard) on the Internet has found a possible solution(typos corrected):

1. Set up an SSH connection in Putty with the tunneling settings below:

- Local ports accepts connections from other hosts [tick]
- Remote ports do the same [tick]
- Set up a dynamic port forward with source port 8080 (this will force the ssh server to act as a socks server)
- Set up a remote port forward with source port 50000, and Destination 127.0.0.1:50000 (this will forward the server's 50000 port to the local 50000 port. This could be changed if port 50000 is not open on the server).

Note that the forwarded ports (remote port forward) on the server side are bound to the loopback interface by default, so you must first check your SSH server's config, and set "GatewayPorts yes" in it's config file (sshd.conf). By default GatewayPorts is set to no!

2. Connect via SSH (note that in default, only the root user can forward ports)

3. Set up uTorrent with the following settings:

- Port used for incoming connections: 50000
- Proxy server: Socks5
- Proxy address: 127.0.0.1
- Proxy port: 8080
- Select resolve hostnames through proxy
- Do not select Authentication, and Use proxy for peer to peer

Go to advanced settings an set bt.allow_same_ip to "true"

Restart uTorrent.

What we can achieve with this:

Now from behind a firewall and/or a proxy with even no direct internet connection we managed to get uTorrent working in active mode.

With the above settings the tracker announces are working, the peer list got downloaded, the uTorrent port checker says that the port forwards are OK, and the download starts and there are several incoming connections (flag I set) among the clients, and the uploads are also working fine.

Friday, July 11, 2014

Copy and sync files with rsync remotely

Copying files using rsync from remote server to local machine

Using rsync is as simple as remembering 2 or 3 parameters.

rsync -a [SOURCE] [DESTINATION]

-a uses archive mode so the file permissions and parameters are kept. It is not required.
I usually use verbose and compression, so it looks like this:
rsync -avz [SOURCE] [DESTINATION]

for remote connections, [SOURCE] and [DESTINATION] can both be in the form:
user@host:/path/

If you want to include hidden files, try:
rsync -a ~/.[^.]* /path/to/backup

Here is part of the synopsis from the rsync man page:
       Local:  rsync [OPTION...] SRC... [DEST]

       Access via remote shell:
         Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
         Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

       Usages with just one SRC arg and no DEST arg will list the source files
       instead of copying.

You can schedule it to run in 15 minute intervals by typing "crontab -e" and adding the following line to the end:
*/15 * * * * rsync [SRC] [DEST] 1>/dev/null 2>/dev/null

Rsync hidden files from home directory for backup purposes

rsync -a ~/.[^.]* /path/to/backup

you can also use:
-v for verbose
-z for compression

Monday, July 7, 2014

Speed up computer with Ramdrive

1) Make a small Ramdisk of 64-512MB size(use Dataram Ramdisk Lite: http://memory.dataram.com/products-and-services/software/ramdisk)
2) Create a small swap file to your Ramdisk, 32-128MB is fine.
3) Move your firefox cache to the Ramdisk, limiting it's size to available space (30MB is fine if you don't have much RAM to spend), check here: Set firefox cache location
4) Restart Firefox and check if it creates the temp directory you specified(and monitor that it doesn't grow out of hand!).
5) Done!

I have found that making just a tiny Ramdisk where you put a little bit of swap seems to make computer faster. If you need more swap, create a few gigs swap somewhere on your HDD/SSD.

Friday, July 4, 2014

Compress all files including hidden files with tar

Type:
tar -cvjf compressed.tar.bz2 path/to/files/.