This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import ConfigParser | |
import os | |
import time | |
import getpass | |
def get_dump(): | |
print "Enter user:" | |
user = raw_input() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source mysql_access | |
TODAY=$(date +"%Y-%m-%d_%H%M%S") | |
CHECK_RETAINER=$( | |
mysql api_test \ | |
-u$MYSQL_USER \ | |
-p$MYSQL_PASS \ | |
-h$SOURCE_HOST \ | |
--socket=$MYSQL_SOCK \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BIND_NETWORK="192.168.5.0" | |
SHARED_VIP="192.168.5.30" | |
apt-get update | |
apt-get install -y pacemaker ntp | |
# Configure Corosync | |
echo "START=yes" > /etc/default/corosync | |
sed -i "s/bindnetaddr: 127.0.0.1/bindnetaddr: $BIND_NETWORK/g" /etc/corosync/corosync.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
######################################################################### | |
# # | |
# MySQL performance tuning primer script # | |
# Writen by: Matthew Montgomery <[email protected]> # | |
# Inspired by: MySQLARd (http://gert.sos.be/demo/mysqlar/) # | |
# Version 1.2-r6 # | |
# Licenced under GPLv2 # | |
# # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tolerance:"touch", | |
drop:function (event, ui) { | |
var basket = $(this), | |
move = ui.draggable, | |
itemId = basket.find("ul li[data-id='" + move.attr("data-id") + "']"); | |
// To increase the value by +1 if the same item is already in the basket | |
if (itemId.html() != null) { | |
itemId.find("input").val(parseInt(itemId.find("input").val()) + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS myschema.create_index_if_not_exists $$ | |
CREATE PROCEDURE myschema.create_index_if_not_exists(in p_tableName VARCHAR(128), in p_indexName VARCHAR(128), in p_columnName VARCHAR(128) ) | |
BEGIN | |
PREPARE stmt FROM 'SELECT @indexCount := COUNT(1) from information_schema.statistics WHERE `table_name` = ? AND `index_name` = ?'; | |
SET @table_name = p_tableName; | |
SET @index_name = p_indexName; | |
EXECUTE stmt USING @table_name, @index_name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************* | |
* | |
* ADD THE FOLLOWING TO PRODUCTION my.cnf | |
* init_connect = "CALL <database>.login_audit()"; | |
* | |
*************************************************/ | |
/*CREATE TABLE FOR AUDIT DATA COLLECTION*/ | |
CREATE TABLE login_audit ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP PROCEDURE IF EXISTS `schema_change`; | |
DELIMITER $$ | |
CREATE PROCEDURE `schema_change`() | |
BEGIN | |
-- BEGIN changes for sip-proxy | |
-- Add columns to store database connection parameters in sipProxyGroup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT field_name, | |
field_name1, | |
field_name2 | |
FROM table_name | |
WHERE field_name IN (select field_name from table_name where field_name = field_name) | |
GROUP BY 1,2 | |
ORDER BY 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT message_id AS id, | |
subject, | |
is_read, | |
Date_format(sentDate, '%m/%d/%y') AS ts, | |
messagetypeid AS type | |
FROM ( | |
SELECT message_id, | |
is_read | |
FROM message_user mu | |
WHERE user_id = 3784 |
NewerOlder