How to Install Latest Deluge BitTorrent Client on Ubuntu

Deluge is a free, open-source and lightweight BitTorrent client, available for Linux, FreeBSD, Mac OS X and Windows. It has a rich collection of plugins that you can install to extend its functionality.

Install Deluge BitTorrent on Ubuntu Server

You can install Deluge BitTorrent daemon on a server and manage the program via a Web browser. Using a server to download torrrent is very fast. Today’s server typically has 100Mbit download and upload speed.

Continue reading

Unpack and repack a JAR file with all of its dependencies

Repacking an unpacked JAR is a little frustrating because of the folder structure

When unpacking with:

jar xvf JAR_NAME.jar

you get a JAR_NAME/ folder

To repack the JAR:

remove old jar

rm JAR_NAME.jar

get inside the folder

cd JAR_NAME

pack the jar referencing the parent folder

jar cf ../JAR_NAME.jar *

and you will end up with the JAR_NAME.jar in the parent folder, where the original was unpacked from, without the first folder level you would get if you had packed the folder itself.

Difference between ‘git pull’ and ‘git fetch’?

In the simplest terms, git pull does a git fetch followed by a git merge.

You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/.

This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I have even heard of people running git fetchperiodically in a cron job in the background (although I wouldn’t recommend doing this).

git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.

Git documentation: git pull

Source: https://stackoverflow.com/questions/292357/what-is-the-difference-between-git-pull-and-git-fetch

Stream Torrents with VLC on Linux/Mac Without Any App

When Popcorn Time was released, it quickly got popular because of its functionality of playing video files from torrents either in its on video player or in VLC Media Player or on TV through Chromecast. Currently, there are two versions of Popcorn Time on the web. The original Popcorn Time apart from streaming movies, also lets you play videos using Torrent links or Magnet links. This is one nice feature if you want to watch a video or movie that’s not in the app’s directory of movies or shows.

Continue reading

What are Content, Subscription and Differential Charging?

Content Charging

Content or value based charging is to charge an end-user based on the variable value of a used service rather than on time used or flat rates. This can be used, for example, when downloading music video clips. Different contents can be charged at different rates, i.e. music contents 30 TK/minute, news contents 20 TK/minute etc.

Subscription Charging

Subscription charging is applied for regular subscription based services. Users can subscribe for a service for a specific modality. Here Subscription Based Modality means users can subscribe for a service monthly/bi weekly/weekly/daily and charge accordingly. Different modalities have different charging rates. When the user is subscribed to a service, the system treats the user as a registered user and sends service specific content to that user and the user can get the service.

Continue reading

L2TP / IPSEC VPN on Ubuntu 16.04

LT2P IPSEC vpn works simple and easily with iOS/Android and Windows 10. Unfortunately as many people likely know (after a few google searches it seems) the client for this is pretty crap in Ubuntu 16.04.

Our setup uses a shared PSK, and a username and password.

I’ve tried a bunch of the quick setup guides, but many were for older versions of Ubuntu and thus didn’t work very well. Finally I stumbled across this guide: https://gist.github.com/psanford/42c550a1a6ad3cb70b13e4aaa94ddb1c

which was used to connect with a meraki router over vpn. There were some minor tweaks in my case, but I managed to get it work.

Continue reading

vim – perform a global search and replace

To perform a global search and replace in vim, use the search and replace command in command mode:

:%s/search_string/replacement_string/g

The % is a shortcut that tells vi to search all lines of the file for search_string and change it to replacement_string. The global (g) flag at the end of the command tells vi to continue searching for other occurrences of search_string. To confirm each replacement, add the confirm (c) flag after the global flag.

How to Compress and Extract Files Using the tar Command on Linux

Compress an Entire Directory or a Single File

Use the following command to compress an entire directory or a single file on Linux. It’ll also compress every other directory inside a directory you specify–in other words, it works recursively.

tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

Here’s what those switches actually mean:

  • -c: Create an archive.
  • -z: Compress the archive with gzip.
  • -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
  • -f: Allows you to specify the filename of the archive.

Continue reading