Skip to content

Instantly share code, notes, and snippets.

View berkayunal's full-sized avatar

Berkay UNAL berkayunal

View GitHub Profile
#!/usr/bin/env bash
# Original: http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
V_BUILD=/Volumes/install_build
V_APP=/Volumes/install_app
T_SI_B=/tmp/mavericks
T_SI=$T_SI_B.sparseimage
@berkayunal
berkayunal / gist:d69ceca597122955cc1e
Last active August 29, 2015 14:24
haproxy acl is not matched sometimes
I have a strange problem, sometimes haproxy cannot match the host so it cannot use the backend and connections is being aborted in the browser.
Do you know any solutions for this kind of problem.
I am using HA-Proxy version 1.5.13 2015/06/23
You can see the problem on http://blog.ganipara.com with firebug or similar.
Here is a screenshot also:
http://berkayunal.com/share/sc_1B4AF7FE.png
Some requests are being dropped since hostname does not matches.
Hey Sean,
Thanks for your help. Appreciate it much
I have a strange problem, sometimes haproxy cannot match the host.
So it cannot use the backend and connections is being aborted in the browser.
Do you know any solutions for this kind of problem.
I am using HA-Proxy version 1.5.14 2015/07/02
@berkayunal
berkayunal / .htaccess
Created August 15, 2016 21:40 — forked from THEtheChad/.htaccess
Access-Control-Allow-Origin for Subdomains
SetEnvIf Origin "^(.*\.example\.com)$" ORIGIN_SUB_DOMAIN=$1
Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
@berkayunal
berkayunal / warm_varnish
Created October 13, 2016 21:37 — forked from jaseclamp/warm_varnish
Warm Varnish Cache
#!/bin/bash
# this script will
# a. crawl the designated site X levels deep to generate a urls list
# b. completely purge all urls on the desisgnated varnish servers for the designated url
# c. clear cache on nginx / mod pagespeed for the designated app servers
# d. individually warm all the listed urls on each designated varnish server
# e. rewarm them in case pagespeed sent a purge request
# define some variables
@berkayunal
berkayunal / default.vcl
Created October 13, 2016 22:15 — forked from joshangell/default.vcl
Varnish config for Craft
# Varnish 4.0 configuration for Craft
#
# Based on the following:
# - https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl
# - https://gist.github.com/aelvan/eba03969f91c1bd51c40
vcl 4.0;
import std;
import directors;
@berkayunal
berkayunal / ubuntu_unattended_upgrades_gmail.markdown
Created November 4, 2016 13:34 — forked from dwilkie/ubuntu_unattended_upgrades_gmail.markdown
Setup unattended upgrades on Ubuntu with Gmail

Install the unattended-upgrades package

$ sudo apt-get install unattended-upgrades 

Edit the periodic configuration

$ sudo nano /etc/apt/apt.conf.d/10periodic
@berkayunal
berkayunal / mysql_splitdump.sh
Created January 3, 2017 08:07 — forked from jasny/mysql_splitdump.sh
Split MySQL dump SQL file into one file per table or extract a single table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
@berkayunal
berkayunal / migrate.sh
Created February 16, 2017 21:34 — forked from dj1020/migrate.sh
Upgrade MAMP to Mysql 5.7 tested by Ken Lin 2015/11/09
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@berkayunal
berkayunal / cronitor.sh
Created April 12, 2017 12:51 — forked from AnthonySheetz/cronitor.sh
Cronitor wrapper script for start/stop notifications, now with proper encoding of stderror and optional dumping of stdout
#!/bin/bash
#
# This script surrounds the command passed in with start and finish notifications
# to the cronitor monitoring application.
#
# === SETUP
#
# * Make sure the cronitor script is executable.
#
# chmod +x cronitor