Skip to content

Instantly share code, notes, and snippets.

@detain
detain / mytop.sh
Last active Aug 16, 2020
mytop (Monitor mysql process list with top like screen updates and adiditonal stats like cpu/io usage)
View mytop.sh
#!/bin/bash
# mytop.sh - (Monitor mysql process list with top like screen updates and adiditonal stats like cpu/io usage)
#
# Sample Output:
#
# CPU Usage 3.29% user 1.60% system 3.37% io wait 0.00% steal 91.59% idle
# Up 17 days 10 hours Load Avg 0.43 0.36 0.35 Processes 1(running) 408(total) Last PID 17825
# +----------+------+-----------+----+---------+------+-------+------------------+
# | Id | User | Host | db | Command | Time | State | Info |
# +----------+------+-----------+----+---------+------+-------+------------------+
@avoidwork
avoidwork / gist:3749973
Created Sep 19, 2012
MySQL sp_split() splits a comma delimited string into a recordset & inserts it into target table or returns it
View gist:3749973
-- ----------------------------
-- Procedure structure for `sp_split`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_split`;
delimiter ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_split`(IN toSplit text, IN target char(255))
BEGIN
# Temp table variables
SET @tableName = 'tmpSplit';
SET @fieldName = 'variable';
@burningTyger
burningTyger / sencond_deploy.md
Last active Aug 30, 2017
How to deploy your openshift app to a second instance
View sencond_deploy.md

##How to deploy your openshift app to a second instance

I set up Moodle for myself on Openshift which I explained here: https://github.com/burningTyger/openshift_moodle

Now I wanted to install Moodle for a friend who has his own user and his own domain on openshift. Since I'm the admin why bother creating a second app which is basically the exact same app as mine and will most cetainly need the exact same updates. DRY!

So I decided to find out how I can use the app repo on two different instances of openshift. This is how it works (there might be better solutions, let me know):

You log in as the second user and create a new app. This will give you a git URL. Copy this URL and head over to you app repo (Moodle used in this example):