Wednesday, October 11, 2017

Eclipse + OSGi + m2e + Tycho plugin

Eclipse Java EE IDE for Web Developers.

Version: Mars Release (4.5.0)
Build id: 20150621-1200

Or use a new one

m2e should be already installed in eclipse


Tycho software site

org.sonatype.tycho.repository -

Open resource

Click at "Set as Target Platform"

Eclipse download statistic

version ee ide classic size ee
Galileo 3.5.2 745 1094 651 190
Helios 3.6.2 3982 934 421 206
Indigo 3.7.2 4671156 1659485 3223475 213
Juno 4.2.2 2825040 1119755 1827173 229
Kepler 4.3.2 4174634 1235322 5699326 250
Luna 4.4.2 2561008 4392111 347281 254
Mars 4.5.2 3419709 1479877 169154 275
Neon  1805982 804094 54177 304
Oxygen  136808 88226 8991 328

Wednesday, September 20, 2017

Monday, September 11, 2017

Git add changes to last commit

It will be rebasing last commit with a new one.

git add .
git commit --amend --no-edit
git push -f

Wednesday, September 6, 2017

uptime periodic print

while(true); do uptime | sed -E 's/\s*up\s*([0-9]* day[s]*,\s*[0-9]*:[0-9]*|[0-9]*:[0-9]*),\s*[0-9]* user[s]*,\s*load average:\s/, /'; sleep 3; done

while(true); do uptime | cut -d':' -f4; sleep 3; done

Friday, September 1, 2017

Grep Console for Eclipse console highlights

Monday, July 17, 2017

Mongo find by id from one collection in other on remove

var id = db.getCollection('first_collection').find({jobClass:"com.example.CleanerJob"}, { _id: 1 }).next()._id;

Test it on your local. If it is ok, replace all "findOne" with "remove"

quartz and mongo:
org.quartz.JobPersistenceException: Could not load job class [See nested exception: java.lang.ClassNotFoundException:
at com.novemberain.quartz.mongodb.JobConverter.toJobDetail
at com.novemberain.quartz.mongodb.MongoDBJobStore.triggersFired

Tuesday, July 11, 2017

Все сотовые Украины

Все мобильные операторы Ураины
All Ukraine mobile operators.
Mobile UA codes.

Wednesday, July 5, 2017

Create one class from another with Stream API

public class User {
public User(

public class UserInfo {
public UserInfo(User log) {

List all = service.getUsers();

List infos =;

Tuesday, July 4, 2017

Rename git branch

Create a new branch from the old one:

git checkout branch_name
git checkout -b new_branch_name
git push --set-upstream origin new_branch_name

Delete the old branch local and remote:

git branch -D branch_name
git push origin --delete branch_name

Possible you want to rebase or squash commits:

git rebase -i master


Thursday, June 8, 2017

NoClassDefFoundError LogManager

NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager

remove:  -Dlog4j.configuration=file:conf/log4j.xml

jcl-over-slf4j-1.7.7.jar or jul-to-slf4j-1.7.12.jar

Wednesday, June 7, 2017

Compilation failure
error: cannot access Consumer

Upgrade Java 1.7 to Java 1.8

Tuesday, June 6, 2017

Maven: Unable to find valid certification path to requested target

[ERROR] Failed to execute goal on project ***:
Could not resolve dependencies for project ***:
Failed to collect dependencies at ***
Failed to read artifact descriptor for ***
Could not transfer artifact ***
PKIX path building failed:
unable to find valid certification path to requested target

Create folder c:\Users\YOUR_NAME\certs\
Put keys *.cer and certs in it
mvn"c:\Users\YOUR_NAME\certs\cacerts" -Dmaven.wagon.http.ssl.ignore.validity.dates=true  -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true  clean install

Wednesday, May 31, 2017

Git howto

Clone the master

git clone https://git/
git clone https://git/ []

Create a new branch

git checkout -b my_hello_world_branch
git add .
git commit -m "B012345 Fixed Hello World"
git push -u origin my_hello_world_branch


git checkout master
git checkout 
git checkout 

Merge a fresh master into your branch

git checkout master
git pull --rebase
git checkout some_fix_bug
git merge master
git push
git fetch
git pull origin master
git push
Before push you might need to resolve conflicts, then add and commit them


Save not staged (not git added changes) changes in local stack storage
git stash
Pop them back
git stash pop


Reset staged files, to get them back to local (NOTHING LOST).
git reset HEAD

If you have uncommitted changes that you want to discard (you'll LOST ALL UNCOMMITTED), use this:
This removes all the local uncommitted changes.
git reset --hard 
which is equivalent to
git reset --hard HEAD 

If you want to remove some offending commits from your local branch (you'll LOST PREVIOUS COMMIT), try rewinding it:
git reset --hard HEAD^ #moves HEAD back by one commit 
or e.g. (you'll LOST PREVIOUS three COMMITS)
git reset --hard HEAD~3 #moves HEAD back by 3 commits 
Use these with caution, as you won't be able to undo these operations. Once you're done cleaning up your local branch, use git pull to get the latest code.
git push -f origin 
If you have it in ignore, use 
 git clean -xf.
You can do 
 git clean -df 
but that will also remove un-tracked directories. Use -n for a dry-run.

Delete branches

Delete branch local
git branch -D 
Delete branch remote
git push origin --delete 

Copy a commit

Apply any commit done in the some branch to the local current branch
git cherry-pick c1qwlkjfcnc432289a42d34ab4b23803c9

Show list all

git branch
git tag
git branch -r
git remote show origin

Checkout Tags

After the clone, you can list the tags with 
 git tag -l 
and then checkout a specific tag: 
 git checkout tags/


Show changes between commits (Diff man )
git diff 4223732fhkjsdve1ffce96563367e8fdc^
git diff HEAD^
git diff HEAD~2

Rename a tag

Here is how to rename a tag old to new:
git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags

Show staged diff

You can show changes that have been staged with the --cached flag:
git diff --cached

Show diff latest 10 commit in current folder

git log -10 . | grep commit | sed 's/commit //' | xargs  git diff

Squashing commits with rebase