Skip to content

Instantly share code, notes, and snippets.

Avatar

Matsuki, Hidenori mazgi

View GitHub Profile
@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 / 00.README.md
Last active Oct 23, 2020
is the zsh script being sourced?
View 00.README.md

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 Apr 5, 2020
fio benchmark results for btrfs raid
View 00.README.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=32m
@mazgi
mazgi / client.md
Last active Aug 24, 2018
LDAP on Gentoo
View client.md
# emerge -pvq sssd openldap sudo openssh
[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)" 
[ebuild   R   ] net-misc/openssh-6.7_p1  USE="hpn pam pie -X -X509 -bindist -kerberos -ldap -ldns -libedit -sctp (-selinux) -skey -static" 
[ebuild   R   ] sys-auth/sssd-1.12.1  USE="ssh sudo -acl -augeas -autofs -locator -manpages -netlink -nfsv4 -nls -python (-selinux) {-test}" PYTHON_TARGETS="python2_7" 
[ebuild   R   ] app-admin/sudo-1.8.12  USE="ldap nls pam sendmail -offensive (-selinux) -skey" 
# < /etc/sssd/sssd.conf
@mazgi
mazgi / file0.txt
Last active Apr 28, 2018
JSX(Adobeの方)でスクリプトファイル自身のpathを求める ref: https://qiita.com/mazgi/items/863e9083430084e82cba
View file0.txt
const SELF = (function(){
try {app.documents.test()}
catch(e) {return File(e.fileName)}
})();
$.writeln(SELF instanceof File);
$.writeln(SELF);
$.writeln(SELF.path);
@mazgi
mazgi / NEW QGROUP!.md
Last active Dec 23, 2017
Btrfs subvolume quota
View NEW QGROUP!.md
[root@btrfs-testdrive] # btrfs qgroup create 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup assign 0/276 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup show /mnt/btrfs
qgroupid rfer       excl       
-------- ----       ----       
0/5      16384      16384      
0/256    2864136192 2864136192 
0/258    833703936  833703936  
0/259    52510720   52510720   
@mazgi
mazgi / Vagrantfile
Created Dec 13, 2016
My favorite Vagrantfile
View 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"