Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/perl5
#
# Time-stamp: <1999-07-04 19:15:55 hirose31>
#
# flock() を使わなくても壊れないカウンタ
# つっても排他制御してるんだけどね。
#
BEGIN: { $|++; }
# https://twitter.com/hirose31/status/1519559294546747392?s=20&t=23VtFa6D63RSB3Go2boDYw
sub mysql_clientversion {
require DBD::mysql;
no warnings qw(redefine);
local *DBD::mysql::db::_login = sub { 1 };
my $dbh = DBI->connect('dbi:mysql:');
return $dbh->{mysql_clientversion};
}
bzcat
bzcmp
bzexe
bzip2
chacl
chgrp
chmod
chown
dmesg
egrep
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010_000;
use Data::Dumper;
# https://perldoc.jp/docs/perl/5.26.1/perlvar.pod
# <FH>, readline, readdir, each が単独で while テストで テストされた場合の、次の値や入力レコードを入れるデフォルトの場所。 while テスト以外ではこれは起こりません。
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010_000;
use Data::Dumper;
use JSON;
say $^V;

Keybase proof

I hereby claim:

  • I am hirose31 on github.
  • I am hirose31 (https://keybase.io/hirose31) on keybase.
  • I have a public key ASAhwAoSU-hkNsPkBcVszT5mwlrnCfuX0QTaOpOTesuMOQo

To claim this, I am signing this object:

#!perl
use strict;
use warnings;
# use POSIX;
my($p, $c);
pipe($p, $c);
if (fork() == 0) {
@hirose31
hirose31 / bt
Created February 12, 2019 09:42
#0 0x00005614c868bfb1 in yaSSL::receiveData (ssl=..., data=...,
peek=peek@entry=false)
at /export/home/pb2/build/sb_0-32013917-1545389775.79/release/mysql-5.7.25/extra/yassl/src/handshake.cpp:1069
#1 0x00005614c8641e5d in yaSSL::yaSSL_read (ssl=ssl@entry=0x5614c917fa20,
buffer=buffer@entry=0x5614c9187ba0, sz=sz@entry=4)
at /export/home/pb2/build/sb_0-32013917-1545389775.79/release/mysql-5.7.25/extra/yassl/src/ssl.cpp:363
#2 0x00005614c8626887 in vio_ssl_read (vio=0x5614c917f250,
buf=0x5614c9187ba0 "\t", size=<optimized out>)
at /export/home/pb2/build/sb_0-32013917-1545389775.79/release/mysql-5.7.25/vio/viossl.c:186
#3 0x00005614c860e6ce in net_read_raw_loop (count=4,
#0 yaSSL::SSL::GetError (this=this@entry=0x56295bf4df70)
at /export/home/pb2/build/sb_0-32013917-1545389775.79/release/mysql-5.7.25/extra/yassl/src/yassl_int.cpp:1520
#1 0x00007f48640aa5db in yaSSL::receiveData (ssl=..., data=...,
peek=peek@entry=false)
at /export/home/pb2/build/sb_0-32013917-1545389775.79/release/mysql-5.7.25/extra/yassl/src/handshake.cpp:1047
#2 0x00007f48640901ed in yaSSL::yaSSL_read (ssl=ssl@entry=0x56295bf4df70,
buffer=buffer@entry=0x56295bf500f0, sz=sz@entry=4)
at /export/home/pb2/build/sb_0-32013917-1545389775.79/release/mysql-5.7.25/extra/yassl/src/ssl.cpp:363
#3 0x00007f4864069987 in vio_ssl_read (vio=0x56295bf49590,
buf=0x56295bf500f0 "r", size=<optimized out>)
/* -*- mode: c; coding: utf-8 -*-
https://bugs.mysql.com/bug.php?id=92394
How to reproduce
gcc simple-query.c $(mysql_config --cflags) $(mysql_config --libs) -o simple-query
MYSQL_USER=scott MYSQL_PWD=tiger ./simple-query
mysql client version: 50724
> while true; do kill -USR1 5922 || break; sleep 15; done