- 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// 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