Skip to content

Instantly share code, notes, and snippets.

Avatar

Matsuki, Hidenori mazgi

View GitHub Profile
@mazgi
mazgi / console.md
Last active Aug 31, 2016
fio on btrfs raid
View console.md
  • 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=16k
@mazgi
mazgi / setup.sh
Last active Oct 5, 2015
Setup network configuration on Gentoo Linux
View setup.sh
#!/bin/bash
set -e
DO_SETUP=false
function read_yes_or_no(){
echo -n "${1} [y/N] "
read YES_OR_NO
case ${YES_OR_NO^^} in
View gentoo.init.md
root@sysresccd /mnt/gentoo % grep -vE '^\s*(#|$)' etc/locale.gen 
en_US ISO-8859-1
en_US.UTF-8 UTF-8
ja_JP.EUC-JP EUC-JP
ja_JP.UTF-8 UTF-8
ja_JP EUC-JP
root@sysresccd /mnt/gentoo % grep -vE '^\s*(#|$)' etc/portage/make.conf
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
View console.md
$ ansible-playbook -i hosts playbook.yml

PLAY [test-servers] *********************************************************** 

GATHERING FACTS *************************************************************** 
ok: [172.x.y.1]

TASK: [example executed by root privilege with sudo] ************************** 
failed: [172.x.y.1] => {"failed": true, "parsed": false}
@mazgi
mazgi / console.log.md
Last active Jan 12, 2021
LDAP Auth for SSSD, SSH, SUDO
View console.log.md
# uname -a
Linux base 4.0.5-gentoo #1 SMP Wed Jul 1 02:23:16 JST 2015 x86_64 Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz GenuineIntel GNU/Linux

Packages

# emerge -pvq openldap openssh sssd sudo
[ebuild   R   ] net-nds/openldap-2.4.38-r2  USE="berkdb crypt gnutls ipv6 minimal sasl ssl syslog tcpd -cxx -debug -experimental -icu -iodbc -kerberos -odbc -overlays -perl -samba (-selinux) -slp -smbkrb5passwd" ABI_X86="(64) -32 (-x32)" 
@mazgi
mazgi / chroot.md
Last active Aug 29, 2015
GentooInstallBattle on SAKURA Cloud
View chroot.md
sysresccd / # passwd 
New password: 
Retype new password: 
passwd: password updated successfully
sysresccd / # emerge -vq flaggie                                                                                                                                                                                   
>>> Verifying ebuild manifests
@mazgi
mazgi / console.md
Last active Aug 29, 2015
Aerospike on Gentoo
View console.md
[root@aerospike-01] # git remote -v
origin  git@github.com:aerospike/aerospike-server.git (fetch)
origin  git@github.com:aerospike/aerospike-server.git (push)
[root@aerospike-01] # git rev-parse HEAD
956c761c026bfd4b96f679a2425625e768b9f58e
[root@aerospike-01] # emerge -pvq openssl lua
@mazgi
mazgi / console.md
Last active Aug 29, 2015
Linux Router on Gentoo
View console.md
[root@Brynhildr] # sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
[root@Brynhildr] # emerge -pvq iptables
[ebuild   R   ] net-firewall/iptables-1.4.21-r1  USE="ipv6 -netlink -static-libs" 
@mazgi
mazgi / console.md
Last active Oct 21, 2015
OpenLDAP on Gentoo
View console.md
# emerge -pvq openldap sudo openssh
[ebuild   R   ] net-nds/openldap-2.4.38-r2  USE="berkdb crypt ipv6 sasl ssl syslog tcpd -cxx -debug -experimental -gnutls -icu -iodbc -kerberos -minimal -odbc -overlays -perl -samba (-selinux) -slp -smbkrb5passwd" ABI_X86="(64) (-32) (-x32)" 
[ebuild   R   ] app-admin/sudo-1.8.11_p1  USE="ldap nls pam sendmail -offensive (-selinux) -skey" 
[ebuild   R   ] net-misc/openssh-6.7_p1  USE="hpn ldap pam pie -X -X509 -bindist -kerberos -ldns -libedit -sctp (-selinux) -skey -static" 
# mv /var/lib/openldap-data/DB_CONFIG{.example,}
# bzip2 --decompress --stdout /usr/share/doc/sudo-1.8.11_p1/schema.OpenLDAP.bz2 > /etc/openldap/schema/sudo.schema
@mazgi
mazgi / console.md
Last active Aug 29, 2015
RHEL6.5 on POWER8
View console.md
[root@localhost] # uname -a
Linux localhost.localdomain 2.6.32-431.el6.ppc64 #1 SMP Sun Nov 10 22:17:43 EST 2013 ppc64 ppc64 ppc64 GNU/Linux
[root@localhost] # nproc
40
[root@localhost] # free -g
             total       used       free     shared    buffers     cached
Mem:           120         13        106          0          0         11
-/+ buffers/cache:          1        118
Swap:            3          0          3