Skip to content

Instantly share code, notes, and snippets.

View kometchtech's full-sized avatar
🏠
Working from home

kometchtech kometchtech

🏠
Working from home
View GitHub Profile
UserParameter=sensors.fan[*],sensors -u | grep fan1_input | cut -d ":" -f2 | cut -d " " -f2
UserParameter=sensors.coretemp1,sensors -u coretemp-isa-0000 | grep temp2_input | cut -d ":" -f2 | cut -d " " -f2
UserParameter=sensors.coretemp2,sensors -u coretemp-isa-0000 | grep temp3_input | cut -d ":" -f2 | cut -d " " -f2
UserParameter=ntp.delay,/usr/bin/ntpq -p | grep \* | awk '{ print $8}'
UserParameter=ntp.offset,/usr/bin/ntpq -p | grep \* | awk '{ print $9}'
UserParameter=ntp.jitter,/usr/bin/ntpq -p | grep \* | awk '{ print $10}'
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
export LESS='-R'
export LESSOPEN='| /usr/share/source-highlight/src-hilite-lesspipe.sh %s'
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35
[Unit]
Description=Zabbix Monitor Agent
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/sbin/zabbix_agentd
#RemainAfterExit=yes
PIDFile=/var/run/zabbix/zabbix_agentd.pid
User=zabbix
@kometchtech
kometchtech / kvm_host_sysctl
Last active August 29, 2015 14:12
kvm host kernel tuning on Ubuntu 15.04
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.ovsbr0.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.accept_ra = 0
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2
@kometchtech
kometchtech / kvm_guest_sysctl
Created December 28, 2014 10:11
kvm guest kernel tuning CentOS7
# cat /etc/sysctl.d/kernel.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 60
@kometchtech
kometchtech / dnstest_2018-4-21
Last active May 29, 2021 10:09
public dns list (2018/07) <Please tell me about Public DNS!>
location: Japan/Tokyo
test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 Average
cloudflare 7 ms 6 ms 5 ms 5 ms 5 ms 5 ms 5 ms 4 ms 5 ms 10 ms 5.70
level3 5 ms 6 ms 5 ms 4 ms 8 ms 4 ms 4 ms 9 ms 4 ms 14 ms 6.30
192.168.1.3 3 ms 14 ms 5 ms 10 ms 14 ms 10 ms 4 ms 10 ms 7 ms 16 ms 9.30
cleanbrowsing 11 ms 17 ms 9 ms 6 ms 5 ms 10 ms 13 ms 15 ms 5 ms 14 ms 10.50
neustar 11 ms 10 ms 9 ms 9 ms 15 ms 9 ms 9 ms 14 ms 8 ms 12 ms 10.60
norton 14 ms 13 ms 9 ms 14 ms 9 ms 9 ms 9 ms 12 ms 12 ms 9 ms 11.00
192.168.1.4 18 ms 174 ms 12 ms 12 ms 13 ms 11 ms 20 ms 14 ms 3 ms 15 ms 29.20
@kometchtech
kometchtech / gist:19d5806ba28c05c306d8
Created February 13, 2015 02:17
compile pdns-recursor
/usr/local/src/pdns-recursor-3.7.1$ sudo ./configure
Testing dependencies and compiler.
Using make to build
g++ -Iext/rapidjson/include -I/usr/local/src/pdns-recursor-3.7.1/ext/polarssl/include -Wall -fPIE -DPIE -D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 -O3 -pthread -Iext/yahttp -D_GNU_SOURCE -DHAVE_STRCASESTR -DSYSCONFDIR='"/etc/powerdns/"' -DLOCALSTATEDIR='"/var/run/"' -MM -MG *.cc *.hh > dep
g++ -Iext/rapidjson/include -I/usr/local/src/pdns-recursor-3.7.1/ext/polarssl/include -Wall -fPIE -DPIE -D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 -O3 -pthread -Iext/yahttp -D_GNU_SOURCE -DHAVE_STRCASESTR -DSYSCONFDIR='"/etc/powerdns/"' -DLOCALSTATEDIR='"/var/run/"' pdns_hw.cc -o pdns_hw
Everything ok, now run make using same settings (if any) you passed ./configure
/usr/local/src/pdns-recursor-3.7.1$ sudo make
PLEASE READ: If you get an error mentioning #include <boost/something.hpp>, please read README
@kometchtech
kometchtech / homebrew.mxcl.pdnsrec.plist
Last active November 29, 2017 02:19
powerdns recursor for Mac OSX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.pdnsrec</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/pdnsrec/sbin/pdns_recursor</string>
</array>
@kometchtech
kometchtech / 99-dns-option
Created April 16, 2015 10:19
Prevention of double registration to resolv.conf
#/bin/sh
FILE="/etc/resolv.conf"
grep "single-request-reopen" $FILE
if [ $? -ne 0 ]; then
echo options single-request-reopen >> /etc/resolv.conf
fi
grep "rotate" $FILE
if [ $? -ne 0 ]; then
echo options rotate >> /etc/resolv.conf