Skip to content

Instantly share code, notes, and snippets.

View mustafaturan's full-sized avatar

Mustafa Turan mustafaturan

View GitHub Profile
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@mustafaturan
mustafaturan / consumer.rb
Created January 14, 2012 01:43 — forked from nragaz/consumer.rb
Consumer class to wrap Active Resource for OAuth
# Example usage:
#
# class Account < ActiveResource::Base
# self.site = "http://localhost:3000"
# end
#
# consumer = Consumer.new( user.access_token, Account )
# consumer.find(1) # => equivalent to Account.find(1), but with OAuth
class Consumer
<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://mashape.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mashape.com http://mashape.com/schema/mashape-api-3.0.xsd">
<method name="Get User" http="GET">
<url><![CDATA[/users/{id}]]></url>
<parameters>
<parameter optional="false">id</parameter>
</parameters>
@mustafaturan
mustafaturan / ruby.2.0.0-setup.sh
Last active May 21, 2019 23:00
ruby 2.0.0 centos 6
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@mustafaturan
mustafaturan / sphinx-setup-latest.sh
Last active October 4, 2015 05:28
latest sphinx setup
#!/usr/bin/env bash
version="2.0.9-release"
cd /usr/local/src
wget http://sphinxsearch.com/files/sphinx-$version.tar.gz
tar zxvf sphinx-$version.tar.gz
cd sphinx-$version
./configure
make -j4
make install
@mustafaturan
mustafaturan / nginx-setup.sh
Last active February 26, 2017 21:25
Install nginx from source
#!/bin/bash
version="1.10.3"
cd /usr/local/src
wget http://nginx.org/download/nginx-$version.tar.gz
tar zxvf nginx-$version.tar.gz
cd nginx-$version
./configure --prefix='/opt/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --with-http_gzip_static_module --with-http_stub_status_module --with-http_realip_module
make
make install
@mustafaturan
mustafaturan / nginx
Created May 5, 2012 13:49
Nginx Init Script Centos 6
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@mustafaturan
mustafaturan / rails-http-response-symbols
Created May 20, 2012 10:15
Rails HTTP response symbols
Status Code Status Message Symbol
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
201 Created :created
202 Accepted :accepted
@mustafaturan
mustafaturan / unicornctl
Created May 21, 2012 13:36
Unicorn init script for rails app
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_NAME=example.com
APP_ROOT=/var/www/$APP_NAME
APP_CURRENT_PATH=$APP_ROOT/current
CONFIG_PATH=$APP_ROOT/shared/config/unicorn.conf.rb
PID=$APP_ROOT/shared/pids/unicorn.pid
@mustafaturan
mustafaturan / s3-nginx-log-rotate.sh
Created June 6, 2012 13:35
S3 Nginx Log rotation file
#!/bin/bash
BUCKETNAME="your_s3_bucket"
LOGDIR="/opt/nginx/logs"
LOGDATE=$(date +"%Y%m%d")
LOGFILES=( "access" "ssl-access" )
BOT_LOGFILES=( "bots-access" "bots-ssl-access" )
echo "Moving access logs to dated logs.."