Skip to content

Instantly share code, notes, and snippets.

View mazgi's full-sized avatar

Hidenori "Hide" Matsuki mazgi

View GitHub Profile
@mazgi
mazgi / 00.README.md
Last active October 23, 2020 22:58
is the zsh script being sourced?

is the zsh script being sourced?

a traditional way

[[ $_ = $0 ]] && {
  echo 'the script is being sourced.'
  return 0
} 
@mazgi
mazgi / 00.README.md
Last active April 5, 2020 11:36
fio benchmark results for btrfs raid
  • bs=4k
fio -rw=read -bs=4k -size=100m -numjobs=40 -runtime=60 -direct=1 -invalidate=1 -ioengine=libaio -iodepth=32 -iodepth_batch=32 -group_reporting -name=seqread
fio -rw=write -bs=4k -size=100m -numjobs=40 -runtime=60 -direct=1 -invalidate=1 -ioengine=libaio -iodepth=32 -iodepth_batch=32 -group_reporting -name=seqwrite
fio -rw=randread -bs=4k -size=100m -numjobs=40 -runtime=60 -direct=1 -invalidate=1 -ioengine=libaio -iodepth=32 -iodepth_batch=32 -group_reporting -name=randread
fio -rw=randwrite -bs=4k -size=100m -numjobs=40 -runtime=60 -direct=1 -invalidate=1 -ioengine=libaio -iodepth=32 -iodepth_batch=32 -group_reporting -name=randwrite
  • bs=32m
@mazgi
mazgi / Vagrantfile
Created December 13, 2016 14:02
My favorite Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.define "ubuntu14" do |m|
m.vm.box = "ubuntu/trusty64"
@mazgi
mazgi / weechat.md
Created December 12, 2016 11:48
weechat
$ grep url ~/.weechat/script.conf
url = "https://weechat.org/files/plugins.xml.gz"
url_force_https = on
$ curl -LI 'https://weechat.org/files/plugins.xml.gz'
HTTP/1.1 200 OK
Date: Mon, 12 Dec 2016 11:47:32 GMT
Server: Apache
X-Frame-Options: sameorigin
X-Content-Type-Options: nosniff
@mazgi
mazgi / memo.md
Created November 29, 2016 03:52
Homebrew LFTP
$ pwd
/Users/hidenori.matsuki/Creations/mazgi/homebrew-core
$ git remote -v
origin	[email protected]:mazgi/homebrew-core.git (fetch)
origin	[email protected]:mazgi/homebrew-core.git (push)
$ git log -1
commit 21edd87ef66064af8860f7593696dda18c88ad43
Author: Hidenori MATSUKI <[email protected]>
Date: Tue Nov 29 12:09:36 2016 +0900
@mazgi
mazgi / foo.md
Created November 28, 2016 07:11

foo bar

foo
bar

@mazgi
mazgi / console.md
Last active February 27, 2016 18:43
btrfs compression
# uname -a
Linux test-04 4.1.15-gentoo-r1 #1 SMP Sat Feb 27 15:52:30 2016 x86_64 Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz GenuineIntel GNU/Linux
# btrfs --version
btrfs-progs v4.0.1
# gdisk -l /dev/vdb
GPT fdisk (gdisk) version 0.8.10