Skip to content

Instantly share code, notes, and snippets.

View phil-hildebrand's full-sized avatar

Phil Hildebrand phil-hildebrand

  • Robinhood.com
  • Seattle
View GitHub Profile
@phil-hildebrand
phil-hildebrand / admin.sql
Created December 12, 2018 21:50 — forked from namrata4/admin.sql
Handy PostgreSQL Monitoring Scripts
-- turn off paging (less/more)
psql> \pset pager off
/*
Pager usage is off.
*/
-- find an object name by id
SELECT OID, relname

Keybase proof

I hereby claim:

  • I am phil-hildebrand on github.
  • I am phildebrand (https://keybase.io/phildebrand) on keybase.
  • I have a public key ASAVLGu-aFMtCTRIUD1J3LxD7_k3zudPIY_L2X1ODY_Qago

To claim this, I am signing this object:

@phil-hildebrand
phil-hildebrand / environments.yml
Created February 8, 2017 22:46
pytest multi environment setup
---
env:
- travis:
namenode-primary: localhost
namenode-backup: localhost
journalnode: localhost
zookeeperserver: localhost
resourcemanager: localhost
historyserver: localhost
httpfs: localhost
@phil-hildebrand
phil-hildebrand / auto_drop_fk.sh
Created October 31, 2016 22:19
Various MySQL tips / scripts
#!/bin/sh
#
# Auto discover and drop FKs:
#
mysql -s -e "select 'alter table ', table_name, ' drop foreign key ', constraint_name, ';' from information_schema.referential_constraints ;" > /tmp/disable_fk.sql
mysql -s < /tmp/disable_fk.sql
@phil-hildebrand
phil-hildebrand / connection_info.sql
Last active April 3, 2022 19:15
Handy MySQL information schema / processlist scripts
-- Get Current sessions by state:
SELECT @@hostname as server, user,state,command,count(*)
FROM information_schema.processlist
GROUP BY user,state,command ;
/*
+-------------+-------------+---------------------------------------------------------------+-------------+----------+
| server | user | state | command | count(*) |