Skip to content

Instantly share code, notes, and snippets.

@keitaj
keitaj / Dockerfile
Created February 4, 2020 12:16
Run the executable docker container
FROM golang:1.13.7-alpine3.10
ADD . /go/src/workspace/ecs-task
WORKDIR /go/src/workspace/ecs-task
RUN go build -o ecs-task && mv ecs-task /bin
ENTRYPOINT ecs-task
@keitaj
keitaj / Dockerfile
Created February 4, 2020 12:31
Run docker container with arguments
FROM golang:1.13.7-alpine3.10
ADD . /go/src/workspace/ecs-task
WORKDIR /go/src/workspace/ecs-task
RUN go build -o ecs-task && mv ecs-task /bin
CMD /bin/sh ./entrypoint.sh
@keitaj
keitaj / kubernetes_troubleshooting.md
Last active October 16, 2020 00:55
Kubernetes Troubleshooting

The Service "xxx" is invalid: spec.clusterIP: Invalid value: "None": field is immutable

Because clusterIP was already created, first run kubectl delete manually, and then deploy.

kubectl delete -f deploy.yaml
kubectl apply -f deploy.yaml
@keitaj
keitaj / lib.rs
Created April 23, 2022 03:20
Solana Program Tutorial
use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::{
account_info::{next_account_info, AccountInfo},
entrypoint,
entrypoint::ProgramResult,
msg,
program_error::ProgramError,
pubkey::Pubkey,
};
import { Connection, PublicKey, clusterApiUrl, LAMPORTS_PER_SOL, RpcResponseAndContext, AccountInfo } from "@solana/web3.js";
import { AccountLayout, TOKEN_PROGRAM_ID } from "@solana/spl-token";


// ... 省略 ...

            const getOwnedTokenAccount = async () : Promise<RpcResponseAndContext<{
                pubkey: PublicKey;