Skip to content

Instantly share code, notes, and snippets.

View dincosman's full-sized avatar

Osman DINC dincosman

View GitHub Profile
@dincosman
dincosman / install_ords.sh
Created May 14, 2024 19:06
Install ORDS (Oracle Rest Data Services)
[oracle@oradev01 ~]$ export ORDS_CONFIG=/home/oracle/ordsconfig
[oracle@oradev01 ~]$ export PATH=/home/oracle/ords/bin:/opt/oracle/product/23ai/dbhomeFree/jdk/bin:$PATH
[oracle@oradev01 ~]$ export JAVA_HOME=/opt/oracle/product/23ai/dbhomeFree/jdk
[oracle@oradev01 ords]$ export ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree
[oracle@oradev01 ~]$ cd ords
[oracle@oradev01 ords]$ ords install
ORDS: Release 24.1 Production on Sat May 04 20:19:24 2024
@dincosman
dincosman / configure_oracle23ai.sh
Created May 14, 2024 18:59
Configure Oracle Database 23ai
[root@oradev01 ~]# /etc/init.d/oracle-free-23ai configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password:
*********
Enter SYSTEM user password:
******
@dincosman
dincosman / install_oracle23ai.sh
Created May 14, 2024 18:21
Install Oracle Database 23ai using rpm method
[root@oradev01 ~]# dnf install -y oracle-database-free-23ai
Last metadata expiration check: 0:03:50 ago on Sat 04 May 2024 10:42:18 PM +03.
Dependencies resolved.
=========================================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================================================
Installing:
oracle-database-free-23ai x86_64 1.0-1 @commandline 1.3 G
Installing dependencies:
@dincosman
dincosman / check_records_in_postgresql.sh
Created May 14, 2024 17:01
Check the inserted records in PostgreSQL database psql command line
[postgres@ferret01 data]$ psql -d ferretdb
psql (16.2)
Type "help" for help.
-- For a mongodb database - a schema created in postgresql
-- For a mongodb collection - a relation/table created in postgresql
ferretdb=# SET schema 'test';
SET
ferretdb=# \dt
List of relations
@dincosman
dincosman / FerretDB_insert_1million.sh
Created May 14, 2024 16:53
Insert 1000000 rows on FerretDB
osmandinc@192 mongoapi % node 1mri_ferret.js
(node:25327) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Inserted: 1000000 rows
Operation took: 65403.59325 milliseconds
[root@mongo01 ~]# mongosh mongodb://postgres:[email protected]:27002/ferretdb?authMechanism=PLAIN
Current Mongosh Log ID: 6636743d70a76b19852202d7
Connecting to: mongodb://<credentials>@192.168.60.202:27002/ferretdb?authMechanism=PLAIN&directConnection=true&appName=mongosh+2.2.5
@dincosman
dincosman / 1mri_ferret.js
Last active May 17, 2024 08:26
One million row insert on FerretDB Nodejs Script
const fs = require("fs");
const mongodb = require("mongodb").MongoClient;
const fastimp = require("fast-csv");
// Start timing
const startTime = process.hrtime();
// Mongo API connection string
let url = "mongodb://postgres:[email protected]:27002/ferretdb?authMechanism=PLAIN";
let stream = fs.createReadStream("measurements.txt");
@dincosman
dincosman / MongoDB_insert_1million.sh
Created May 14, 2024 09:54
Insert 1000000 rows on MongoDB
osmandinc@192 mongoapi % node 1mri_mongo.js
(node:23091) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Inserted: 1000000 rows
Operation took: 21868.841958 milliseconds
[root@mongo01 ~]# mongosh mongodb://insanedba:[email protected]:27001/test
Current Mongosh Log ID: 663681a98dee05e7f72202d7
Connecting to: mongodb://<credentials>@192.168.1.31:27001/test?directConnection=true&appName=mongosh+2.2.5
@dincosman
dincosman / prepare_data_onmacbook.sh
Created May 13, 2024 21:22
Install SDKMAN, Java, Node, NVM (Node Version Manager), fast-csv, mongoose and fs npm packages on Macbook M1 Apple Silicon.
--- Install SDKMAN
osmandinc@192 ~ % curl -s "https://get.sdkman.io" | bash
osmandinc@192 ~ % source "/Users/osmandinc/.sdkman/bin/sdkman-init.sh"
osmandinc@192 ~ % sdk version
...
SDKMAN!
script: 5.18.2
native: 0.4.6
-- Install Java
@dincosman
dincosman / 1mri_mongo.js
Created May 13, 2024 20:56
One million row insert on Vanilla MongoDB Community Edition Nodejs Script
const fs = require("fs");
const mongodb = require("mongodb").MongoClient;
const fastimp = require("fast-csv");
// Start timing
const startTime = process.hrtime();
// Mongodb connection string
let url = "mongodb://insanedba:[email protected]:27001/test";
@dincosman
dincosman / enable_tls_on_pgbackrest
Last active April 28, 2024 21:51
Configure TLS on pgbackrest repo server and postgresql databases
[root@posbckp01 ~]# cd /etc/ssl/
[root@posbckp01 ssl]# mkdir pgbackrest
[root@posbckp01 ssl]# cd pgbackrest/
[root@posbckp01 ~]# cat csr_details.txt
[ req ]
default_bits = 2048
default_md = sha256
req_extensions = v3_req
distinguished_name = dn
prompt = no