| BML-S | Help Login

Last entries

    20241203.0924
  1. bash > how to iterate list of strings with `read -ra` and IFS in the loop (not while loop) - [s]

    input_string='"npm-releases", "npm-hosted", "npm-proxy"' IFS=", " read -ra repos <<< "$input_string" for repo in "${repos[@]}"; do echo "Processing repository: $repo" done

  2. 20241128.1614
  3. bash > Are `-L1` and `-n 1` the same for `xargs` - [s]

    $ printf '1 2\n3 4\n' | xargs -L1 -t echo echo 1 2 1 2 echo 3 4 3 4 $ printf '1 2\n3 4\n' | xargs -n1 -t echo echo 1 1 echo 2 2 echo 3 3 echo 4 4

  4. 20241125.1051
  5. postgres > JSON|jsonb Manipulation with PostgreSQL - [s]

    UPDATE docker_asset SET attributes = jsonb_set(attributes, '{docker}', (attributes->'docker')::jsonb - 'content_digest', true);

  6. 20241125.1047
  7. postgres > Dealing with nested JSON objects (jsonb) in PostgreSQL - [s]

  8. 20241125.0907
  9. Using SELinux | Red Hat Product Documentation - [s]

  10. 20241122.0913
  11. postgres > Where in the DB is the Location of a PostgreSQL tablespace stored - [s]

    select spcname ,pg_tablespace_location(oid) from pg_tablespace;

  12. 20241120.0951
  13. postgres|postgresql|patroni - [s]

  14. 20241114.1119
  15. bash - Tee resets exit status is always 0 - [s]

    # Example: wrap git command to add trace logging cat << 'EOF' > ./git #!/usr/bin/env bash echo "# $(date --rfc-3339=seconds) Executing git" >> /tmp/git_trace.out export GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_SETUP=2 /usr/bin/git "$@" 2>/tmp/git_trace.out | tee -a /tmp/git_trace.out exit ${PIPESTATUS[0]} EOF chmod a+x ./git

  16. 20241113.0818
  17. postgres|PostgreSQL > assign variables with SELECT column INTO TEMP variable_tbl - [s]

    select role_id into TEMP role_ids from role order by random() limit 11; select member_name into TEMP member_names from membership_mapping where member_type = 'USER' order by random() limit 1; EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM membership_mapping t0 WHERE (((t0.member_name = (select member_name from member_names) OR LOWER(t0.member_name) = LOWER((select member_name from member_names)) OR UPPER(t0.member_name) = UPPER((select member_name from member_names))) AND t0.member_type = 'USER' OR t0.member_name IN ('(all-authenticated-users)') AND t0.member_type = 'GROUP') AND t0.role_id IN (select role_id from role_ids)) ORDER BY t0.context_id ASC, t0.role_id ASC LIMIT 500000;

  18. 20241112.1529
  19. postgres > Optimizing PostgreSQL Performance: How the Fill Factor Setting improve I/O performance - [s]

    ALTER TABLE customer_orders SET (fillfactor = 75); # https://www.cybertec-postgresql.com/en/estimating-table-bloat/ CREATE EXTENSION IF NOT EXISTS pgstattuple; # https://www.postgresql.org/docs/14/pgstattuple.html # the last two values are approx_free_space and approx_free_percent SELECT relnamespace::regnamespace::text as ns, relname AS table_name, pgstattuple_approx(oid) AS table_stats FROM pg_class WHERE relkind = 'r';

  20. 20241103.0930
  21. Keep Your postgres|postgresql Stable — Vacuum - [s]

  22. 20241103.0927
  23. postgres|postgresql > Understanding and Monitoring pg_stat_user_indexes - [s]

[s] public (12)