Skip to content

Instantly share code, notes, and snippets.

@hbekkouche
Created October 1, 2025 05:16
Show Gist options
  • Select an option

  • Save hbekkouche/39c9fc9f92be1d647dab8ee3a4fd0a41 to your computer and use it in GitHub Desktop.

Select an option

Save hbekkouche/39c9fc9f92be1d647dab8ee3a4fd0a41 to your computer and use it in GitHub Desktop.
cat > /etc/yum.repos.d/AnyDesk-RHEL.repo << "EOF"
[anydesk]
name=AnyDesk RHEL - stable
baseurl=http://rpm.anydesk.com/rhel/$releasever/$basearch/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://keys.anydesk.com/repos/RPM-GPG-KEY
EOF
dnf install anydesk
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf install -y postgresql18-server
sudo /usr/pgsql-18/bin/postgresql-18-setup initdb
sudo systemctl enable postgresql-18
sudo systemctl start postgresql-18
sudo -i -u postgres
psql
ALTER USER postgres WITH PASSWORD 'StrongPasswordHere';
\q
sudo nano /var/lib/pgsql/18/data/postgresql.conf
listen_addresses = '*'
sudo -i -u postgres psql <<'SQL'
-- 1) Create database
CREATE DATABASE ias_ledger_20 ENCODING 'UTF8';
\c ias_ledger_20
-- 2) Schema for the ledger data
CREATE SCHEMA IF NOT EXISTS compta AUTHORIZATION postgres;
-- 3) Base table that the FDW will point to
-- Types chosen to be permissive & compatible with most sources.
-- Adjust later if you know exact types.
CREATE TABLE IF NOT EXISTS compta.ecriture_gcom (
_id text PRIMARY KEY,
_version integer,
_security text,
libelle text,
reference text,
date date,
ligne integer,
piece text,
comptabilise boolean,
id_compte text,
id_tier text,
journal_instance_id text,
debit numeric(18,3),
credit numeric(18,3)
);
-- 4) Helpful indexes (optional but recommended)
CREATE INDEX IF NOT EXISTS idx_ecriture_gcom_journal ON compta.ecriture_gcom(journal_instance_id);
CREATE INDEX IF NOT EXISTS idx_ecriture_gcom_compte ON compta.ecriture_gcom(id_compte);
SQL
# PGDG package for Postgres 18
sudo dnf install -y postgresql18-contrib
sudo -i -u postgres psql -d <your_db_name>
-- inside psql:
CREATE EXTENSION IF NOT EXISTS tablefunc;
\dx -- verify it's listed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment