Skip to content

Instantly share code, notes, and snippets.

@berkayunal
berkayunal / after.sh
Created October 11, 2017 13:10 — forked from truetamtam/after.sh
Laravel Homestead after.sh placed in ~/.homestead/after.sh
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
echo "Updating machine software"
locale-gen en_GB.UTF-8
# Updating composer
@berkayunal
berkayunal / after.sh
Created October 11, 2017 12:59 — forked from mewebstudio/after.sh
~/.homestead/after.sh
#!/usr/bin/env bash
# Populate this array with each of your dev site hostnames.
sites_hosts=( homestead.app ) # array, e.g., www.example.dev
# Config for SSL.
SSL_DIR="/etc/nginx/ssl"
PASSPHRASE="secret"
SUBJ="
C=BE
@berkayunal
berkayunal / nginx.conf
Created October 10, 2017 07:59 — forked from abpin/nginx.conf
nginx.conf File For ExpressionEngine or Codeigniter
server {
listen :80;
server_name www.example.com;
rewrite ^/(.*) http://example.com/$1 permanent;
}
server {
server_name example.com;
listen :80;
@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
@berkayunal
berkayunal / redis-server
Created March 28, 2017 12:11 — forked from sumodirjo/redis-server
redis-server init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@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 / redis.service
Created February 10, 2017 01:19 — forked from ordoghl/redis.service
redis systemd unit file
Description=Redis In-Memory Data Store
After=network.target
[Service]
Type=forking
User=redis
Group=redis
Environment=statedir=/run/redis
PermissionsStartOnly=true
PIDFile=/run/redis/redis.pid
@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 / 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 / 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;