Skip to content

Instantly share code, notes, and snippets.

View kenichi-shibata's full-sized avatar
🇯🇵
working

Kenichi Shibata kenichi-shibata

🇯🇵
working
View GitHub Profile
Hello,
We have a recent update on a workaround to achieve the PCA cross account setup.
As of now AWS Private CA does not offer a resource-based policy to provide access to Private CAs across accounts, however you may create a role with (with issue-certificates and get-certificates permissions) in the Account hosting the CA trusting cross-accounts where users would issue certificates using the private CA using CLI by creating a private key and CSR without using the Certificate Manager. Please find the below steps that explains this process,
Setup:
Account A - Hosting Private CA, Example ARN: arn:aws:acm-pca:us-east-2:12345678901:certificate-authority/d85a56xx-6591-4ca4-bf0c-97badb11c87c
Account A - Role: "CrossAccountPCA" - ARN: arn:aws:iam::12345678901:role/CrossAccountPCA
The below IAM policy would give permissions to issue private certificates using a specific private Certificate Authority only. If you wish to allow permissions across all CAs, you may replace the resource section with a wild-card (*) inste

Run the Shibata.Cloud Website

Open the Cloud9

Services -> Cloud9 -> Open IDE

Get the project

@kenichi-shibata
kenichi-shibata / Create-EC2.md
Last active October 5, 2020 13:15
Demo EC2 Create

0. Login to Cloud9

Create a new IDE

Services -> Cloud9 -> Create Environment -> <yourname>-cloud-laptop -> Click on Next -> Click on Ubuntu -> Click on next step -> Confirm

Open an existing IDE

Services -> Cloud9 -> Open IDE
# using curl
curl https://keybase.io/kenichishibata/key.asc | gpg --import
# using `keybase pgp pull` which
# imports to GPG key chain for you
keybase follow kenichishibata
keybase pgp pull kenichishibata
plugins=(
git
bundler
dotenv
osx
rake
rbenv
ruby
kubectl
pipenv
@kenichi-shibata
kenichi-shibata / kubectl-multi-version-brews.md
Last active July 1, 2020 09:34 — forked from rdump/kubectl-multi-version-brews.md
kubectl multi-version brews (kubernetes-cli formula)

kubectl multi-version brews

We need to run multiple versions of kubectl for compatibility with various kubernetes clusters.

It's a bit easier to get and use multiple versions of kubectl using Homebrew than it is using Macports.

With brew, it's simple to:

  • Install a bunch of versions of kubectl (in the kubernetes-cli Formula)
  • Switch between them as needed
@kenichi-shibata
kenichi-shibata / jq-cheetsheet.md
Created May 26, 2020 16:57 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

  • face towel
  • pan(katulad ng nsa kusina natin na pinaglulutuan ko ng mga ulam/pinagboboilan ko dn-1pc
  • ginger -5pcs
  • triple A battery
  • 2L milk -check expiry date
  • eggs-12pcs
  • bigas sainsburys white long grain rice red ang lalagyan 2kilos
  • thai jasmin rice microwavable blue 4 pcs
  • croissant 6pcs-1pack
  • slice bread dpat 5 days p maga expire

Scenario: Smart meters are now being distributed across all households in the UK however currently we are having problems with the data coming in. Some of the data coming in all at once and we have to scale our infrastructure a lot more because the smart meters collect all the data at 6pm at night,

We would like to rearchitect the smart meter delivery system to an hourly system and enable eventual consistency in the way we handle these data in order to decouple our microservices.

Another thing we have to keep in mind is we need to be able to replay data which are not successfulyy processed by our smart meter platform

Finally we would like to get all of the processed events into the data swamp to be processed by our data engineering team

@kenichi-shibata
kenichi-shibata / go_file_print.go
Created April 6, 2020 09:51 — forked from limboinf/go_file_print.go
golang print file content
//打印文件内容
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"io"
"path/filepath"