Skip to content

Instantly share code, notes, and snippets.

View ykocaman's full-sized avatar

ykocaman ykocaman

  • istanbul
View GitHub Profile
@ykocaman
ykocaman / nginx.conf
Last active August 26, 2016 10:02 — 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/
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@ykocaman
ykocaman / kong cassandra docker
Created November 28, 2016 19:16
kong cassandra docker
version: "2"
services:
cassandra:
image: mashape/cassandra
environment:
- MAX_HEAP_SIZE=128M
- HEAP_NEWSIZE=24M
restart: always
volumes:
CassandraSeed:
environment:
RANCHER_ENABLE: 'true'
RANCHER_SEED_SERVICE: CassandraSeed
CASSANDRA_RACK: 'rack1'
CASSANDRA_DC: aws-us-east
CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch
labels:
io.rancher.container.pull_image: always
tty: true
@ykocaman
ykocaman / composer.json
Last active April 6, 2017 10:11
fixing tls problem of laravel swiftmailer
"scripts": {
"post-install-cmd": [
"sed -i 's/$options = array();/$options = array(\"ssl\" => array(\"verify_peer\" => FALSE, \"verify_peer_name\" => FALSE));/' vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php",
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"sed -i 's/$options = array();/$options = array(\"ssl\" => array(\"verify_peer\" => FALSE, \"verify_peer_name\" => FALSE));/' vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php",
"php artisan clear-compiled",
"php artisan optimize"
Komutlar
-- uzaktan baglanti
ssh user@192.168.1.1
-- dosyalama
ls -lah
cd ..
mkdir klasor
cp -r klasor yeni_klasor
mv yeni_klasor yepyeni_klasor
ansible hosts -b -m get_url \
-a 'url=https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar dest=/usr/bin/wp mode=0777'
@ykocaman
ykocaman / development
Last active June 27, 2018 14:22
Nginx development config with all php version. For example http://test.dev7.lo runs index.php in /home/www/test with version 7.0
#/etc/nginx/sites-enabled/development
server {
listen 80;
listen 443 ssl;
#parse domain
server_name
~^(?<domain_name>.+)\.(?<dir_name>[^\d]*)(?<version>\d+)\.lo$
~^(?<domain_name>.+)\.(?<dir_name>.+)\.lo$;
#!/usr/bin/env bash
set -e;
##############################
#### Tanimlamalar
#############################
ssh_user='vagrant';
ssh_port=22;
conky.config = {
update_interval = 1,
cpu_avg_samples = 2,
net_avg_samples = 2,
out_to_console = false,
override_utf8_locale = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 32768,
<?php
function fibonacci($limit){
$first = 0;
$second = 1;
for($i = 0; $i < $limit; $i++){
yield $first;
list($first, $second) = [$second, $first + $second];