LINUX – Move MySQL data directory

LinuxIn newer versions of Linux it’s not easily possible to just move the MySQL data directory to another location and modify my.cnf or create a symbolic link. There is a secutity/protection “daemon” running in background checking which locations is some process trying to access. If it’s allowed, then access is granted, otherwise the process is unable to read/write the required data. This guardian is called “APPARMOR” Continue reading

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_COMMITTER_NAME  = "New Author";
    export GIT_COMMITTER_EMAIL = "new_author@example.com";
  fi;
  git commit-tree "$@"'

Now update the remote (bare) repository

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

JAVA – Parsing given string to be used by java.awt.robot

JavaJava Robot can be very usefull tool emulating e.g. pressing a key on your keyboard. Sometimes this can be difficult especially for non-standard characters like ‘asterisk’. Therefore I developed following piece of code which translates given string into separated chars, converts them to ASCII and Java Robot types them using ALT+ASCII_KEY Continue reading