Git

Rename the project in Bitbucket

Let’s say the existing project name as MyTestApp

I want to change the app name to sandbox-app

Let us see how to rename a project in bitbucket and as well as in local.

Bitbucket:

  • Login to bitbucket and traverse to your project and go to settings
  • Change the name from MyTestApp to sandbox-app
  • Save the changes

That’s it at bitbucket.

Local:

  • Go to project location. cd /home/loganathan/git/MyTestApp
  • Go to .git directory. cd .git
  • Open config file in vim. vim config
  • Change the name to sandbox-app in the url
  • Save and exit the file
  • Come 2 directories back, cd ../../
  • Change directory name from MyTestApp to sandbox-app. mv MyTestApp sandbox-app
  • Go to sandbox-app
  • Open .project file in vim and change name from MyTestApp to sandbox-app. Save and exit.
  • Open pom.xml in vim and change artifact and name to crawler-app. Save and exit.
Advertisements
Docker

Making docker to listen on network

The default installation of docker-engine is accessed only from the local machine where it is installed.

If we want to make the docker to listen over the network which helps in working with docker remotely without logging into the machine where docker is installed.

Below is the simplest way to achieve it but this is not a secured way. We have tweak it further to make this secure,

Docker configuration file with its location: /etc/default/docker

By adding -H option with IP as 0.0.0.0 in the config file, we can make docker listen over the network.

Add DOCKER_OPTS="-H tcp://0.0.0.0:2375"

Save the file and restart the docker.

You can verify in browser, hit the URL in browser: http://192.168.1.11:2375/_ping

OK is the response returned if the setup is successful.

Here 192.168.1.11 is IP of docker installed the machine.

Now you can run docker commands remotely:

Ex:

wagonsoft@Lenovo-G50-80:~$ sudo docker -H 5.44.98.132 ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cd12fff3cf09 ubuntu “bash” 4 hours ago Exited (0) 3 hours ago adoring_jang
e2695f761862 hello-world “/hello” 4 hours ago Exited (0) 2 minutes ago agitated_allen

Otherwise, we can try: chrome addon Simple Docker UI

Now docker will listen only on TCP port, so we have to use -H option even in the docker installed machine.

In order to make docker work without -H option in local, it has to listen on default unix socket.

To enable this add following in DOCKER_OPTS in /etc/default/docker,

-H unix:///var/run/docker.sock

Now DOCKER_OPTS looks like,

DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"

Save the file and restart the docker,

service docker restart

Now we will be able to run docker without -H option in local.

Reference: https://docs.docker.com/v1.10/engine/reference/commandline/daemon/