Instantly share code, notes, and snippets.

View nginx.conf
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
View nginx0_trmp_live_stream.sh
apt-get -y install build-essential libpcre3 libpcre3-dev libssl-dev unzip
wget http://nginx.org/download/nginx-1.14.1.tar.gz
wget https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/dev.zip
unzip dev.zip
tar zxvf nginx-1*
cd nginx-1*
./configure --sbin-path=/usr/local/sbin --user=www-data --group=www-data --with-stream --with-threads --with-file-aio --add-module=../nginx-rtmp-module-dev
View ningx_complie_install.sh
#!/bin/sh
echo -e "install core packages...\n"
apt-get -qq -y install build-essential git
apt-get -qq -y install libpcre3 libpcre3-dev zlib1g zlib1g-dev
cd /tmp
wget -q http://nginx.org/download/nginx-1.12.1.tar.gz
wget -q http://s.tip90.com/source/packages/openssl-0.9.8zf.tar.gz && tar zxvf nginx-1.12.1.tar.gz && tar zxvf openssl-0.9.8zf.tar.gz && cd nginx-1.12.1 && ./configure --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt=-Wl,-z,relro --sbin-path=/usr/local/sbin --with-http_stub_status_module --with-http_ssl_module --user=www-data --group=www-data --with-openssl=/source/openssl-0.9.8zf/ --with-stream
make && make install
echo -e " set sysconf tuning \n"
wget -O /etc/sysctl.conf "https://raw.githubusercontent.com/AysadKozanoglu/mytools/master/conf/sysctl.conf"
View vim icinga2 syntax.sh
PREFIX=~/.vim && mkdir -p $PREFIX/{syntax,ftdetect} && curl https://git.io/fA36A > $PREFIX/ftdetect/icinga2.vim
View netWatch_ddos.sh
#! /bin/sh
# author: Aysad Kozanoglu
# email: aysadx@gmail.com
#
# QUICK USAGE:
# wget -O - "https://git.io/fAtyh" | bash
View check_tls_swaks.sh
swaks -a -tls -q HELO -s mailserver.example.com -au test -ap '<>'
View vim_nginx_syntax.sh
mkdir -p ~/.vim/syntax/
cd ~/.vim/syntax/
wget -O nginx.vim http://www.vim.org/scripts/download_script.php?src_id=19394
cat > ~/.vim/filetype.vim <<EOF
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
EOF
View mount_qcow2.md

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
View kernel_tuning_sysctl.conf
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
View kvm_debian_ preesed.cfg
d-i debian-installer/locale string en_US
d-i keymap select de
d-i keyboard-configuration/xkb-keymap select de
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string de
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string debianhost
d-i netcfg/get_domain string mydomain
d-i netcfg/wireless_wep string