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 / 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 -->
@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;
@AysadKozanoglu
AysadKozanoglu / index.html
Created April 29, 2016 21:12 — forked from morganestes/index.html
A pure HTML and CSS navigation bar based on something you might see in an iOS application. Forked from odd-e's original. Original - http://codepen.io/odd-e/details/iIHJy
<ul id="nav">
<li></li>
<li></li>
<li class="home mid"><a href="#"></a></li>
<li></li>
<li></li>
</ul>
<div>
@AysadKozanoglu
AysadKozanoglu / nginx.conf
Created August 26, 2016 22:45 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@AysadKozanoglu
AysadKozanoglu / nodeJs_express_service.js
Last active September 5, 2016 12:51
simple example together working of nodejs mongoDB express
// Aysad Kozanoglu
//before use npm install express
var express = require('express');
var app = express();
var port = 8000;
app.get('/', function (req, res) {
res.send('die Welt ist grösser als nur die Fünf ;)!');
});
@AysadKozanoglu
AysadKozanoglu / nodeJs_mongoDB_express_with_reuse_Of_DB.js
Last active September 5, 2016 12:54
example of nodejs express mongo reuse function
var express = require('express');
var mongodb = require('mongodb');
var app = express();
var port = 8000;
var MongoClient = require('mongodb').MongoClient;
var db;
// Initialize connection once
MongoClient.connect("mongodb://localhost:27017/test_db", function(err, database) {
@AysadKozanoglu
AysadKozanoglu / tmux-cheatsheet.markdown
Created September 5, 2016 14:15 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname