This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! SendLineToTmux(no_return) abort | |
| let target = '' | |
| let restore_focus = 0 | |
| let current_pane = '' | |
| " Only do targeting / restore logic if inside tmux (opening the script in the last pane) | |
| if exists('$TMUX') | |
| let current_pane = substitute(system('tmux display-message -p "#{pane_id}"'), '\n$', '', '') | |
| " Jump to last active pane to get its ID, then target it | |
| call system('tmux last-pane') | |
| let target_pane = substitute(system('tmux display-message -p "#{pane_id}"'), '\n$', '', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Data Modeling Methodology | |
| for MongoDB</title> | |
| <style> | |
| html, body { | |
| height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # start a YugabyteDB node | |
| docker run -d --name yb yugabytedb/yugabyte:2.23.0.0-b710 \ | |
| yugabyted start --enable_pg_parity_tech_preview --background=false | |
| # start PostgreSQL client | |
| docker run --rm -it --link yb:yb \ | |
| -e PGHOST=yb -e PGPORT=5433 -e PGUSER=yugabyte postgres psql | |
| select version(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create extension if not exists postgres_fdw; | |
| select format(' | |
| create server if not exists "gv$%1$s" | |
| foreign data wrapper postgres_fdw | |
| options (host %2$L, port %3$L, dbname %4$L) | |
| ', host, host, port, current_database()) from yb_servers(); | |
| \gexec | |
| select format(' | |
| drop user mapping if exists for admin | |
| server "gv$%1$s" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- SQL implementation of https://github.com/gunnarmorling/1brc | |
| -- | |
| -- get the basic feed data as insert statements in weatherstations.sql | |
| -- | |
| /* run in shell to build the 400 lines feed data that was hardcoded in CreateMeasurements.java : | |
| curl -s https://raw.githubusercontent.com/gunnarmorling/1brc/main/src/main/java/dev/morling/onebrc/CreateMeasurements.java | awk ' | |
| # Oracle Database # BEGIN{print "begin"} END{ print "end;" ; print "/" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table> | |
| <tbody><tr> | |
| <td> | |
| <strong>MVCC Isolation level</strong> | |
| </td> | |
| <td> | |
| <strong>Serializable Snapshot Isolation</strong> | |
| </td> | |
| <td> | |
| <strong>Snapshot Isolation</strong> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- load names | |
| \! wget -cO/var/tmp/baby-names.csv "https://github.com/hadley/data-baby-names/blob/master/baby-names.csv?raw=true" | |
| drop table if exists baby_names; | |
| create table baby_names ( year int , name text, percent float, sex text, primary key (name,year, sex)); | |
| \copy baby_names from '/var/tmp/baby-names.csv' with ( skip 1, format csv ); | |
| -- joins scale | |
| drop table if exists users,messages cascade; | |
| create table users ( | |
| primary key (user_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PATH=$PATH:$ORACLE_HOME/python/bin | |
| pip install html2text | |
| for f in $(grep -l ' wrapped *$' $(find $ORACLE_HOME -name "*.plb")) | |
| do | |
| curl -s -F "file=@$f" -F "ShowLineNumbers=false" -F "UnwrapFile=Unwrap File" https://www.codecrete.net/UnwrapIt/ | | |
| html2text | awk ' | |
| /Unwrap More Code/{p="Y";next} | |
| /Bleichenbacher/{print "--",$0;next} | |
| p=="Y"{gsub(/ʼ/,qq);print} | |
| ' qq="'" > ${f}.unwrapped && wc ${f}.unwrapped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Load from psql: | |
| \! curl -s https://gist.githubusercontent.com/FranckPachot/ec2b586d18965a4571a544c2b862e6a7/raw/fef5faa450ab25949b6bd35f7af9dbc48e89c068/yb_emp_dept.sql > yb_emp_dept.sql | |
| \i yb_emp_dept.sql | |
| */ | |
| drop table if exists emp; | |
| drop table if exists dept cascade; | |
| CREATE TABLE IF NOT EXISTS dept ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # take the following from the public image: /home/yugabyte /etc/yum.repos.d/CentOS.repo /etc/yum.repos.d/almalinux8.repo /usr/bin/NOTICE.txt /usr/bin/azcopy /usr/local/gsutil | |
| FROM yugabytedb/yugabyte:2.17.1.0-b439 as public_image | |
| # remove those that are re-created later | |
| RUN rm -rf /home/yugabyte/{master,tserver} | |
| FROM almalinux:8 | |
| ENV RELEASE=4 | |
| ENV USER=root |
NewerOlder