Skip to content

Instantly share code, notes, and snippets.

View k-kawashiman's full-sized avatar

kazuyuki kawashima k-kawashiman

View GitHub Profile
@k-kawashiman
k-kawashiman / find-ecr-image.sh
Created May 26, 2021 08:27 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@k-kawashiman
k-kawashiman / uwsgi.conf
Created April 15, 2021 11:00 — forked from amgorb/uwsgi.conf
uWSGI separate JSON logging for application compatible with Elasticsearch
[uwsgi]
;this will encode uwsgi messages into JSON, encode requests to JSON and leave application output unchanged
;if this output from application has msgName string
logger = default stdio
logger = secondlogger stdio
log-route = secondlogger msgName
log-route = default ^((?!msgName).)*$
log-encoder = json:default {"@timestamp":"${strftime:%%Y-%%m-%%dT%%H:%%M:%%S.666Z}","source":"uwsgi", "message":"${msg}"}
@k-kawashiman
k-kawashiman / awsecsdeploy-stack.ts
Created March 5, 2021 12:56 — forked from bkono/awsecsdeploy-stack.ts
Deploys Mastodon using AWS CDK
import cdk = require('@aws-cdk/cdk');
import ec2 = require('@aws-cdk/aws-ec2');
import elastic = require('@aws-cdk/aws-elasticache');
import rds = require ('@aws-cdk/aws-rds');
import es = require("@aws-cdk/aws-elasticsearch");
import ecs = require('@aws-cdk/aws-ecs');
import s3 = require("@aws-cdk/aws-s3");
import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');
import route53 = require('@aws-cdk/aws-route53');
import certificateManager = require("@aws-cdk/aws-certificatemanager");
"""This module contains the ``SeleniumMiddleware`` scrapy middleware"""
import asyncio
from pyppeteer import launch
from scrapy import signals
from scrapy.http import HtmlResponse
from twisted.internet import defer
from .http import PuppeteerRequest