Plex Server Up and Running with Docker

Plex is a media server which aggregates your media and allows you to access it on your home network. Installing the server is relatively simple… Installing it with Docker is even simpler. Docker also makes it easy to define a single configuration which is reusable across environments.

I’m working off a Ubuntu installation, since that is where I’m setting up my home media centre, but once docker is installed, getting Plex going should be nearly identical in any OS.

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

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