Skip to content

Instantly share code, notes, and snippets.

@austinmcconnell
austinmcconnell / postmortem.md
Created April 24, 2019 14:31 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@austinmcconnell
austinmcconnell / statistics.sql
Created August 9, 2018 18:18 — forked from ruckus/statistics.sql
Postgres statistics queries
** Find commmonly accessed tables and their use of indexes:
SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct;
Returns output like:
relname | seq_tup_read | idx_tup_fetch | idx_tup_pct
----------------------+--------------+---------------+------------------------
schema_migrations | 817 | 0 | 0.00000000000000000000
user_device_photos | 349 | 0 | 0.00000000000000000000
command+delete Send Hex Code: 0x15 kill line backward
command+shift+delete Send Hex Code: 0x0B kill line forward
option+delete Send Hex Code: 0x17 kill word backward
option+shift+delete Send Escape Sequence: Esc+d kill word forward
command+left Send Hex Code: 0x01 move to start of line
command+right Send Hex Code: 0x05 move to end of line
option+left Send Escape Sequence: Esc+b move word backward
option+left Send Escape Sequence: Esc+f move word forward
@austinmcconnell
austinmcconnell / _upgrade_postgres
Last active November 13, 2017 16:22 — forked from chbrown/_upgrade-pg9.4-to-pg9.5.md
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew
First, check your current config (example output in `homebrew.mxcl.postgresql.plist.xml` lower down in this gist):
cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Most importantly, note the `-D /usr/local/var/postgres` argument.
Second, shut down your current PostgreSQL.
brew services stop postgresql
@austinmcconnell
austinmcconnell / 0_reuse_code.js
Created March 27, 2014 21:43
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