Author Archives: gik

Git configuration across multiple repositories

Often you need to push across many git repositories with different credentials. The simplest way is to edit “$REPO/.git/config” file to setup environment. But may be more convenient is to keep configuration in a few files behind the project source. How to manage multiple git repositories in one place is described below. According to git read more »

Access to device over 3g mobile internet or NAT

The problem is to present access to your device (pc, raspberry etc) which has usb-dongle (or wifi) connected to mobile internet provider. So, in this case you have no public (white) IP address and this is the challenge! The solution i advice is to use SSH tunnel. For this you need public SSH server accessible read more »

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 »