Skip to content

Instantly share code, notes, and snippets.

@serkanh
serkanh / gist:2c5fbb53c47c703add14
Created November 4, 2014 21:09
Manually run chef on Opsworks instance
echo cookbook_path ["/opt/aws/opsworks/current/site-cookbooks"] > solo.rb
opsworks-agent-cli get_json > attributes.json
sudo /opt/aws/opsworks/current/bin/chef-solo -c solo.rb -j ~ubuntu/attributes.json -o recipe[map-proxy::config]
FROM ubuntu:12.10
MAINTAINER Ken Cochrane "kencochrane@gmail.com"
RUN apt-get -qq update
RUN apt-get install -y python-dev python-setuptools supervisor git-core
RUN easy_install pip
RUN pip install virtualenv
RUN pip install uwsgi
RUN virtualenv --no-site-packages /opt/ve/djdocker
ADD . /opt/apps/djdocker
ADD .docker/supervisor.conf /opt/supervisor.conf
@serkanh
serkanh / gist:1bc420e2ac585c8cd162
Created June 8, 2015 15:40
jira-https-nginx-wildcard-cert-configuration
# mkdir -p /etc/nginx/ssl
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
# redirect HTTP to HTTPS - /etc/nginx/sites-available/default
server {
listen 80;
server_name jira.example.com;
access_log off;
@serkanh
serkanh / gist:54fe57a7a826da6105b4
Created June 8, 2015 16:02
jira-stash-nginx-https
index index.html index.htm;
server {
root /usr/share/nginx/html;
listen 443;
server_name git.example.com;
access_log off;
# serkan haytac
#!/usr/bin/python
import boto.opsworks.layer1 as opsworks
##########################################################################################
# Simple class to manage opsworks provisioning #
# It can be useful to integrate CI servers and issue #
# lifecycle events such as deployment through aws boto library #
# Make sure to add your access credentials in .boto file in #
# home directory. #
# http://boto.readthedocs.org/en/latest/getting_started.html#configuring-boto-credentials#
@serkanh
serkanh / gist:f8a4b2e95f518a01a1f2
Last active August 29, 2015 14:25
vim-go vimrc setup
" serkan haytac
call pathogen#infect()
call pathogen#helptags()
syntax on
set background=light
filetype plugin indent on
set number
set nowrap
set hlsearch
let g:go_disable_autoinstall = 0
@serkanh
serkanh / gist:166b1db35f84a4f80478
Created July 20, 2015 14:21
Sublime-3-GoSublime user settings.
{
// you may set specific environment variables here
// e.g "env": { "PATH": "$HOME/go/bin:$PATH" }
// in values, $PATH and ${PATH} are replaced with
// the corresponding environment(PATH) variable, if it exists.
"env": {"GOPATH": "$HOME/go", "PATH": "$GOPATH/bin:$PATH" },
"fmt_cmd": ["goimports"],
@serkanh
serkanh / geojson_serializer.py
Created November 20, 2012 21:07 — forked from danielsokolowski/geojson_serializer.py
GeoJSON Serializer for GeoDjango (gis)
'''
Created on 2011-05-12
@author: Daniel Sokolowski
Extends django's built in JSON serializer to support GEOJSON encoding
Requirements:
Install and setup geodjango (django.contrib.gis)
@serkanh
serkanh / geojson_serializer.py
Created November 20, 2012 21:18 — forked from glenrobertson/geojson_serializer.py
GeoJSON serializer for Geodjango
"""
Modified from: https://gist.github.com/967274
CHANGES:
* Serialize pk in feature.id and remove from feature.properties
* Added default date format and time format for encoder
* Allow geometryfield option, which doesn't have to be a field, e.g. a @property
USAGE:
description "Vault server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
chdir /home/vault
env VAULT_ADDR=http://127.0.0.1:8200
script