Skip to content

Instantly share code, notes, and snippets.

% sudo parted /dev/sdf
GNU Parted 2.3
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) p
Model: ATA WDC WD20EARS-00M (scsi)
Disk /dev/sdf: 3907029168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
table8 = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6 , 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5 , 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8]
table16 = []
256.times do |i|
256.times do |j|
table16[i * 256 + j] = table8[i] + table8[j]
end
end
@itochan
itochan / -
Created October 13, 2014 14:11
pool: tank
state: ONLINE
scan: resilvered 1.40T in 12h48m with 0 errors on Mon Oct 13 06:50:31 2014
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
ata-WDC_WD40EZRX-00SPEB0_WD-WCC4E34EN4H0 ONLINE 0 0 0
ata-WDC_WD20EFRX-68AX9N0_WD-WMC300228224 ONLINE 0 0 0
Process: iTunes [2495]
Path: /Applications/iTunes.app/Contents/MacOS/iTunes
Identifier: com.apple.iTunes
Version: 12.0.1 (12.0.1.26)
Build Info: iTunes-1200012000001026~1
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: iTunes [2495]
User ID: 501
@itochan
itochan / -
Created November 15, 2014 15:05
smartctl 6.3 2014-07-26 r3976 [x86_64-apple-darwin13.3.0] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: APPLE SSD SM128C
Serial Number: S0N7NYAB567408
LU WWN Device Id: 5 0000f0 000000000
Firmware Version: AXM09A1Q
User Capacity: 121,332,826,112 bytes [121 GB]
Sector Size: 512 bytes logical/physical
@itochan
itochan / -
Created November 17, 2014 09:32
Process: Butter [5933]
Path: /Applications/Butter.app/Contents/MacOS/Butter
Identifier: jp.harukasan.butter
Version: 0.1.4 (0.1.4)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Butter [5933]
User ID: 501
Date/Time: 2014-11-17 18:31:10.164 +0900
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.006 000.006: --- VIM STARTING ---
000.094 000.088: Allocated generic buffers
000.378 000.284: locale set
000.382 000.004: clipboard setup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jq -s '{ response: [( (.[0].response | sort_by(.name)) as $a | (.[1].response | sort_by(.name)) as $b | ($a | length) as $length | $a[] as $item | $item + $b[range(0;$length)] )] }' a.json b.json

a.json

{
  "response": [
    {
      "station_ja": "新宿",