Skip to content

Instantly share code, notes, and snippets.

@JGrubb
JGrubb / bigquery_physical_storage_pricing_estimator.sql
Created July 28, 2023 15:21
Helps you estimate the physical storage pricing change for your BigQuery project(s)
DECLARE active_logical_gib_price FLOAT64 DEFAULT 0.02;
DECLARE long_term_logical_gib_price FLOAT64 DEFAULT 0.01;
DECLARE active_physical_gib_price FLOAT64 DEFAULT 0.04;
DECLARE long_term_physical_gib_price FLOAT64 DEFAULT 0.02;
WITH
storage_sizes AS (
SELECT
table_schema AS dataset_name,
-- Logical

Keybase proof

I hereby claim:

  • I am jgrubb on github.
  • I am jgrubb (https://keybase.io/jgrubb) on keybase.
  • I have a public key ASAFU6KSZUultQPCrjhOVcU2NQ67Odz8PzlT2-ZOQ8-1MAo

To claim this, I am signing this object:

@JGrubb
JGrubb / deploy.sh
Created June 22, 2017 13:52
Deploy hook for multisite WP (call from deploy hook)
#!/bin/bash
OLDURL='YOURSITE.COM'
NEWURL=$(echo $PLATFORM_ROUTES | base64 --decode | awk -F'"' '{print $2}' | awk -F"/" '{print $3}')
if [[ $PLATFORM_BRANCH != "master" ]]; then
php wp-cli search-replace $OLDURL $NEWURL 'wp_*options' wp_blogs wp_usermeta wp_site wp_sitemeta --skip-columns=guid
else
echo "This is the master branch, skipping URL replace."
fi
@JGrubb
JGrubb / app.yaml
Created June 22, 2017 13:50
App yaml for multisite WP (web section)
web:
locations:
"/":
root: ""
passthru: "/index.php"
index:
- "index.php"
expires: 600
scripts: true
allow: true
import os
import json
import base64
class Config():
special_props = (
'relationships',
'application',
'routes',

Keybase proof

I hereby claim:

  • I am jgrubb on github.
  • I am jgrubb (https://keybase.io/jgrubb) on keybase.
  • I have a public key ASAlKMW5OOD4FV55jIhoKCYd4X9F3dBfbASjqxxzGtzyxAo

To claim this, I am signing this object:

mysql> select * from field_data_field_taxonomy where entity_id = 26221;
+-------------+---------------------+---------+-----------+-------------+----------+-------+--------------------+
| entity_type | bundle | deleted | entity_id | revision_id | language | delta | field_taxonomy_tid |
+-------------+---------------------+---------+-----------+-------------+----------+-------+--------------------+
| node | legacy_content_item | 0 | 26221 | 26221 | und | 0 | 12 |
+-------------+---------------------+---------+-----------+-------------+----------+-------+--------------------+
1 row in set (0.00 sec)
mysql> select * from taxonomy_index where nid = 26221;
+-------+-----+--------+------------+
@JGrubb
JGrubb / gist:5f81a7014bf9dcee9a9f
Created June 23, 2015 15:14
Which tables are huge?
SELECT CONCAT(table_schema, '.', table_name) as Table_name, CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac FROM information_schema.TABLES ORDER BY data_length + index_length DESC LIMIT 10;
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
Possible duplicate - Don't Forget Your Memory
Possible duplicate - Ethical Practices in Forensics
Possible duplicate - Mozilla Firefox Forensics: Part 2
Possible duplicate - Mozilla Firefox Forensics: Part 3
Possible duplicate - Starting a Digital Forensics Section
Possible duplicate - Computer Forensics Standards and Controls
Possible duplicate - Stressing Demeanor Credibility: Continued Impacts of Melendez-Diaz for Forensic Scientists
Possible duplicate - CSI Cell Phone
Possible duplicate - Before You Pull the Plug
Possible duplicate - Triage a Computer