Tuesday, December 19, 2017

Python libraries

Running API from python code needs this libraries.


installing in centos
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py

sudo pip install web.py
sudo pip install pyt
sudo pip install python-dateutil
sudo pip install tzlocal
sudo pip install pyyaml



installing in ubuntu, need to install the pip first.
$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv



Monday, December 18, 2017

How to install Sublime in ubuntu

apt

Install the GPG key:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
 
Ensure apt is set up to work with https sources:
sudo apt-get install apt-transport-https
 
Select the channel to use:
Stable
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
Dev
echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
Update apt sources and install Sublime Text
sudo apt-get update
sudo apt-get install sublime-text

How to install docker-compose in ubuntu

sudo apt-get -y install python-pip
sudo pip install docker-compose 

Sunday, December 17, 2017

GIT cheatsheet

I am curious about this GIT ever since but I don't have any actual encounter to use GIT in my development until now.  I have a freelance job which use GIT as source control.

This project is an odoo development.

I have been struggling to commit my codes as I'm not familiar how to use GIT but luckily I understand a little bit more now.
With the help of my friend Google. There are some tutorial and sites that is very helpful to my knowledge.

very slick site and clear to understand
http://rogerdudler.github.io/git-guide/

another very good site to understand more about merging
https://confluence.atlassian.com/bitbucket/use-a-git-branch-to-merge-a-file-681902555.html


# clone a remote repository
git clone https://skyguyver@bitbucket.org/skyguyver/malphi.git


# update local repository
git pull origin master


# to see any changes
git status

# to check the difference
git diff

# last 1 entry in the log
git log -1


# to move to staging
git add <file>

# to commit
git commit -m "some comments here"

# show commit history
git log


git show 81a00

# revert committed
git revert 81a00

# delete irreversible
# git reset --hard 2e75

# reset and delete current merge
git reset --hard HEAD

# set usename and email
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com


I found this more useful with an image to understand more about GIT
https://developer.atlassian.com/blog/2014/12/pull-request-merge-strategies-the-great-debate/

Monday, November 27, 2017

Odoo API



How to find name of database for XML-RPC connection to OpenERP/Odoo?

db_serv_url = 'http://{}/xmlrpc/db'.format(host)
sock = xmlrpclib.ServerProxy(db_serv_url)
dbs = sock.list()
print dbs



free online comma separating tool

https://delim.co/#