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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowReadAccessToDynamoDBTables", | |
"Effect": "Allow", | |
"Action": [ | |
"dynamodb:BatchGetItem", | |
"dynamodb:GetRecords", | |
"dynamodb:GetShardIterator", |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowAccessToGogAndGogCloneSecrets", | |
"Effect": "Allow", | |
"Action": [ | |
"secretsmanager:GetSecretValue" | |
], | |
"Resource": [ |
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
# start and beginning and only go to -t time | |
ffmpeg -y -i "song.mp4" -t 00:03:10.00 -c copy dystopiaStart.mp4 | |
# start at -ss and go to the end | |
ffmpeg -y -ss 00:19:27.00 -i "song.mp4" -c copy dystopiaEnd.mp4 | |
# concat both clips :: update: does not work for mp4 files | |
#ffmpeg -i "concat:dystopiaStart.mp4|dystopiaEnd.mp4" -c copy Ffmpeg_test2.mp4 | |
# concat demuxer method without re-encode |
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 | |
# script to backup Pi SD card | |
# 2017-06-05 | |
# DSK='disk4' # manual set disk | |
OUTDIR=~/temp/Pi | |
# Find disk with Linux partition (works for Raspbian) | |
# Modified for PINN/NOOBS | |
export DSK=`diskutil list | grep "Linux" | sed 's/.*\(disk[0-9]\).*/\1/' | uniq` | |
if [ $DSK ]; then | |
echo $DSK |
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
// Execute Install.sql line by line | |
// (install.sql still needed for test cases) | |
func ExecInstallSqlbyLine(instance *confighelper.Instance, dbcfg *dbhelper.DbConfig, installSqlf string, packageRoot string, logDirRoot string, logSuffix string) (err error) { | |
// logging for instance | |
log := instance.Logger | |
// read install.sql | |
raw, err := ioutil.ReadFile(installSqlf) |
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
// Find key in interface (recursively) and return value as interface | |
func Find(obj interface{}, key string) (interface{}, bool) { | |
//if the argument is not a map, ignore it | |
mobj, ok := obj.(map[string]interface{}) | |
if !ok { | |
return nil, false | |
} |
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
// Download File | |
func DownloadFile(url string, headers map[string]string, jsonData string, downloadFilePath string) (downloadedFile string, err error) { | |
var jsonStr = []byte(jsonData) | |
log.Printf("DownloadFile(): %v\n%+v...", url, jsonStr) | |
req, err := http.NewRequest("GET", url, bytes.NewBuffer(jsonStr)) | |
for k,v := range(headers) { |
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
// ExecSQL executes psql.exe with arguments | |
// assumes cmdArgs either contains sqlfile or statement. example: ("-f", "install.sql" | "-c", <sql statement> ) | |
// singleTransaction=true to run all commands as a single-transaction/rollback on error | |
func ExecSQL2(log *logrus.Logger, dbcfg *DbConfig, cmdArgs []string, packageRoot string, logSuffix string, singleTransaction bool) (output []string, err error) { | |
log.Println("Setting Environment Variables:") | |
os.Setenv("VERBOSITY", "verbose") | |
log.Println("VERBOSITY=" + os.Getenv("VERBOSITY")) | |
os.Setenv("PGPASSWORD", dbcfg.Password) |
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
// create DB Dirs creates dirs for postgress tabelspace(s) | |
// replaces tokens contained in the configMap | |
func CreateDBDirs(dirs []string, configMap map[string]string) (err error) { | |
for _, dir := range dirs { | |
dir = TokenReplace(dir, configMap) | |
_, err := os.Stat(dir) | |
if err != nil { |
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
// UpdateTenantConfig | |
func InsertOrUpdateTenantConfig(instance *confighelper.Instance, dbcfgM *dbhelper.DbConfig, dbcfgTenant *dbhelper.DbConfig, dbcfgOlap *dbhelper.DbConfig) (err error) { | |
// 1. update the connection strings where id_ = tenant | |
// 2. if records updated, return. if no record updated, continue | |
// 3. run stored procedure to insert a new tenantconfig record | |
// logging for instance | |
log := instance.Logger |
NewerOlder