Skip to content

Instantly share code, notes, and snippets.

@fujiwara
fujiwara / arch.txt
Created July 2, 2014 05:12
stud / HAProxy SSL benchmark
[ client ] --> [ :8443 stud ] --> [ :8888 haproxy ] ---> [ :80 nginx ]
+---------------------------> [ :9443 haproxy ] -/
#!/usr/bin/env ruby
require 'json'
def read_json(file_name)
JSON.parse(File.read(file_name))
end
def parse(iam)
result = []
@fujiwara
fujiwara / gist:c33927f5b03007c0fdeedd171488e5e5
Last active May 14, 2021 18:05
ecspresso handbook diff between v1.3 and v1.5.4
diff --git a/books/ecspresso-handbook/codedeploy.md b/books/ecspresso-handbook/codedeploy.md
index 7204de5..e68c4ea 100644
--- a/books/ecspresso-handbook/codedeploy.md
+++ b/books/ecspresso-handbook/codedeploy.md
@@ -185,9 +185,9 @@ https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/userguide/deployment-type-blu
Blue/Green デプロイを設定したサービスは、オートスケーリングが有効な状態ではデプロイが行えません。
-`ecspresso deploy --suspend-autoscaling` を指定することで、デプロイ前に Application Autoscaling を一時的に停止できます。
+`ecspresso deploy --suspend-auto-scaling` を指定することで、デプロイ前に Application Autoscaling を一時的に停止できます。
aws ecs describe-task-definition --task-definition ecspresso-test --include TAGS | jq '. | {containerDefinitions:.taskDefinition.containerDefinitions, cpu:.taskDefinition.cpu, executionRoleArn:.taskDefinition.executionRoleArn, family:.taskDefinition.family, memory:.taskDefinition.memory, networkMode:.taskDefinition.networkMode, placementConstraints:.taskDefinition.placementConstraints, requiresCompatibilities:.taskDefinition.requiresCompatibilities, taskRoleArn:.taskDefinition.taskRoleArn, proxyConfiguration:.taskDefinition.proxyConfiguration, volumes:.taskDefinition.volumes, tags:.tags}'
<!Docutype HTML>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>UserStreamsClient</title>
<script src="http://www.google.com/jsapi"></script>
<script> google.load("jquery", "1.4") </script>
<style>
div.tweet {
border-bottom: 1px solid #999;
@fujiwara
fujiwara / config.yml
Created February 21, 2020 05:39
aws-cli-v2 orb
orbs:
aws-cli-v2:
commands:
install:
steps:
- run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
@fujiwara
fujiwara / fluentd.conf
Last active February 7, 2020 13:00
fix fluentd tags from firelens
<match *-firelens-*>
@type firelens_tag_filter
</match>
<match app.firelens.**>
# ...
</match>
@fujiwara
fujiwara / graph-depends-on.pl
Created May 29, 2019 05:51
Visualize container dependencies from ECS task definition JSON.
#!/usr/bin/env perl
use 5.12.1;
use warnings;
use JSON::PP;
my $file = shift;
open my $in, "<", $file or die $!;
my $taskdef = JSON::PP::decode_json(do { local $/ = undef; <$in> });
my $g = $file;
CPAN: Archive::Tar loaded ok (v1.52)
PerlIO-Util-0.70/
PerlIO-Util-0.70/Changes
PerlIO-Util-0.70/dir.c
PerlIO-Util-0.70/example/
PerlIO-Util-0.70/example/dir_bench.pl
PerlIO-Util-0.70/example/iocapture.pl
PerlIO-Util-0.70/example/ioname.pl
PerlIO-Util-0.70/example/piotac.pl
PerlIO-Util-0.70/example/piotee.pl
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use 5.014;
use Encode;
use JSON::PP qw/encode_json decode_json/;
use Sys::Hostname;
use IPC::Open2;