Skip to content

Instantly share code, notes, and snippets.

View amad's full-sized avatar
🚀
(⌐■_■)

Ahmad Samiei amad

🚀
(⌐■_■)
View GitHub Profile
@amad
amad / The_Well-Architected_Framework_Checklist.md
Last active January 6, 2024 04:07
AWS Well-Architected Framework Checklist

The Well-Architected Framework Checklist

This is the set of questions presented on The Well-Architected Framework whitepaper designed to evaluate how well your architecture is aligned with AWS best practices.

Security Pillar

Data Protection

  • How are you encrypting and protecting your data at rest?
@amad
amad / aws_route53_delete.sh
Created December 2, 2021 20:45 — forked from earljon/aws_route53_delete.sh
Delete a Route 53 Record Set in AWS CLI
#!/bin/sh
# NOTE:
# Make sure that the value of Name, Type, TTL are the same with your DNS Record Set
HOSTED_ZONE_ID=<YOUR_HOSTED_ZONE_ID>
RESOURCE_VALUE=<YOUR_DNS_RESOURCE_VALUE-ex:IP or dns>
DNS_NAME=<YOUR_DNS_NAME-ex: subdomain.domain.com>
RECORD_TYPE=<DNS_RECORD_TYPE-ex: A, CNAME>
TTL=<TTL_VALUE>
@amad
amad / cloudSettings
Last active August 8, 2020 10:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-08T10:13:59.555Z","extensionVersion":"v3.4.3"}
trait Car {
val doorsNb: Int
override def equals(a: Any) = {
a match {
case c: Car => doorsNb == c.doorsNb
case other => false
}
}
}

Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load
import numpy as np
from scipy.signal import find_peaks
from moviepy.editor import VideoFileClip, concatenate
import matplotlib.pyplot as plt
import sys
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", help="path to the video file")
args = vars(ap.parse_args())
import numpy
import perfplot
perfplot.show(
setup=lambda n: numpy.random.randint(0, 1000, n),
kernels=[
lambda a: a[::-1],
lambda a: numpy.ascontiguousarray(a[::-1]),
lambda a: numpy.fliplr([a])[0]
@amad
amad / tutorial.md
Created July 23, 2018 19:44 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@amad
amad / docker-cleanup-resources.md
Created May 7, 2018 13:41 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm