Posts

Showing posts from December, 2017

spring boot vs vert.x

                              Spring Boot                                        Vert.x Managed by Pivotal Under Eclipse Foundation (VMware initially) Only JVM languages Polyglot - Any language (Overcome disadvantage of Node js - single threaded), Vert.x allows to create multiple threads based on the number of CPU cores whlie only one process is executed. Opinionated & heavy weight Very raw and light weight Bigger ecosystem and support for spring is huge Testing async. code might be tedious Spring boot is not reactive(event based) by default ...

docker useful commands/issues

1.) To get interactive session with docker container     docker > 1.3     docker exec -it <containerIdOrName> bash 2.) Running docker container as background     docker run -td <image>     -d = for detached mode 3.) Expose port for docker container      docker run -p 8080:8080 <image> 4.) If getting below error :-          docker: Error response from daemon: driver failed programming external connectivity on endpoint nervous_hermann (ee9f330f106a41dde01e47967acd4c374c55aa4f45e1a3c4c41e1b541f00db4d):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8080 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name.  (exit status 1)). Solution:- restart  docker daemon, this atleast worked for me :) 5.) exposePort 8080, not working for gradle docker plugin.     https://github....

Spring data rest : quick reference

1.) Restrict HTTP methods to be exposed           Override methods in interface and mark as "@RestResource(exported = false)"       @RepositoryRestResource(collectionResourceRel = "user", path = "user") public interface UserRepository extends CrudRepository<User, Integer> {     @Override     @RestResource(exported = false)     User save(User s);     @Override     @RestResource(exported = false)     default User findOne(Integer integer) {         return null;     }     @Override     @RestResource(exported = false)     default boolean exists(Integer integer) {         return false;     }     @Override     @RestResource(exported = false)     default Iterable<User> findAll(Iterable<Integer> iterable) {        ...

git: useful commands

-- Undo a Git merge that hasn't been pushed yet git reset --hard HEAD~1 It will get you back 1 commit. Any modified and uncommitted/unstashed files will be reset to their unmodified state

Running docker as non-root user

To create the  docker  group and add your user: Create the  docker  group. sudo groupadd docker Add your user to the  docker  group. sudo usermod -aG docker $USER L og out and log back in so that your group membership is re-evaluated. If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect. On a desktop Linux environment such as X Windows, log out of your session completely and then log back in. Verify that you can run  docker  commands without  sudo . docker run hello-world Reference:- https://docs.docker.com/engine/installation/linux/linux-postinstall/#next-steps

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Image
Step 1:- sudo service docker status Step 2:- sudo service docker start  Step 3:- sudo service docker status

Installing gradle in linux

Step 1:- Download and Install gradle  # cd /opt # sudo wget https://services.gradle.org/distributions/gradle-3.1-bin.zip # sudo unzip gradle-3.1-bin.zip # sudo ln -s gradle-3.1 gradle Step 2:- Set Environment Variable # sudo vim /etc/profile.d/gradle-env.sh export GRADLE_HOME=/opt/gradle export PATH=$PATH:$GRADLE_HOME/bin # sudo source /etc/profile.d/gradle-env.sh

Installing-maven-3-0-5-in-redhat-linux

Step 1:- D ownload the Maven tar file and untar it to a shared location on the workstation wget http://mirrors.gigenet.com/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz su -c "tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /opt/" Step 2:-  Setup the Maven Environment Variables in shared profile. The next step is to setup the Maven environment variables in a shared profile so all users on the system will get them import at login time su -c "vi /etc/profile.d/maven.sh" # Add the following lines to maven.sh export M2_HOME=/opt/apache-maven-3.0.5 export M2=$M2_HOME/bin PATH=$M2:$PATH Step 3:- T est your install of Maven. Logout of the system and then log back into it. mvn -version Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500) Maven home: /opt/apache-maven-3.0.5 Java version: 1.7.0_19, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/jre Default locale: en_US,...