Skip to content

Instantly share code, notes, and snippets.

@shaunhess
shaunhess / aws_cli_qrg.md
Last active February 11, 2020 13:01
AWS Command Line Interface (CLI) Quick Reference Guide

AWS Command Line Interface Quick Reference

The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

AWS CLI Credential Order

Order Prod Use Option Description
1 Command Line Options aws [command] --profile [profile name] - Profile data uses long term credentials stored locally. This is not recommended for production or instances with public access.
2 Environment Variables You can store values in environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN. Recommended for temp use in non-production environments.
3 AWS CLI Credentials File aws configure - Command creates a credentials
@shaunhess
shaunhess / Get-PixelDensity.ps1
Created June 10, 2018 15:46
Generate Pixel Per Inches for Monitor size based on horizontal resolution, vertical resolution, and diagonal monitor size.
<#
.Synopsis
Generate Pixel Per Inches for Monitor size.
.DESCRIPTION
Generate Pixel Per Inches for Monitor size based on horizontal resolution, vertical resolution, and diagonal monitor size.
.EXAMPLE
Get-PixelDensity -HorizontalResolution 1920 -VerticalResolution 1080 -MonitorSize 24
#>
function Get-PixelDensity
{
@shaunhess
shaunhess / Car Detailing
Last active August 26, 2024 10:08
Basics for detailing a car
Make sure the vehicle is cool to the touch and not in direct sunlight
before beginning.
1) Verify all products are on hand before beginning. Below are ones
I recommend, but feel free to swap for your favorites.
Wheels
- Sonax Max Effect Wheel Cleaner http://amzn.to/2banxeg
- Griots Rubber Cleaner http://amzn.to/2bF0KWk
- Tuf shine tire brush http://amzn.to/2be8U8R
@shaunhess
shaunhess / CentOS7_min_desktop_setup.txt
Created March 10, 2016 17:21
CentOS7 Minimal Desktop Installation
1. Install CentOS 7 - Minimal
2. yum groupinstall "X Window System"
3. yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
4. unlink /etc/systemd/system/default.target
5. ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
6. reboot
@shaunhess
shaunhess / Vagrant_Setup_Win10_x64.txt
Last active March 10, 2016 19:04
Vagrant Setup on Windows 10 64bit
1) Download and install Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package
https://www.microsoft.com/en-us/download/details.aspx?id=26999
2) Download and install VirtualBox
https://www.virtualbox.org/
3) Download and install Vagrant
https://www.vagrantup.com/
4) Download and replace curl.exe in C:\HashiCorp\Vagrant\embedded\bin
@shaunhess
shaunhess / code_complexity_efficiency.py
Last active September 30, 2015 23:51
Measuring Code Complexity and Efficiency
# Measure complexity as a function of input size
# - Worst case scenario
# - Largest factor in expression
# Asymptotic Notation - provide a formal way to talk about the relationship between
# the running time of an algorithm and the size of inputs.
#
# Asymptotic notation describes the complexity of an algorithm as the size of it's
# inputs approaches infinity
@shaunhess
shaunhess / Memory_Intro
Last active August 29, 2015 14:27
A Brief Introduction to Memory
RAM, random access memory, is the ability to store/read values based on address inputs
(versus say sequentially). It is also commonly referred to as voltile memory because it
requires a constant supply of electricity to retain its contents.
The number of values that a RAM array can store is based on the number of address inputs.
With 1 address input we can store 2 values (0 or 1).
2 addresses = 4 values (00, 01, 10, 11)
3 addresses = 8 values (000, 001, 010, 100, 011, 101, 110, 111)
4 addresses = 16 values
@shaunhess
shaunhess / Scheme_Notes
Created July 18, 2015 22:30
Notes from SICP using Scheme (LISP)
;; Installation on Mac OS X
;; After downloading and installing into applications folder run the following commands from the terminal
;; sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-x86-64
;; sudo ln -s /usr/local/lib/mit-scheme-x86-64/mit-scheme /usr/bin/scheme
;; To Launch simply type "scheme" in the terminal
;; Using operators on operands (Scheme uses prefix notation)
(+ 4 4) ; Add 4 + 4 = 8
;; Add two numbers that are multiplied
@shaunhess
shaunhess / cache_perf_calc
Created April 19, 2015 19:18
Cache Performance Calculation
Cache is a net benefit in perf if time saved in cache hits exceeds time lost in cache overhead.
L = Regular lookup
H = Cache Hit
M = Cache Miss
R = Cache Hit Ratio (500 lookups/100 served from cache is 20%)
H x R + M x (1 - R) < L