This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Csv implements Iterator { | |
private $_file = null; | |
private $_rows = 0; | |
private $_header = array(); | |
private $_emptyRow = array(); | |
private $_delimiter = '\t'; | |
private $_idFieldName = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |