Skip to content

Instantly share code, notes, and snippets.

View major's full-sized avatar
🤠
Yeehaw.

Major Hayden major

🤠
Yeehaw.
View GitHub Profile
@major
major / output.txt
Created August 15, 2014 17:16
Ansible: create directory w/relative path
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
<localhost> REMOTE_MODULE setup
<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1408122888.66-13421194942965 && echo $HOME/.ansible/tmp/ansible-tmp-1408122888.66-13421194942965']
<localhost> PUT /tmp/tmp5Qho7b TO /root/.ansible/tmp/ansible-tmp-1408122888.66-13421194942965/setup
<localhost> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1408122888.66-13421194942965/setup; rm -rf /root/.ansible/tmp/ansible-tmp-1408122888.66-13421194942965/ >/dev/null 2>&1']
ok: [localhost]
TASK: [file path=test_dir state=directory] ************************************
@major
major / keybase.md
Last active August 29, 2015 14:05
keybase.md

Keybase proof

I hereby claim:

  • I am major on github.
  • I am mhayden (https://keybase.io/mhayden) on keybase.
  • I have a public key whose fingerprint is 1BF9 9264 9596 0033 698C 252B 7370 51E0 C101 1FB1

To claim this, I am signing this object:

@major
major / test.py
Created August 21, 2014 19:51
ansible #8640/#8642
[root@builder ~]# python test.py /var/www/html
#8642 ----->
/var
/var/www
/var/www/html
#8640 ----->
/
//var
//var/www
//var/www/html
@major
major / -
Created August 25, 2014 13:57
These people really want to break into my systems at home
inetnum: 119.10.0.0 - 119.10.127.255
netname: XinnetIDC
country: CN
descr: XinNet Technology Corp.
descr: Sino-i Campus,No.1 Disheng West Street,Beijing Economic-Technological Development Area,
descr: Beijing,P.R.China
admin-c: ML1867-AP
tech-c: BW719-AP
mnt-by: MAINT-CNNIC-AP
mnt-lower: MAINT-CNNIC-AP
@major
major / -
Created October 16, 2014 14:50
ixgbe fails on 3.17
# make
make -C /lib/modules/3.17.0-301.fc21.x86_64/build SUBDIRS=/root/ixgbe-3.22.3/src modules
make[1]: Entering directory '/usr/src/kernels/3.17.0-301.fc21.x86_64'
CC [M] /root/ixgbe-3.22.3/src/ixgbe_main.o
CC [M] /root/ixgbe-3.22.3/src/ixgbe_common.o
CC [M] /root/ixgbe-3.22.3/src/ixgbe_api.o
CC [M] /root/ixgbe-3.22.3/src/ixgbe_param.o
CC [M] /root/ixgbe-3.22.3/src/ixgbe_lib.o
CC [M] /root/ixgbe-3.22.3/src/ixgbe_ethtool.o
/root/ixgbe-3.22.3/src/ixgbe_ethtool.c: In function ‘ixgbe_update_ethtool_fdir_entry’:
[root@the-ocho ~]# cat /proc/cpuinfo
processor : 0
cpu : POWER8E (raw), altivec supported
clock : 3026.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 1
cpu : POWER8E (raw), altivec supported
clock : 3026.000000MHz
revision : 2.1 (pvr 004b 0201)
@major
major / host1.txt
Last active August 29, 2015 14:08
cgroups magically disappearing with libvirt 1.2.9 and systemd 216
<Event dir=True mask=0x40000020 maskname=IN_OPEN|IN_ISDIR name=machine.slice path=/sys/fs/cgroup/devices pathname=/sys/fs/cgroup/devices/machine.slice wd=1 >
<Event dir=True mask=0x40000020 maskname=IN_OPEN|IN_ISDIR name='' path=/sys/fs/cgroup/devices/machine.slice pathname=/sys/fs/cgroup/devices/machine.slice wd=3 >
<Event dir=True mask=0x40000001 maskname=IN_ACCESS|IN_ISDIR name=machine.slice path=/sys/fs/cgroup/devices pathname=/sys/fs/cgroup/devices/machine.slice wd=1 >
<Event dir=True mask=0x40000001 maskname=IN_ACCESS|IN_ISDIR name='' path=/sys/fs/cgroup/devices/machine.slice pathname=/sys/fs/cgroup/devices/machine.slice wd=3 >
<Event dir=True mask=0x40000020 maskname=IN_OPEN|IN_ISDIR name=machine-qemu\x2dinstance\x2dc28b9842\x2d08f8\x2d48c9\x2d9562\x2d16d5fa371687.scope path=/sys/fs/cgroup/devices/machine.slice pathname=/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2dinstanc
e\x2dc28b9842\x2d08f8\x2d48c9\x2d9562\x2d16d5fa371687.scope wd=3 >
<Event dir=True mask=0x40000020 maskname=IN_OPEN|IN_ISDIR
@major
major / gist:a8d6a068bd1fdceef97c
Created November 3, 2014 20:17
systemd aggressive cgroup trimming
If I leave a KVM virtual machine running for a short while, I see this:
# find /sys/fs/cgroup -name machine-qem*
/sys/fs/cgroup/perf_event/machine.slice/machine-qemu\x2dinstance\x2dc51f7c4b\x2d12a1\x2d4cfe\x2d87e0\x2d55b237ef31d2.scope
/sys/fs/cgroup/net_cls,net_prio/machine.slice/machine-qemu\x2dinstance\x2dc51f7c4b\x2d12a1\x2d4cfe\x2d87e0\x2d55b237ef31d2.scope
/sys/fs/cgroup/freezer/machine.slice/machine-qemu\x2dinstance\x2dc51f7c4b\x2d12a1\x2d4cfe\x2d87e0\x2d55b237ef31d2.scope
/sys/fs/cgroup/cpuset/machine.slice/machine-qemu\x2dinstance\x2dc51f7c4b\x2d12a1\x2d4cfe\x2d87e0\x2d55b237ef31d2.scope
/sys/fs/cgroup/systemd/machine.slice/machine-qemu\x2dinstance\x2dc51f7c4b\x2d12a1\x2d4cfe\x2d87e0\x2d55b237ef31d2.scope
Once I reboot it, I see this:
@major
major / gist:3b97dfdc6e78868b97ae
Created November 4, 2014 01:53
systemd trying repeatedly to remove cgroups on a running qemu instance
# grep 18d70758347c.scope systemd.trace | grep rmdir
1 rmdir("/sys/fs/cgroup/blkio/machine.slice/machine-qemu\\x2dinstance\\x2d5607101e\\x2d94d7\\x2d477a\\x2da9a6\\x2d18d70758347c.scope") = -1 EBUSY (Device or resource busy)
1 rmdir("/sys/fs/cgroup/memory/machine.slice/machine-qemu\\x2dinstance\\x2d5607101e\\x2d94d7\\x2d477a\\x2da9a6\\x2d18d70758347c.scope") = -1 EBUSY (Device or resource busy)
1 rmdir("/sys/fs/cgroup/devices/machine.slice/machine-qemu\\x2dinstance\\x2d5607101e\\x2d94d7\\x2d477a\\x2da9a6\\x2d18d70758347c.scope") = -1 EBUSY (Device or resource busy)
1 rmdir("/sys/fs/cgroup/cpu/machine.slice/machine-qemu\\x2dinstance\\x2d5607101e\\x2d94d7\\x2d477a\\x2da9a6\\x2d18d70758347c.scope/vcpu0" <unfinished ...>
1 rmdir("/sys/fs/cgroup/cpu/machine.slice/machine-qemu\\x2dinstance\\x2d5607101e\\x2d94d7\\x2d477a\\x2da9a6\\x2d18d70758347c.scope/emulator" <unfinished ...>
1 rmdir("/sys/fs/cgroup/cpu/machine.slice/machine-qemu\\x2dinstance\\x2d5607101e\\x2d94d7\\x2d477a\\x2da9a6\\x2d18d
Nov 04 14:20:20 kvm-545338 audispd[1032]: node=kvm-545338 type=VIRT_RESOURCE msg=audit(1415110820.935:527): pid=1088 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=net reason=open vm="instance-c51f7c4b-12a1-4cfe-87e0-55b237ef31d2" uuid=c51f7c4b-12a1-4cfe-87e0-55b237ef31d2 net=bc:76:4e:11:46:1b path="/dev/net/tun" rdev=0A:C8 exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Nov 04 14:20:20 kvm-545338 audispd[1032]: node=kvm-545338 type=VIRT_RESOURCE msg=audit(1415110820.935:528): pid=1088 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=net reason=open vm="instance-c51f7c4b-12a1-4cfe-87e0-55b237ef31d2" uuid=c51f7c4b-12a1-4cfe-87e0-55b237ef31d2 net=bc:76:4e:11:46:1b path="/dev/vhost-net" rdev=0A:EE exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'
Nov 04 14:20:20 kvm-545338 libvirtd[1088]: Domain id=4 name='instance-c51f7c4b-12a1-4cfe-87e0-55b237ef31d2' uuid=c51f7c4b-12a1-4cfe-87e0-55b237ef31d2 is tainted: host-cpu
Nov 04 14:20:20 kvm-545338 dbus[1060]: [syst