This file contains 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
WITH ou_commissions AS ( | |
SELECT | |
code "org_unit_code", | |
commissions->>'type' "commission_type", | |
commissions->>'value' "commission_value", | |
commissions->>'priceField' "price_field", | |
commissions->>'product_code' "product_code", | |
commissions->>'product_name' "product_name", | |
commissions->>'product_slug' "product_slug", | |
commissions->>'sameRateForAgencyBranches' "same_rate", |
This file contains 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
DO $BODY$ | |
DECLARE | |
p_select_query varchar; | |
p_update_query varchar; | |
p_agency_code varchar; | |
p_agency_codes jsonb; | |
p_commissions jsonb; | |
BEGIN | |
-- fetch agency codes | |
-- ------------------------------------------------------------------------- |
This file contains 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
sch='ACADEMIA_DEV';seq='ACADEMIA_SEQ';\ | |
printf '\n\033[0;33mDo you iterate \033[0m %s \033[0;33m?\033[0m\n' "$seq";\ | |
select y in 'yes' 'no';do case $y in 'yes') break;; 'no') break;;esac;done;\ | |
printf '\nYour option is: \033[0;32m%s\033[0m' "$y";if [ "$y" == "yes" ];\ | |
then printf '\n\033[0;33mEnter the no.of iteration: \033[0m';read itr;printf \ | |
'\033[0;33mEnter the password of\033[0m %s\033[0m\033[0;33m: \033[0m' "$sch";\ | |
read -s pwd;(cat<<EOF | |
CONN $sch/$pwd; | |
DECLARE | |
VISIT_NO NUMBER; |
This file contains 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
sch='ACADEMIA_DEV';seq='ACADEMIA_SEQ';\ | |
printf '\n\033[0;33mDo you iterate \033[0m %s \033[0;33m?\033[0m\n' "$seq";\ | |
select y in 'yes' 'no';do case $y in 'yes') break;; 'no') break;;esac;done;\ | |
printf '\nYour option is: \033[0;32m%s\033[0m' "$y";if [ "$y" == "yes" ];\ | |
then printf '\n\033[0;33mEnter the no.of iteration: \033[0m';read itr;printf \ | |
'\033[0;33mEnter the password of\033[0m %s\033[0m\033[0;33m: \033[0m' "$sch";\ | |
read -s pwd;(cat<<EOF | |
CONN $sch/$pwd; | |
DECLARE VISIT_NO NUMBER; | |
BEGIN |
This file contains 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
# any where of the bash file can be placed this script | |
SYSPWD=oracle;\ | |
echo "Oracle SQLPlus Multi-Line Input";\ | |
(cat<<EOF | |
drop user academia_dev cascade; | |
create user academia_dev identified by academia_dev; | |
grant connect, resource, dba to academia_dev; | |
exit; | |
EOF | |
)|sqlplus -s sys/$SYSPWD as sysdba;\ |
This file contains 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
#################### CLIENT SIDE #################### | |
# generating a new ssh key and adding it to the ssh client | |
# https://gist.github.com/shahedhossain/7d91028ba1eb9c56049ea421a12e76fd | |
# ssh key generation for chorke | |
ssh-keygen -t rsa -b 4096 -C "user@cdn.chorke.org" | |
# Generating public/private rsa key pair. | |
# Enter a file in which to save the key (/Users/user/.ssh/id_rsa): [Press enter] | |
# Enter passphrase (empty for no passphrase): [Type a passphrase] | |
# Enter same passphrase again: [Type passphrase again] |
This file contains 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 microsoft/mssql-server-linux image | |
docker pull microsoft/mssql-server-linux | |
# mssql dockers image creation | |
docker run --name="mssql" -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=pa55w0rd" -e "MSSQL_PID=Express" -p 1433:1433 microsoft/mssql-server-linux | |
# sqlcmd access to mssql | |
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P pa55w0rd | |
# start stop docker image |
This file contains 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
#login as sysdba using os auth | |
sqlplus "/as sysdba" | |
exit | |
#login as sysdba using sys/password | |
sqlplus sys/password as sysdba | |
exit | |
#login as sysdba using sys/password@sid | |
sqlplus sys/password@cki as sysdba |
This file contains 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
# generating a new ssh key and adding it to the ssh agent | |
# https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ | |
# ssh key generation for chorke | |
ssh-keygen -t rsa -b 4096 -C "your_email@chorke.org" | |
# Generating public/private rsa key pair. | |
# Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] | |
# Enter passphrase (empty for no passphrase): [Type a passphrase] | |
# Enter same passphrase again: [Type passphrase again] |
This file contains 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
# .bash_profile | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# User specific environment and startup programs | |
PATH=$PATH:$HOME/bin | |
export PATH |
NewerOlder