Download and install 1Password before doing anything else.
Download karabiner-elements: https://pqrs.org/osx/karabiner/
-- find rows where a certain key exists | |
select | |
* | |
from | |
my_table | |
where | |
json_field::jsonb ? 'key_i_want' | |
; | |
-- get certain key from json field |
-- view interesting information for all queries for a user | |
select | |
pid, | |
client_addr, | |
application_name, | |
(current_timestamp - query_start) as duration, | |
state, | |
query | |
from | |
pg_stat_activity |
# define letters in puzzle | |
letters = [ | |
'g', 'w', 'p', 'e', 'o', 'f', | |
'v', 'q', 'r', 'x', 's', 'z', | |
'm', 'c', 'i', 'k', 'u', 'd', | |
] | |
# unique words in puzzle 1 | |
words_1 = [ | |
'bus', |
Download and install 1Password before doing anything else.
Download karabiner-elements: https://pqrs.org/osx/karabiner/
start up postgres after your computer shits the bed and you don't know why it won't start.
cat /usr/local/var/postgres/postmaster.pid
kill 455 # top line of postmaster.pid output
postgres -D /usr/local/var/postgres # will output some error but stuff works now (shrug)
psql -U ryan test
def num_ipads(rows): | |
return sum(i+1 for i in range(rows)) | |
def num_rows(ipads): | |
running_total = 0 | |
i = 0 |
import random | |
# define letters | |
letters = ['A', 'C', 'T', 'G'] | |
# get a sorted list of your triplets and frequencies | |
# (assuming you have a way of getting these already) | |
# (these are for illustration) | |
trips = ['AAG', 'CCC', 'TTT'] | |
freqs = [0.25, 0.70, 0.05] |
Regular Tasks include how normal, non-emergency, operational duties are handled—that is, how work is received, queued, distributed, processed, and verified, plus how periodic tasks are scheduled and performed. All services have some kind of normal, scheduled or unscheduled work that needs to be done. Often web operations teams do not perform direct customer support but there are interteam requests, requests from stakeholders, and escalations from direct customer support teams. These topics are covered in Chapters 12 and 14.
aws cloudwatch get-metric-statistics \ | |
--metric-name DatabaseConnections \ | |
--start-time 2016-09-01T00:00:00 \ | |
--end-time 2016-09-06T00:00:00 \ | |
--period 3600 \ | |
--namespace AWS/RDS \ | |
--statistics Average \ | |
--dimensions Name=DBInstanceIdentifier,Value=my-db-instance-identifier-name |