Skip to content

Instantly share code, notes, and snippets.

bitcoin@ubuntu-bitcoin:~$ tail -f /mnt/blockstorage/Bitcoin/debug.log
2018-02-08 04:58:05 Opening LevelDB in /mnt/blockstorage/Bitcoin/blocks/index
2018-02-08 04:58:05 scheduler thread start
2018-02-08 04:58:06 Corruption: missing start of fragmented record(2)
2018-02-08 04:58:06 Database corrupted
2018-02-08 04:58:06 : Error opening block database.
Please restart with -reindex or -reindex-chainstate to recover.
2018-02-08 04:58:06 Aborted block database rebuild. Exiting.
2018-02-08 04:58:06 scheduler thread interrupt
2018-02-08 04:58:06 Shutdown: In progress...
@masakielastic
masakielastic / error.md
Created February 1, 2018 01:46
Lisk Core をインストール後のエラーメッセージ

√ Blockchain restored successfully. fs.js:796 return binding.writeBuffer(fd, buffer, offset, length, position); ^

Error: ENOSPC: no space left on device, write at Error (native) at Object.fs.writeSync (fs.js:796:20) at SyncWriteStream._write (fs.js:2243:6) at doWrite (_stream_writable.js:333:12)

@masakielastic
masakielastic / test.md
Last active January 11, 2018 02:39
脚注のテスト

タイトル

見出し1

本文。[1]

見出し2

次の文。[2]

1 脚注その1

@masakielastic
masakielastic / test.php
Last active September 19, 2017 16:36
0x0 から 0xff の範囲のバイトに対して mb_convert_encoding が無効なバイトをどのように置き換えるのかを確認します。
<?php
$enc = "cp932";
for ($cp = 0; $cp < 0x100; $cp++) {
$c = chr($cp);
$ret = mb_convert_encoding($c, $enc, $enc);
echo
bin2hex($c), " ",
@masakielastic
masakielastic / diff.rb
Last active October 2, 2017 06:39
ラウンドトリップが保障されない文字を調べます。
def chr_unsafe(cp, enc)
[cp.to_s(16)].pack("H*").force_encoding(enc)
end
enc = 'cp932'
count = 0
count2 = 0
(0x8000..0xffff).each do |cp|
begin
@masakielastic
masakielastic / utf8_ord.php
Created September 1, 2017 21:48
utf8_ord
<?php
function utf8_ord($char) {
$x = ord($char[0]);
if ($x < 0x80) {
return $x;
} else if ($x < 0xE0) {
$y = ord($char[1]);
<?php
$a = chr(0xfa).chr(0x4a);
var_dump(
"fa4a" === bin2hex($a),
"8754" === bin2hex(mb_strtolower($a, "CP932")),
"8754" === bin2hex(mb_strtoupper($a, "CP932"))
);
<?php
$a = chr(0xfa).chr(0x4a);
var_dump(
"fa4a" === bin2hex($a)
);
$a = mb_convert_encoding($a, "UTF-8", "CP932");
$a = mb_convert_encoding($a, "CP932", "UTF-8");
// http://stackoverflow.com/a/14947838/531320
const fromId = document.getElementById.bind(document);
const snabbdom = require('snabbdom');
const patch = snabbdom.init([
require('snabbdom/modules/class'),
require('snabbdom/modules/props'),
require('snabbdom/modules/style'),
require('snabbdom/modules/eventlisteners'),
]);