Found a good article which enabled me to install python 2.7.3 inside a folder.
http://www.benhepworth.com/blog/2016/05/18/install-python-to-separate-directory-on-linux-in-5-easy-steps/
Found a good article which enabled me to install python 2.7.3 inside a folder.
http://www.benhepworth.com/blog/2016/05/18/install-python-to-separate-directory-on-linux-in-5-easy-steps/
In order to setup a fully functional Redmine server via Docker I use the following consolidated command:
docker run \ --detach \ --name redmine \ --link mysql:mysql \ --publish 3000:3000 \ --env="REDMINE_DB_MYSQL: redmine" \ --env="REDMINE_DB_PASSWORD: redmine" \ --volume /Volumes/DATA/Abhinav/Docker/redmine/files:/usr/src/redmine/files \ redmine
This connects my mysql docker instance with sonar and it is able to create tables and start using MySQL properly for storing all it’s data.
I found a good piece of code which can be used to extract multiple email from a String. A modified version of the code is listed below:
public static String readContactEmailFromString(String resumeText) {
final String RE_MAIL = "([\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Za-z]{2,4})";
Pattern p = Pattern.compile(RE_MAIL);
Matcher m = p.matcher(resumeText);
StringBuilder sb = new StringBuilder();
while(m.find()) {
if (sb.toString().contains(m.group(1))) continue;
if (sb.toString().isEmpty()) {
sb.append(m.group(1));
} else {
sb.append("; " + m.group(1));
}
}
return sb.toString();
}
I am currently using Github and all project members have forked the main repository into private repository. Now the problem is that I need to review my colleagues code committed in his branch inside his forked repository. So to do this I found out a good article that showed me exactly how to do that. I used the following approach.
git remote add my-colleague https://github.xyz.com/my-colleague/project.git git fetch my-colleague git checkout -b my-colleague-branch --track my-colleague/branch
After I do this I can see all the work done by my colleague and I can switch back to my branch anytime.
We can now do Spring certification without going for Pivotal training. It was long due and here it is finally!
Can you take Spring certification without Pivotal Training Course?
5 Spring Framework Books for Java developers (Includes Spring Security and Spring Boot) – Best of lot
Read more: http://www.java67.com/2016/12/5-spring-framework-books-for-java-programmers.html#ixzz4hVU7visy
A simple technique on MacOS which I use every now and then when my SSH connections hang due to network disconnect. You can immediately terminate the hung SSH session by pressing ~. (tilde and dot) keys together.
http://apple.stackexchange.com/questions/35524/what-can-i-do-when-my-ssh-session-is-stuck
I use CURL for debugging my REST endpoints every now and then if I don’t want to use Postman or DHC clients. I usually like to copy paste results / statistics from command line into emails to my colleagues. This gives them a plain jane command which they can use to test themselves as well as compare their results with mine. The following article has some good pointers on how to use CURL and some very practical examples have been provided.
15 Practical Linux cURL Command Examples (cURL Download Examples)
I recently got into a situation where I had to debug around 10 servers all of which were suffering from memory issues. My java applications were slowing down after a day or so. Although its is difficult to diagnose this kind of issues which span across multiple VMs (welcome to Micro Services!) but with some little bit of scripting it is possible to see in real time the actual numbers if you manage to use tmux to multiplex multiple shell sessions stacked together. I hacked up the following command to display hostname, running war files as well as the memory statistics refreshed every 1 second on screen.
watch -d -n 1 "hostname | tr '\r\n' ' ' && printf \" \" && jps -l | grep .war | tr '\r\n' ' ' && echo "" && free -h"
I found a good link which lists good usages of the Linux command “du”.
This command allows me to see the usage in a ascending sort which is really helpful.
Tested on Linux.
du -h / | sort -h
Tested on Mac OS.
du -hs * | gsort -h
In case you don’t have gsort install coreutils.
brew install coreutils
This variation allows me to see any line which has the text “G” in it which basically allows me to see folders using space in GBs. Agreed it might give some folder names as well with “G” in it but I can bear with it.
Tested on Linux.
du -h /the/path | sort -h | grep "G"
Tested on Mac OS.
du -h /the/path | gsort -h | grep "G"
In order to setup a fully functional Sonarqube server via docker I use the following consolidated command:
docker run \
--detach \
--name=sonarqube \
--publish 9000:9000 \
--publish 9092:9092 \
--env="SONARQUBE_JDBC_USERNAME=sonar" \
--env="SONARQUBE_JDBC_PASSWORD=sonar" \
--env="SONARQUBE_JDBC_URL=jdbc:mysql://mysql:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true" \
--link mysql:mysql \
sonarqube:5.1
This connects my dockerized mysql instance with sonar and it is able to create tables and start using MySQL properly for storing all it’s data.