Skip to content

Instantly share code, notes, and snippets.

View stelf's full-sized avatar
🦌
focusing 🦊

Gheorghi stelf

🦌
focusing 🦊
View GitHub Profile
@stelf
stelf / oracle.net.core.connect.ps1
Created July 19, 2021 09:16
establish Oracle connection via .NET Core from Powershell using TNS config
# this GIST is available under the conditions of
# https://creativecommons.org/licenses/by/4.0/
using namespace Oracle.ManagedDataAccess.Core
# the following is needed if the connector is already globally installed
# but IS OKAY even without dependencies, as these install half gig of the .NET core libs anyway
#
# $dest = "$(gl)\packages\"
# Install-Package -Name Oracle.ManagedDataAccess.Core -Destination $dest -SkipDependencies
rg -UiH --multiline-dotall --pcre2 --glob *.raml '(?x) ^\s*description:.*? (?= ( ^\s*\# | ^[\s]+[/\-\w(){}]+: | ^$ ))'
@stelf
stelf / outlook.search.ps1
Last active July 19, 2021 09:37
iterate outlook folder item search results via powershell COM automation
# this GIST is available under the conditions of
# https://creativecommons.org/licenses/by/4.0/
# example how to search Outlook mailbox via COM automation
# + find lines with specific text while also further filtering these
# this approach is actually much more readable than the VB examples in MS help
# thanks to escaped quotes not subject to some ugly concatenation practices
#
# useful references here:
# https://docs.microsoft.com/en-us/office/vba/outlook/how-to/search-and-filter/filter-the-body-of-a-mail-item
@stelf
stelf / create.fdw.sql
Last active July 19, 2021 09:37
Oracle 19 foreign data wrapper in PostgreSQL setup
--- this GIST is available under the conditions of
--- https://creativecommons.org/licenses/by/4.0/
CREATE EXTENSION oracle_fdw;
drop server orcl19;
CREATE SERVER orcl19 FOREIGN DATA WRAPPER oracle_fdw
OPTIONS (dbserver '//localhost:1521/ORCL19');
GRANT USAGE ON FOREIGN SERVER orcl19 TO postgres;
@stelf
stelf / research.oracle.usage.sql
Last active July 19, 2021 09:38
query oracle usage stats
--- # this GIST is available under the conditions of
--- # https://creativecommons.org/licenses/by/4.0/
SELECT
MAX(LAST_SAMPLe_DATE) AS "Last use",
NAME AS "Name",
CAST (TO_CHAR(SUM(DETECTED_USAGES) / SUM(TOTAL_SAMPLES) * 100, '999') AS VARCHAR2(5)) AS "%"
FROM
dba_feature_usage_statistics
WHERE
@stelf
stelf / rx.monitor.ps.js
Last active July 19, 2021 09:38
monitor bash processes via rxjs
// this GIST is available under the conditions of
// https://creativecommons.org/licenses/by/4.0/
const psList = require('ps-list');
const { interval, from } = require('rxjs');
const { switchMap, filter, map } = require('rxjs/operators');
interval(500)
.pipe( switchMap(() => psList()),
@stelf
stelf / for.ifs.sh
Created August 30, 2019 14:26
IFS bash change example
IFS=$'\n'
dest=FL_insurance_sample.csv
counties=$(cut -d',' -f 3 $dest | sort | uniq)
for county in $counties
do
cnt=$(grep $county $dest | wc -l)
echo $county has $cnt
done
@stelf
stelf / 100nums.random.js
Created December 25, 2018 13:08
100 random.org nums
const http = require('https')
const querystring = require('querystring')
const adr = 'https://www.random.org/integers/?';
const qry = querystring.stringify({
num: 100,
min: 1,
max: 100,
col: 1,
@stelf
stelf / dates.numerology.js
Created December 17, 2018 10:08
find dates with 11/22/33 vibration
for (let y = 2000; y <= 2099; y++ ) {
let [ y11, y22, y33 ] = [0,0,0];
for (let m = 1; m <= 12; m++ ) {
for (let d = 1; d < 31; d++ ) {
let yx = parseInt(y / 1000) + parseInt((y % 100) / 10 ) + y % 10;
if (yx != 11 && yx != 22 && yx != 33 ) {
while (yx >= 10)
yx = parseInt(yx / 10) + yx % 10;
@stelf
stelf / tmux-web2print.sh
Created April 6, 2018 13:17
dev tmux setup
#!/bin/sh
WORKROOT=/media/stelf/work2
tmux new-session -d -c $WORKROOT/web2print -n pechatar -s pechatar
tmux split-window -d -v -t pechatar -c $WORKROOT/visionr2018/visionr-dev
tmux send-keys -t pechatar "vrs run" Enter
tmux send-keys -t pechatar.1 "npm start" Enter