Get connection status for a managed node with AWS CLI

I kept forgetting about the AWS CLI which is quite handy to quickly check if SSM is working on an EC2 instance. So here it is again for my future-self. Use get-connection-status to return the connection status of the specified managed instance. $ aws ssm get-connection-status --target i-092af3b3c1234567 { "Status": "connected", "Target": "i-092af3b3c1234567" } Reference: get-connection-status

June 26, 2024 · 1 min · 56 words · kenno

PostgreSQL FATAL: Peer Authentication Failed for User Postgres

Recently, I upgraded a server running Ubuntu 22.04 to 24.04, that also comes with PostgreSQL 16. For some odd reasons, the Postgres server was not managed by Ansible, and changes previously made to Postgres 15 was not recorded. I noticed that the backup database (pg_dump) was not working properly, the backup database size was just a few kilobytes. Let’s investigate, shall we? root@toto:/etc/cron.daily# ./postgresql-backup pg_dump: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres" You might be wondering, what’s in postgresql-backup? Well, nothing fancy. ...

June 21, 2024 · 4 min · 666 words · kenno

Postgres: Getting Permission Denied for Schema Public

I recently upgraded the PostgreSQL server on one my server from version 14 to 16. Why the big jump? This was due to the OS running on this server was upgraded from Ubuntu 22.04 to 24.04. When the database was restored from the database dump, the application that requires that the database detects the new version and tried to perform the database migration. That’s when it failed and produced the following error message: ...

June 21, 2024 · 3 min · 556 words · kenno

How to use auto-update in Podman

I have a Podman container that needs periodically manual update once in a while. I’d like this container to auto-update, and found that this was possible with podman auto-updates feature. Essentially, I need to set a label for the container - --label io.containers.autoupdate=registry. More details with and very good explanation about this topic is available at a Red Hat Enable Sysadmin article titled “How to use auto-updates and rollbacks in Podman”. ...

June 15, 2024 · 2 min · 378 words · kenno

How to upgrade openSUSE 15.5 to 15.6 using the cli

The following note shows how to use Zypper to do a live distribution upgrade of openSUSE Leap 15.5 to openSUSE Leap 15.6. thounchey3:~ # cat /etc/os-release NAME="openSUSE Leap" VERSION="15.5" ID="opensuse-leap" ID_LIKE="suse opensuse" VERSION_ID="15.5" PRETTY_NAME="openSUSE Leap 15.5" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:leap:15.5" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/" DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap" LOGO="distributor-logo-Leap" Check for the 3 required repositories, ensure they are enabled.` thounchey3:~ # zypper lr -u Repository priorities are without effect. All enabled repositories share the same priority. # | Alias | Name | Enabled | GPG Check | Refresh | URI ---+-----------------------------+---------------------------------------------------------------------------------------------+---------+-----------+---------+------------------------------------------------------------------------ 1 | repo-backports-debug-update | Update repository with updates for openSUSE Leap debuginfo packages from openSUSE Backports | No | ---- | ---- | http://download.opensuse.org/update/leap/15.5/backports_debug/ 2 | repo-backports-update | Update repository of openSUSE Backports | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.5/backports/ 3 | repo-debug | Debug Repository | No | ---- | ---- | http://download.opensuse.org/debug/distribution/leap/15.5/repo/oss/ 4 | repo-debug-non-oss | Debug Repository (Non-OSS) | No | ---- | ---- | http://download.opensuse.org/debug/distribution/leap/15.5/repo/non-oss/ 5 | repo-debug-update | Update Repository (Debug) | No | ---- | ---- | http://download.opensuse.org/debug/update/leap/15.5/oss/ 6 | repo-debug-update-non-oss | Update Repository (Debug, Non-OSS) | No | ---- | ---- | http://download.opensuse.org/debug/update/leap/15.5/non-oss/ 7 | repo-non-oss | Non-OSS Repository | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/15.5/repo/non-oss/ 8 | repo-openh264 | Open H.264 Codec (openSUSE Leap) | Yes | (r ) Yes | Yes | http://codecs.opensuse.org/openh264/openSUSE_Leap/ 9 | repo-oss | Main Repository | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/15.5/repo/oss/ 10 | repo-sle-debug-update | Update repository with debuginfo for updates from SUSE Linux Enterprise 15 | No | ---- | ---- | http://download.opensuse.org/debug/update/leap/15.5/sle/ 11 | repo-sle-update | Update repository with updates from SUSE Linux Enterprise 15 | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.5/sle/ 12 | repo-source | Source Repository | No | ---- | ---- | http://download.opensuse.org/source/distribution/leap/15.5/repo/oss/ 13 | repo-update | Main Update Repository | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.5/oss/ 14 | repo-update-non-oss | Update Repository (Non-Oss) | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.5/non-oss/ thounchey3:~ # zypper refresh Repository 'Update repository of openSUSE Backports' is up to date. Repository 'Non-OSS Repository' is up to date. Repository 'Open H.264 Codec (openSUSE Leap)' is up to date. Repository 'Main Repository' is up to date. Repository 'Update repository with updates from SUSE Linux Enterprise 15' is up to date. Repository 'Main Update Repository' is up to date. Repository 'Update Repository (Non-Oss)' is up to date. All repositories have been refreshed. thounchey3:~ # zypper update Loading repository data... Reading installed packages... Nothing to do. thounchey3:~ # grep baseurl /etc/zypp/repos.d/*.repo | grep -v releasever [1321/1321] /etc/zypp/repos.d/repo-openh264.repo:baseurl=http://codecs.opensuse.org/openh264/openSUSE_Leap/ thounchey3:~ # zypper --releasever=15.6 refresh Warning: Enforced setting: $releasever=15.6 Retrieving repository 'Update repository of openSUSE Backports' metadata ..........................................................[done] Building repository 'Update repository of openSUSE Backports' cache ...............................................................[done] Retrieving repository 'Non-OSS Repository' metadata ...............................................................................[done] Building repository 'Non-OSS Repository' cache ....................................................................................[done] Repository 'Open H.264 Codec (openSUSE Leap)' is up to date. Retrieving repository 'Main Repository' metadata ..................................................................................[done] Building repository 'Main Repository' cache .......................................................................................[done] Retrieving repository 'Update repository with updates from SUSE Linux Enterprise 15' metadata .....................................[done] Building repository 'Update repository with updates from SUSE Linux Enterprise 15' cache ..........................................[done] Retrieving repository 'Main Update Repository' metadata ...........................................................................[done] Building repository 'Main Update Repository' cache ................................................................................[done] Retrieving repository 'Update Repository (Non-Oss)' metadata ......................................................................[done] Building repository 'Update Repository (Non-Oss)' cache ...........................................................................[done] All repositories have been refreshed. thounchey3:~ # zypper --releasever=15.6 dup --download-in-advance Warning: Enforced setting: $releasever=15.6 Loading repository data... Reading installed packages... Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command. Computing distribution upgrade... The following 163 packages are going to be upgraded: ansible apparmor-abstractions apparmor-parser apparmor-profiles bind-utils branding-openSUSE cracklib cracklib-dict-small crypto-policies curl dracut dracut-mkinitrd-deprecated e2fsprogs fipscheck firewalld fish gettext-runtime gio-branding-openSUSE girepository-1_0 git git-core glib2-tools glibc glibc-devel glibc-locale glibc-locale-base gpg2 grub2 grub2-branding-openSUSE grub2-i386-pc grub2-x86_64-efi haveged htop hwloc-data ipset jeos-firstboot kmod krb5 less libapparmor1 libargon2-1 libaugeas0 libblkid1 libbsd0 libcom_err2 libcontainers-common libcontainers-default-policy libcrack2 libcryptsetup12 libcurl4 libdevmapper1_03 libext2fs2 libfdisk1 libfido2-1 libfido2-udev libfipscheck1 libgcrypt20 libgio-2_0-0 libgirepository-1_0-1 libglib-2_0-0 ... ... dracut[I]: *** Stripping files *** dracut[I]: *** Stripping files done *** dracut[I]: *** Creating image file '/boot/initrd-6.4.0-150600.21-default' *** dracut[I]: *** Creating initramfs image file '/boot/initrd-6.4.0-150600.21-default' done *** Running post-transaction scripts ..................................................................................................[done] There are running programs which still use files and libraries deleted or updated by recent upgrades. They should be restarted to benefit from the latest updates. Run 'zypper ps -s' to list these programs. Since the last system boot core libraries or services have been updated. Reboot is suggested to ensure that your system benefits from these updates. reboot ❯ cat /etc/os-release NAME="openSUSE Leap" VERSION="15.6" ID="opensuse-leap" ID_LIKE="suse opensuse" VERSION_ID="15.6" PRETTY_NAME="openSUSE Leap 15.6" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:opensuse:leap:15.6" BUG_REPORT_URL="https://bugs.opensuse.org" HOME_URL="https://www.opensuse.org/" DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap" LOGO="distributor-logo-Leap" Reference: ...

June 12, 2024 · 4 min · 785 words · kenno