Skip to content

Instantly share code, notes, and snippets.

View kaipm's full-sized avatar

Martin Kaip kaipm

View GitHub Profile
@kaipm
kaipm / linux.md
Last active August 13, 2023 18:17
Cheat Sheet

Virtual Box

Converting images

You can convert real linux disk images into VBox images:

VBoxInstallDir\VBoxManage convertdd source.img target.vdi --format VDI

Linux

Extracting files

  • tar -xzf file.tar.gz for GZIP

Signing commits

You can sign commits via GPG. Since 2022 you can also sign with SSH.

Signing with SSH

  1. Your git email must match GitHub (either real email, or anonymous one):

    git config --global user.email "12345678+xyz@users.noreply.github.com"
    

Enable file nesting for .razor

  • In settings, search file nesting
  • Make sure, it is enabled
  • In File Nesting: Patterns add a new item
    • Item *.razor with value ${capture}.razor.*

Customization

Custom date/time display format with line breaks

Rightclick the clock and click Configure, then switch to custom format. After that, open the .json file in ~/.cinnamon/configs/calendar@cinnamon.org, in the section custom-format, set

"custom-format": {
  ...
  "value": "%H:%M\n%a, %d.%m.%Y"
}

windows server actions

For actions using runs-on: windows-latest

  • Set environment variable RELEASE_VERSION depending on tag

    - name: Set tag version env
      run: |
        chcp 65001 # utf-8
    

echo ("RELEASE_VERSION=" + $env:GITHUB_REF.split("/")[-1]) >> $env:GITHUB_ENV

@kaipm
kaipm / saltstack.sh
Created March 29, 2022 08:41 — forked from michaelkarrer81/saltstack.sh
[Saltstack Cheat Sheet] #saltstack
# ============
# COMMON TASKS
# ============
# Run state.sls file on minion(s)
salt -G 'os:Ubuntu' state.apply ubuntu1401 # Formula file name without .sls at the end
salt -G 'os:Ubuntu' state.apply ubuntu1401 test=True # Test only (dryrun)
salt -G "minion_roles:ONLINE" state.apply execute_script_example pillar='{"single_instance_update": "aiat"}'
# Webhook state.sls example
@kaipm
kaipm / update_instances.sh
Created October 21, 2021 13:34 — forked from michaelkarrer81/update_instances.sh
[Update instances.sh] #odoo #update #saltstack
# Get a list of all instances of a server
grep -l /srv/saltstack/pillar/instances/*.sls -e 'online1' | awk '$0=$2' FS=_ RS=. ORS=","
grep -l /srv/saltstack/pillar/instances/*.sls -e 'online2' | awk '$0=$2' FS=_ RS=. ORS=","
grep -l /srv/saltstack/pillar/instances/*.sls -e 'online3' | awk '$0=$2' FS=_ RS=. ORS=","
grep -l /srv/saltstack/pillar/instances/*.sls -e 'online4' | awk '$0=$2' FS=_ RS=. ORS=","
# all instances
grep -l /srv/saltstack/pillar/instances/*.sls -e 'online*' | awk '$0=$2' FS=_ RS=. ORS=","
# Check Release Tag of Online Core
@kaipm
kaipm / odoo_backup.sh
Created October 21, 2021 13:33 — forked from michaelkarrer81/odoo_backup.sh
[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'
@kaipm
kaipm / facebook_api_cheat_sheet.md
Created October 21, 2021 13:31 — forked from michaelkarrer81/facebook_api_cheat_sheet.md
[facebook api cheat sheet] Facebook API Cheat Sheet #facebook
@kaipm
kaipm / odoo-dev.md
Last active February 18, 2021 09:34

Odoo with PyPI

  1. Setup postgres 10+
  2. Setup Python 3.6+ venv virtualenv /path/envdir
  3. Install Odoo from source
  4. Open in PyCharm and pick venv, then in Odoo root run pip install -e .
  5. Run pip install odoo-autodiscovery
  6. Create/install addons
  7. Start Odoo with server.conf

Installing addons