Skip to content

Instantly share code, notes, and snippets.

View jeffreyroberts's full-sized avatar

Jeffrey L. Roberts jeffreyroberts

  • PHP DevOps
  • Miami, Florida
View GitHub Profile
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
#get root access
$su -
$ cd /tmp
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
# Colors
DARK_PURPLE="\[\033[1;34m\]"
GREEN="\[\033[0;32m\]"
GREY="\[\033[1;30m\]"
NORMAL="\[\033[0m\]"
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
# Git shortcuts
alias gci='git commit'
<?php
$start_date = strtotime('3 months ago');
$start_quarter = ceil(date('m', $start_date) / 3);
$start_month = ($start_quarter * 3) - 2;
$start_year = date('Y', $start_date);
$start_timestamp = mktime(0, 0, 0, $start_month, 1, $start_year);
echo $start_timestamp;