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 / creating-self-signed-certificates.md
Created September 20, 2017 07:08 — forked from Themitchell/creating-self-signed-certificates.md
Creating Self Signed Certificates

Creating Self Signed Certificates for use with Node and Chrome

Creating the certificate files

  1. Generate a private key with open ssl.

    $ openssl genrsa -des3 -out /var/lib/ssl/self-signed.key 1024
  2. Generate a CSR (Certificate Signing Request).

@miqui
miqui / gist:eb3095f96c30589729507f8c86c6548c
Created May 21, 2017 17:18 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt