Get Mysql database size via query

SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema;

Linux: disk i/o by process command

iotop -bod5

Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
8783 be/4 apache 0.00 B/s 180.58 K/s 0.00 % 0.00 % httpd
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
Total DISK READ: 0.00 B/s | Total DISK WRITE: 56.55 K/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
228 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.02 % [kjournald]
11605 be/4 apache 0.00 B/s 0.00 B/s 0.00 % 0.02 % httpd

Identify current CentOS version

how to get current CentOS version:

cat /etc/centos-release

and to see kernel info:

uname -a

Rackspace API: Trove install to enable root user for cloud DB

Rackspace Trove set-up:

Mac OSX:

sudo easy_install pip
sudo pip install python-troveclient

# trove:
# http://docs.rackspace.com/cdb/api/v1.0/cdb-getting-started/content/Install_Trove_Client.html

trove list
trove root-enable

Clear DNS cache on Mac OSX

How to reset (flush) the DNS cache on Mac OSX

OSX 10.9 (Mavericks)
dscacheutil -flushcache
sudo killall -HUP mDNSResponder

should also work for 10.10 (Yosemite)

Get build ID from Git repo

git log --pretty=oneline | wc -l

« Previous Entries