Skip to content

Instantly share code, notes, and snippets.

View hansode's full-sized avatar

Masahito Yoshida hansode

View GitHub Profile
#!/bin/bash
#
# requires:
# bash
#
set -e
set -o pipefail
function nbd_used?() {
local devpath=${1}
@hansode
hansode / mirror-centos-to-local.sh
Created October 1, 2014 07:42
mirror-centos-to-local.sh
#!/bin/bash
#
# requires:
# bash
# mkdir, rsync
#
set -e
set -o pipefail
set -x
#!/bin/bash
#
# requires:
# bash
# git
#
set -e
set -o pipefail
set -x
$ ./setup-brvlan-pair.sh
=> /etc/sysconfig/network-scripts/ifcfg-brvlan2001
DEVICE=brvlan2001
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
=> /etc/sysconfig/network-scripts/ifcfg-vlan2001
DEVICE=vlan2001
BOOTPROTO=none
ONBOOT=yes
@hansode
hansode / qemu-kvm.spec
Last active December 31, 2015 05:09
qemu-kvm-1.5.3-19.el7.src.rpm
$ rpm2cpio qemu-kvm-1.5.3-19.el7.src.rpm | cpio --list 2>/dev/null | egrep '\.spec$'
qemu-kvm.spec
$ rpm2cpio qemu-kvm-1.5.3-19.el7.src.rpm | cpio -id qemu-kvm.spec
28804 blocks
@hansode
hansode / gist:7933031
Created December 12, 2013 18:34
upgraded from centos-6.5(minimal) to rhel7-beta1
Transaction Check Error:
file /etc/my.cnf from install of mariadb-libs-1:5.5.33a-3.el7.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/Index.xml from install of mariadb-libs-1:5.5.33a-3.el7.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mariadb-libs-1:5.5.33a-3.el7.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of mariadb-libs-1:5.5.33a-3.el7.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of mariadb-libs-1:5.5.33a-3.el7.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/cp852.xml from install of mariadb-libs-1:5.5.33a-3.el7.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/hebrew.xml from install of maria
@hansode
hansode / result.md
Last active December 25, 2015 22:38
size description
833140 setup
4121560 100% used
1587032 tar->untar
@hansode
hansode / MUSSEL_RC
Last active December 25, 2015 01:59
### mussel hack!!!
#
# top-level:
#
# + stdout
# + stderr
# + history
# + statistics/:namespace/:cmd/:today/:txid/
# + test/:category/:api_version/:script/:step/:today/:txid/
#!/bin/bash
#
# requires:
# bash
#
set -e
while read line; do
set ${line}
pid=$(echo ${line} | sed "s, ,\n,g" | head -1)
#!/bin/bash
#
# requires:
# bash
# cat, pidstat
#
set -e
LANG=C
LC_ALL=C