Skip to content

Instantly share code, notes, and snippets.

View yelizariev's full-sized avatar
Hello World!

Ivan Kropotkin yelizariev

Hello World!
View GitHub Profile
@yelizariev
yelizariev / install-odoo.sh
Last active November 20, 2023 13:57
install odoo from source. Script is maintained on github now: https://github.com/yelizariev/install-odoo
if [ "$(basename $0)" = "install-odoo.sh" ]; then
echo "don't run install-odoo.sh, because it's not fully automated script. Copy, paste and execute commands from this file manually"
exit 0
fi
#### Detect type of system manager
export SYSTEM=''
pidof systemd && export SYSTEM='systemd'
@yelizariev
yelizariev / install-ivann-ssh.sh
Last active July 9, 2020 11:33
save my ssh key
#
su
# ivann + general
mkdir ~/.ssh
curl --silent https://github.com/yelizariev.keys | xargs echo -n >> ~/.ssh/authorized_keys
echo -ne " [email protected]\n" >> ~/.ssh/authorized_keys
@yelizariev
yelizariev / edit-odoo-source.sh
Last active August 29, 2015 14:16
edit-odoo-source.sh
cd /usr/local/src/odoo
## delete matches="..." at /web/database/manager
sed -i 's/matches="[^"]*"//g' addons/web/static/src/xml/base.xml
## disable im_odoo_support
sed -i "s/'auto_install': True/'auto_install': False/" addons/im_odoo_support/__openerp__.py
@yelizariev
yelizariev / 1-Ubuntu-odoo-development.sh
Last active September 6, 2019 10:09
Ubuntu configuration for odoo development
sudo apt-get update
sudo apt-get install git python-pip htop moreutils tree nginx gimp wmctrl postgresql-server-dev-all
sudo apt-get upgrade
################### Github
# configure ssh keys: https://help.github.com/articles/generating-ssh-keys/
################### Odoo
# download odoo from git:
cd /some/dir/
### instruction to run via docker
# install docker ( https://docs.docker.com/engine/installation/ubuntulinux/ )
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list # ubuntu 14.04
apt-get update
apt-get purge lxc-docker
apt-cache policy docker-engine
apt-get install linux-image-extra-$(uname -r) # ubuntu 14.04
apt-get install docker-engine
@yelizariev
yelizariev / 1-Constitution.md
Last active February 20, 2021 00:05
IT-Projects LLC rules. The document is moved to https://gitlab.com/itpp/handbook/

Constitution explains how and in what direction is the company growing

I. Just work well

  • The only way to compensate poorly made work is to improve yourself and do it well

I.1. No penalties

  • There are no any financial, moral, administrative penalties

I.2. No excuses

  • Inside the company, excuses have no sense
@yelizariev
yelizariev / print-pdf-on-ticket-printer.md
Last active November 13, 2018 19:09
How-to print pdf on a ticket printer.

Instruction provided by @invitu

1- Install Cups on the posbox:

  • The posbox is a read-only system, you have to chroot it to install cups
  • Run a posbox on a raspberry-pi and plug a pen drive containing another posbox image
  • chroot the posbox in the pen drive
  • install cups with apt-get
  • plug the epson on the posbox
  • setup a Raw queue using usb://EPSON/TM-T20II in cups and share it (remove the "?serial=xxxxxxx" part if you want to use the image with another printer
  • there is no driver for epson printer for raspbian, that's the reason we must use raw queue
# PS1 for remote root
# \t \h \w\$
export PS1='\[\033[00;31m\]\t \[\033[01;31m\]\h \[\033[01;34m\]\w\[\033[01;31m\]\$\[\033[00m\] '
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt
@yelizariev
yelizariev / fix-travis.sh
Last active December 1, 2016 06:54
Script to fix lint travis errors on odoo. OBSOLETE. Latest version is here: https://odoo-development.readthedocs.io/en/latest/dev/lint/index.html
# fix line break symbols
find * -type f | grep -v ".\(svg\|png\|jpg\)$" | xargs sed -i 's/\r//g'
# trim trailing whitespaces
find * -type f | grep -v ".\(svg\|png\|jpg\)$" | xargs sed -i 's/[ \t]*$//g'
#PEP8 для py-файлов:
autopep8 --in-place -r --aggressive --aggressive --ignore E501 ./
# fix CamelCase
@yelizariev
yelizariev / new-api.sh
Last active March 17, 2017 05:37
Helpers for migrating to new odoo api (10.0+). Obsolete. Check for latest version here: https://odoo-development.readthedocs.io/en/latest/migration/index.html
# IMPORTS
# replace osv, orm
find . -type f -name '*.py' | xargs sed -i 's/from openerp.osv import orm$/from odoo import models/g'
find . -type f -name '*.py' | xargs sed -i 's/from openerp.models.orm import Model$/from odoo.models import Model/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.osv_memory/models.TransientModel/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.osv/models.Model/g'
find . -type f -name '*.py' | xargs sed -i 's/osv.except_osv/UserError/g'
find . -type f -name '*.py' | xargs sed -i 's/osv\./models./g'
find . -type f -name '*.py' | xargs sed -i 's/\<orm\./models./g'
find . -type f -name '*.py' | xargs sed -i 's/\(import .*\), osv/\1, models/g'