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
# config/server.rb | |
require "em-synchrony" | |
require "em-synchrony/mysql2" | |
config['db'] = EM::Synchrony::ConnectionPool.new(:size => 25) do | |
::Mysql2::EM::Client.new({ | |
:adapter => 'em_mysql2', | |
:database => 'shard001', | |
:username => 'xxx', | |
:password => 'xxx', |
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
require 'benchmark' | |
require 'em-synchrony' | |
require 'em-synchrony/connection_pool' | |
require 'em-synchrony/activerecord' | |
require 'mysql2' | |
require 'active_record' | |
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/sh | |
######################################################################### | |
# # | |
# MySQL performance tuning primer script # | |
# Writen by: Matthew Montgomery <[email protected]> # | |
# Inspired by: MySQLARd (http://gert.sos.be/demo/mysqlar/) # | |
# Version: 1.5-r5 Released: 2009-11-22 # | |
# 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
#!/usr/bin/perl -w | |
# mysqltuner.pl - Version 1.1.1 | |
# High Performance MySQL Tuning Script | |
# Copyright (C) 2006-2009 Major Hayden - [email protected] | |
# | |
# For the latest updates, please visit http://mysqltuner.com/ | |
# Git repository available at http://github.com/rackerhacker/MySQLTuner-perl | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
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/ruby | |
require 'rubygems' | |
require 'redis' | |
# Redis command processor. Author: Valery Vishnyakov | |
# | |
# Reports the following metrics | |
# | |
# CMD_PER_SEC Commands processed per second |
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
require 'rubygems' | |
require 'redis' | |
require 'uri' | |
class Redis | |
module Helper | |
def parse_redis_url(redis_url) | |
node = URI(redis_url) |
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
puts 'jm1640424qm4l4vflo54ddkjm56l7hnhzx'.to_i(36).to_s(2).tr("01","#.").scan(/.{35}/) |
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
for a in (36634234658,39796869174,51130141738,43496245282,43613571106): | |
print bin(a)[3:].replace('1','#').replace('0','.') |
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
curl -s quiz.ask.fm|grep '##'|sed -e "s/<br\/>/\x0A/g" -e "s/ <p>//g" -e "s/<\/p>//g" |
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
class t{public static void main(String[]r){for(int i=175;i>0;)System.out.print(new java.math.BigInteger("18s9jqdkp79cwvqpza2mwg1f1mbe9sgkdac",36).testBit(i--)?"#":i%35>0?".":".\r\n");}} |