Git Push commits to another branch

When pushing to a non-default branch, you need to specify the source ref and the target ref:

git push origin branch1:branch2

Or

git push <remote> <branch with new changes>:<branch you are pushing to>

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

Encode or Decode base64 from the Command Line

If you have ever needed to quickly decode or encode base64, Linux has a command line utility called base64 that works great. I’ll show you how it works!


To encode text to base64, use the following syntax:

$ echo -n 'codediary.net rocks' | base64
Y29kZWRpYXJ5Lm5ldCByb2Nrcw==

To decode, use base64 -d. To decode base64, use a syntax like the following:

$ echo -n Y29kZWRpYXJ5Lm5ldCByb2Nrcw== | base64 -d
codediary.net rocks

Note: if on OS X, use capital D:

echo -nY29kZWRpYXJ5Lm5ldCByb2Nrcw== | base64 -D

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