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 logging | |
import azure.functions as func | |
import os | |
from pathlib import Path | |
from cassandra.cluster import Cluster | |
from cassandra.auth import PlainTextAuthProvider | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Marcus is a douche bag</title> | |
<meta charset="UTF-8"> | |
<style> | |
html, | |
body { |
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-StrictMode -version 5.0 | |
$ErrorActionPreference = 'Stop' | |
$env:JAVA_HOME = 'C:\Program Files\Java\jre1.8.0_301\' | |
$script_path = $MyInvocation.MyCommand.Path | |
$script_directory = Split-Path -Parent $script_path | |
$install_directory = Split-Path -Parent $script_directory | |
$install_lib_directory = "${install_directory}\lib\" |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Metadata: | |
License: Apache-2.0 | |
Parameters: | |
ClusterTargetVPC: | |
Description: "The name of the VPC to host the cluster." | |
Type: "String" | |
ClusterSubnetCIDRRange: |
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
--Original query... | |
SELECT CID, | |
min_price, | |
collection_date, | |
FROM QL2_TMP.PUBLIC.7PLUS_OVERLAP_SAMPLE_DATA_VIEW | |
WHERE site_name = 'Walmart' | |
AND year(date(Collection_date, 'dd-mm-yyyy')) = '2020' | |
AND CID in (4548496, 4548521, 4548615, 4548664, 4548672, 4548681, 4548684, 4548688, 4548732, 4548723) | |
ORDER BY collection_date DESC; |
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
'use strict' | |
/* | |
.Synopsis | |
Import Data from File to DynamoDB Table | |
.Description | |
Imports data from a file expressed as JSON to a | |
DynamoDB table. |
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
## Retrieve a list of log groups | |
aws logs describe-log-groups --profile development --region us-east-2 | |
## Retrieve a list of log groups matching a specific name | |
aws logs describe-log-groups --log-group-name /aws/lambda/sandbox --profile development --region us-west-2 | |
## Update a specific log group to a given retention period | |
aws logs put-retention-policy --log-group-name /aws/lambda/decoNetworkChild --retention-in-days 5 --region us-east-2 --profile development |
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
const LogGroupRetentionUpdate = async (logGroupNamePrefix, retentionPeriodInDays, profile = "development", region = "'us-wast-1'") => { | |
const AWS = require('aws-sdk'); | |
process.env.AWS_SDK_LOAD_CONFIG = true; | |
process.env.AWS_PROFILE = profile; | |
AWS.config.update( {region: region} ); | |
const logs = new AWS.CloudWatchLogs({apiVersion: '2014-03-28'}); | |
// Make sure the function was passed a valid log group prefix and retention period |
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
const mtz = require('moment-timezone'); | |
const moment = require('moment'); | |
const original_date_string = "2019/10/15 14:21:14"; | |
const original_date_object = new Date(original_date_string); | |
const original_date_object_est = moment.tz(original_date_object, 'America/New_York'); | |
console.log("Original: %s", original_date_string); | |
console.log("UTC: %s", original_date_object_est.utc().toISOString()); | |
exports.handler = async (event) => { |
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
REM Will add the `dntz` file extension to files w/o a file extension | |
REM in the current directory | |
for %f IN ("*.") DO ren %f %f.dntz | |
REM Will add the `dntz` file extension to files w/o a file extension | |
REM in the current and any sub-directories | |
for /R %f IN ("*.") DO move %f %f.dntz |
NewerOlder