Skip to content

Instantly share code, notes, and snippets.

Kevin Rabello krabello

  • Catalog Solutions
  • DeLand, Florida
Block or report user

Report or block krabello

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DKIM-Ubuntu-Install.yml
- hosts: webservers-test
gather_facts: no
remote_user: root
pre_tasks:
- name: Update apt cache.
apt: update_cache=true cache_valid_time=600
tasks:
- name: Install opendkim
@krabello
krabello / remove-all-ps-products.sql
Created Oct 10, 2018
Prestashop Delete * Product Data
View remove-all-ps-products.sql
# All these tables have an id_product primary key
TRUNCATE TABLE ps_product;
TRUNCATE TABLE ps_product_attachment;
TRUNCATE TABLE ps_product_country_tax;
TRUNCATE TABLE ps_product_group_reduction_cache;
TRUNCATE TABLE ps_product_lang;
TRUNCATE TABLE ps_product_sale;
TRUNCATE TABLE ps_product_tag;
TRUNCATE TABLE ps_category_product;
TRUNCATE TABLE ps_feature_product;
@krabello
krabello / RIBPS.sql
Created Sep 21, 2018
RIBPS, Recommended InnoDB Buffer Pool Size based on all InnoDB Data and Indexes with an additional 60%
View RIBPS.sql
SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;
@krabello
krabello / Innodb_buffer_pool_reads.sh
Created Sep 21, 2018
The number of reads from disk into the buffer pool (per second)
View Innodb_buffer_pool_reads.sh
mysqladmin -uroot -proot ext -ri1 | grep Innodb_buffer_pool_reads
@krabello
krabello / convert_myisam_to_innodb.sql
Created Sep 21, 2018
Returns list of queries that will convert all tables in a given schema from MyISAM to InnoDB
View convert_myisam_to_innodb.sql
SET @DB_NAME = 'your_database';
SELECT CONCAT('ALTER TABLE `',
table_name, '` ENGINE=InnoDB;') AS sql_statements
FROM information_schema.tables AS tb
WHERE table_schema = @DB_NAME
AND ENGINE = 'MyISAM'
AND TABLE_TYPE = 'BASE TABLE'
ORDER BY table_name DESC;
@krabello
krabello / MyISAM_tables.sql
Created Sep 21, 2018
Returns list of all MyISAM tables sorted by size
View MyISAM_tables.sql
SELECT
concat(table_schema, '.', table_name) tbl,
engine,
concat(round(table_rows/
1000000,2),'M') rows,
concat(round(data_length/
(1024*1024*1024),2),'G') DATA,
concat(round(index_length/
(1024*1024*1024),2),'G') idx,
concat(round((data_length+index_length)/
@krabello
krabello / table_storage_engine.sql
Created Sep 21, 2018
Query that shows the storage engines you are using and a number of tables using each storage engine
View table_storage_engine.sql
SELECT engine,
count(*) as TABLES,
concat(round(sum(table_rows)/
1000000,2),'M') rows,
concat(round(sum(data_length)/
(1024*1024*1024),2),'G') DATA,
concat(round(sum(index_length)/
(1024*1024*1024),2),'G') idx,
concat(round(sum(data_length+index_length)/
(1024*1024*1024),2),'G') total_size,
@krabello
krabello / youtube_video_id.php
Created Aug 17, 2018
PHP Regex to get youtube video ID
View youtube_video_id.php
<?php
// Matches
// youtube.com/v/vidid
// youtube.com/vi/vidid
// youtube.com/?v=vidid
// youtube.com/?vi=vidid
// youtube.com/watch?v=vidid
// youtube.com/watch?vi=vidid
// youtu.be/vidid
// youtube.com/embed/vidid
@krabello
krabello / ubuntu-redis-install.sh
Created Feb 14, 2018
Configure Redis on Ubuntu
View ubuntu-redis-install.sh
#!/bin/bash
###############################################################################
######################### Install and Configure Redis #########################
###############################################################################
###############################################################################
@krabello
krabello / titlecase.pipe.ts
Created Oct 19, 2017
Titlecase Angular Pipe
View titlecase.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'titlecase'
})
export class TitlecasePipe implements PipeTransform {
transform(value: any): any {
if (!value) {
return null;
You can’t perform that action at this time.