Skip to content

Instantly share code, notes, and snippets.

@kazeburo
kazeburo / mroonga_repl_test.md
Created January 29, 2014 05:34
ON DUPLICATE KEY UPDATE と mroongaでレプリケーションが壊れる件の検証

環境

  • CentOS 6.5
  • MySQL 5.6.15 Oracle rpm
  • mroonga 3.11
  • binlog_formatはMIXED

テーブル

CREATE TABLE article_index (

package main
import "fmt"
func main () {
// 見つめ合う
fmt.Println("おっくせんまん!おっくせんまん!!")
defer fmt.Println("ジャパン!!!");
}
@sh2
sh2 / load.pl
Created October 11, 2013 15:30
Parallel restore script for mysqldump
#!/usr/bin/env perl
use strict;
use warnings;
use File::Temp qw/tempfile/;
my ($state, $nprocs) = (0, 0);
my ($fh, $tempfile, @settings);
@do-aki
do-aki / mylogin_dumper.pl
Created April 17, 2013 08:54
MySQL Casual Talks Vol.4 LT 「セキュアそうでセキュアじゃない少しセキュアな気分になれるmysql_config_editor」 http://www.slideshare.net/do_aki/mysql-config-editor を参照。 Crypt::ECB と Crypt::OpenSSL::AES が必要です。
######################################
# usage
# mylogin_dumper.pl ~/.mylogin.conf
######################################
use strict;
use warnings;
use Crypt::ECB;
#use Crypt::OpenSSL::AES;
my $my_login_file = shift;
@syohex
syohex / buffer_flush.pl
Created November 26, 2012 10:17
Buffer flush sample
#!perl
use strict;
use warnings;
use POSIX ();
sysopen my $in, "/proc/net/dev", POSIX::O_RDONLY or die "Can't open file: $!";
open my $out, '>', 'output.log' or die "Can't open file: $!";
#$out->autoflush(1); # <== バッファリングしない(autoflush $out, 1; も可)
@tmtm
tmtm / mysql_unicode_collation.rb
Created April 16, 2011 06:25
MySQL 5.5.11 unicode_ci で同一視される文字
#!/usr/local/bin/ruby
# -*- coding: utf-8 -*-
require 'cgi'
filename, = ARGV # path of file `ctype-uca.c'
ctype_uca = File.read(filename)
ctype_uca =~ /^uchar uca_length\[256\]={\n(.*?)};$/m or raise 'uca_length not found'
uca_length = $1.gsub(/\s/,'').split(/,/).map(&:to_i)
@kamipo
kamipo / innobackupex-1.5.1.diff
Created January 6, 2011 11:02
innobackupexをtritonnに対応させるよ!
--- innobackupex-1.5.1.org 2010-12-09 23:03:09.000000000 +0900
+++ innobackupex-1.5.1 2011-01-07 01:28:20.000000000 +0900
@@ -1333,10 +1333,19 @@
print FILE "CHANGE MASTER TO MASTER_LOG_FILE='$filename', MASTER_LOG_POS=$position\n";
close(FILE);
+ my $orig_datadir = get_option(\%config, 'mysqld', 'datadir');
+
if ($option_stream eq 'tar') {
+ system("cd $orig_datadir; tar chf - master.info")