Skip to content

Instantly share code, notes, and snippets.

VS build tools: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15
Windows SDK: the version is for Windows Update 1809 and could be installed without updating windows from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
Python: https://www.python.org/ftp/python/3.7.4/python-3.7.4-amd64.exe
@mlazarov
mlazarov / nginx.conf
Last active December 15, 2017 11:35
nginx time tracking
# http
log_format timed_combined '$upstream_response_time\t"$request" $status $body_bytes_sent';
# server
access_log /var/log/nginx/times.log timed_combined;

Creating 100k empty files:

time for ((i = 1; i < 100000; i++)) ; do touch $i.foo ; done

  • glusterfs: 4m1.412s
  • ssd* disk: 0m52.337s

Deleting 100k empty files:

time find ./ -delete

'''Plugin to override the default output logic.'''
# upstream: https://gist.github.com/cliffano/9868180
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
[mlazarov@test rtl8188eu]$ ls
control_ap COPYING core dkms.conf hal hostapd-0.8 include Makefile os_dep README.md rtl8188eufw.bin rtl_hostapd.conf
[mlazarov@test rtl8188eu]$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/2.6.32-573.3.1.el6.centos.plus.x86_64/build M=/home/mlazarov/tmp/rtl8188eu modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-573.3.1.el6.centos.plus.x86_64'
CC [M] /home/mlazarov/tmp/rtl8188eu/core/rtw_ap.o
CC [M] /home/mlazarov/tmp/rtl8188eu/core/rtw_br_ext.o
CC [M] /home/mlazarov/tmp/rtl8188eu/core/rtw_cmd.o
CC [M] /home/mlazarov/tmp/rtl8188eu/core/rtw_debug.o
CC [M] /home/mlazarov/tmp/rtl8188eu/core/rtw_efuse.o
[root@test rtl8188eu]# make all
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/2.6.32-504.12.2.el6.centos.plus.x86_64/build M=/root/tmp/rtl8188eu modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-504.12.2.el6.centos.plus.x86_64'
CC [M] /root/tmp/rtl8188eu/core/rtw_ap.o
CC [M] /root/tmp/rtl8188eu/core/rtw_br_ext.o
CC [M] /root/tmp/rtl8188eu/core/rtw_cmd.o
CC [M] /root/tmp/rtl8188eu/core/rtw_debug.o
CC [M] /root/tmp/rtl8188eu/core/rtw_efuse.o
CC [M] /root/tmp/rtl8188eu/core/rtw_ieee80211.o
CC [M] /root/tmp/rtl8188eu/core/rtw_io.o
@mlazarov
mlazarov / gist:253c9a523df80f651ab4
Created April 3, 2015 11:19
centos 6.6 host dmesg output
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.32-504.8.1.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Jan 28 21:11:36 UTC 2015
Command line: ro root=UUID=01341f68-0e59-4711-9015-68c95a784b47 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
Centaur CentaurHauls
BIOS-provided physical RAM map:
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.19.3 (buildbot@ip-10-204-3-57) (gcc version 4.8.3 (Gentoo Hardened 4.8.3 p1.1, pie-0.5.9) ) #2 SMP Thu Apr 2 06:44:23 UTC 2015
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz console=ttyS0,115200n8 console=tty0 root=LABEL=ROOT mount.usr=PARTUUID=7130c94a-213a-4e5a-8e26-6cce9662f132
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001ffeffff] usable
// shard-status
while (true) {
db.currentOp().inprog.forEach(function(row) { if (row.query.moveChunk) printjson(row.query.shardId + " " + row.msg + " secs: " + row.secs_running + " switches: " + row.numYields); });
sleep(1000);
}