Docker Commands
List images:
docker images
List running docker processes:
docker ps
Docker Commands
List images:
docker images
List running docker processes:
docker ps
| import org.apache.catalina.LifecycleListener; | |
| import org.apache.catalina.core.AprLifecycleListener; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; | |
| import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| /** | |
| * NOTE: You also need to install APR on your system, on Arch Linux the package is called `tomcat-native`. |
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 0. List Remotes | |
| git remote -v |
| import boto3 | |
| import logging | |
| #setup simple logging for INFO | |
| logger = logging.getLogger() | |
| logger.setLevel(logging.INFO) | |
| #define the connection | |
| ec2 = boto3.resource('ec2') |
| #!/usr/bin/env python3 | |
| import boto3 | |
| import argparse | |
| class StaleSGDetector(object): | |
| """ | |
| Class to hold the logic for detecting AWS security groups that are stale. | |
| """ | |
| def __init__(self): | |
| super(StaleSGDetector, self).__init__() |
http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
Pull bucket names and check for public access
| #!/usr/bin/env python | |
| import boto3 | |
| ### ### | |
| # Need aws credentails already been configured # | |
| ### ### | |
| ### Code based on https://gist.github.com/miketheman/2630437 | |
| client = boto3.client('ec2') |
| #!/usr/local/bin/python3 | |
| ###################################################################################################################### | |
| # Purpose: Generate rules report of all the security groups # | |
| # Input Params: None [Make sure to set AWS CLI session by populating env. vars. with keys.] # | |
| # Usage: ./ec2_sg_rules.py > account-date.csv [python ./ec2_sg_rules.py > gill-dev-sg-2018-04-11.csv] # | |
| # Author: Abdul Gill # | |
| # Doc. Ref: http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_security_groups# | |
| ###################################################################################################################### | |
| from __future__ import print_function |
1 0.0.0.0 0.0.0.0 x.x.x.x WAN 0
2 X.X.X.X 255.255.255.0 0.0.0.0 WAN 0
3 10.10.1.0 255.255.255.0 0.0.0.0 office_srv2 0
4 192.168.1.0 255.255.255.0 0.0.0.0 office_wrk2 0
x.x.x.x = public ip of office 1 router with ipsec endpoint