Sunday, December 30, 2018
creating REST api using python
https://codeburst.io/this-is-how-easy-it-is-to-create-a-rest-api-8a25122ab1f3
Saturday, December 29, 2018
Wednesday, December 26, 2018
Project okasyonapp.com
Plan
References:
https://www.facebook.com/okasyonevents/
https://okasyonweddings.wordpress.com/
https://www.cvent.com/sg/
References:
https://www.facebook.com/okasyonevents/
https://okasyonweddings.wordpress.com/
https://www.cvent.com/sg/
Sunday, December 23, 2018
Installing react
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
nodejs -v
2. install react
sudo npm i -g create-react-app@1.5.2
cd folder
npm start
Saturday, December 22, 2018
Json formatter
It's a great json formatter where you can view into different type like form,view,tree,code
https://jsonformatter.org
https://jsonformatter.org
Friday, December 21, 2018
Wednesday, December 5, 2018
curl: (60) Peer's Certificate issuer is not recognized
After our company implements stricter rules, I can't install docker in my vagrant properly. I have been solving this issue for about a week and its hard to point out the correct solution until I found from stackoverflow.
add this in vagrant file
config.vm.box_download_ca_cert = "./Fortinet_CA_SSL.cer"
https://stackoverflow.com/questions/47676980/curl-60-peers-certificate-issuer-is-not-recognized
add this in vagrant file
config.vm.box_download_ca_cert = "./Fortinet_CA_SSL.cer"
Finally fixed it. Post the answer here as reference.
- Export company trusted root certificate with .cer extension. Somthing naming external root certificate
- Convert the ca file to .pem file using
openssl x509 -in xxx.cer -inform der -outform pem -out xxx.pem
Then on the centos 7 os:
- Install the ca-certificates package: yum install ca-certificates
- Enable the dynamic CA configuration feature: update-ca-trust force-enable
- Add the exported pem files to /etc/pki/ca-trust/source/anchors/
- Use command: update-ca-trust extract
https://stackoverflow.com/questions/47676980/curl-60-peers-certificate-issuer-is-not-recognized
Wednesday, November 28, 2018
Postgres SQL
To get the 12HH with AM/PM
select to_char(create_date at time zone 'utc', 'HH12:MI:SS AM') as "createdate", proc_type, state, * from vb_proc_queue where proc_type='Email1SubsqSignUpNotify' order by create_date desc
04:18:19 PM
Monday, November 26, 2018
Sunday, November 25, 2018
Installing Kubernetes
1. Install kubectl
Install with snap on Ubuntu
sudo snap install kubectl --classic
kubectl version
1.1 Install virtualbox
Installing a pod network add-on ???
Install docker
yum install -y docker
systemctl enable docker
systemctl start docker
Install with snap on Ubuntu
sudo snap install kubectl --classic
kubectl version
1.1 Install virtualbox
https://tecadmin.net/install-oracle-virtualbox-on-ubuntu/
2. Install minikube
https://github.com/kubernetes/minikube/blob/v0.29.0/README.md
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \ && sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start
and then ... can't allocate memory :(
2nd attempt
https://kubernetes.io/docs/setup/independent/install-kubeadm/
2. Install minikube
https://github.com/kubernetes/minikube/blob/v0.29.0/README.md
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \ && sudo install minikube-linux-amd64 /usr/local/bin/minikube
and then ... can't allocate memory :(
2nd attempt
https://kubernetes.io/docs/setup/independent/install-kubeadm/
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kube*
EOF
# Set SELinux in permissive mode (effectively disabling it)
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
systemctl enable kubelet && systemctl start kubelet
Installing a pod network add-on ???
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
before kubeadm init, run below
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
before kubeadm init, run below
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
Install docker
yum install -y docker
systemctl enable docker
systemctl start docker
Wednesday, November 14, 2018
Odoo Warning - Validation Error
Problem:
Solution: None
it turns out that the problem was the trigger. our DB admin created trigger :(
Sunday, November 4, 2018
curl example
In my freelance job, I have tasked which I need to call the API using curl. I don't have any much knowledge of it but I think I got some idea.
Basically, the API is called by a PDA mobile device where a user can enter the information and will send through JSON format and call the API.
But the API call will not always return success. The first task which I want to do is to store that raw json into the server, which I already finish implemented.
The second one is to call the API through curl and passing the failed raw JSON. So before will run the curl, a user who only has SSH access to a server can able to edit the raw JSON and run curl to call API with edited raw JSON.
here's the curl syntax:
curl -vX POST http://206.189.159.4:8080/chicken/api/order/create -d @json/20181008-180947_PDA_1.json --header "Content-Type: application/json"
let me explain more:
-v = verbose
X = request
-d = data json file (i don't know why there is @ at the beginning)
--header "Content-Type: application/json" = i think its understandable as we pass json file here
Eureka!
Basically, the API is called by a PDA mobile device where a user can enter the information and will send through JSON format and call the API.
But the API call will not always return success. The first task which I want to do is to store that raw json into the server, which I already finish implemented.
The second one is to call the API through curl and passing the failed raw JSON. So before will run the curl, a user who only has SSH access to a server can able to edit the raw JSON and run curl to call API with edited raw JSON.
here's the curl syntax:
curl -vX POST http://206.189.159.4:8080/chicken/api/order/create -d @json/20181008-180947_PDA_1.json --header "Content-Type: application/json"
let me explain more:
-v = verbose
X = request
-d = data json file (i don't know why there is @ at the beginning)
--header "Content-Type: application/json" = i think its understandable as we pass json file here
Eureka!
Sunday, October 21, 2018
Friday, October 19, 2018
Monday, October 15, 2018
Friday, October 5, 2018
Sunday, September 23, 2018
Fix: is not in the sudoers file. This incident will be reported.
lynard is not in the sudoers file. This incident will be reported.
switch to root
sudo usermod -g sudo lynard
Eureka!
switch to root
sudo usermod -g sudo lynard
Eureka!
Saturday, September 22, 2018
Installing elasticsearch in ubuntu
sudo apt-get update
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.deb wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.deb.sha512 shasum -a 512 -c elasticsearch-6.4.0.deb.sha512
sudo dpkg -i elasticsearch-6.4.0.deb
if error as below:
systemctl: command not found
sudo apt-get install systemd
updated: 17 Oct 2019
https://www.elastic.co/guide/en/elasticsearch/reference/current/es-release-notes.html
if error as below:
systemctl: command not found
sudo apt-get install systemd
updated: 17 Oct 2019
https://www.elastic.co/guide/en/elasticsearch/reference/current/es-release-notes.html
Install oracle java jdk 8 in ubuntu
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:webupd8team/java
sudo bash -c "echo deb http://http.debian.net/debian jessie-backports main >> /etc/apt/sources.list"
sudo bash -c "echo deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main >> /etc/apt/sources.list.d/webupd8team-java.list"
sudo bash -c "echo deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main >> /etc/apt/sources.list.d/webupd8team-java.list"
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo apt-get update
sudo apt-get -y upgrade
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo apt-get -y install oracle-java8-installer oracle-java8-set-default
https://stackoverflow.com/questions/48356434/install-java-8-jdk-1-8-using-vagrant-up-not-working-on-debian
update: 23/9/2018
this is more clearer
https://thishosting.rocks/install-java-ubuntu/
Sunday, September 16, 2018
How to launch sublime from command prompt
1. run sysdm.cpl in command prompt
2. add the path from sublime to the environment variables
C:\Program Files\Sublime Text 3
reference:
https://stackoverflow.com/questions/9440639/sublime-text-from-command-line-win7
Thursday, September 6, 2018
GIT let's talk about it
cherry-pick
https://www.youtube.com/watch?v=-ndmel-4wsk
git branching and merging
https://www.youtube.com/watch?v=uR-9NGrpU-c
https://www.youtube.com/watch?v=-ndmel-4wsk
git branching and merging
https://www.youtube.com/watch?v=uR-9NGrpU-c
Monday, September 3, 2018
Odoo installation guide
I found this site very helpful regarding Odoo especially on the script where the odoo start and stop in the server.
https://www.linode.com/docs/websites/cms/install-odoo-9-erp-on-ubuntu-14-04/
https://www.linode.com/docs/websites/cms/install-odoo-9-erp-on-ubuntu-14-04/
Thursday, August 30, 2018
Permanent aliases
Sometimes typing docker-compose up is too long to type. The best to make it shorter is to create aliases like alias ll="ls -al" but this is only temporary.
To make it a permanent aliases edit the ~/.bashrc and add the following
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias dbup='docker-compose up -d db'
alias up='docker-compose up app'
alias stop='docker-compose stop'
alias re='docker-compose restart'
alias logs='docker-compose logs -f --tail 10'
refresh
source ~/.bashrc
Eureka!
To make it a permanent aliases edit the ~/.bashrc and add the following
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias dbup='docker-compose up -d db'
alias up='docker-compose up app'
alias stop='docker-compose stop'
alias re='docker-compose restart'
alias logs='docker-compose logs -f --tail 10'
refresh
source ~/.bashrc
Eureka!
Monday, August 27, 2018
Copy file or folder from docker container to host
Odoo11
$docker cp odoo11:/usr/lib/python3/dist-packages/odoo/addons addons
Friday, August 24, 2018
Package control and GITSavvy for sublime
Since I worked in python I always use sublime as my main editor. It's super sleek, fast and lightweight. On the other hand, using GIT is better than using SVN but you need to learn at least the basic git commands and I'll tell you that it super hard at first.
I found this tool to be installed in sublime as a helper when you use GIT.
Install the package control first
https://packagecontrol.io/installation#st3
https://mijingo.com/blog/sublime-text-package-control
after installing, just open up the package control by pressing ctrl+shift p. Install GITSavvy and that's it. Eureka!
Monday, August 6, 2018
Jasper Server 2.0
In my previous post http://skytechguyver.blogspot.com/search/label/Jasper I was able to run in docker and though it is running I think its lacking something.
And I found this link https://github.com/TIBCOSoftware/js-docker and I think this is the right way for my jasper server setup in my development machine.
The documentation is understandable except when I run the docker-compose. I got this error in a jasperserver-pro name because when you download the zip file from https://community.jaspersoft.com/project/jasperreports-server/releases the default name is already changed to jasperserver instead of jasperserver-pro.
And I found this link https://github.com/TIBCOSoftware/js-docker and I think this is the right way for my jasper server setup in my development machine.
The documentation is understandable except when I run the docker-compose. I got this error in a jasperserver-pro name because when you download the zip file from https://community.jaspersoft.com/project/jasperreports-server/releases the default name is already changed to jasperserver instead of jasperserver-pro.
Overall, it was awesome I can run localhost:8080/jasperserver
So, right now I want to try to download the latest jasperserver 7.1.0 and add into resources and build again the docker.
Sunday, August 5, 2018
Vagrant forwarded port already in use
Conflict with existing port
Solution:
- Install first the TCPView https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview
- Find the desired port and end process
That's it! Eureka.
How to make folder writable in ubuntu
That makes the directory writable, readable and executable by anybody
sudo chmod 777 directory
It will give all permission except write by anybody.
It will give all permission except write by anybody.
sudo chmod 775 'your directory'
Postgres backup and restore
Backup commands
- pg_dump db_name > db_backup.sql
- pg_dumpall > cluster_backup.sql
Restore commands
- psql db_name < db_backup.sql
- psql -f cluster_backup.sql postgres
Using compression
- pg_dump db_name | gzip > db_backup.gz
- pg_dumpall | gzip > cluster_backup.gz
Restore
- gunzip -c db_backup.gz | psql db_name
- gunzip -c cluster_backup.gz | psql postgres
reference:
https://www.rubytreesoftware.com/resources/basic-postgresql-backup-and-restore/
- pg_dump db_name > db_backup.sql
- pg_dumpall > cluster_backup.sql
Restore commands
- psql db_name < db_backup.sql
- psql -f cluster_backup.sql postgres
Using compression
- pg_dump db_name | gzip > db_backup.gz
- pg_dumpall | gzip > cluster_backup.gz
Restore
- gunzip -c db_backup.gz | psql db_name
- gunzip -c cluster_backup.gz | psql postgres
reference:
https://www.rubytreesoftware.com/resources/basic-postgresql-backup-and-restore/
Cron job
sudo crontab -e
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday; 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command_to_execute
0 0 * * * /opt/odoo12/run_backup.sh
Thursday, August 2, 2018
Vagrant error
I had encountered similar error below
and I think when I installed vagrant plugin called vagrant-dns
It happens that I need to reinstall vagrant which took a lot of time but still the error persists.
After digging into the internet for a solution, I finally found it. Damn it!
$ vagrant plugin uninstall vagrant-dns
Well, at least I know now.
Adios!
Wednesday, August 1, 2018
Gitlab self-hosted
It's been a while that I have done trial and error installing Gitlab on my local machine and I find some interesting way of learning.
1st attempt
So first of all, I started to install Gitlab directly using someone's code base from github.
Looks promising, I will give it a try
https://gist.github.com/cjtallman/b526d8c7d8b910ba4fd41eb51cd5405b
I don't know what happen when I execute vagrant up but I was astonished
2nd attempt
This time, I read another tutorial with more details and videos
update: 2018-08-07
https://codereviewvideos.com/course/your-own-private-github
steps:
sudo apt-get update
1st attempt
So first of all, I started to install Gitlab directly using someone's code base from github.
Looks promising, I will give it a try
https://gist.github.com/cjtallman/b526d8c7d8b910ba4fd41eb51cd5405b
I don't know what happen when I execute vagrant up but I was astonished
2nd attempt
This time, I read another tutorial with more details and videos
update: 2018-08-07
https://codereviewvideos.com/course/your-own-private-github
steps:
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
sudo apt-get install -y postfix
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/trusty/gitlab-ce_11.1.4-ce.0_amd64.deb/download.deb
sudo dpkg -i gitlab-ce_11.1.4-ce.0_amd64.deb
sudo gitlab-ctl reconfigure
3rd attempt
This time, is my favorite docker installation. hope everything's okay
Installation using Docker
https://hub.docker.com/r/gitlab/gitlab-ce/
https://docs.gitlab.com/omnibus/docker/
sudo gitlab-ctl reconfigure
3rd attempt
This time, is my favorite docker installation. hope everything's okay
Installation using Docker
https://hub.docker.com/r/gitlab/gitlab-ce/
https://docs.gitlab.com/omnibus/docker/
Sunday, July 29, 2018
Rsync (Remote Sync)
Every time I create a new odoo instance is that I always copy my source code to a new odoo folder setup. It's not only time-consuming but every time I need to edit a single source code I also need to edit the other source code. bit confusing? anyway, I'm the only one who understands. :)
I found this Linux command and I think it is very useful. The last time I remember that I have encountered this kind of command but didn't think of it much how useful it is.
so here we go, without further ado.
first install the tool
sudo apt-get install rsync
I found this Linux command and I think it is very useful. The last time I remember that I have encountered this kind of command but didn't think of it much how useful it is.
so here we go, without further ado.
first install the tool
sudo apt-get install rsync
sudo rsync -avzh /odoo/trunk/app/customaddons /odoo/sit3/app
eureka!
reference:
Wednesday, July 25, 2018
Installation ansible
sudo apt-get install ansible
ssh-keygen
ssh-copy-id
reference:
https://www.youtube.com/watch?v=icR-df2Olm8
ssh-keygen
ssh-copy-id
reference:
https://www.youtube.com/watch?v=icR-df2Olm8
Font Awesome
As I was checking the upwork site I stumbled this one project. It has there project description and was curious about this font awesome. Maybe I'm gonna try this sometime.
https://fontawesome.com/
https://www.w3schools.com/icons/fontawesome_icons_intro.asp
https://fontawesome.com/
https://www.w3schools.com/icons/fontawesome_icons_intro.asp
Tuesday, July 24, 2018
How to install postgresql into ubuntu
Installation
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
Backup
pg_dump my_postgres_db > my_postgres_db.sql
Restore
plsql my_postgres_db < my_postgres_db.sql
Sunday, July 22, 2018
Installing subversion in linux
sudo apt-get install subversion
sudo svn checkout svn://172.18.6.8/repo2/trunk
Friday, July 20, 2018
forwarded port to xxxx is already in use on the host machine
Problem:
Solution:
netstat -ano | findstr :5432
taskkill /PID 4128 /F
Reference:
https://stackoverflow.com/questions/39632667/how-to-kill-a-currently-using-port-on-localhost-in-windows
Wednesday, July 18, 2018
Odoo transcoder.js issue
Problem:
Solution:
docker cp transcoder.js vbroker_app:/usr/lib/python2.7/dist-packages/openerp/addons/web_editor/static/src/js
reference:
https://github.com/odoo/odoo/issues/22517
Thursday, July 12, 2018
Monday, July 2, 2018
Change user and group permission in linux
problem:
solution:
sudo chown -R odoo:odoo vbroker20-beta2
references:
Installing Rasa NLU in docker
It's been a while I wrote up an article and I find today is the best to start again.
I have been using Rasa Chatbot for a while and still didn't get much knowledge of it because of the busy at work. I will start to install Rasa again using docker and let's see how it goes. So buckle up and start your engine.
Step-by-step
1. docker run -p 5000:5000 rasa/rasa_nlu:latest-full
2. curl 'http://localhost:5000/parse?q=hello'
Voila!
I have been using Rasa Chatbot for a while and still didn't get much knowledge of it because of the busy at work. I will start to install Rasa again using docker and let's see how it goes. So buckle up and start your engine.
Step-by-step
1. docker run -p 5000:5000 rasa/rasa_nlu:latest-full
2. curl 'http://localhost:5000/parse?q=hello'
Voila!
Monday, June 18, 2018
VBoxGuestAdditions in vagrant centos
1. sudo yum update && sudo yum -y install kernel-headers kernel-devel
2. manually by downloading the iso file inside VM (e.g. wget) and installing it, e.g.
wget http://download.virtualbox.org/virtualbox/5.0.16/VBoxGuestAdditions_5.0.16.iso -P /tmp
(read only to write permission)
sudo chmod 777 /tmp/VBoxGuestAdditions_5.0.16.iso
sudo mount -o loop /tmp/VBoxGuestAdditions_5.0.16.iso /mnt
(install libraries)
sudo yum -y install gcc
sudo yum install freeglut-devel
sudo yum install mesa*
sudo sh -x /mnt/VBoxLinuxAdditions.run # --keep
forget all the commands above , just download the geerlingguy/centos7
that's it!!! voila
vagrant provisioning thing...
last time I got this error installing docker and docker-compose during the vagrant up.
Ta dang!
config.vm.provision :docker
config.vm.provision :docker_compose
Reference:
https://github.com/leighmcculloch/vagrant-docker-compose
Ta dang!
config.vm.provision :docker
config.vm.provision :docker_compose
Reference:
https://github.com/leighmcculloch/vagrant-docker-compose
Sunday, June 3, 2018
fluentd the new logging
while working in one of my freelance jobs, I encountered this logging technology fluentd. It is quite interesting, hopefully can learn with this new technology.
I have installed in my centos operating system
References:
https://docs.fluentd.org
I have installed in my centos operating system
curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh
References:
https://docs.fluentd.org
Friday, May 11, 2018
django
install https://docs.docker.com/compose/django/
startapp
startapp
$ docker-compose run web python manage.py startapp map
Thursday, May 10, 2018
Vagrant centos version
I spent almost 3 hours figuring out this issue I have just encountered.
In my personal laptop, I plan to install centos/7 box but I got some weird issue. Something like permission thing, after an hour of fixing still I can't solve my problem.
So, I switch to bento/centos-6-7 and it works. It downloads the box and installed it. However when I try to clone the git repo. I got another issue. something in the git.
so, I downloaded again another box but this time, it is bento/centos7-2. hopefully, it will work now.
In my personal laptop, I plan to install centos/7 box but I got some weird issue. Something like permission thing, after an hour of fixing still I can't solve my problem.
So, I switch to bento/centos-6-7 and it works. It downloads the box and installed it. However when I try to clone the git repo. I got another issue. something in the git.
so, I downloaded again another box but this time, it is bento/centos7-2. hopefully, it will work now.
Thursday, April 26, 2018
How fast can you work in excel
https://www.facebook.com/7Second.Riddles/videos/200898747368848/UzpfSTEwMDAwMDc5NzczMzA4NjoxNzEwMTY3MzI5MDE5ODQy/
Monday, April 16, 2018
Troubleshooting with nodejs and npm
I got error when I tried to install rasa-nlu-trainer
$npm i -g rasa-nlu-trainer
error:
npm http GET https://registry.npmjs.org/express
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\main.js:409:26)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:88:17)
solution:
You can bypass https using below commands:
npm config set strict-ssl false
reference:
https://stackoverflow.com/questions/21855035/ssl-error-cert-untrusted-while-using-npm-command
-----------------------------------------------------
To update nodejs and npm:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
-----------------------------------------------------
"/usr/bin/env: node: No such file or directory"
solution:
ln -s /usr/bin/nodejs /usr/bin/node
Monday, March 26, 2018
Install Python 3 in Ubuntu
if add-apt is not found,
sudo: add-apt-repository: command not found
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo add-apt-repository ppa:jonathonf/python-3.6
I don't know my previous post above if its totally working on how to install python 3.6.
But here, I just tested it and obviously it works.
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
Wednesday, March 21, 2018
Inheriting a view without overriding the original view
the solution is to add
https://www.odoo.com/forum/help-1/question/inheriting-a-view-without-overriding-the-original-view-solved-85762
<field name="mode">primary</field>that's it! I don't know who created odoo but it's hard to get the right answer because of less documentation.
https://www.odoo.com/forum/help-1/question/inheriting-a-view-without-overriding-the-original-view-solved-85762
Monday, March 19, 2018
Installing nodejs
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
updated:
I just installed nodejs and npm in a newly created vm.
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04update: 7/30/2018
Alternatively, for Node.js 10:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
Wednesday, March 14, 2018
Setup a vagrant with gui
I have experimented to launch a vagrant using existing VMbox like ubuntu but I was failed to do it. I found this tutorial below.
https://relativkreativ.at/articles/how-to-build-a-vagrant-base-box-from-a-virtualbox-vm
Although, this example is based on centos I'm hoping to manage it in Ubuntu. I got an error in its really frustrating.
So I stop and goes right away to vagrant cloud to find any existing predefined vagrant box.
this one looks promising and will give it a try.
https://app.vagrantup.com/igorbrites/boxes/ubuntu-trusty64-gui
vagrant init igorbrites/ubuntu-trusty64-gui --box-version 0
https://relativkreativ.at/articles/how-to-build-a-vagrant-base-box-from-a-virtualbox-vm
Although, this example is based on centos I'm hoping to manage it in Ubuntu. I got an error in its really frustrating.
So I stop and goes right away to vagrant cloud to find any existing predefined vagrant box.
this one looks promising and will give it a try.
https://app.vagrantup.com/igorbrites/boxes/ubuntu-trusty64-gui
vagrant init igorbrites/ubuntu-trusty64-gui --box-version 0
Linux command
To set new password for root in Ubuntu
> sudo passwd root
To locate a file
find / -name 'pg_hba.conf' 2>/dev/null
To add new user
> sudo adduser --home /home/demo --shell /bin/bash demo
> sudo passwd root
To locate a file
find / -name 'pg_hba.conf' 2>/dev/null
To add new user
> sudo adduser --home /home/demo --shell /bin/bash demo
Wednesday, February 28, 2018
Sublime shortcut keys
I really like sublime, especially in my development. It is very lightweight and many features.
Today I learned something nice related to shortcut keys.
http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_win.html
Keep on subliming... :)
Today I learned something nice related to shortcut keys.
http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_win.html
Keep on subliming... :)
Sunday, February 25, 2018
Setup vagrant but cannot ping other network ip address “Destination Host Unreachable”
I spend many days to figure it out my problem in Vagrant. After I posted my question in stackoverflow, nobody is helping me instead they downvoted my post.
https://stackoverflow.com/questions/48899409/setup-vagrant-but-cannot-ping-other-network-ip-address-destination-host-unreach
Sad! really sad. :( curse you!!!
But anyway, I solved it in my own way. I found this article below
https://github.com/moby/moby/issues/27818
It's simply my docker IP address clashed with my company IP address because when you create the container by default it will create 172.18.xx.xx IP address. Boom! Destination unreachable.... blah blah.
So, I just create a custom docker network and when I checked it created IP address that start 172.19.xx.xx
$ docker network create --driver=bridge --subnet=172.20.0.0/16 --gateway=172.20.0.0 vbroker-network-v1
updated 2018-0720:
docker network create --driver=bridge --subnet=172.28.0.0/16 --gateway=172.28.5.254 vbroker-network
then in the docker-compose.yml, just added
networks:
default:
external:
name: vbroker-network
Eureka!
https://stackoverflow.com/questions/48899409/setup-vagrant-but-cannot-ping-other-network-ip-address-destination-host-unreach
Sad! really sad. :( curse you!!!
But anyway, I solved it in my own way. I found this article below
https://github.com/moby/moby/issues/27818
It's simply my docker IP address clashed with my company IP address because when you create the container by default it will create 172.18.xx.xx IP address. Boom! Destination unreachable.... blah blah.
So, I just create a custom docker network and when I checked it created IP address that start 172.19.xx.xx
$ docker network create --driver=bridge --subnet=172.20.0.0/16 --gateway=172.20.0.0 vbroker-network-v1
updated 2018-0720:
docker network create --driver=bridge --subnet=172.28.0.0/16 --gateway=172.28.5.254 vbroker-network
then in the docker-compose.yml, just added
networks:
default:
external:
name: vbroker-network
Eureka!
Monday, February 19, 2018
Install VirtualBox guest additions in CentOS
Open up the virtualbox centos gui
type:
su -
yum update kernel*
yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
reboot
insert virtual optical disk in settings
mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run
Merci!
References:
http://nanxiao.me/en/install-virtualbox-guest-additions/
type:
su -
yum update kernel*
yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
reboot
insert virtual optical disk in settings
mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run
Merci!
References:
http://nanxiao.me/en/install-virtualbox-guest-additions/
Monday, February 12, 2018
Improve command prompt console
In Linux when you open a terminal, you can also open a new tab out of it but in Windows you can't using the native command prompt. Even Powershell has no capability of opening new tab.
So I call my friend google and found out this 2 amazing tools.
1. Console - pretty simple and nice but the problem is that I don't know how to properly maximize without losing the focus of the command prompt.
2. ConEmu - this is the finest that I found so far. Pretty slick and have a lot of function. you can choose what console you liked. Recommended!!!
Thursday, February 8, 2018
the right way to write docker-compose, charing!
version: '2'
services:
odoo:
image: odoo:9
container_name: myevo_odoo
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./myevo_odoo_addons:/mnt/extra-addons
environment:
- PYTHONUNBUFFERED=1
- user=odoo
- password=odoo
db:
image: postgres:9.5.10
container_name: myevo_db
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
odoo-web-data:
odoo-db-data:
services:
odoo:
image: odoo:9
container_name: myevo_odoo
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./myevo_odoo_addons:/mnt/extra-addons
environment:
- PYTHONUNBUFFERED=1
- user=odoo
- password=odoo
db:
image: postgres:9.5.10
container_name: myevo_db
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
odoo-web-data:
odoo-db-data:
New to vagrant and its really cool
I always heard this name before and I thought its another technology and not relevant. So I didn't bother to learn.
But now, when I read the documentation its all about development thing, like the docker for containerization and vagrant for virtual machine.... COOL!
So, I hopped in youtube find a nice and easy to learn how to install vagrant. I found this link below.
https://www.youtube.com/watch?v=PmOMc4zfCSw&t=178s
Everything went well until I type the command. vagrant ssh, boom! permission denied. It took me at least 5 hours including lunch time break :)
Finally, I got it working. fix some permission on authentickey and enabling some settings, and blah blah blah..
https://groups.google.com/forum/#!topic/vagrant-up/mUNB182dY24
Eureka!
Finally, I can ssh without opening a real virtual machine. soooooo coooolllll!!!!
But now, when I read the documentation its all about development thing, like the docker for containerization and vagrant for virtual machine.... COOL!
So, I hopped in youtube find a nice and easy to learn how to install vagrant. I found this link below.
https://www.youtube.com/watch?v=PmOMc4zfCSw&t=178s
Everything went well until I type the command. vagrant ssh, boom! permission denied. It took me at least 5 hours including lunch time break :)
Finally, I got it working. fix some permission on authentickey and enabling some settings, and blah blah blah..
https://groups.google.com/forum/#!topic/vagrant-up/mUNB182dY24
Eureka!
Finally, I can ssh without opening a real virtual machine. soooooo coooolllll!!!!
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
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
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!
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
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
Saturday, January 6, 2018
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.
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!
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!
Subscribe to:
Posts (Atom)
free online comma separating tool
https://delim.co/#
-
In my current company, I'm using Visual Paradigm for my documentation task. If you go there site, you can either download community and ...
-
One of the functionality in our system is can able to generate a report using Jasper report. We have a Jasper server setup in another ip ad...
-
https://www.liquidweb.com/kb/how-to-install-nvm-node-version-manager-for-node-js-on-ubuntu-12-04-lts/