Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / virtual_env.sh
Last active October 15, 2018 07:39
[Virtual env Cheat Sheet] Virtual Environment Cheat Sheet #python #virtualenv
# --------
# PYTHON 3
# --------
# Create a new virtual environment
python3 -m venv "your_venv_folder"
# Activate the new venv it with bash script called "source"
source "your_venv_folder/bin/activate"
pip ...
@michaelkarrer81
michaelkarrer81 / git.sh
Last active February 26, 2024 21:19
[GIT Cheat Sheet] Git commands and procedures #git
# Show status of repository
git status
# Show all branches
git branch -avv
# Create a branch
git branch ${new_branch_name}
# Checkout a branch