Skip to content

Instantly share code, notes, and snippets.

@jkreileder
jkreileder / whoop-goldencheetah.py
Last active April 12, 2025 12:53
Python 3 script to export WHOOP Strap recovery data for use with Golden Cheetah
#!/usr/bin/env python3
import requests # for getting URL
import json # for parsing json
from datetime import datetime # datetime parsing
import pytz # timezone adjusting
import csv # for making csv files
import os
#################################################################
@chrisk
chrisk / mysql_db_and_table_size_queries.sql
Created January 19, 2012 02:58
MySQL queries to show the size of databases and tables reported by information_schema
-- Check the total size of each database
SELECT
tables.TABLE_SCHEMA AS database_name,
ROUND(SUM(tables.DATA_LENGTH + tables.INDEX_LENGTH) / POWER(2, 30), 3) AS database_size_in_gb
FROM information_schema.TABLES AS tables
GROUP BY tables.TABLE_SCHEMA
ORDER BY database_size_in_gb DESC;
-- List all tables larger than 1 GB
SELECT
@cee-dub
cee-dub / 1_install_transcript.sh
Created January 10, 2012 07:24
Installing Ruby 1.9.3 & gem dependencies on Mac OS X Lion
# Install Xcode from the Mac App Store
open /Applications/Install\ Xcode.app # complete the installation
# Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
# Install RVM
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
# Install some libraries to link ruby and gems against
@tonyc
tonyc / gist:1384523
Last active June 3, 2024 15:34
Using strace and lsof

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)