Skip to content

Instantly share code, notes, and snippets.

View miqui's full-sized avatar

Miguel Quintero miqui

View GitHub Profile
@miqui
miqui / notes.md
Created March 10, 2022 04:34 — forked from jaygiang/notes.md
AWS Certified Developer Notes (June 2018 Release)

Dynamo DB


General Info

  • DynamoDB is schemaless
  • use DynamoDb Stream when item is updated to primary table and also inserted into a secondary table
  • When looking for a good partition key use one with Automatically generated GUID
  • If large table, use queries instead of scans
  • In order to work with search queuries:
    • Specify a key condition expression in the query
  • Specify a partition key name and value in the equality condition
@miqui
miqui / cloudwatch_log_insights_mysql_slow_query_examples.md
Created March 10, 2022 04:30 — forked from grocky/cloudwatch_log_insights_mysql_slow_query_examples.md
CloudWatch Log Insights query examples for MySQL slow query log.

Filtering queries

Find slowest write queries

parse @message /Query_time: (?<queryTime>.*?) Lock_time: (<?lockTime>.*?) Rows_sent: (?<rowsSent>.*?) Rows_examined: (?<rowsExamined>.*?)\s(?<query>.*?)$/
  | filter @message like /(?i)insert/
  | sort queryTime desc
  | limit 10
@miqui
miqui / APIGateway.md
Created March 10, 2022 04:23 — forked from bskim45/APIGateway.md
CloudWatch Logs Insights query for API Gateway

Req id:

parse @message '(*) *' as reqId, message
| filter reqId like "c19dd3fc-5f27-11e9-a823-930d231e2ab8"
| sort @timestamp asc
| limit 50

Status code:

___ _____ ___ _ _ __ _ _ ___ _ _ ___ _ _ _
/_\ \ / / __| ___ / __|___ _ _| |_(_)/ _(_)___ __| | / __| ___ __ _ _ _ _(_) |_ _ _ / __|_ __ ___ __(_)__ _| | |_ _ _
/ _ \ \/\/ /\__ \ |___| | (__/ -_) '_| _| | _| / -_) _` | \__ \/ -_) _| || | '_| | _| || | \__ \ '_ \/ -_) _| / _` | | _| || |
/_/ \_\_/\_/ |___/ \___\___|_| \__|_|_| |_\___\__,_| |___/\___\__|\_,_|_| |_|\__|\_, | |___/ .__/\___\__|_\__,_|_|\__|\_, |
|__/ |_| |__/
Notes taken in Mar-2018, from acloud.guru and AWS FAQ
___ _ _ _ __ _
/ __| ___ __ _ _ _ _(_) |_ _ _ / |/ \/ |
@miqui
miqui / 00-CloudWatch Insights Queries.md
Created March 10, 2022 03:54 — forked from tkburns/00-CloudWatch Insights Queries.md
Assorted queries for AWS CloudWatch Insights

CloudWatch Insights Queries

Assorted queries for AWS CloudWatch Insights

@miqui
miqui / lambda-duration
Created March 10, 2022 03:50 — forked from chasingmaxwell/lambda-duration
AWS CloudWatch Insight Queries
filter @type = "REPORT"
| stats
avg(@billedDuration) as Average,
percentile(@billedDuration, 99) as NinetyNinth,
percentile(@billedDuration, 95) as NinetyFifth,
percentile(@billedDuration, 90) as Ninetieth
by bin(30m)
@miqui
miqui / gist:490d3836b4c60e5cc2b238e79d288693
Created March 10, 2022 03:47 — forked from zenoyu/gist:f63799a9079a5df376d5daf3cea27be4
AWS Lambda (Node) - Using Insight API to Query your Cloudwatch Log for Daily Error Report
/**
* AWS Lambda (Node) - Using Insight API to Query your Cloudwatch Log for Daily Error Report
* @author Zeno Yu <zeno.yu@gmail.com>
*/
const AWS = require('aws-sdk');
var cloudwatchlogs = new AWS.CloudWatchLogs();
exports.handler = async (event) => {
// Cloudwatch Log Group name
@miqui
miqui / generate-ssh-key.sh
Created April 2, 2021 00:48 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@miqui
miqui / openapi-weather-api.yaml
Created February 5, 2018 03:27
weather gov api swagger openapi
swagger: '2.0'
info:
title: weather.gov API
description: |
# API Reference
We are excited to announce a brand new API to provide forecast data for your applications. This new design is a significant change with easier to navigate data to enrich your application. The new API is now separate from the forecast website. The new website will only return HTML for viewing within a browser. Additional security measures will be implemented to prevent improper usage of the website to ingest forecast data. The new website is now a lightweight presentation view that uses the same API to display the forecast. This same data will be available to you through the API.
version: 1.0.0
host: api.weather.gov
@miqui
miqui / swagger-info-markdown.md
Created February 4, 2018 21:45
swagger markdown
swagger: '2.0'
info:
  title: weather.gov API
  description: |
    # Heading

    Text attributes _italic_, *italic*, __bold__, **bold**, `monospace`.

 Horizontal rule: