Skip to content

Instantly share code, notes, and snippets.

@michaelkarrer81
michaelkarrer81 / docker_cheat_sheet.sh
Last active November 1, 2018 15:52
[docker cheat sheet] basic docker commands #docker
# Docker Basics
docker ps
docker restart <container_id>
docker logs
docker exec -it <container_id> /bin/bash
@michaelkarrer81
michaelkarrer81 / diff_freeze.py
Created November 2, 2018 18:34 — forked from qgerome/diff_freeze.py
How to compare or diff 2 pip freeze or 2 requirements.txt in Python
"""
pip install click
"""
import click
import itertools
@michaelkarrer81
michaelkarrer81 / odoo_backup.sh
Last active October 21, 2021 13:33
[odoo manual backups] create manual backup and transfer via ssh #odoo
# 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'
@michaelkarrer81
michaelkarrer81 / nextcloud.sh
Last active July 8, 2021 10:42
[Nextcloud] Nextcloud Administration and Setup #nextcloud
# 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:
# --------------------------
@michaelkarrer81
michaelkarrer81 / cors.nginxconf
Created March 18, 2019 07:57 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# 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 {
@michaelkarrer81
michaelkarrer81 / bash_commands.sh
Last active July 1, 2019 13:49
[Linux Bash Commands] Basic Bash commands #linux
# 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
@michaelkarrer81
michaelkarrer81 / pyenv.md
Last active February 22, 2025 03:20
[Install python versions] Install multiple python versions in linux with pyenv #pyenv #python #linux

Important links

Install pyenv for the user root

sudo su
curl https://pyenv.run | bash

# Load pyenv automatically by adding
# the following to ~/.bashrc:
@michaelkarrer81
michaelkarrer81 / systemctl.sh
Last active January 17, 2020 11:00
[systemctl Cheat Sheet] systemctl / systemd cheat sheet #systemctl #systemd #linux
# Cheat Sheet for systemctl / systemd
@michaelkarrer81
michaelkarrer81 / facebook_api_cheat_sheet.md
Last active February 28, 2024 05:03
[facebook api cheat sheet] Facebook API Cheat Sheet #facebook
@michaelkarrer81
michaelkarrer81 / remote_dev.py
Created March 23, 2020 14:12 — forked from ilyasProgrammer/remote_dev.py
Remote Debug Odoo in Pycharm Prof
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.