Author Archives: Dima

inputrc

Oneliner

curl https://wdm.net.ua/t/inputrc | bash"
bash -c "$(wget --no-verbose -O - https://wdm.net.ua/t/inputrc)"

Manually: add content directly

cat << EOF >> ~/.inputrc
"\e[A":history-search-backward
"\e[B":history-search-forward
EOF

Continue reading

selinux: example avc denied – chcon

Issue

# systemctl status crond
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2023-12-08 16:59:47 UTC; 4s ago
  Process: 994 ExecStart=/usr/sbin/crond -n $CRONDARGS (code=exited, status=203/EXEC)
 Main PID: 994 (code=exited, status=203/EXEC)

Host

# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.9 (Ootpa)

Continue reading

offlineimap error: Error in IMAP command CREATE: Missing arguments

offlineimap execution error

Source: MS Exchange 2013, attached mailbox
Destination: Dovecot IMAP host

 Creating folder [imap_local]
 ERROR: While attempting to sync account 'second-domain-com'
  CREATE command error: BAD [b'Error in IMAP command CREATE: Missing arguments (0.001 + 0.000 secs).']. Data: b'MOFC11 CREATE \r\n'

Continue reading

Jenkins UnmappableCharacterException

Jenkins agent: 3107.v665000b_51092
Jenkins agent OS: Windows 10

Issue

In job log:

[Pipeline] // timeout
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.nio.charset.UnmappableCharacterException: Input length = 1
	at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:275)
	at java.base/java.lang.String.decodeWithDecoder(String.java:1205)

Continue reading

grub: manual boot

Commands in Grub cli

cat (hd0,gpt2)/grub/grub.cfg

Example 1: Ubuntu 20.04 with LVM

Boot with init=/bin/bash

insmod part_gpt
insmod lvm
insmod ext2
set root='hd0,gpt2'
# search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci-0,gpt2 e3a4d311-baa1-44c8-86e6-afdb9bccc081
search --no-floppy --fs-uuid --set=root e3a4d311-baa1-44c8-86e6-afdb9bccc081
linux /vmlinuz-5.4.0-167-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro init=/bin/bash
initrd /initrd.img-5.4.0-167-generic

ArchLinux pamac

pacman -S --needed git base-devel
git clone https://aur.archlinux.org/libpamac-aur.git
cd libpamac-aur
makepkg -si
cd ..
git clone https://aur.archlinux.org/pamac-aur.git
cd pamac-aur
makepkg -si

Oracle query: table size in bytes

SELECT TRUNC(sum(bytes)) table_size, table_name 
FROM (SELECT segment_name table_name, bytes
    FROM user_segments
    WHERE segment_type = 'TABLE'
    UNION ALL
    SELECT i.table_name, s.bytes
    FROM user_indexes i, user_segments s
    WHERE s.segment_name = i.index_name 
    AND   s.segment_type = 'INDEX'
    UNION ALL
    SELECT l.table_name, s.bytes
    FROM user_lobs l, user_segments s
    WHERE s.segment_name = l.segment_name 
    AND   s.segment_type = 'LOBSEGMENT'
    UNION ALL
    SELECT l.table_name, s.bytes
    FROM user_lobs l, user_segments s
    WHERE s.segment_name = l.index_name 
    AND   s.segment_type = 'LOBINDEX')
GROUP BY table_name
HAVING SUM(bytes)/1024/1024 > 100

DataDog Oracle custom_query: Only float values can be submitted as metrics

Errors in log

2021-12-30 13:07:02 UTC | CORE | WARN | (pkg/collector/python/datadog_agent.go:124 in LogMessage) | oracle:9eb61efa95cfcc8c | (base.py:580) | Metric: 'test.table_rows.rowcount' has non float value: 'ITEMS'. Only float values can be submitted as metrics.

Configuration with issue

instances:
  - custom_queries:
    - metric_prefix: test.table_rows        
      query: select table_name, regexp_replace(to_char(nvl(num_rows,-1), '99999999999.9'),'
            ', '') rowcount from all_tables where owner='TEST'
      columns:
        - name: rowcount
          nype: gauge
        - name: table_name
          type: tag

Solution:

Set first field as field with value:

select (...) rowcount, table_name from ...