Skip to content

Instantly share code, notes, and snippets.

Aysad Kozanoglu AysadKozanoglu

Block or report user

Report or block AysadKozanoglu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AysadKozanoglu
AysadKozanoglu / wp.config.php
Created May 30, 2019
Disable admin-ajax on the front-end of WordPress sites and cache the resulting 404.
View wp.config.php
<?php
if(
strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false &&
strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false
) {
header( 'Cache-Control: max-age=30000, must-revalidate' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' );
header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" );
die;
@AysadKozanoglu
AysadKozanoglu / debian-install-megacli.md
Created May 28, 2019 — forked from fxkraus/debian-install-megacli.md
Install LSI MegaCli .deb package on Debian/Ubuntu
View debian-install-megacli.md

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
View MariaDB_Debian_jessie_install.sh
#author: Aysad Kozanoglu
#email: aysadx@gmail.com
# Debian Jessie
# QUICK LAUNCH script
# wget -O - https://git.io/fjWjB | bash
#
apt-get -y -qq install software-properties-common
# install repo mariadb
# see source
View canlitv.com_getStreamAndRestream
streamPath="/usr/local/nginx/html/stream"; link=$(wget -qO tv8.html https://canlitv.com/canli-tv8-5 | cat tv8.html | grep file | cut -d \" -f2); rm -rf $streamPath/* && ffmpeg -y -probesize 15000000 -analyzeduration 12000000 -i "$link" -user_agent "firefox browser" -strict -2 -dn -acodec copy -vcodec copy -crf 29 -hls_flags delete_segments -hls_time 10 -hls_list_size 8 -hls_segment_filename "$streamPath/tv8%d.ts" $streamPath/tv8.m3u8
View bashrc
# Shorten home dir, cygwin drives, paths that are too long
# (just bourne; no perl, sed, or bashisms!)
HOST='\033[02;36m\]\h'; HOST=' '$HOST
TIME='\033[01;31m\]\t \033[01;32m\]'
LOCATION=' \033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\1_\2#g"`'
BRANCH=' \033[00;33m\]$(git_branch)\[\033[00m\]\n\$ '
PS1=$TIME$USER$HOST$LOCATION$BRANCH
PS2='\[\033[01;36m\]>'
View php7.2 install debian_jessie
#!/bin/sh
#author: Aysad Kozanoglu
#email: aysadx@gmail.com
#
# QUICK launch script
# wget -O - https://git.io/fhxNt | bash
#
@AysadKozanoglu
AysadKozanoglu / nginx.conf
Last active Feb 25, 2019
fail2ban nginx 404 400 403 444 filter /etc/fail2ban/filter.d/nginx-4xx.conf
View nginx.conf
# nano /etc/fail2ban/filter.d/nginx-4xx.conf
#
[Definition]
failregex = ^<HOST>.*"(GET|POST).*" (404|444|403|400) .*$
ignoreregex =
@AysadKozanoglu
AysadKozanoglu / capture Passwords tcpdump.md
Created Feb 12, 2019
get plain passwords with tcpdump
View capture Passwords tcpdump.md

Capture SMTP Email

tcpdump -nn -l port 25 | grep -i 'MAIL FROM\|RCPT TO'

Extract HTTP Passwords in POST Requests

tcpdump -s 0 -A -n -l | egrep -i "POST /|pwd=|passwd=|password=|Host:"

Capture FTP Credentials and Commands

View vim nginx icinga2 syntax highlight
#!/bin/bash
# author: Aysad Kozanoglu
# Highligh Nginx config file in Vim
# NGINX
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget https://git.io/fhJsu -O ~/.vim/syntax/nginx.vim
# Set location of Nginx config file
@AysadKozanoglu
AysadKozanoglu / install openvpn 2.4 ubuntu 16.04 and debian Jessie.sh
Last active Jan 22, 2019
install openvpn 2.4 ubuntu 16.04 and debian jessie
View install openvpn 2.4 ubuntu 16.04 and debian Jessie.sh
curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add
# ubuntu 16.04
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
#debian jessie
echo "deb http://build.openvpn.net/debian/openvpn/stable jessie main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
apt update
apt install -y openvpn
You can’t perform that action at this time.