Skip to content

Instantly share code, notes, and snippets.

View kaipm's full-sized avatar

Martin Kaip kaipm

View GitHub Profile
@kaipm
kaipm / linux-ubuntu-cheat-sheet.md
Last active May 10, 2022 17:09
Ubuntu Linux cheat sheet

SSH

Login via ssh username@server-or-ip. Copy files via SSH with the command scp source destination. You can use user@server:path for remote sources or destinations.

Host name

Set the desired host name via hostnamectl set-hostname abc

  • /etc/hosts usually has the entry 127.0.1.1 hostname, change this accordingly
@kaipm
kaipm / dotnet-core-cheat-sheet.md
Last active December 3, 2020 07:38
.NET Cheat Sheet

.NET Cheat Sheet

Revert to default templates

Removes all custom installed templates and reverts to .NET Core default templates.

dotnet new --debug:reinit

Converting or upgrading projects

Checking compatibility for converting from .NET Framework to .NET

Windows Terminal

  1. Install Windows Terminal via Store

  2. Download & install PowerShell Core

  3. Download & install Font Cascadia Code PL (it's a free font)

  4. Open Windows Terminal, go to Settings

    • Set PowerShell Core GUID in the defaultProfile
  • Under profiles add defaults
@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

@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_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 / 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 / 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

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

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"
}