Skip to content

Instantly share code, notes, and snippets.

@rendicott
rendicott / BINDConfigReadPolicy.json
Created July 27, 2018 22:16
Role and policy that trusts all accounts in an organization and requires an external ID
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"dynamodb:BatchGetItem",
"dynamodb:Scan",
"dynamodb:ListTagsOfResource",
@rendicott
rendicott / gatsfa.py
Created September 29, 2015 18:29
Quick example of how to pull a report from Salesforce in CSV format via the API using Python-Requests. Then take the CSV data and parse it into an object model for sifting sorting and timedelta.
'''
GATSFA - Gateway to Salesforce API
The CSV report this is pulling down is querying the Salesforce event log.
Each line in the CSV is a Salesforce event log entry that has the prefix
of the name of our API application. So the report is a log of the
activity between the gateway API and the Salesforce API
'''
@rendicott
rendicott / delete_slack_images.py
Created October 24, 2018 16:00
delete images from slack
'''
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 / crontab-entry
Last active November 23, 2018 22:50
quick backup script to tar and gzip the jenkins home directory and upload it to Artifactory for backup
5 18 * * * /root/jenkins-backup-to-artifactory.sh >/var/log/jenkinsbackup/jenkinsbackup.`date +\%Y\%m\%d\%H\%M\%S`.log 2>&1
@rendicott
rendicott / dns-looker.py
Last active December 14, 2018 13:46
lambda for DNS lookups
"""
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
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 / main.go
Created January 15, 2020 16:42
barebones golang client application for AWS
package main
import (
"fmt"
"flag"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/organizations"
)
@rendicott
rendicott / eowcf.py
Last active June 18, 2020 10:45
generate utopia game end of war ceasefire throne page message
#!/usr/bin/env python
#
# eowcf.py
#
# Generates the throne page end of war cease fire message for a Utopia kingdom
#
# Run it with the month and first day that the end of war cease fire begins and it will
# generate a timeline of events to post to the throne page so that everyone knows
# when they need to do things.
#
@rendicott
rendicott / nix-cmd-cheats.md
Last active January 18, 2022 12:49
quick commands I use frequently in linux but always forget the syntax

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 / task.txt
Created April 27, 2022 12:23
amazing-race-instructions
Here you will find a list of URLs. Each URL is a link to a gzipped json file. Each json file is a list of a made up data type called a "Mongo". Mongos have lots of properties but only some that you care about.
Here is a tiny pack of Mongos for you to play with: https://d195aeoz58rky7.cloudfront.net/tiny/output-manifest.json
Once you think you can handle more Mongos then play with a practice set: https://d195aeoz58rky7.cloudfront.net/practice/output-manifest.json
At 3pm EST I will send out another link with a much longer list of files about the same size as the practice set. The first person to answer the following questions from the large data set will win a prize.
What is the total height of all Dallos?:
How many total Dallos are there?: