Skip to content

Instantly share code, notes, and snippets.

View ravibhure's full-sized avatar

Ravi ravibhure

View GitHub Profile
"""
Slack chat-bot Lambda handler.
"""
import os
import logging
import urllib
# Grab the Bot OAuth token from the environment.
BOT_TOKEN = os.environ["BOT_TOKEN"]
@ravibhure
ravibhure / AWS-CSA-A-Notes.md
Created August 29, 2017 08:23 — forked from jacoelho/AWS-CSA-A-Notes.md
Notes from studying for the AWS Certified Solutions Architect Exam. I felt well-prepared for the exam and passed with a 94%. Please reach out with any corrections or questions.

External Resources

Settting up a Container Registry with docker-gitlab

This should be used for new users to getting started with the container registry feature on docker-gitlab.

Requirements

@ravibhure
ravibhure / AWS VPC Flow Logs Collection (Lambda)
Created June 19, 2017 10:36
AWS VPC Flow Logs Collection (Lambda)
# Terraform template to have VPC flow logs be sent to AWS Lambda
provider "aws" {
region = "us-west-2"
}
resource "aws_cloudwatch_log_group" "vpc_flow_log_group" {
name = "vpc-flow-log-group"
retention_in_days = 1
}
echo -e "-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\nA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\nb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\nMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\nYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\naWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\njc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\nxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\nsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\nU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\nAQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\nyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5
#!/bin/sh
# WARNING: REQUIRES /bin/sh
#
# Install Puppet with shell... how hard can it be?
#
# 0.0.1a - Here Be Dragons
#
# Set up colours
if tty -s;then
## How to install on Ubuntu (also works on Ubuntu for Windows)
https://github.com/magnumripper/JohnTheRipper
https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/doc/EXAMPLES
https://dunnesec.com/category/tools/john-the-ripper/decrypting-linuxunix-password-shadow-files-using/
## From apt packages
### install
sudo apt-get update
@ravibhure
ravibhure / haproxy_auth.md
Created March 28, 2017 13:13
Configure HAProxy for userlists

Create SHA512 passwords

# make sure to use a leading space so that the command is not stored in your bash history!!
 mkpasswd -m sha-512 password1
# generates -> $6$yMgsow58.g/Z$mBjHfdVzqcF/LN.iwV23Eyqg.yGPTsp9pOwaStsJ6c4I4zL7BhucVVAkv5guf7OVRr8Pw0mHF4NrWBRCG5ci7/
 mkpasswd -m sha-512 password2
# generates -> $6$RZ86vRkQ$aRKN1HOsk6bDHBbMhS7jSo/p1NGFl4PvwY3KpU.72i./LvITi41nL84EkxOFXl.6Bmhynj/L7pYbfF0rUHtOB0
@ravibhure
ravibhure / Kubernetes_debug.md
Created March 15, 2017 09:15
Kubernetes – troubleshooting and commands

*How to reset kubernetes configuration and setup *Change service IP subnet *Useful commands *Logs

0. How to reset kubernetes configuration and setup

When you start experimenting with kubernetes it is useful to reset all and start from scratch. During "reset" etcd and flanneld should be running and configured correctly because docker is in dependency.

@ravibhure
ravibhure / delete_unattached_volumes.py
Created February 15, 2017 08:46
Delete unattached volume
#!/usr/bin/env python
from boto import ec2
conn = ec2.connect_to_region('us-west-2')
#vols = conn.get_all_volumes(filters={'status': 'available'})
vols = conn.get_all_volumes(filters={'status': 'available', 'tag-key' : 'Name', 'tag-value' : 'kubernetes*'})
for vol in vols:
#print 'checking vol:', vol.id, 'status:', vol.status