Skip to content

Instantly share code, notes, and snippets.

View objectoriented's full-sized avatar

Gareth Dismore objectoriented

  • Denver, CO
View GitHub Profile
@objectoriented
objectoriented / rds_postgres_analysis.sh
Created April 22, 2021 13:22
RDS Performance Insights
#!/bin/bash
# **README**
#1. Copy script on Amazon EC2 Linux instance with AWS CLI configured, and psql client installed with accessibility to RDS/Aurora Postgres instance
#2. Make script executable: chmod +x pg_health_check.sh
#3. Run the script: ./ pg_health_check.sh
#4. It will take around 2-3 mins to run (depending on size of instance), and generate html report: <Database identifier>_report_<date>.html
#5. Share the report with your AWS Technical Account Manager
#################
# Author: Vivek Singh, Postgres Specialist Technical Account Manager, AWS
# V-13 : 4/10/2020
This file has been truncated, but you can view the full file.
[{"date":"2020-01-21","county":"Snohomish","state":"Washington","fips":53061,"cases":1,"deaths":0},{"date":"2020-01-22","county":"Snohomish","state":"Washington","fips":53061,"cases":1,"deaths":0},{"date":"2020-01-23","county":"Snohomish","state":"Washington","fips":53061,"cases":1,"deaths":0},{"date":"2020-01-24","county":"Cook","state":"Illinois","fips":17031,"cases":1,"deaths":0},{"date":"2020-01-24","county":"Snohomish","state":"Washington","fips":53061,"cases":1,"deaths":0},{"date":"2020-01-25","county":"Orange","state":"California","fips":"06059","cases":1,"deaths":0},{"date":"2020-01-25","county":"Cook","state":"Illinois","fips":17031,"cases":1,"deaths":0},{"date":"2020-01-25","county":"Snohomish","state":"Washington","fips":53061,"cases":1,"deaths":0},{"date":"2020-01-26","county":"Maricopa","state":"Arizona","fips":"04013","cases":1,"deaths":0},{"date":"2020-01-26","county":"Los Angeles","state":"California","fips":"06037","cases":1,"deaths":0},{"date":"2020-01-26","county":"Orange","state":"Californ
@objectoriented
objectoriented / 0_reuse_code.js
Created July 19, 2017 17:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
class Csv implements Iterator {
private $_file = null;
private $_rows = 0;
private $_header = array();
private $_emptyRow = array();
private $_delimiter = '\t';
private $_idFieldName = null;
body #searchspring-autocomplete_results {
-webkit-border-radius: 0;
-moz-border-radius: 0;
-ms-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
border: 1px solid #ccc;
z-index: 9999999;
margin: 0 auto;
-webkit-box-sizing: border-box;
<?php
/*
# Dynamic Image Resize .htaccess
RewriteCond %{REQUEST_URI} /resize/(\d+)x(\d+)/(.*)
RewriteRule ^(.*)$ http://www.example.com/resize.php?width=%1&height=%2&file=%3 [L]
*/
// Example Usage: http://www.example.com/resize/300x350/images/example-image.jpg
// Declare Variables
@objectoriented
objectoriented / SearchSpring .NET Search Form
Last active September 25, 2015 12:37
Submit a SearchSpring search query to a search results page on a .NET page with a monolithic form
<script type="text/javascript">
function redirectToSearchSpring() {
var evt = window.event ? window.event : null;
if (evt) {
var key = evt.charCode ? evt.charCode : (evt.keyCode ? evt.keyCode : (evt.which ? evt.which : 0));
if (key == "13") {
window.location.href = 'http://www.example.com/search.html?q=' + encodeUriComponent(document.getElementById('search_query_input').value);
return false;
}
}
@objectoriented
objectoriented / aws_cf_invalidate.rb
Created September 28, 2010 17:37 — forked from jmlacroix/aws_cf_invalidate.rb
Ruby script to invalidate objects on Amazon's CloudFront CDN (shows status of recent requests also)
require 'rubygems'
require 'hmac-sha1' # on OS X: sudo gem install ruby-hmac
require 'net/https'
require 'base64'
#
# CHANGE ME: S3 access credentials go here, along with CloudFront Distribution ID
#
s3_access=''
s3_secret=''
@objectoriented
objectoriented / Ensure complete download from Amazon S3 Bucket
Created August 21, 2010 14:51
Ensure complete backup or copy of an Amazon S3 bucket (compare file lists on S3 vs your filesystem)
#!/bin/sh
#
# Diff file lists to find missing files on local copy
#
s3cmd ls -r s3://<<..S3 BUCKET..>>/|awk '{ print $4 }' | awk '{sub(/^s3\:\/\/<<..S3 BUCKET..>>\//, "")};1' | sort > /tmp/s3-file-list.txt.sorted
find . -type f | awk '{sub(/\.\//, "")};1' | sort > /tmp/my-file-list.txt.sorted
diff /tmp/s3-file-list.txt.sorted /tmp/my-file-list.txt.sorted
#