Update your fork repo from it’s Upstream

#case: you fork a repo from github into your account, and upstream (owner) of repo have an update and you want to sync it to your fork repo



— you fork my repo: https://github.com/addhe/Akubot then it will copied over to your github account let’s called your github account ‘mrsomething’ Akubot repo will be copy and now it become https://github.com/mrsomething/Akubot.git

— you now able to git clone Akubot thru your github account, you will be able to push, commit and so forth.

— in the future i have update to Akubot and it’s important, you want to update your Akubot and do not want to destroy or remove your custom changes. let’s do this


  1. cd Akubot
  2. check upstream, change the upstrem to my repo
    git remote add upstream https://github.com/addhe/Akubot.git
  3. check git remote
    git remote -v
  4. fetch upstream update
    git fetch upstream
  5. Check out to your local master repo, this will change to master branch
    git checkout master
  6. Merge Upstream update to your local repo
    git merge upstream/master


Application Privacy Statement

This privacy statement (“Privacy Statement”) applies to the treatment of personally identifiable information submitted by, or otherwise obtained from, you in connection with the associated application (“Application”). The Application is provided by AkuBot (and may be provided by AkuBot on behalf of a AkuBot licensor or partner (“Application Partner”). By using or otherwise accessing the Application, you acknowledge that you accept the practices and policies outlined in this Privacy Statement.


We collect the following types of information from our users:

Personal Information You Provide to Us:

We may receive and store any information you submit to the Application (or otherwise authorize us to obtain – such as, from (for example) your Facebook account). The types of personal information collected may include your full name, email address, gender, IP address, browser information, username, demographic information, and any other information necessary for us to provide the Application services.

Personal Information Collected Automatically:

We receive and store certain types of usage related information whenever you interact with Application. For example, AkuBot may automatically receive and record information regarding your computer’s IP address, browser information, Facebook user ID, Facebook Page fan status, and URLs accessed. Such information may be shared in aggregate (non-personally identifiable) form with our partners.


AkuBot uses the information described in this Privacy Statement (i) internally, to analyze, develop and improve its products and services, and (ii) as set forth below in the “Will AkuBot Share any of the personal information it Collects” section below.


AkuBot may provide personal information to the applicable Application Partner. The Application Partner’s use of your personal information is subject to the Application Partner’s separate privacy policy – and not this Privacy Statement. The Application Partner’s privacy policy is linked to from within the Partner’s Facebook application.


Personal information about our users is an integral part of our business. We neither rent nor sell your personal information to anyone (with the exception of sharing your information with an applicable Application Partner – see the “Application Partner Treatment” section above). We share your personal information only as described below.

Application Partners: We will share your personal information with an applicable Application Partner (see the “Application Partner Treatment” section above).

Agents: We employ other companies and people to perform tasks on our behalf and need to share your information with them to provide products or services to you. Unless we tell you differently, AkuBot’s agents do not have any right to use personal information we share with them beyond what is necessary to assist us. You hereby consent to our sharing of personal information for the above purposes. Business Transfers: In some cases, we may choose to buy or sell assets. In these types of transactions, customer information is typically one of the business assets that are transferred. Moreover, if AkuBot, or substantially all of its assets were acquired, or in the unlikely event that AkuBot goes out of business or enters bankruptcy, user information would be one of the assets that is transferred or acquired by a third party. You acknowledge that such transfers may occur, and that any acquirer of AkuBot may continue to use your personal information as set forth in this policy.

Protection of AkuBot and Others: We may release personal information when we believe in good faith that release is necessary to comply with the law; enforce or apply our conditions of use and other agreements; or protect the rights, property, or safety of AkuBot, our employees, our users, or others. This includes exchanging information with other companies and organizations for fraud protection and credit risk reduction.

With Your Consent: Except as set forth above, you will be notified when your personal information may be shared with third parties, and will be able to prevent the sharing of this information.


If you decide to use or otherwise access the Application, your use/access and any possible dispute over privacy is subject to this Privacy Statement and our Terms of Use, including limitations on damages, arbitration of disputes, and application of Indonesia law.


The Application may permit you to link to other applications or websites. Such third party applications/websites are not under AkuBot’s control, and such links do not constitute an endorsement by AkuBot of those other applications/websites or the services offered through them. The privacy and security practices of such third party application/websites linked to the Application are not covered by this Privacy Statement, and AkuBot is not responsible for the privacy or security practices or the content of such websites.


AkuBot allows you to access the following information about you for the purpose of viewing, and in certain situations, updating that information. This list may change in the event the Application changes. – Account and user profile information – User e-mail address, if applicable – Facebook profile information, if applicable – User preferences – Application specific data


Our site and the services available through AkuBot are not intended for children under the age of 17. AkuBot does not knowingly or specifically collect information about children under the age of 17 and believes that children of any age should get their parents’ consent before giving out any personal information. We encourage you to participate in your child’s web experience.


AkuBot may amend this Privacy Statement from time to time. Use of information we collect now is subject to the Privacy Statement in effect at the time such information is used. If we make changes in the way we use personal information, we will notify you by posting an announcement on our Site or sending you an email. Users are bound by any changes to the Privacy Statement when he or she uses or otherwise accesses the Application after such changes have been first posted.


If you have any questions or concerns regarding privacy on our Website, please send us a detailed message at addhe.warman@gmail.com. We will make every effort to resolve your concerns.

Effective Date: December 1, 2016

Akubot is maintained by Addhe Warman.

Using ec2_facts to gather and print ansible ec2 variables

some people may asked, how can i use my ansible to print our my ec2_facts, this is the simple way to do that :

1. Login to your ec2 instance, create your playbook

#mkdir provisioning
#vim provisioning/ec2-gather.yml
- name: Initialize EC2 Instance For '{{ name_web_host }}'
hosts: localhost
connection: local
gather_facts: True
- name: Get instance ec2 facts
action: ec2_facts
register: ec2_facts
- debug: var=ec2_facts

2. Let’s put your ec2.py in same directory also ec2.private-ip.ini

#cp ec2.py ec2.private-ip.ini ~/provisioning/

3. Let’s test add some information for it

#export EC2_INI_PATH=./ec2.private-ip.ini
#export AWS_ACCESS_KEY={your aws access key}
#export AWS_SECRET_KEY={your aws secret key}

#~/provisioning/ec2.py –refresh-cache

#ansible-playbook -i local, provisioning/ec2-gather.yml –extra-vars=”aws_access_key=$AWS_ACCESS_KEY aws_secret_key=$AWS_SECRET_KEY” -vvvv

your output will be something like this

TASK: [debug var=ec2_facts] ***************************************************
ok: [localhost] => {
“ec2_facts”: {
“ansible_facts”: {
“ansible_ec2_ami_id”: “ami-xxxxx”,
“ansible_ec2_ami_launch_index”: “0”,
“ansible_ec2_ami_manifest_path”: “(unknown)”,
“ansible_ec2_block_device_mapping_ami”: “/dev/sda1”,
“ansible_ec2_block_device_mapping_ephemeral0”: “sdb”,
“ansible_ec2_block_device_mapping_ephemeral1”: “sdc”,
“ansible_ec2_block_device_mapping_root”: “/dev/sda1”,
“ansible_ec2_hostname”: “ip-10-xx-xx-xx.ap-southeast-1.compute.internal”,
“ansible_ec2_instance_action”: “none”,
“ansible_ec2_instance_id”: “i-xxabxx”,
“ansible_ec2_instance_type”: “t2.small”,
“ansible_ec2_local_hostname”: “ip-10-xx-xx-xx.ap-southeast-1.compute.internal”,
“ansible_ec2_local_ipv4”: “10.x.xx.xxxx”,
“ansible_ec2_mac”: “02:17:41:4d:4c:91”,
“ansible_ec2_metrics_vhostmd”: ““,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_device_number”: “0”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_interface_id”: “eni-8xx0dxxx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_ipv4_associations_54.xx.xx.xxx”: “10.xx.xx.xxxx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_local_hostname”: “ip-10-0-xx-x.ap-southeast-1.compute.internal”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_local_ipv4s”: “10.xxx.xx.x”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_mac”: “02:17:41:4d:4c:91”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_owner_id”: “x38xxxx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_public_hostname”: “ec2-54-xx-xxx-xxxx.ap-southeast-1.compute.amazonaws.com”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_public_ipv4s”: “54.xx.xxx.xxxx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_security_group_ids”: “sg-xbxxx3xx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_security_groups”: “bastixx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_subnet_id”: “subnet-xdxxx2xx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_subnet_ipv4_cidr_block”: “”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_vpc_id”: “vpc-x0xxx8xx”,
“ansible_ec2_network_interfaces_macs_02_17_41_4d_4c_91_vpc_ipv4_cidr_block”: “”,
“ansible_ec2_placement_availability_zone”: “ap-southeast-1a”,
“ansible_ec2_placement_region”: “ap-southeast-1”,
“ansible_ec2_profile”: “default-hvm”,
“ansible_ec2_public_hostname”: “ec2-54-xx-xxx-x.ap-southeast-1.compute.amazonaws.com”,
“ansible_ec2_public_ipv4”: “54.x.x.x”,
“ansible_ec2_public_key”: “ssh-rsa AAAxxzaC1yc2EAAAADxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrn3IGNMePcms277wgx9X+YI/rVYCxxxxxxxxxMgoTJ/xbdVsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/h google-staging\n”,
“ansible_ec2_reservation_id”: “r-dXXX7XXX”,
“ansible_ec2_security_groups”: “bastixx”,
“ansible_ec2_services_domain”: “amazonaws.com”,
“ansible_ec2_user_data”: null
“changed”: false,
“invocation”: {
“module_args”: “”,
“module_name”: “ec2_facts”

PLAY RECAP ********************************************************************
Get instance ec2 facts ————————————————– 0.13s
debug var=ec2_facts —————————————————– 0.01s
Total Timing :0.13s
localhost : ok=3 changed=0 unreachable=0 failed=0

feel free to get it from my github

7 plugins untuk editor brackets

Bagi mereka yang belum pernah tahu atau pakai brackets, brackets adalah opensource editor yang dibuat oleh adobe. mari kita mulai review sederhana untuk 7 plugins brackets kita. catatan sampingan buat anda brackets is not new, di github ada 23970 star dengan lebih dari 5025 fork

Github : https://github.com/adobe/brackets
Slack: Brackets on Slack (You can join by requesting an invite)
Developers mailing list: http://groups.google.com/group/brackets-dev
Twitter: @brackets
Blog: http://blog.brackets.io/
IRC: #brackets on freenode

1. Brackets Git

plugin brackets editor yang satu ini akan menghubungkan anda dengan git, tentunya anda harus install git di computer anda. create branch, commit dan jangan lupa settings remote anda. bisa github, bitbucket atau apapun.

2. Code folding

Plugin ini sangat berguna ketika anda ingin melipat code anda dalam kurung kurawal atau berdasarkan tag html tertentu misalnya div, bila code anda terlalu panjang anda dapat melipatnya untuk melihatnya lebih singkat.

3. Beautify

secara umum ctrl+shift+l shortcut untuk beautify, apa yang beautify lakukan untuk anda ? dia akan merapikan tab dan spasi yang telah anda buat di code anda. Merapikan tab dan spasi pada code anda yang berantakan secara otomatis.

4. Emmet

https://github.com/emmetio/brackets-emmet adalah plugin untuk HTML dan CSS dimana emmet akan membuat waktu coding anda singkat karena dengan perintah singkatnya dia akan membuatkan tag dan css yang berulang menjadi lebih singkat. kindly goto youtube https://www.youtube.com/watch?v=NhVdn7_ub5k

5. Documents Toolbar

Document toolbar seperti sublime meletakkan file yang sedang anda edit dalam urutan tab

6. HTMLHint

ini adalah plugin linter untuk HTML, ketika menuliskan class pada html dan class itu belum ada, maka editor brackets akan memberikan kamu kesempatan untuk membuat class baru itu dan kamu secara otomatis akan dibawa ke class yang baru atau ke class yang sudah ada. langsung di edit inline di tempat tidak perlu buka file yang berbeda. sangat membantu mencegah lupa akan class css sewaktu menulis html.

7. Minimap

ini dia minimap code, ketika code anda sangat panjang dan rumit anda ingin tahu anda kini ada di area mana pada coding anda. minimap bisa membantu anda memberikan informasi anda ada di tengah-tengah code atau di bagian bawah code saat ini.

My Custom Git Cheet Sheet Command

git identity

- git config --global user.name "Addhe Warman"
- git config --global user.email "addhe.warman@gmail.com"

git editor

- git config --global core.editor vim

git diff tool

- git config --global merge.tool vimdiff

git check settings

- git config --list

git help

- git help
- man git

git initial a repository in existing directory

$ git init
$ git add sample.txt
$ git add README
$ git commit -m 'first initial project versioning'

git cloning existing repository

$ git clone https://github.com/addhewarman/docker-locust

$ git clone git@github.com:addhewarman/docker-locust.git

git check status of your file changes

$ git status

git tracking new files

$ git add YOUR_FILE

$ git add YOUR_FILE_1 YOUR_FILE_2

git how you commit your changes

$ git status

$ git diff


$ git commit -m 'i have updated my file'

$ git log

$ git show SHA_NUM

git revert your changes

$ git checkout YOUR_MODIF_FILE

git revert one commit

$ git reset HEAD~1


$ git revert HEAD

git ignore file

$ vim .gitignore

git check your ignore file

$ cat .gitignore

git compare your changes

$ git diff

$ git diff --cached

git compare staged changes to your last commit

$ git diff --staged

git commit your changes

$ git commit -m '
i made this cheatsheet as simple and posible
as clear as clean water and 5 years old kid can
learn and read it

$ git commit -a -m '
add -a will add everything without have to add
or using git add one by one

git remove file that you already add

$ git rm YOUR_FILE

$ git rm *~

$ git rm log/*.log

git moving files

$ git mv file_from file_to

git show commit history

$ git log

$ git log -p -2

git series of summarizing option

$ git log --stat

git log output to formats other than default (one liner)

$ git log --pretty=oneline

git log output to your own format

$ git log --pretty=format:"%h - %an, %ar: %s"

git limit log output

$ git log --since=12.weeks

git log commit by awan in december 2014 to january 2015

$ git --pretty="%h:%s" --author=awan --since="2014-12-01" --before="2015-01-28"

git log pretty format with ASCII graph visual of your branch and merge

$ git log --pretty-format:"%h %s" --graph

git commit forget one file to commit

$ git commit -m 'i commit this and i forget one file'
$ git add file_kelupaan
$ git commit --amend

git command to revert one file from list of your git add

case : dayummm i git add everything, i should not add them all this cubbysmart.txt should not in the list

awan@google:~/django# git add .
awan@google:~/django# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
# new file: awan.txt
# new file: cubbysmart.txt
# new file: encrypt.py
# new file: index.py
# new file: master_code.py
awan@google:~/django# git reset HEAD cubbysmart.txt
awan@google:~/django# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
# new file: awan.txt
# new file: encrypt.py
# new file: index.py
# new file: master_code.py
# Untracked files:
# (use "git add ..." to include in what will be committed)
# cubbysmart.txt

git unmodifying a modified file

$ git checkout your_modified_file.py

git showing your remotes

$ git remote

$ git remote -v

git add remote repository

$ git remote add awan_cloud git://github.com/awan/cloudofme.git

awan@google:~/django# git remote
awan@google:~/django# git remote -v
origin ssh://534dda7f5004461b4d0000f8@django-addhewarman.rhcloud.com/~/git/django.git/ (fetch)
origin ssh://534dda7f5004461b4d0000f8@django-addhewarman.rhcloud.com/~/git/django.git/ (push)
awan@google:~/django# git remote add awan_cloud git://github.com/awan/cloudofme.git
awan@google:~/django# git remote -v
awan_cloud git://github.com/awan/cloudofme.git (fetch)
awan_cloud git://github.com/awan/cloudofme.git (push)
origin ssh://534dda7f5004461b4d0000f8@django-addhewarman.rhcloud.com/~/git/django.git/ (fetch)
origin ssh://534dda7f5004461b4d0000f8@django-addhewarman.rhcloud.com/~/git/django.git/ (push)

git get data from remote projects

$ git fetch your_remote

$ git fetch awan_cloud

git push to your remote

$ git push origin remote

$ git push origin awan_cloud

git inspecting a remote

$ git remote show origin

$ git remote show awan_cloud

git remove and rename remotes

$ git remote rename awan_cloud cloud_aws

$ git remote

$ git remote rm cloud_aws

git tag your revision

$ git tag

$ git tag -a your_tag_name -m 'my first tag' your_sha_revision_id

awan@google:~/django# git tag -a my_tag -m 'tset tag' 22d9cd99b2184967033fd14b1be8cd5c88a1d037
awan@google:~/django# git tag -l
awan@google:~/django# git show my_tag
tag my_tag
Tagger: Awan
Date: Sun Aug 30 23:09:26 2015 +0700

tset tag

commit 22d9cd99b2184967033fd14b1be8cd5c88a1d037
Author: Awan
Date: Wed Apr 16 08:17:40 2014 +0700

update code

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..70166b0
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+#addhe warman django project

git sharing tag

$ git push origin my_tag

git alias

$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status
$ git config --global alias.unstage 'reset HEAD --'
$ git config --global alias.last 'log -1 HEAD'

git check your current branch

$ git branch

git create a branch

$ git checkout -b MY_NEW_BRANCH

git push changes to branch

$ git push origin MY_NEW_BRANCH

git pull from branch

$ git pull origin MY_NEW_BRANCH

git change back to master branch

$ git checkout master

git merge branch to master

$ git checkout master
$ git merge MY_NEW_BRANCH

—————— continue to part 2

Let’s Encrypt SSL Gratis Untuk Semua Orang

ISRG (Internet Security Research Group) sebuah perusahaan di San Francisco, California meluncurkan Let’s Encrypt pada tanggal 27 July 2015. Let’s Encrypt adalah tempat dimana kamu bisa mendapatkan sertifikast ssl gratis untuk website kamu. Ada 2 alasan kenapa https diperlukan, pertama adalah Enkripsi, dan yang kedua adalah Identification. Kapan anda membutuhkannya ? ketika anda mengirimkan data sensitif ke server seperti login, informasi account bank, informasi kartu kredit.

Let’s Encrypt has reached a point where we’re ready to announce our launch schedule.

  • First certificate: Week of July 27, 2015
  • General availability: Week of September 14, 2015

Untuk mendapatkan sertifikasi ssl gratis ini anda hanya butuh menginstall aplikasi let’s encrypt di server anda lalu aplikasi ini akan mengenerate sertifikasi yang dibutuhkan lalu menguploadnya ke server Let’s Encrypt, anda akan mendapatkan sertifikasi authority dan tinggal di gunakan di website anda.

Untuk anda yang sudah memiliki / mengenerate sertifikat sendiri anda dapat menggunakannya dan menguploadnya ke server let’s encypt untuk mendapatkan certificate authority gratis

Skipfish scanner step by step

Skipfish adalah tool dibuat oleh karyawan yang kini bekerjaa di google, skipfish pada dasarnya akan scan webapplication dan hasilnya akan di pass ke mesin deteksi untuk di analisa.

Untuk menjalankan skipfish, anda butuh 2 hal yang penting.
– Direktori
– List kata / Kamus kata

1. Ciptakan folder untuk skipfish
mkdir skipfish-outlog

2. List kata ambil contoh kata bisa dari
cp /usr/share/skipfish/dictionaries/medium.wl .

3. Pastikan folder yang kamu buat bisa di tulis, eksekusi perintah ini untuk check
chmod 755 medium.wl

4. Jalankan skipfish
skipfish -S medium -o skipfish-outlog/

skipfish -S medium.wl -o skipfish-out/ http://detik.com

python telnet / monitoring redis or beanstalk

i wrote this python to monitor my redis or beanstalk process, cannot give you full of my scripts this is only basic scripts. in case me in the future forget how to write and send command to server via telnet and failed because of hung in the middle of process (got into limbo) this will get the value and send that value over to monitoring server thru REST API or CLI

Monitoring current connected client in redis

#!/usr/bin/env python
# Very simple python monitoring redis connected clients.

import sys
import telnetlib
import time

def run_telnet_session():
 #host = raw_input("Enter remote hostname e.g. localhost:")
 #port = raw_input("Enter remote hostname e.g. 6379:")
 host = ""
 port = 6379
 session = telnetlib.Telnet(host,port)

 session.write("info \r\n")
 session.write("quit \r\n")
 #print data
 for item in data.split("\n"):
  if "connected_clients" in item:
    print item.strip()
    print item.strip().split(':')[1]

if __name__ == '__main__':

Monitoring Current Job ready beanstalkd

#!/usr/bin/env python
# Very simple python monitoring redis connected clients.

import sys
import telnetlib
import time

def run_telnet_session():
 host = ""
 port = 11300
 session = telnetlib.Telnet(host,port)


 for item in data.split("\n"):
   if "current-jobs-ready" in item:
    print item.strip()
    print item.strip().split(':')[1]

if __name__ == '__main__':


Easiest way “How to get tag from remote github repository”

when someone ask you, is it posible to get my latest tag from my github repository so i can put or add it into my automation deployment process for staging environment every morning without have to trigger it manually ? here it’s how to solve it

awan@google-provision:~$ MY_PROJECT=avengers
awan@google-provision:~$ git ls-remote --tags git@github.com:MY_REPOSITORY/"$MY_PROJECT".git | awk '{print $2}' | grep -v '{}' | awk -F"/" '{print $3}' | tail -n 1

put it into variable and you can pass the variable into your automation scripts.

if you’re using ansible to deploy it, ansible has module to do this

- name: Get Latest Tag from my Repo
local_action: shell git ls-remote --tags git@github.com:MY_REPOSITORY/"$MY_PROJECT".git | awk '{print $2}' | grep -v '{}' | awk -F"/" '{print $3}' | tail -n 1
register: my_last_tag

- name: Update Code Via Github
git: repo=git@github.com:MY_REPOSITORY/avengers.git
ssh_opts="-o ForwardAgent=yes"
version="{{ item }}"
with_items: my_last_tag.stdout_lines
register: code
sudo: no
tags: update

Menghubungkan Container Docker di Hardware Yang Berbeda

Kalau ada yang bertanya, apakah memungkinkan saya menghubungkan docker container saya dengan container yang lain pada mesin / hardware / server yang berbeda ? jawabnya tentu dan sangat mudah. mari kita buatkan analoginya

1. Saya punya 4 mesin mewakili 4 layer di infrastruktur saya, terdiri dari :
— 2 buah server DELL untuk webserver
— 1 buah server HP untuk application / cron / api
— 1 buah server IBM untuk database server

2. Didalam setiap server saya letakkan container docker yang sudah di provision menggunakan ansible sebagai berikut

— container web application
–++ Image Container Name : infra/web
— container apps / cron / api
–++ Image Container Name : infra/apps
— container database
–++ Image Container Name : infra/db

3. Sekarang saya ingin memberikan contoh ip address yang saya gunakan untuk testing ini

— 2 buah server DELL untuk webserver

— 1 buah server HP untuk application / cron / api

— 1 buah server IBM untuk database

4. untuk dapat menghubungkan container dengan container lain pada mesin / server yang berbeda dapat dengan cara sebagai berikut :

--- login ke server DELL ip
--- root@ docker run -i -t --net=host infra/web /bin/bash
--- root@ <--- anda sudah berada dalam container dengan IP hardware

--- login ke server DELL ip
--- root@ docker run -i -t --net=host infra/web /bin/bash
--- root@ <--- anda sudah berada dalam container dengan IP hardware

--- login ke server HP ip
--- root@ docker run -i -tn --net=host infra/apps /bin/bash
--- root@ <--- anda sudah berada dalam container dengan IP hardware

--- login ke server IBM ip
--- root@ docker run -i -tn --net=host infra/apps /bin/bash
--- root@ <--- anda sudah berada dalam container dengan IP hardware

dengan container yang telah menggunakan ip hardware dari server anda, anda dapat langsung berhubungan dengan server lainnya, perlu di ingat karena anda membuka port ketika menjalankan aplikasi anda port itu tidak akan terlihat oleh host master tapi oleh container anda jangan sampai lupa karena terkadang anda butuh menjalankan beberapa container pada satu hardware dan ternyata port 80 sudah terbuka di container yang lain namun port ini tidak akan dapat complaint oleh aplikasi karena dia terbuka di container yang berbeda, hasil yang anda dapatkan bisa sangat bervariasi baik itu flaky network atau aplikasi yang berjalan dengan tidak semestinya.

Selamat anda telah menghubungkan container dengan container running under docker dengan 4 hardware yang berbeda.