How to test RSYNC before already syncing


Wrong execution of rsync command can result a mess that you may cost you some precious time to fix later, so you can test the rsync command before already executing it using the (-n) parameter or (--dry-run): rsync -anv path/to/file/with/trailing/slash/  path/to/file/without/trailing/slash Then you can execute it by removing the dry run parameter: rsync -av path/to/file/with/trailing/slash/ … Continue reading How to test RSYNC before already syncing

Show which git branch you are using on terminal


You can Add this code in your ~/.bashrc file to view the current branch in your project like   function parse_git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } RED="\[\033[0;31m\]" YELLOW="\[\033[0;33m\]" GREEN="\[\033[0;32m\]" NO_COLOR="\[\033[0m\]" PS1="$GREEN\u@\h$NO_COLOR:\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ "   Now your terminal will look like the following on a directory that … Continue reading Show which git branch you are using on terminal

PHP – Ubuntu: supported locales


1. First of all list supported locales: cat /usr/share/i18n/SUPPORTED 2. Copy the locales for your region. I will copy the following lines: sv_SE.UTF-8 UTF-8 sv_SE ISO-8859-1 3. Edit the list of 'supported locales' and paste your locales that you've copied. (See step above) gedit /var/lib/locales/supported.d/local   4. Finely generate your locales dpkg-reconfigure locales

Adding extra Repositories on Ubuntu


Repositories on Ubuntu are the locations that you can download software from. As a general rule, the default repositories don’t contain the right locations for most software packages that you’ll want to install. You will want to open up the /etc/apt/sources.list file, find and uncomment the following lines deb http://us.archive.ubuntu.com/ubuntu dapper universe main restricted universe deb … Continue reading Adding extra Repositories on Ubuntu

Secure copy via ssh connection


scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh. Examples: Copy the file "foobar.txt" from a remote host to the local host $ scp your_username@remotehost.edu:foobar.txt /some/local/directory Copy the file "foobar.txt" from the local host to a remote host … Continue reading Secure copy via ssh connection