Skip to content

Instantly share code, notes, and snippets.

Russell Endicott rendicott

Block or report user

Report or block rendicott

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
View pastebin
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLQtYd/lGX2ZwpbYcCscuumXZoL88BTnj5KsEntUzf+odOrtWwrhIb69gOE/sGSvmhLZc1YMezWXWRpiu5B+XNRDuRiFJ4GP5ojIVakq9EWPjjkPa90UgmGZrr+WO+eeOhLvi5bk53M2Tb6hqifyGI5QUuOCySfeXqnISd2bLVAfAK9tMoViZQyCMCgsfSJcHahEBO7QjSqHZ5AB4fXxQv9t3l7ny5I24WR9Lz3X7Tc4c3N8e9IsdNcN1dIMWihKjuBu3r8rXgkYSWT+9bSFp+0pH2K+UIYcOZ9aGhsSYNWr+S1z1iNIo135pAwrg0v4C5RhYMpQWpCpsq9Jmrs6tx pcteam@ip-10-230-204-162" >> /home/pcteam/.ssh/authorized_keys
@rendicott
rendicott / dns-looker.py
Last active Dec 14, 2018
lambda for DNS lookups
View dns-looker.py
"""
Platform: Lambda - Python 2.7
This function is designed to troubleshoot lambda DNS resolution
and log the current source IP of a lambda request.
Change the host var to whatever you want to test and go.
"""
import urllib2
import socket
import logging
@rendicott
rendicott / delete_slack_images.py
Created Oct 24, 2018
delete images from slack
View delete_slack_images.py
'''
delete_slack_images.py
Deletes all images from slack to free up space on free slack.
Usage:
Set your slack user token to the env variable "SLACK_TOKEN" then run like:
python delete_slack_images.py
@rendicott
rendicott / BINDConfigReadPolicy.json
Created Jul 27, 2018
Role and policy that trusts all accounts in an organization and requires an external ID
View BINDConfigReadPolicy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"dynamodb:BatchGetItem",
"dynamodb:Scan",
"dynamodb:ListTagsOfResource",
View Dockerfile
FROM ruby
RUN gem install vimgolf
RUN apt-get update
RUN apt-get install vim -y
ENTRYPOINT /bin/bash
@rendicott
rendicott / vertSplitter.go
Last active Jan 3, 2018
Parse a text file and split sections based on vertical anchors
View vertSplitter.go
// vertSplitter parses an AWS credentials file and splits the sections
// up based on profiles. It then parses each section to build a
// JSON profile struct for each profile including comments.
package main
import (
"bufio"
"encoding/json"
"fmt"
@rendicott
rendicott / build.sh
Created Jun 23, 2017
go build cross platform
View build.sh
#!/bin/bash
#Binary built in alpine docker causes OOM exceptions in runtime on c3.xl centos7 (self.golang)
#submitted 9 hours ago
#If I build on the c3.xl it's fine. Everything I'm reading about cross compilation involves building from nix to Windows/ Darwin but not much about platform. I'm woefully ignorant here.
#Anyone have tips for reading resources?
#2 commentsshare
#all 2 comments
#sorted by: best
#[–]kron4eg 3 points 4 hours ago
@rendicott
rendicott / check_port.py
Last active Mar 30, 2017
quick script to use to check whether or not a port is open using python standard library, good for when telnet is unavailable and it's too much trouble to install it
View check_port.py
#!/usr/bin/env python
'''
quick script to use to check whether or not a port is open using python standard library,
good for when telnet is unavailable and it's too much trouble to install it
Usage: ./check_port.py 127.0.0.1 5601
Thanks to mrjandro on SO
http://stackoverflow.com/questions/19196105/python-how-to-check-if-a-network-port-is-open-on-linux
sample output:
{"exit_code": 1, "results": "Port not open", "port": 5672, "host_ip": "['11.22.111.200']", "address": "internal-lb-1912362693.us-east-1.elb.amazonaws.com"}
@rendicott
rendicott / nix-cmd-cheats.md
Last active Dec 4, 2018
quick commands I use frequently in linux but always forget the syntax
View nix-cmd-cheats.md

Quick Reference Linux Commands

Find string in files in directory

find . | xargs grep 'string' -sl
sudo find / | xargs grep 'http://127.0.0.1:4567' -sl

Find case insensitive

find / -iname 'wOrDs'

@rendicott
rendicott / red2graph.py
Created Jan 11, 2017
Ships metrics from Redis to graphite
View red2graph.py
import graphitesend
import redis
import os
import time
import sys
pattern = '%Y-%m-%d %H:%M:%S'
g = graphitesend.init(prefix='devops.dotshipper',graphite_server='dograph2.docl.nic')
You can’t perform that action at this time.