Skip to content

Instantly share code, notes, and snippets.

iapilgrim pilgrim2go

Block or report user

Report or block pilgrim2go

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pilgrim2go
pilgrim2go / graphUndirected.ipynb
Created Apr 8, 2019 — forked from anirudhjayaraman/graphUndirected.ipynb
Python Implementation of Undirected Graphs (Adjacency List and Adjacency Matrix)
View graphUndirected.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pilgrim2go
pilgrim2go / postgresql.py
Created Mar 6, 2019 — forked from robertsosinski/postgresql.py
DataDog script for collecting PostgreSQL stats
View postgresql.py
# Create the datadog user with select only permissions:
# CREATE USER datadog WITH PASSWORD '<complex_password>';
#
# Grant select permissions on a table or view that you want to monitor:
# GRANT SELECT ON <schema>.<table> TO datadog;
#
# Grant permissions for a specific column on a table or view that you want to monitor:
# GRANT SELECT (id, name) ON <schema>.<table> TO datadog;
#
# Let non-superusers look at pg_stat_activity in a read-only fashon.
@pilgrim2go
pilgrim2go / buildspec.yml
Created Oct 16, 2018 — forked from QuinnyPig/buildspec.yml
The buildspec.yml that deploys Last Week in AWS.
View buildspec.yml
version: 0.2
phases:
install:
commands:
- echo Entered the install phase...
- pip install -r requirements.txt
build:
commands:
- echo Entered the build phase...
@pilgrim2go
pilgrim2go / attach-eni.py
Created Sep 26, 2018 — forked from rcillo/attach-eni.py
This gist contains code that attaches an ENI to a running EC2 instance and configures the network accordingly
View attach-eni.py
# -*- coding: utf-8 -*-\
"""
The MIT License (MIT)
Copyright (c) 2015 Zalando SE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@pilgrim2go
pilgrim2go / aws-athena-auto-partition-lambda.py
Created Sep 20, 2018 — forked from SQLadmin/aws-athena-auto-partition-lambda.py
AWS Athena create auto partition for CloudTrail logs on Daily Basis
View aws-athena-auto-partition-lambda.py
# Lambda function to create partition for Cloudtrail log on daily basis.
# You need to schedule it in AWS Lambda.
'''
-------------------------------------------
AWS Athena Create Partitions Automatically
-------------------------------------------
Version 1.0
Author: SqlAdmin
@pilgrim2go
pilgrim2go / .gitlab-ci.yml
Created Sep 10, 2018 — forked from foklepoint/.gitlab-ci.yml
Build and Push images to GCP Container Registry with Gitlab CI
View .gitlab-ci.yml
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@pilgrim2go
pilgrim2go / haproxy-parse.sh
Created Aug 30, 2018 — forked from fnzv/haproxy-parse.sh
Parsing HAProxy Logs with goaccess
View haproxy-parse.sh
goaccess -f haproxy.log --log-format='%^ %^ %^:%^:%^ %^ %^[%^]: %h:%^ [%d:%t.%^] %^ %^ %^/%^/%^/%^/%L %s %b %^ %^ %^ %^/%^/%^/%^/%^ %^/%^ "%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q
@pilgrim2go
pilgrim2go / security-group-cleanup.py
Created Aug 3, 2018 — forked from sa-jbrooks/security-group-cleanup.py
Security Group Cleanup using boto3
View security-group-cleanup.py
#!/usr/bin/env python
import boto3
import argparse
def lookup_by_id(sgid):
sg = ec2.get_all_security_groups(group_ids=sgid)
return sg[0].name
@pilgrim2go
pilgrim2go / nltk-ne.py
Created Jul 19, 2018
Extract entities using NLTK
View nltk-ne.py
# https://stackoverflow.com/questions/36255291/extract-city-names-from-text-using-python
import nltk
def extract_entity_names(t):
entity_names = []
if hasattr(t, 'label') and t.label:
if t.label() == 'NE':
entity_names.append(' '.join([child[0] for child in t]))
@pilgrim2go
pilgrim2go / docker_ip.sh
Created Jun 29, 2018
Docker IP and Container Name
View docker_ip.sh
# One line command to list container name with its IP
# From https://superuser.com/questions/1167922/get-list-of-docker-ip-containers
for i in `docker ps -q`; do echo $i; echo " : "; docker inspect $i | grep -i ipaddress | grep -v null | cut -d ':' -f 2; done
You can’t perform that action at this time.