Bash commands

1. Some handy bash commands


Compare two files and get list of differences.

$ diff file1 file2


Create softlink 
ln -s {/path/to/file-name} {link-name}

Delete softlink
rm {link-name}

Support colors in cygwin bash terminal

Open  file “.bashrc” in your home folder and uncomment commands aliases with some additional parameters as “–color”:

alias grep='grep --color'                     # show differences in colour
alias egrep='egrep --color=auto'              # show differences in colour
alias fgrep='fgrep --color=auto'              # show differences in colour
# Some shortcuts for different directory listings
alias ls='ls -hF --color=tty'                 # classify files in colour
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias ll='ls -l'                              # long list
alias la='ls -A'                              # all but . and ..
alias l='ls -CF'                              #


You can ssh into machine with command:

ssh -l username -p port hostname
ssh username@hostname -p port

ssh ibus@localhost -p 3022


2. Add bash.exe as terminal in Visual Studio Code

Open user settings profile and add command:

"": "C:\\cygwin64\\bin\\bash.exe"

The terminal is opened inside IDE as “Terminal window” with current project folder.


3. Add bash.exe as terminal in IntelliJ IDEA IDE

Open “File/Settings/Terminal” and enter shell path in application settings section :

When you open terminal you get bash shell inside IDE :


Netbeans and Polymer

Polymer HTML code completion for Netbeans 8.2

Thanks to this wonderful extension I can get rid of annoying errors in HTML editor when I edit polymer components in html files.

Because I use maven project type and netbeans , there is no “.nbproject” folder. In that case the “customs.json” file must be present in src/main/webapp folder.


Recreate new version of customs.json

Because not all attributes are recognized by customs.json I will recreate it as explained in project documentation.

After downloading master zip file, you need to create “dist” folder under src folder and then run index.js file.

igorb@Pavilion ~/PolymerForNB-master/src
$ mkdir dist

igorb@Pavilion ~/PolymerForNB-master/src
$ node index.js

New copy of customs.json will be created in dist folder, just copy it to the webapp folder and that’s it.

Merge changes back to project file

Don’t forget if you already used customization and added something, you need to merge old version with new one or you will lose your changes…

Well, it’s not so simple, looks like after you add few changes to customs.json with HTML editor, the file (customs.json) changed very  dramatically. Looks like netbeans  reorganize whole structure or something.





Spring boot and Netbeans

Setup spring boot application

Simplest way to create “netbeans” ready project is to create project zip file with spring web wizard and unpack it somewhere. Open the wizard page and switch to the full version.

2016-12-07-22_04_31-spring-initializrSelect all needed dependency, for example “web”, “jax-rs”, jOOQ etc.

After you click on “Generate project” or press Alt+Return, you will get zip file “save as” dialog. This file is created with all necessary configurations to start developing web application.   Just extract it somewhere and open project folder from netbeans.

Created project is maven project with “pom.xml” definition file, you will need maven installed on your system.


Maven – installation

How to install Maven on Windows 10

  1. Download Apache Maven ZIP file and unzip it to some folder (example: C:\Programs\apache-maven-3.3.9 ).
  2. Add maven folder to environment variables:
  • MAVEN_HOME = C:\Programs\apache-maven-3.3.9
  • add to path = %MAVEN_HOME%\bin


$ mvn –version

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\Programs\apache-maven-3.3.9
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_101\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"