Skip to content

Instantly share code, notes, and snippets.

View andresaquino's full-sized avatar
🏠
Working from home

Andrés Aquino andresaquino

🏠
Working from home
View GitHub Profile
@andresaquino
andresaquino / ssl.thor
Created April 13, 2016 04:24 — forked from grantr/ssl.thor
ssl cert generation with thor and openssl (ruby 1.9)
# Step 1: gem install thor
# Step 2: thor ssl:generate_ca && thor ssl:generate_cert
require 'thor'
require 'securerandom'
class SSL < Thor
desc "generate_ca", "Generate a Root CA"
method_option :name, type: :string, desc: "Common name"
@andresaquino
andresaquino / gist:36835e0fd87fb5c5cff587ba76a28bc5
Created May 27, 2016 06:52 — forked from unnitallman/gist:944011
sqlite with activerecord outside rails
require 'active_record'
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.colorize_logging = false
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:dbfile => ":memory:"
)
@andresaquino
andresaquino / hashquiz.rb
Created June 28, 2016 22:42 — forked from potatosalad/hashquiz.rb
Ruby quiz for convert hash "dot paths" into actual hash hierarchy.
#require 'rubygems'
require 'pp'
#require 'ap' # Awesome Print
class Object
# expects [ [ symbol, *args ], ... ]
def recursive_send(*args)
args.inject(self) { |obj, m| obj.send(m.shift, *m) }
end
end
@andresaquino
andresaquino / magento installation script
Created August 24, 2016 18:27 — forked from asimsikka/magento installation script
Installing Magento 1.8.1.0 on Mac OsX 10.8 & 10.9 Note: Make sure you have already installed the following: 1- php 2- php mcrypt extension 3- mysql
cd ~/Downloads
curl -O http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz
curl -O http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
tar -zxvf magento-1.8.1.0.tar.gz
mv ~/Downloads/magento-1.8.1.0 ~/Sites/magento
tar -zxvf magento-sample-data-1.6.1.0.tar.gz
mv magento-sample-data-1.6.1.0/media/* ~/Sites/magento/media/
mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql ~/Sites/magento/data.sql
cd ~/Sites
mv magento/* magento/.htaccess magento
@andresaquino
andresaquino / homebrew.mxcl.pdnsd.plist
Created December 27, 2016 11:06 — forked from fujimogn/homebrew.mxcl.pdnsd.plist
Installing pdnsd from Homebrew

Installing pdnsd from homebrew as root user.

$ brew install pdnsd

$ sudo chown -R nobody /usr/local/var/cache/pdnsd

$ curl -L http://goo.gl/kMlyQ -o pdnsd.conf
$ mv pdnsd.conf /usr/local/etc
$ sudo chown root /usr/local/etc/pdnsd.conf
@andresaquino
andresaquino / theme.html
Created September 24, 2017 08:27 — forked from soemarko/theme.html
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@andresaquino
andresaquino / haproxy-db.conf
Created April 2, 2018 08:37 — forked from aw/haproxy-db.conf
HAProxy configuration for MySQL failover and redundancy
# HAProxy configuration - haproxy-db.cfg
##
## FRONTEND ##
##
# Load-balanced IPs for DB writes and reads
#
frontend db_write
bind 172.16.0.50:3306
@andresaquino
andresaquino / RUNBOOK.md
Last active April 29, 2021 02:34 — forked from voxxit/RUNBOOK.md
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@andresaquino
andresaquino / POSTMORTEM.md
Created April 10, 2018 19:54 — forked from voxxit/POSTMORTEM.md
Example/outline of a postmortem to be conducted after a site outage/incident

POSTMORTEM: “Event Title Here”

Issue Summary

This should be a short (4-5 sentences) blurb which succinctly describes the event. At the very least, it should include:

  • the duration (with start & end times in the U.S. Pacific time zone):

…which lasted for roughly 10 minutes between 9:02PM and 9:12PM Pacific…

  • the impact to our users:
@andresaquino
andresaquino / query_finder.sql
Created December 20, 2018 16:08 — forked from mezis/query_finder.sql
Finding long-running queries in MySQL
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120)
FROM information_schema.processlist
WHERE command <> 'Sleep'
AND info NOT LIKE '%PROCESSLIST%'
ORDER BY time DESC LIMIT 50;