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
cd /path/to/module/
# view source
find . -iname "*.py" -or -iname "*.xml" -or -iname "*.csv" -or -iname "*.yml" -or -iname "*.rst" -or -iname "*.md" | xargs tail -n +1 | less
# view source without docs
find . -iname "*.py" -or -iname "*.xml" -or -iname "*.csv" -or -iname "*.yml" | xargs tail -n +1 | less
'''
# Installation:
sudo pip install PyGithub
# create token here: https://github.com/settings/tokens (you don't need to set any access checkboxes there)
# Usage
curl -s https://gist.githubusercontent.com/yelizariev/3d5152df5226d03f8bcea08ece939e9a/raw/pull-requests-portfolio.py | python - --token=ABCDE \
"https://github.com/it-projects-llc/access-addons/pull/26" \
@yelizariev
yelizariev / current-stats.sh
Last active October 17, 2016 07:58
check and configure postgres
# connect to docker
docker exec -i --user=root -t db-9.5 /bin/bash
# inside docker
psql -U odoo
# inside psql
select datname, count(*) from pg_stat_activity group by datname;
@yelizariev
yelizariev / 1-instruction.rst
Last active April 11, 2018 12:21
Emulate odoo pos BOX

hw_escpos

  • apply patch
  • install hw_escpos on odoo
  • run odoo with -d DB_WITH_HW_ESCPOS --db-filter=DB_WITH_HW_ESCPOS
  • in new terminal run
@yelizariev
yelizariev / nginx_odoo.conf
Last active May 10, 2017 11:51
How to deploy SaaS Demo
server {
listen 80;
#rewrite ^/.*$ https://$host$request_uri? permanent; #Uncomment this line in case you want to use https only
server_name NGINX_SERVER_DOMAIN;
include odoo_params;
location /longpolling {
proxy_pass http://SERVER_HOST:8072;
}
@yelizariev
yelizariev / change-password.js
Last active June 18, 2020 19:12
XMLRPC for apps.odoo.com
// Step 1. Ask support team to set some temporar password on apps.odoo.com database
// Step 2. Login to https://apps.odoo.com/web in a usual way (via oauth)
// Step 3. Open browser console and change password by using js code below
odoo.define('www', function(require) {
"use strict";
var ajax = require('web.ajax');
// will only work after the password has been set by Odoo
ajax.jsonpRpc('/web/session/change_password', 'call', {
'fields' : [
@yelizariev
yelizariev / 1-lxd.sh
Last active August 6, 2018 18:33
LXD+dockers+nginx. Remote development for several developer on a single server. LATEST VERSION is here: https://odoo-development.readthedocs.io/en/latest/remote-dev/lxd/lxd.html
# For understanding LXC see https://wiki.debian.org/LXC
# Based on:
# lxd + docker: https://stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/
# lxd network (static ip): https://stgraber.org/2016/10/27/network-management-with-lxd-2-3/
LXD_NETWORK="dev-network2"
# install lxd 2.3+
apt-get install software-properties-common
# 8.0
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db-geo-8 camptocamp/postgres
docker run -d --name geo-8 -p 8069:8069 -p 8072:8072 -e ODOO_MASTER_PASS=master --link db-geo-8:db -v /root/odoo/odoo-8.0/geospatial/:/mnt/addons/extra/geospatial -t itprojectsllc/install-odoo:8.0 -- --db-filter=^%d$
docker exec -u odoo -i -t geo-8 /bin/bash -c "export UPDATE_ADDONS_PATH='yes'; bash /install-odoo-saas.sh"
# 10.0
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db-geo-10 camptocamp/postgres
docker run -d --name geo-10 -p 8069:8069 -p 8072:8072 -e ODOO_MASTER_PASS=master --link db-geo-10:db -v /root/odoo/odoo-10.0/geospatial/:/mnt/addons/extra/geospatial -t itprojectsllc/install-odoo:10.0 -- --db-filter=^%d$
docker exec -u odoo -i -t geo-10 /bin/bash -c "export UPDATE_ADDONS_PATH='yes'; bash /install-odoo-saas.sh"
git -C /root/odoo/odoo-10.0/geospatial/ pull upstream pull/146/head
@yelizariev
yelizariev / Smiles.md
Last active February 17, 2021 13:40 — forked from roachhd/README.md
Smiles EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

People

:bowtie: 😄 😆 😊 😃 ☺️ 😏 😍

@yelizariev
yelizariev / 001-psql.sql
Last active March 6, 2018 10:16
Postgresql
--- connection count
SELECT sum(numbackends) FROM pg_stat_database;
--- long running queries
SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity