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 / README.md
Last active April 10, 2024 20:19
Вращайте ☢️ БАРАБАН

Ваш 🦀 БИЛЕТ

БИЛЕТ № 101


[MOME] Any plans to open #Odoo 🦀 office# ?debug=assets

Ваше 🪬 ПРИЛОЖЕНИЕ

@yelizariev
yelizariev / mappings.txt
Last active February 27, 2020 07:46 — forked from dmgerman/vimium-emacs.md
Emacs-Style Key Bindings for Vimium
#########################################
unmapAll # Use Emacs-style bindings only.
#########################################
# Modifier Keys w/ Emacs Terminology:
# `<c-*>` = ⌃ Control Key; i.e. `C-*`.
# `<a-*>` = ⌥ Meta Key (Alt/Option); i.e. `M-*`.
@yelizariev
yelizariev / 00-install-odoo-translation.sh
Last active August 17, 2020 11:40
Automatic translation of odoo files by using existing translation (e.g. from Ukrainian to Russian, English to Russian, Russian to Russian)
# install dependencies
sudo pip install polib
sudo pip install google-cloud-translate==2.0.0
# https://docs.transifex.com/client/installing-the-client
sudo pip install transifex-client
# prepare and export your google cloud credentials
# See https://cloud.google.com/translate/docs/basic/setup-basic
# and https://cloud.google.com/docs/authentication/getting-started
@yelizariev
yelizariev / rotate.sh
Created February 18, 2019 15:07
Simple file rotating (e.g. for backups)
# based on https://serverfault.com/a/196847
# It will keep only latest 12 files
ls -1t /path/to/dir/* | tail -n +13 | xargs rm > /dev/null 2>&1
@yelizariev
yelizariev / monotoring.sh
Last active February 16, 2019 22:32
monitoring tools
sudo apt install lolcat cowsay
while true; do export PINGHOST=8.8.8.8 && RESULT=$(ping -q -n -c 4 $PINGHOST | awk '/packet loss/ {if ($6 != "0%") print $6, "packet loss"}') && echo "Done:" && if [[ -z $RESULT ]]; then cowsay "No package lost!" | lolcat --seed=45; else cowsay $RESULT | lolcat --seed=17; fi; date; echo -n "sleeping... "; sleep 5; echo -n "pinging... "; done
@yelizariev
yelizariev / disk-arhive.sh
Last active February 14, 2019 02:06
backup disk
# https://help.ubuntu.com/community/BackupYourSystem/TAR
# Archive
tar -cvpzf backup.tar.gz --one-file-system /
# Restore
sudo tar -xvpzf /path/to/backup.tar.gz -C /media/whatever --numeric-owner
@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