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 | |
# This playbook assumes you have cloned https://github.com/openark/orchestrator | |
# and ran: ./script/dock system | |
# which landed you in orchestrator's playground environment. | |
# Further information available on the welcome screen once you've ran the docker image. | |
# FYI, orchestrator's config file is at /etc/orchestrator.conf.json | |
orchestrator-client -c topology-tabulated -alias ci | |
orchestrator-client -c topology-tabulated -alias ci | tr '|' '\t' |
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
/* | |
// Override Slack CSS | |
// Tested with Slack 2.8.2 Direct Download | |
// Instructions: | |
// - Append the following javascript code to: | |
// - /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js (MacOS/X) | |
// - /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js (Debian/Ubuntu) |
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
# Assuming time series is in /tmp/ts-data.dat | |
# Assuming timeseries in 2015-01-02 format (change according to data) | |
echo ' | |
set xdata time | |
set timefmt "%Y-%m-%d" | |
set terminal dumb size 120, 24 | |
plot "/tmp/ts-data.dat" using 1:2 title "data pr time unit" with histeps | |
' | gnuplot |
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 | |
# good brew setup for Mac OS/X | |
brew tap homebrew/dupes | |
brew install homebrew/dupes/grep | |
brew install go --with-cc-all | |
brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt | |
brew install git gnupg rpm npm bash-completion |
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 | |
# | |
# Usage: block_mysql_access.bash [true|false] | |
# "true" or empty input blocks 3306 access, via iptables | |
# "false" re-enables access to 3306 | |
# | |
if [ $# -eq 0 ] || [ "$1" == "true" ]; then | |
sudo -i /sbin/iptables -I INPUT -p tcp --destination-port 3306 -j REJECT | |
elif [ "$1" == "false" ]; then |
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 | |
( | |
mysql_datadir=$(grep datadir /etc/my.cnf | head -n 1 | cut -d "=" -f 2 | cut -d "#" -f 1) | |
cd $mysql_datadir | |
for frm_file in $(find . -name "*.frm" | egrep -v "[.]/(mysql|sys|performance_schema|common_schema)") | |
do | |
table_schema=$(echo $frm_file | cut -d "/" -f 2) | |
table_name=$(echo $frm_file | cut -d "/" -f 3 | cut -d "." -f 1) | |
if [ -f ${frm_file//.frm/.MYD} ]; then |
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/python | |
# | |
# Convert a Row-Based-Replication binary log to Statement-Based-Replication format, cheating a little. | |
# This script exists since Percona Toolkit's pt-query-digest cannot digest RBR format. The script | |
# generates enough for it to work with. | |
# Expecting standard input | |
# Expected input is the output of "mysqlbinlog --verbose --base64-output=DECODE-ROWS <binlog_file_name>" | |
# For example: | |
# $ mysqlbinlog --verbose --base64-output=DECODE-ROWS mysql-bin.000006 | python binlog-rbr-to-sbr.py | pt-query-digest --type=binlog --order-by Query_time:cnt --group-by fingerprint | |
# |