graph TD
user
subgraph aws[AWS]
subgraph s3[S3 & CloudFront]
web[web app]
end
subgraph ecs[ECS]
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 | |
# Usage: ./s3cmdclearfiles "bucketname" "30d" | |
s3cmd ls s3://$1 | grep " DIR " -v | while read -r line; | |
do | |
createDate=`echo $line|awk {'print $1" "$2'}` | |
createDate=`date -j -f "%Y-%m-%d %H:%M" "$createDate" +%s` | |
olderThan=`date -j -v-$2 +%s` | |
if [[ $createDate -lt $olderThan ]] |
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 | |
regex_repo_name="\/([^\/]*\.git)" | |
if [[ ${!#} =~ $regex_repo_name ]] | |
then | |
repo_name="${BASH_REMATCH[1]}" | |
else | |
echo "Could not find a repo name in ${!#}" | |
fi |
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
import base64 | |
import json | |
import multiprocessing | |
import sys | |
import boto3 | |
import botocore | |
INPUT_FILE = 'all_raw_files.txt' | |
S3_RAW_BUCKET_NAME = '____' |
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
"""Run this script to create or refresh your developer environment | |
Installs a virtual environment with the main requirements at venv, one at venv/dbt, and one at venv/meltano. The root (venv) can be changed by passing an argument e.g. "python requirements/developer_setup.py my_venv_root" | |
To run: python developer_setup.py | |
""" | |
import glob | |
import os | |
import pip | |
import re | |
import shutil | |
import subprocess |
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
import argparse | |
import os | |
import boto3 | |
class S3MultipartUpload(object): | |
# AWS throws EntityTooSmall error for parts smaller than 5 MB | |
PART_MINIMUM = int(5e6) |
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
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i |
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 A AS ( | |
SELECT * | |
FROM OPENROWSET('SQLNCLI', 'Server=<SERVERA>;Database=CADIS;Trusted_Connection=yes;', 'select top 10 * from <TABLE>') | |
), | |
B AS (SELECT * FROM <TABLE>), | |
A_ONLY AS ( | |
SELECT TOP 10 * FROM A | |
EXCEPT | |
SELECT TOP 10 * FROM B |
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
# comes with node and npm already installed | |
FROM node:carbon-alpine | |
RUN mkdir -p /usr/src/app | |
RUN chown node:node /usr/src/app | |
WORKDIR /usr/src/app | |
USER node | |
# ensures both package.json and package-lock.json are copied | |
COPY package*.json ./ | |
RUN npm install --quiet --production --no-progress && \ |
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
param ( | |
[string]$output = "wiki", # can be html or wiki | |
[string]$DatabaseServer = "nt7565", | |
[string]$Database = "MARKITEDM_DEV_DX" | |
#[Parameter(Mandatory=$true)][string]$username, | |
#[string]$password = $( Read-Host "Input password, please" ) | |
) | |
Clear-Host | |
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex |
NewerOlder