Skip to content

Instantly share code, notes, and snippets.

View tdmalone's full-sized avatar

Tim Malone tdmalone

View GitHub Profile
@kellyrmilligan
kellyrmilligan / s3Sync.sh
Created June 8, 2017 13:38
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@Kevin-De-Koninck
Kevin-De-Koninck / Get_current_real-time_travel_time.py
Created May 14, 2017 19:24
Get current real-time travel time using Python and Google's distance matrix
#!/usr/bin/python
# This script wil get the real-time travel time between your home and your work (in both directions at the current time).
#
# You could use this script to map the real time travel times of the past day (cron job, every minute)
# To plot grpahs you could use: http://plot.ly
#
#
# If you want to plat the estimated driving times for each minute of a given day in the future, check out my gist:
# Get estimated travel times using Python and Google's distance matrix
@paladini
paladini / aws-ec2-redis-cli.md
Last active February 20, 2024 04:05 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

@mgoodness
mgoodness / k8s-svc-annotations.md
Last active March 11, 2024 16:24
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@jlevy
jlevy / SecConfig.py
Last active April 29, 2024 18:42
SecConfig.py from AWS Re-Invent 2013 (export AWS security configurations)
#! /usr/bin/python
# This script is taken (unmodified except for this comment) from: https://s3.amazonaws.com/reinvent2013-sec402/SecConfig.py
# Talk: http://www.slideshare.net/AmazonWebServices/intrusion-detection-in-the-cloud-sec402-aws-reinvent-2013
# Example code to output account security config
__author__ = 'Greg Roth'
import boto
import urllib
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@mikeschinkel
mikeschinkel / redirect-old-urls.php
Created May 31, 2016 03:26
WordPress plugin to redirect old URLs when a site is refreshed. Uses a JSON file on activate to import into the DB. If Activation fails because of an error in the JSON file just deactivate, edit the file and then reactivate.
<?php
/**
* Plugin Name: Redirect Old URLs
* Description: Supports redirecting from an old site's URL to a new site on same domain.
* Version: 0.1.0
* Author: The WPLib Team
* Author URI: http://github.com/wplib
* Author Email: team@wplib.org
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mcaskill
mcaskill / Function.HTML-Build-Attributes.php
Last active January 8, 2024 04:14
PHP / WordPress : Generate a string of HTML attributes
<?php
if (!function_exists('html_build_attributes')) {
/**
* Generate a string of HTML attributes
*
* @param array $attr Associative array of attribute names and values.
* @param callable|null $callback Callback function to escape values for HTML attributes.
* Defaults to `htmlspecialchars()`.
* @return string Returns a string of HTML attributes.
@wags
wags / lint-shell-scripts.md
Created April 19, 2016 14:48
Lint Shell Scripts with Travis CI

Handy notes from this article.

git submodule add https://github.com/caarlos0/shell-travis-build.git build
cp build/travis.yml.example .travis.yml

Adds ShellCheck verification via Travis CI for any shell scripts in the repo.