Skip to content

Instantly share code, notes, and snippets.

@rohityadavcloud
rohityadavcloud / my.cnf
Created July 27, 2015 10:19
Example MySQL my.cnf optimized
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
syslog
# expects seconds, returns pretty string of how long ago event happened
def ago(seconds)
a = seconds
case a
when 0 then "just now"
when 1 then "a second ago"
when 2..59 then a.to_s+" seconds ago"
when 60..119 then "a minute ago" #120 = 2 minutes
when 120..3540 then (a/60).to_i.to_s+" minutes ago"
when 3541..7100 then "an hour ago" # 3600 = 1 hour