Monday, January 29, 2018

Keepass + KeeAnywhere plugin

I used KeePass long time ago and until now I'm still using it.

It's a great tool to save your password encrypted. At my home, I saved the database file in my google drive. But when I'm outside I can't retrieve my password without opening the database file in my google drive.

For this, I want to explore how to run KeePass on my USB stick and at the same time synchronize it in my google drive where my database file is located.

I found a way to succeed my idea through the help of plugin called KeeAnywhere
https://keepass.info/plugins.html#keeanywhere

you just download the zip file, unzip it and load everything on the plugin folder in your keepass.
click KeeAnywhere


Add google drive

Open from Cloud Drive


and Voila, is it stupendous! 


Saturday, January 27, 2018

How to change report.pdf in Odoo


from Delivery Report.pdf to PO00001.pdf



class report_controller(main.ReportController):
        @http.route(['/report/download'], type='http', auth="user")
        def report_download(self, data, token):
            order_obj = http.request.env['stock.picking']
            normalize_obj = unicodedata.normalize('NFKD', data).encode('ascii','ignore')
            if 'delivery_report' in normalize_obj:
                reportname = normalize_obj.split('/report/pdf/')[1].split('?')[0]
                reportname, docids = reportname.split('/')
                assert docids
                object = order_obj.browse(int(docids))
                response = super(report_controller, self).report_download(data, token)
                response.headers.set('Content-Disposition', 'attachment; filename=%s.pdf;' % object.origin)
                return response


fixed bug:
pls see on red

Reference:

Friday, January 26, 2018

How to install Docker compose



STEP 1: Download Docker compose

sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose


STEP 2: Execute permission

sudo chmod +x /usr/local/bin/docker-compose



docker-compose --version

Thursday, January 25, 2018

Next level Kubernetes

I was thinking to learn something new today and I've got this feeling to take a look again with Kubernetes.

I found this tutorial that is very good and he demonstrates from start zero to finish.

Here's the link
https://www.youtube.com/watch?v=b_fOIELGMDY


updated: 2/11/2018
https://www.youtube.com/watch?v=gpmerrSpbHg

Sunday, January 14, 2018

Docker issue


1. I had experience once in a blue moon and there's nothing way than to stop/start the docker service. Viola!

Issue:
Error response from daemon: cannot stop container: odoo9: Cannot kill container 0a08b9aefcaa2db053330cbd2b80591a81e68e4027cf6183338fc2700dd940bb: connection error: desc = "transport: dial unix /var/run/docker/containerd/docker-containerd.sock: connect: connection refused": unknown



solution:
sudo /etc/init.d/docker stop
sudo /etc/init.d/docker start





2. When I tried to run latest odoo11 and postgres 10 using docker-compose , I knew I perfectly copied from my configuration in odoo 9 setup but when I hit enter. Bang! issue found.
After a few googling for answers, I think there's some problem with volume. I guess. :)

Issue:

psycopg2.OperationalError: FATAL:  password authentication failed for user "odoo"


Solution:
docker volume rm malphi_malphi_odoo-db-data

Reference:
https://stackoverflow.com/questions/29580798/docker-compose-environment-variables




3. When I installed a new fresh centos environment in vbox. Everything is new, even docker :)
I have this issue everytime I open the virtual box that docker is not running.


Solution:
sudo systemctl start docker
sudo systemctl enable docker

Reference:
https://docs.docker.com/install/linux/linux-postinstall//

Friday, January 12, 2018

Print output does not reflecting in the log

It took me a couple of days just to figure out this problem. I know its a simple as you think but I'm wondering why can't show the print output in the log.

For many test attempt that I have done, I finally figure it out.

Simple.

environment:
      - PYTHONUNBUFFERED=1

that's it, just add this to docker-compose yml file.
Eureka!

Sunday, January 7, 2018

We will talk about NGINX

I have heard this NGINX a long time ago when I got here in my recent job but I don't know what exactly it is. I had a little knowledge that it will manage the proxy and that's it.

When I deployed docker in our SIT environment (my boss give me the opportunity to use my skill in docker). I heard again NGINX in our discussion and I asked this question. "What is exactly is NGINX?" my boss replied. "Boy, it's a good time to learn something new" and so he explains.

We end up with docker deployed in SIT and installed Odoo environment as well but no NGINX.

Today, I learn this technology by watching youtube.

This link from Quentin Stafford-Fraser who explains very clearly about NGINX

Wednesday, January 3, 2018

Linux command that you don't know first


1. Linux command to print directory structure in the form of a tree

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'



2. Change folder ownership

chmod -R 777 directory_name



3. Make it runnable

sudo chmod +x filename.bin


4. Renew IP address
sudo dhclient -r

Monday, January 1, 2018

Change the file permissions to be server-writable?

Linux
Once you have the files set up on your Linux box, and assuming you can SSH into the box to access your SimplePie files:

Navigate to the directory above your cache directory.
Type chmod -Rf 755 ./cache.
If that doesn't work, try 775, then 777 in order until you find one that works.

How to connect shared folder in virtual box using centos


sudo mount -t vboxsf repo2 /home/devlynard/data/vbroker

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

sudo yum install docker-ce
yum list docker-ce --showduplicates | sort -r

docker-ce.x86_64            17.12.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.09.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.09.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.06.2.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.06.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.06.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.2.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.0.ce-1.el7.centos             docker-ce-stable

sudo yum install docker-ce-17.09.1.ce

sudo systemctl start docker
sudo usermod -aG docker $USER

https://www.youtube.com/watch?v=EYVO4kEQomE
https://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-hat-rhel/




UPDATED: 9 Jan 2018

I have successfully connected my working directory from host(Windows) to server(virtualbox running centos)

1. add shared folder in virtual box settings.

2. mount below folders
sudo mount -t vboxsf repo2 /home/devlynard/odoo9/app/customaddons

3. add command at start up
edit etc/rc.d/rc.local
make it executable

Eureka!




free online comma separating tool

https://delim.co/#