Author Archives: gik

Install Oracle Java 8 on Ubuntu Linux

To install Oracle JDK 8 on Ubuntu you can choose one of two methods: A. Automatic installation: sudo apt-get install python-software-properties sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer sudo update-alternatives –config java sudo update-alternatives –config javac sudo update-alternatives –config javaws B. Manual installation: Download oracle jdk at http://www.oracle.com/technetwork/java/javase/downloads/index.html Extract archive into /usr/local/jdk1.8.0_65 read more »

Exclude beans from tests in Spring Boot

Running unit tests bootstraps, for example, scheduling tasks (EnableScheduling, Scheduled). To exclude automatic start up auto-configuration beans with annotation you can follow next instruction: 1. Create annotation: public @interface ExcludeFromTests { } 2. Annotate with it Application and Scheduled beans (or what you want to be skipper during tests): @SpringBootApplication @EnableAsync @EnableScheduling @ExcludeFromTests public class read more »

Change default password for Oracle 11g Database

To change the default password for SYS and SYSTEM users use the trick. 1. Run in shell: sqlplus / as sysdba 2. Change password for SYS: SQL> alter user SYS identified by “your-super-password”; 3. Change password for SYSTEM: SQL> alter user SYSTEM identified by “your-super-password”; Thanx to http://stackoverflow.com/a/740884

Using RSYNC to backup (synchronize) folders

If you want to synchronize two folders use next snippets. 1. Sync folder “source” content to “target” folder: rsync -arpv –delete /mnt/source/ /mnt/target Notice trailing slash for “source” folder! 2. Sync whole folder “source” to “parent” folder: rsync -arpv –delete /mnt/source /mnt/parent More info https://linux.die.net/man/1/rsync

Generate SSH key (identity)

To generate SSH key you have to do following: 1. Install any SSH client (if absent). 2. Show existing keys: ls -la ~/.ssh It can be empty. 3. Generate key itself: ssh-keygen -t rsa -b 4096 -C “your@email.com” You’ll be prompted to enter the path to store the key. Also, you can enter a passphrase. read more »

Multiple SSH keys configuration

If you are using, for example GIT, it may be needed to use different ssh keys for different servers. By default git client uses “~/.ssh/id_rsa” private key. And you’ll get the error like: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository read more »

Apache and SVN configuration with user permissions

This tutorial shows how to configure Apache+SVN couple. 1. First of all you should install Apache Httpd server (version 2.4 in this case) with DAV_SVN module and subversion client: yum -y install httpd mod_dav_svn subversion 2. Check installed modules are turned on: LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule dav_module modules/mod_dav.so LoadModule read more »