This file contains 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 | |
####### launch-configuration | |
ami=ami-af79ebc0 | |
my_launch_config=copcc-2-test | |
my_key_pair=copcc-02 # aws ec2 describe-key-pairs|grep KeyName | |
instance_type=t2.nano | |
#my_userdata= | |
####### |
This file contains 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 | |
# scale_instances.sh -g AUTOSCALING_GROUP -c DESIRED_CAPACITY | |
# e.g. scale_instances -g copcc-02 -c 3 | |
########### read parameter #### | |
while getopts c:g: option | |
do | |
case "${option}" |
This file contains 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
<?php | |
####### graphite sqlite events migration to mysql ####### | |
####### phillip.hagedorn@gmail.com ####### | |
# php-sqlite3 php-mysql | |
####### configuration ####### | |
# source configuration for sqlite | |
$sqlite_file = "graphite.db"; |
This file contains 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
# Query to list top 5 largest tables in the database | |
# http://www.thegeekstuff.com/2008/11/overview-of-mysql-information_schema-database-with-practical-examples/ | |
# This examples gives the top 5 largest space occupying tables in the database along with it’s size in MB. | |
SELECT concat(table_schema,'.',table_name) table_name, | |
concat(round(data_length/(1024*1024),2),'M') data_length | |
FROM information_schema.TABLES | |
ORDER BY data_length DESC LIMIT 5 |
This file contains 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
# Query to display tables with more than 1000 rows | |
# http://www.thegeekstuff.com/2008/11/overview-of-mysql-information_schema-database-with-practical-examples/ | |
#Using the above mentioned information_schema tables you can build your own query to get metadata information. This example displays #the MySQL tables that have more than 1000 rows. | |
select concat(table_schema,'.',table_name) as table_name,table_rows | |
from information_schema.tables where table_rows > 1000 | |
order by table_rows desc; |
This file contains 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 | |
echo "- Install prerequirements" | |
echo "-- Install build tools" | |
apt-get update | |
apt-get install -y build-essential git curl | |
echo "-- Install NodsJS" | |
curl -sL https://deb.nodesource.com/setup | bash - | |
apt-get -y install nodejs | |
echo "- Build Grafana" | |
echo "-- Checkout Grafana sources" |
This file contains 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 TABLE_NAME AS "Table", | |
TABLE_ROWS AS "Rows", | |
CONCAT((FORMAT((DATA_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Data Size", | |
CONCAT((FORMAT((INDEX_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Index Size", | |
CONCAT((FORMAT((DATA_LENGTH+ INDEX_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Total Size", | |
TRIM(TRAILING ', ' FROM CONCAT_WS(', ', ENGINE, TABLE_COLLATION, CREATE_OPTIONS)) AS "Type" | |
FROM information_schema.TABLES | |
WHERE information_schema.TABLES.table_schema = "schema_name" |
This file contains 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/sh | |
### BEGIN INIT INFO | |
# Provides: grafana-authentication-proxy | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: grafana-authentication-proxy | |
### END INIT INFO |
This file contains 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/python -tt | |
# | |
import datetime | |
import json | |
import logging | |
import logging.handlers | |
import optparse | |
import os | |
import re | |
import sys |