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
#!/bin/bash | |
# Purpose: | |
# Author: Full_name <email@> | |
# Note : | |
# Last updated on : 2018-03-05 | |
# ----------------------------------------------- | |
sqlplus -S /nolog <<EOF | |
--connect user/pass | |
@cleanup_database_tables.sql |
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
set echo on | |
set feed on | |
set time on | |
set timing off | |
set lines 300 | |
set trims on | |
set define off | |
set sqlblanklines on | |
set serveroutput on size unlimited |
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
if [[ -e $PMSourceFileDir\Clients\MyCompany\*fileName.txt ]] | |
then | |
echo "File exist" | |
return 0 | |
else |
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
Reference: https://stackoverflow.com/questions/12117024/decimal-number-regular-expression-where-digit-after-decimal-is-optional | |
You need a regular expression like the following to do it properly: | |
/^[+-]?((\d+(\.\d*)?)|(\.\d+))$/ | |
The same expression with whitespace, using the extended modifier (as supported by Perl): | |
/^ [+-]? ( (\d+ (\.\d*)?) | (\.\d+) ) $/x | |
or with comments: | |
/^ # Beginning of string |
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
[DI_RA_Prices.WF:wf_P_TR_FXRates_0905.ST:session_name] | |
$$ResponseFileName =rt_fxrates_0905_ |
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
:: Empty file | |
copy /y NUL EmptyFile.txt >NUL | |
:: Error handling | |
somecommand > log.txt 2>&1 | someothercommand | |
somecommand 2>&1 | someothercommand | |
:: Check if file exists | |
if exist \\somefile.txt ( | |
echo file exists |
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
-- Old powershell version call from command task in infa | |
powershell -executionpolicy bypass -File "$PMRootDir\check_directory_access_infa.ps1" > "$PMRootDir\check_directory_access_infa.log" 2>&1 | |
-- PowerShell exit sample code | |
# some logic to set $hasError variable. | |
if ($hasError) { | |
Write-Host has errors | |
exit 1 | |
} else { |
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
# powershell | |
git config --list --show-origin | |
## | |
## https://stackoverflow.com/questions/7335420/global-git-ignore | |
## | |
# ignore dirs/files in all user's local git repositories | |
git config --global core.excludesFile "$Env:USERPROFILE\.gitignore" | |
#review the setting | |
git config --global core.excludesFile |
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
-- Deep copy | |
CREATE OR REPLACE TABLE table1_deep_copy AS SELECT * FROM table1; | |
-- Shallow copy | |
CREATE OR REPLACE TABLE table1_shallow_copy LIKE table1; | |
-- Temporary - for current session. Cannot be cloned. | |
CREATE TEMPORARY TABLE cust_temp AS SELECT * FROM customers; | |
-- Transient - multisession, does not use fail-safe storage. | |
CREATE TRANSIENT TABLE cust_temp AS SELECT * FROM customers; | |
-- Clone |
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
python -m venv .venv | |
.\.venv\Scripts\activate | |
python -m pip install --upgrade pip | |
deactivate | |
python -m pip install -r requirements.txt | |
python -m pip freeze | |
OlderNewer