Skip to content

Instantly share code, notes, and snippets.

View koliadych's full-sized avatar

Fintechner koliadych

View GitHub Profile

Keybase proof

I hereby claim:

  • I am koliadych on github.
  • I am oleberg (https://keybase.io/oleberg) on keybase.
  • I have a public key ASACpTWSE90SGaniW8z0Nb1IYieVkVunMdgZDsWkE8kU6Ao

To claim this, I am signing this object:

@koliadych
koliadych / 02-tf-plan.sh
Last active May 10, 2026 12:26
fintechner tokyo-solo terraform bootstrap
#!/bin/bash
# fintechner — clone the repo into CloudShell and run terraform plan
# for the tokyo-solo env. Reads no secrets, writes nothing to AWS.
set -euo pipefail
REPO=koliadych/fintechner
BRANCH=feature/tokyo-deploy
WORKDIR="$HOME/work"
TFDIR="$WORKDIR/fintechner/infra/envs/tokyo-solo"
@koliadych
koliadych / 03-tf-apply.sh
Created May 10, 2026 12:42
fintechner tokyo-solo apply
#!/bin/bash
# fintechner — apply tokyo-solo terraform plan and seed the DB secret.
set -euo pipefail
TFDIR=$HOME/work/fintechner/infra/envs/tokyo-solo
REGION=ap-northeast-1
if [ ! -f "$TFDIR/plan.bin" ]; then
echo "ERROR: $TFDIR/plan.bin not found. Run 02-tf-plan.sh first."
@koliadych
koliadych / 04-fix-bootstrap.sh
Created May 10, 2026 12:51
fintechner recovery: finish bootstrap on EC2
#!/bin/bash
# fintechner — finish the EC2 bootstrap that user-data couldn't complete
# (Caddy is not in AL2023's default dnf repos; install from official binary).
#
# Run on the EC2 via: aws ssm start-session ... then paste the curl below.
# Idempotent — safe to re-run.
set -euo pipefail
REGION="ap-northeast-1"
@koliadych
koliadych / 05-deploy-app.sh
Last active May 11, 2026 09:22
fintechner deploy app to tokyo EC2
#!/bin/bash
# fintechner — build connector + dashboard in CloudShell and ship to EC2.
# Idempotent: re-running re-builds + re-installs.
set -euo pipefail
REGION=ap-northeast-1
INSTANCE_ID=i-089ad4a6b76132ba2
WORKDIR=$HOME/work/fintechner
TMPDIR=$(mktemp -d)
@koliadych
koliadych / 06-set-admin-pass.sh
Created May 10, 2026 20:31
fintechner set admin password
#!/bin/bash
# fintechner — set the dashboard admin password.
#
# Prompts for the password locally (no echo). Generates a bcrypt hash,
# stores ONLY the hash in AWS Secrets Manager, restarts the dashboard.
# The plaintext password never leaves the CloudShell process.
set -euo pipefail
REGION=ap-northeast-1
@koliadych
koliadych / 07-diagnose-dashboard.sh
Created May 10, 2026 20:35
fintechner dashboard diagnostic
#!/bin/bash
# fintechner — diagnose why the dashboard isn't responding (502).
set -euo pipefail
REGION=ap-northeast-1
INSTANCE_ID=i-089ad4a6b76132ba2
echo "=== Sending diagnostic command to EC2 ==="
CMD_ID=$(aws --region "$REGION" ssm send-command \
@koliadych
koliadych / 08-install-node-on-ec2.sh
Created May 10, 2026 20:39
fintechner install node on EC2
#!/bin/bash
# fintechner — install Node.js on the EC2 (the dashboard's server.js needs it).
set -euo pipefail
REGION=ap-northeast-1
INSTANCE_ID=i-089ad4a6b76132ba2
echo "=== Installing nodejs20 on EC2 + restarting dashboard ==="
CMD_ID=$(aws --region "$REGION" ssm send-command \
@koliadych
koliadych / 09-tail-dashboard-log.sh
Created May 10, 2026 20:42
fintechner dashboard log tail
#!/bin/bash
# fintechner — show recent dashboard logs and let you trigger a login attempt.
set -euo pipefail
REGION=ap-northeast-1
INSTANCE_ID=i-089ad4a6b76132ba2
echo "=== Last 100 lines of dashboard journal ==="
CMD_ID=$(aws --region "$REGION" ssm send-command \
--instance-ids "$INSTANCE_ID" \
@koliadych
koliadych / 10-fix-node.sh
Created May 10, 2026 20:43
fintechner force install node on EC2
#!/bin/bash
set -euo pipefail
REGION=ap-northeast-1
INSTANCE_ID=i-089ad4a6b76132ba2
echo "=== Force-install Node.js + symlink + restart dashboard ==="
CMD_ID=$(aws --region "$REGION" ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name AWS-RunShellScript \
--parameters 'commands=[