Skip to content

Instantly share code, notes, and snippets.

View yelizariev's full-sized avatar
Matthew 22:30

Ivan Yelizariev yelizariev

Matthew 22:30
View GitHub Profile
@yelizariev
yelizariev / Letsencrypt Wildcard DNS manual.rst
Last active February 20, 2021 00:12 — forked from Rusllan/Letsencrypt Wildcard DNS manual.rst
Issue certificate with DNS manual mode
@yelizariev
yelizariev / 000-aws-lambda-todo-bot.md
Last active November 10, 2021 12:48
TODO-list bot for Telegram. OBSOLETE: latest version is here https://itpp.dev/chat/todo-bot/index.html

Allows to create TODOs for a small group of users.

Tasks can have on of the following states:

  • TODO -- to be done
  • DONE -- done
  • CANCELED -- nothing was done and not going to be done
  • WAITING -- cannot be started and waits for something

Technical specification

@yelizariev
yelizariev / 000-aws-lambda-bot.md
Last active December 15, 2022 15:18
Telegram resending bot on AWS Lambda. OBSOLETE: the latest version is here https://chatops.readthedocs.io/en/latest/resend-bot/index.html

The general idea is to ask a group (let's call it target group) via bot and get answer. The group might be:

  • Support Team
  • IT Department of your company
  • etc.

TODO: text formatting is lost on resending. Use entities instead of text field

TODO: set debug level via Environment variables

@yelizariev
yelizariev / docker-cleanup-resources.md
Last active February 6, 2020 06:28 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

docker volume rm $(docker volume ls -qf dangling=true)

docker volume ls -qf dangling=true | xargs -r docker volume rm

@yelizariev
yelizariev / odoo-performance.rst
Last active March 3, 2018 12:55
Performance optimization
@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
@yelizariev
yelizariev / Smiles.md
Last active February 17, 2021 13:40 — forked from roachhd/README.md
Smiles EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

People

:bowtie: 😄 😆 😊 😃 ☺️ 😏 😍

# 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 / 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
@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' : [