Skip to content

Instantly share code, notes, and snippets.

View maishsk's full-sized avatar

Maish Saidel-Keesing maishsk

View GitHub Profile
{
"version": "0",
"id": "xxxxxxxxxxxx-7288-8259-a251d0d4f872",
"detail-type": "GuardDuty Finding",
"source": "aws.guardduty",
"account": "xxxxxxxxxxxx",
"time": "2019-03-04T08:55:11Z",
"region": "us-east-1",
"resources": [],
"detail": {
{
"eventVersion": "1.05",
"UserIdentity": {
"type": "AssumedRole",
"principalId": "xxxxxxxxxxxxxxxxx:Maish",
"arn": "arn:aws:sts::xxxxxxxxxxxx:assumed-role/Some_Role/Maish",
"accountId": "xxxxxxxxxxxx",
"accessKeyId": "xxxxxxxxxxxx",
"sessionContext": {
"attributes": {
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "xxxxxxxxxxxxx7NSXUYG",
"arn": "arn:aws:iam::xxxxxxxxxxxx:user/some_username",
"accountId": "xxxxxxxxxxxx",
"accessKeyId": "AKIAJTMN5LKN3KSNDOPA",
"userName": "some_username"
},
@maishsk
maishsk / maishsk.sh
Created January 13, 2019 09:21
Create solution
#!/bin/bash
# create structure
mkdir -p mysql/sql-scripts nginx node
## Download Files
# docker-compose
curl -L "https://gist.githubusercontent.com/maishsk/252c7d77502604ee9c4d3520b65f5cfb/raw/84ccae8b94dfb0e2bcbd4fd78b97aba31ce479bc/docker-compose.yml" -o docker-compose.yml
## mysql
@maishsk
maishsk / docker-compose.yml
Created January 13, 2019 08:49
Docker compose
version: '3'
services:
mysql:
image: "maishsk/mysql"
ports:
- "3306:3306"
expose:
- 3306
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
@maishsk
maishsk / Dockerfile
Created January 13, 2019 08:47
nginx Docker image
FROM nginx
COPY nginx.conf /etc/nginx/nginx.conf
@maishsk
maishsk / Dockerfile
Created January 13, 2019 08:45
MYSQL docker image
# Derived from official mysql image (our base image)
FROM mysql:5.6
EXPOSE 3306
# Add a database
ENV MYSQL_DATABASE maishsk
# Add the content of the sql-scripts/ directory to your image
# All scripts in docker-entrypoint-initdb.d/ are automatically
# executed during container startup
COPY ./sql-scripts/ /docker-entrypoint-initdb.d/
@maishsk
maishsk / Dockerfile
Last active January 13, 2019 09:04
Dockerfile
FROM node:8
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
@maishsk
maishsk / create_data.sql
Created January 13, 2019 06:27
create database
CREATE TABLE mytable ( id smallint unsigned not null auto_increment, name varchar(20) not null, constraint pk_example primary key (id) );
INSERT INTO mytable ( id, name ) VALUES ( null, 'Hello World' );
@maishsk
maishsk / Dockerfile
Created January 13, 2019 06:25
Dockerfile
# Derived from official mysql image (our base image)
FROM mysql:5.6
EXPOSE 3306
# Add a database
ENV MYSQL_DATABASE maishsk
# Add the content of the sql-scripts/ directory to your image
# All scripts in docker-entrypoint-initdb.d/ are automatically
# executed during container startup
COPY ./sql-scripts/ /docker-entrypoint-initdb.d/