GIT – Change author or committer

If you want to change author’s and/or committer’s name and/or email in given GIT revisions, you can use the following script:

git filter-branch -f --commit-filter '
  if [ "$GIT_AUTHOR_NAME" = "Old Author" ];
  then
    export GIT_AUTHOR_NAME    = "New Author";
    export GIT_AUTHOR_EMAIL   = "new_author@example.com";
    export GIT_COMMITER_NAME  = "New Author";
    export GIT_COMMITER_EMAIL = "new_author@example.com";
  fi;
  git commit-tree "$@"'

Now update the remote (bare) repository

git push --force --tags origin 'refs/heads/*'

Secured FTP – ProFTP + TLS in Ubuntu

FTP is considered as very insecure protocol because all data transferred using this protocol is passed between client and server in clear text and can be hacked by someone listening on your line. But you can easily encrypt the whole communication by enabling/forcing TLS and make FTP much more secure. This article explains how to set up ProFTPd with TLS on an Ubuntu server. Continue reading

LFTP – Backup website over FTP

LinuxI was facing task how to schedule an automatic backup/mirror of a website which allows connecting over FTP. PHP command exec was forbidden by the provider so it was not possible to run OS commands. PHP script execution time was set to quite short time so it was neither possible to zip using PHP functions and send the whole backup file somewhere easily. Continue reading