Skip to content

Instantly share code, notes, and snippets.

View apolloclark's full-sized avatar
💭
automating the world

Apollo Clark apolloclark

💭
automating the world
View GitHub Profile
@apolloclark
apolloclark / mysql cheatsheet.md
Last active July 27, 2023 01:46
mysql cheatsheet

MySQL Cheatsheet

This is a collection of the most common commands I run while administering Mysql databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Mysql has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu 14.04

https://help.ubuntu.com/14.04/serverguide/mysql.html

sudo apt-get update

AWS IAM Multi-Tenancy, Multi-Account, Architectures

This article is an overview of IAM implementations, focused on multi-tenancy deployments.

 

Terminology

  • IAM User - IAM access account.
  • IAM Group - A grouping of IAM Users.
@apolloclark
apolloclark / Buffer Overflow Tutorial in Kali.md
Last active May 13, 2023 20:14
Buffer overflow demonstration in Kali Linux, based on the Computerphile video
@apolloclark
apolloclark / lock_down_public_s3_buckets.md
Last active January 27, 2023 08:10
Bash one-liner to find public facing AWS S3 buckets, and make them private

Command

aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'if [[ $(aws s3api get-bucket-acl --bucket {} --query '"'"'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers` && Permission==`READ`]'"'"' --output text) ]]; then aws s3api put-bucket-acl --acl "private" --bucket {} ; fi'



1. List all of the user's buckets, and output the name, as text.

@apolloclark
apolloclark / jenkins credentials-plugin example.md
Created January 31, 2019 17:07
Jenkins credentials-plugin example script
# run jenkins/jenkins:lts, with volumes, exposed ports
docker run -d -v jenkins_home:/var/jenkins_home \
  -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
  
# Jenkins Pipeline script, using Credentials

pipeline {
    agent any
@apolloclark
apolloclark / mongodb cheatsheet.md
Last active July 20, 2022 05:30
mongodb cheatsheet

Hello, I am Apollo Clark, a Cloud Architect, formerly with HashiCorp, with 13+ years of AWS experience, 4+ years of Azure Experience, and 3+ years of GCP experience. I've worked with the largest financial services companies in the world, and various US Dept of Defense (DoD) organizations, over the years on projects with security requirements of PCI-DSS, HIPAA, FedRAMP, and GDPR. AWS is an amazing service capable of a wide variety of uses, but with that flexibility comes a lot of complexity that is easy to misconfigure. Unfortunately, even in 2022, a lot of cloud provider services are not secure by default. This guide is a list of the most common mistakes I've seen. Many organizations adopted AWS organically, without any centralized planning, given the ease of using an oragnization credit card to spin up infrastucture in minutes, versus going through months of approval and waiting for physical hardware to be delivered, installed, configured, and made available into on-prem VMware based data centers. Whenver I

@apolloclark
apolloclark / rhel cheat sheet.md
Last active May 9, 2022 01:48
Redhat LInux cheat sheet
@apolloclark
apolloclark / Kali Linux 2016.2 - Metasploitable Tutorial.md
Last active March 9, 2022 20:50
Kali Linux 2016.2 - Metasploitable Tutorial

Metasploitable Tutorial

https://www.kali.org/downloads/
https://sourceforge.net/projects/metasploitable/
https://community.rapid7.com/docs/DOC-1875

1. create "Host-only Adapter"