Current Setup:
- 2 Monitor 4k 27 inch
- Macbook Pro 14 M1 Pro
Problem: when 2 monitor pluged in, 1 of the monitor hand or can't be used
Solutions:
- Remove windowserver displays by using terminal command
Current Setup:
Problem: when 2 monitor pluged in, 1 of the monitor hand or can't be used
Solutions:
This note explains why deleting from account_move_line spikes CPU and provides step-by-step instructions to fix it natively in PostgreSQL.
When executing DELETE FROM account_move_line WHERE id IN ( ? ), PostgreSQL triggers internal system checks (RI_FKey_check_relation) for every table referencing account_move_line. If those referencing columns are not indexed, PostgreSQL performs a Sequential Full Table Scan across dozens of tables for every single ID deleted, melting your CPU.
| import time | |
| import odoorpc | |
| import pandas | |
| def odoo_download_stock_move_to_excel(): | |
| """ | |
| Download stock move data from Odoo and save it to an Excel file. | |
| """ | |
| # Odoo connection |
| export GOROOT="$(go1.17 env GOROOT)" | |
| PATH_add "$(go1.17 env GOROOT)/bin" | |
| export GO111MODULE=on | |
| export GOFLAGS=-mod=vendor | |
| export CGO_ENABLED=0 |
| # get count postgres idle connection for database | |
| $ watch -n 1 psql -U myuser -d mydb -c \"select count\(\*\) from pg_stat_activity where state in \(\'idle\', \'idle in transaction\'\) and datname = \'mydb\'\" |
| SELECT | |
| id, name | |
| FROM table_users | |
| WHERE 1=1 | |
| [[ AND name = ANY(STRING_TO_ARRAY({{ user_name }}, ',')) ]] | |
| -- `user_name` is metabase variables, type: Text | |
| -- `','` is the delimeter | |
| -- usage: in variablse `user_name` -> `Sky,Blue,Green` | |
| -- it's will equal to `AND name IN ('Sky', 'Blue', 'Greem') |
| #!/bin/bash | |
| # filter by name | |
| docker ps -a -f name=^/sentry | |
| # filter by name only container id | |
| docker ps -a -q -f name=^/sentry | |
| # filter by name then remove | |
| docker rm $(docker ps -a -q -f name=^/sentry) |
Kiro System Prompt used in .github/instructions/system-prompt.instructions.md
source: https://github.com/ghuntley/amazon-kiro.kiro-agent-source-code-analysis
| https://prod.download.desktop.kiro.dev/stable/metadata-dmg-darwin-arm64-stable.json |