Skip to content

Instantly share code, notes, and snippets.

View AysadKozanoglu's full-sized avatar
💭
free 4 ever

Aysad Kozanoglu AysadKozanoglu

💭
free 4 ever
View GitHub Profile
@AysadKozanoglu
AysadKozanoglu / postfix_main.cf
Created April 10, 2016 23:30
postfix mail version = 2.9.6 main.cf settings - worked
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
@AysadKozanoglu
AysadKozanoglu / postfix_master.cf
Created April 10, 2016 23:33
postfix mail version 2.9.6 master.cf settings worked (wheezy)
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
@AysadKozanoglu
AysadKozanoglu / iptable-script.sh
Last active February 28, 2020 16:52
iptable script enable http https ssh 222001 postfix&dovecot imp
#!/bin/sh
IPT="/sbin/iptables"
# Flush old rules, old custom tables
$IPT --flush
$IPT --delete-chain
@AysadKozanoglu
AysadKozanoglu / spamhaus-iptable.sh
Created April 10, 2016 23:40
spamhaus blacklisted iptable blocker script
#!/bin/bash
IPT=”/bin/iptables”
FILE=”/tmp/drop.lasso”
URL=”http://www.spamhaus.org/drop/drop.lasso”
echo “”
echo -n “Deleting DROP list from existing firewall…”
#This will delete all dropped ips from firewall
@AysadKozanoglu
AysadKozanoglu / curl_webserver_stress.sh
Created April 10, 2016 23:47
Curl webserver stress script 150 simultaneously
#!/bin/bash
SERVER="http://127.0.0.1/script.php"
for (( c=1; c<=150; c++ ))
do
curl -s $SERVER"?[1-1000]" &
pidlist="$pidlist $!"
done
@AysadKozanoglu
AysadKozanoglu / ps1.sh
Created April 10, 2016 23:50
PS1 and COMMAND prompt example (for putty title )
#!/bin/bash
export PS1="\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]@\h \[\e[0m\]\[\e[00;33m\]\@\[\e[0m\]\[\e[00;36m\][\w]\[\e[0m\]\n"
export PROMPT_COMMAND='printf "\033]0;Arena playansurf.com Muhafiz Server Management - Aysad Kozanoglu - Uptime: %s\007" "`uptime`"'
@AysadKozanoglu
AysadKozanoglu / jquery_document_ready.js
Created April 11, 2016 21:06
jquery document ready different methods
$(document).ready(function() {
//do jQuery stuff when DOM is ready
});
<!-- methode 2 -->
$(function(){
//jQuery code here
});
<!-- methode 3 -->
<?
#////////////////////////////////////////////////////////////////////
#
# PHP Token based user authentication
# Token and tokenServerService Class
# based on factory design patterns
#
# written by: Aysad Kozanoglu
# email: k.a@tuta.io
# website: http://onweb.pe.hu
@AysadKozanoglu
AysadKozanoglu / php-design-factory-pattern.php
Last active April 15, 2016 00:29
This code uses a factory to create the Bike object. There are two possible benefits to building your code this way; the first is that if you need to change, rename, or replace the Bike class later on you can do so and you will only have to modify the code in the factory, instead of every place in your project that uses the Bike class. The second…
<?php
#////////////////////////////////////////////////////////////////////
#
#
# written by: Aysad Kozanoglu
# email: k.a@tuta.io
# website: http://onweb.pe.hu
#
# MIT licence
@AysadKozanoglu
AysadKozanoglu / do_not_log.conf
Created April 29, 2016 21:01 — forked from kfl62/do_not_log.conf
nginx configuration file, (do not log robots.txt and favicon.ico requests)
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;