sudo su
curl https://pyenv.run | bash
# Load pyenv automatically by adding
# the following to ~/.bashrc:
This file contains hidden or 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
# Docker Basics | |
docker ps | |
docker restart <container_id> | |
docker logs | |
docker exec -it <container_id> /bin/bash |
This file contains hidden or 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
""" | |
pip install click | |
""" | |
import click | |
import itertools | |
This file contains hidden or 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
# Create a manual odoo backup | |
sudo su - dev1 -c "/opt/online/online_tools/start.py --instance-dir /opt/online/dev1 --backup /opt/online/dev1/update/care_manual_backup --stop-after-init" | |
sudo su - dev2 -c "/opt/online/online_tools/start.py --instance-dir /opt/online/dev2 --backup /opt/online/dev2/update/care_manual_backup --stop-after-init" | |
sudo su - npha -c "/opt/online/online_tools/start.py --instance-dir /opt/online/npha --backup /opt/online/npha/update/manual_backup --stop-after-init" | |
# Via salt Master | |
salt "online4" cmd.run 'sudo su - dev1 -c "/opt/online/online_tools/start.py --instance-dir /opt/online/dev1 --backup /opt/online/dev1/update/dev1_sebi_backup --stop-after-init"' | |
salt "online4" cmd.run 'ls -al /opt/online/dev1/update' | |
salt "online4" cmd.run 'll /opt/online/dev1/update' |
This file contains hidden or 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
# Migrate files between users | |
# https://docs.nextcloud.com/server/12/admin_manual/configuration_files/file_sharing_configuration.html#transferring-files-to-another-user | |
# Transfers Shars and Links | |
occ files:transfer-ownership user1 user2 | |
# -------------------------- | |
# Onlyoffice Update Prozess: | |
# -------------------------- |
This file contains hidden or 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
# | |
# Acts as a nginx HTTPS proxy server | |
# enabling CORS only to domains matched by regex | |
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
# | |
# Based on: | |
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
# * http://enable-cors.org/server_nginx.html | |
# | |
server { |
This file contains hidden or 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
# Process and Thread commands | |
strace -p 7577 -f | |
ps -eLf | grep gl2k | grep 13301 | |
strace -p 13301 | |
perf top | |
perf record -F 99 -ag -p <pid> -- sleep 10 | |
perf script |
This file contains hidden or 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
# Cheat Sheet for systemctl / systemd | |
- Tutorial to get the access token odoo addon facebook_lead
- crm_facebook_leads crm_facebook_leads
This file contains hidden or 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
On your remote server, run: pip install cython pydevd | |
IMPORTANT: Make sure that your computer is visible to server's IP by pinging your computer's IP | |
AND make port forwarding if necessary | |
Create debug folder localy using same path as on remote server. Necessary for correct break points work. | |
Connect remote content for debug: | |
sshfs bar:/srv/odoo /srv/odoo/ | |
Use this path for mapping. | |
On your computer, configure a Python Remote Debug in run configurations. |