Skip to content

Instantly share code, notes, and snippets.

View ryantuck's full-sized avatar
🤙
chillin'

Ryan Tuck ryantuck

🤙
chillin'
View GitHub Profile
-- 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',
@ryantuck
ryantuck / new_machine.md
Last active August 16, 2021 19:49
instructions on setting up a new osx machine

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
@ryantuck
ryantuck / ipad_stacking.py
Created October 19, 2016 15:17
stackin' ipads
def num_ipads(rows):
return sum(i+1 for i in range(rows))
def num_rows(ipads):
running_total = 0
i = 0
@ryantuck
ryantuck / dna_strands.py
Created October 11, 2016 22:16
messing around with generating strings given frequencies of substrings in python
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

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.

Sample Assessment Questions

@ryantuck
ryantuck / keyboard_maestro.png
Last active September 13, 2016 14:34
Salvage your caps lock key if you fucked up and upgraded to macOS Sierra.
keyboard_maestro.png
@ryantuck
ryantuck / get-rds-metrics.sh
Created September 6, 2016 15:50
get rds metrics
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