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 / mysql_cheetsheet.md
Created December 20, 2018 16:10 — forked from weblogix/mysql_cheetsheet.md
[MySQL Cheetsheet] #mysql #mariadb

Exporting a Compressed MySQL Dump

mysqldump -u {user} -p {database} | gzip > {database}.sql.gz

Importing a Compressed MySQL Dump

gzip -dc < {database}.sql.gz | mysql -u {user} -p {database}
@andresaquino
andresaquino / mysql-queries1.md
Created December 20, 2018 16:10 — forked from msanjaypandit/mysql-queries1.md
[MySQL Queries] Mysql queries #mysql #query
  • Convert DateTime in UnixTimeStamp
    SELECT *,from_unixtime(date_added) FROM TABLE_NAME order by date_added desc

  • Space consume by a table
    SELECT table_schema "Data Base Name",sum( data_length + index_length ) / 1024 / 1024 /1024 "Used GB" FROM information_schema.TABLES GROUP BY table_schema ;

  • Character Set utf8mb4_unicode_ci

  • Set a login path using terminal/putty

@andresaquino
andresaquino / MySQL-Guide.txt
Created December 20, 2018 16:09 — forked from i-stos/MySQL-Guide.txt
MySQL: Basic MySQL Guide
==========================================================================================================
MySQL Guide - Basics
==========================================================================================================
Connect/Disconnect from MySQL Server
----------------------------------------------------------------------------------------------------------
:~ sudo mysqld_safe //Turns on MySQL server
:~ mysql -h host -u root -p //Connects to MySQL server: "no need to specify host on local"
mysql> quit; //Disconnects from MySQL
:~ mysqladmin -u root -p shutdown //Shuts down MySQL server
----------------------------------------------------------------------------------------------------------
@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;
@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 / 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 / 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 / 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 / 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