This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
class DriveFile | |
{ | |
private $service = null; | |
private $client = null; | |
private $auth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for pkg in `brew list --formula -1 | egrep -v '\.|\.\.'` | |
do echo $pkg `brew info $pkg | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/\1/' | awk '{print $1;}/[0-9]$/{s+=$1};/[mM][bB]$/{s+=$1*(1024*1024);next};/[kK][bB]$/{s+=$1*1024;next} END { suffix=" KMGT"; for(i=1; s>1024 && i < length(suffix); i++) s/=1024; printf "\t(all versions: %0.1f%s)",s,substr(suffix, i, 1), $3; }'` | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gzip -dc thefile.gz | wc -c | awk '{$1=$1/1024/1024/1024; print $1,"GB";}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema "DB Name", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
FROM information_schema.tables | |
WHERE table_schema='[db-name]' | |
GROUP BY table_schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Email owner user@hcwh.org | |
GDRIVE_OWNER_EMAIL=$1 | |
# File ID 1qvBd0deuWHAsPyDwEVBnUg_a09_Z3Xlo39Qhlg2apyw | |
GDRIVE_FILEID=$2 | |
# Username at practicegreenhealth.org. ie bjones | |
GDRIVE_PGHUSERNAME=$3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//$server_name = $_SERVER["SERVER_NAME"] | |
$server_name = "3b38a450c-92602-463c8-5581855-84c64c57741f--pr-389.probo.build"; | |
// Get parts of the domain to use subdomain later. | |
$domain_parts = explode('.',$server_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Perform a Network Service Lookup, using StatDNS API. | |
* | |
* @param {"google.com"} dn A well-formed domain name to resolve. | |
* @return {String} Resolved IP address | |
* @customfunction | |
*/ | |
function NSLookup(dn) { | |
// From gist.github.com/mogsdad/ece531531e0ef5dc355d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pv dump.sql.gz | gzcat | mysql -uroot -p dbname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Log commit messages as a 'highlight' in RescueTime Premium | |
# | |
# To enable this hook: | |
# | |
# 1. Place this file in your project's .git/hooks directory and make sure its name is "post-commit". | |
# 2. Make sure it has executable permissions (chmod +x post-commit) | |
# 3. All commits will be automatically logged as highlight events. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://[Pipermail_server]/mailman/private/[listname].mbox/[listname].mbox |
NewerOlder