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 / using-auto-backup-vim.md
Created Jul 19, 2017 — forked from nepsilon/using-auto-backup-vim.md
Using auto backup with Vim — First published in fullweb.io issue #3
View using-auto-backup-vim.md

Using auto backup with Vim

Not using versioning on your configuration files and editing them with Vim? Use Vim’s backup option to automatically keep a copy of past versions:

To put in your ~/.vimrc:

"Turn on backup option
set backup
@AysadKozanoglu
AysadKozanoglu / remote_backup_server_data.sh
Created Nov 8, 2017
3 days retain backup solutio n for remote server data
View remote_backup_server_data.sh
#!/bin/bash
#
#author: Aysad Kozanoglu
#
#
# Directory in which to store the backups
ROOT_DIR=/mnt/backup
REMOTE_USER=root
REMOTE_PATH=/mnt/drbd/var/mail/vmail/espresto.com
@AysadKozanoglu
AysadKozanoglu / rsync_best_fast_muster.md
Last active Jul 31, 2019
rsync best fast file transfer muster (90MB/s on a 1Gbit NIC)
View rsync_best_fast_muster.md

#auhtor: Aysad Kozanoglu

realizing a file transfer over 50MB-90MB/s on 1Gbit NIC

from remote to local

rsync -avHAXx --numeric-ids --progress -e "ssh -T -c arcfour -o Compression=no -x" user@[source]:[source_dir] [dest_dir]
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
@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

@AysadKozanoglu
AysadKozanoglu / nginx.conf
Last active Jul 29, 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 =
View net_scans.txt
nbtscan 192.168.1.0-192.168.1.255
detail info host
nmap -A 192.168.1.8
get most ports
nmap --script smb-os-discovery 192.168.1.8
get mac adress ips hostnames
nmap -sP 192.168.1.0/24 | awk '/Nmap scan report for/{printf $5;}/MAC Address:/{print " => "$3;}' | sort
@AysadKozanoglu
AysadKozanoglu / sysctl.conf
Created Apr 10, 2016
high secure & perfornce debian sysctl.conf setting - debian sysctl yüksek güven ve performans ayarlari
View sysctl.conf
# Kernel sysctl configuration file for Linux
# Version 1.11 - 2015-07-07
# Aysad Kozanoglu Aysad K.
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
#
# Tested with: Ubuntu 14.04 LTS kernel version 3.13
@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
You can’t perform that action at this time.