Skip to content

Instantly share code, notes, and snippets.

@pchmn
pchmn / gist.graphql
Last active April 19, 2022 16:48
Github GraphAPI Gist
# Type queries into this side of the screen, and you will
# see intelligent typeaheads aware of the current GraphQL type schema,
# live syntax, and validation errors highlighted within the text.
# https://docs.github.com/en/graphql/overview/explorer
# We'll get you started with a simple query showing gists info!
query {
viewer {
gists (first: 100, orderBy: {field: CREATED_AT, direction: DESC} ) {
@pchmn
pchmn / 1_aws_ecs_conf.md
Last active February 16, 2024 02:29
Setup an AWS ECS Cluster

Configuring AWS ECS

Configuration of ECS with EC2 instances

Setting up ECS

Create an IAM User

Official doc

Create a key pair

Official doc

@pchmn
pchmn / awc-ecs-access-to-aws-efs.md
Created October 17, 2020 13:21 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

package org.bouncycastle.openpgp.examples;
import org.bouncycastle.bcpg.ArmoredOutputStream;
import org.bouncycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.*;
import org.bouncycastle.openpgp.jcajce.JcaPGPObjectFactory;
import org.bouncycastle.openpgp.operator.PGPDigestCalculator;
import org.bouncycastle.openpgp.operator.PublicKeyDataDecryptorFactory;
import glob
import os
from PIL import Image
def changeColotToGrayScale():
os.makedirs('grayscale', exist_ok=True)
bmp_files = glob.glob('./*.png')