Skip to content

Instantly share code, notes, and snippets.

View isfernand's full-sized avatar
💭
🌚

Israel Fernandez isfernand

💭
🌚
  • Contifico
  • Guayaquil, Ecuador
View GitHub Profile
@isfernand
isfernand / tmux-cheatsheet.markdown
Created March 4, 2020 21:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@isfernand
isfernand / README-Template.md
Created January 6, 2020 18:43 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@isfernand
isfernand / super_query.sql
Last active November 12, 2018 23:33
query que retorna columnas, cuantos registros tiene esa columna, y su tipo
use <database>;
SET group_concat_max_len = 4294967295; -- to overcome default 1KB limitation
SELECT CONCAT(
'SELECT * FROM ('
, GROUP_CONCAT(
'SELECT ', QUOTE(TABLE_NAME), ' AS `table`,',QUOTE(COLUMN_NAME), 'AS `column`',
',COUNT(`', REPLACE(COLUMN_NAME, '`', '``'), '`) AS `count`,', QUOTE(COLUMN_TYPE), 'AS `column_type`'
, 'FROM `', REPLACE(TABLE_NAME, '`', '``'), '`'
SELECT table_name AS "Table",
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)",
table_rows as '# rows'
FROM information_schema.TABLES
WHERE table_schema = "database"
ORDER BY (data_length + index_length) DESC;